ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç db/install.php000064400000001742152266404500007320 0ustar00. function xmldb_repository_recent_install() { global $CFG; $result = true; require_once($CFG->dirroot.'/repository/lib.php'); $recent_plugin = new repository_type('recent', array(), true); if(!$id = $recent_plugin->create(true)) { $result = false; } return $result; } db/access.php000064400000002223152266404500007106 0ustar00. /** * Plugin capabilities. * * @package repository_recent * @copyright 2010 Dongsheng Cai * @author Dongsheng Cai * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); $capabilities = array( 'repository/recent:view' => array( 'captype' => 'read', 'contextlevel' => CONTEXT_MODULE, 'archetypes' => array( 'user' => CAP_ALLOW ) ) ); lang/en/repository_recent.php000064400000003032152266404500012361 0ustar00. /** * Strings for component 'repository_recent', language 'en', branch 'MOODLE_20_STABLE' * * @package moodlecore * @copyright 2010 Dongsheng Cai * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ $string['configplugin'] = 'Configuration for recent files repository'; $string['recentfilesnumber'] = 'Number of recent files'; $string['emptyfilelist'] = 'There are no files to show'; $string['notitle'] = 'notitle'; $string['recent:view'] = 'View recent files repository plugin'; $string['pluginname_help'] = 'Files recently used by current user'; $string['pluginname'] = 'Recent files'; $string['privacy:metadata'] = 'The Recent files repository plugin does not store or transmit any personal data.'; $string['timelimit'] = 'Time limit'; $string['timelimit_help'] = 'Only retrieve recent files within the time limit'; pix/icon.svg000064400000011763152266404500007031 0ustar00 ]> pix/icon.png000064400000000655152266404500007014 0ustar00PNG  IHDRatIDATx3Qmo۶U'UltqbL۶m083֯yyC7E4 Yj[VļՇ \ѣ /=16՟4%|̘575tkP-?cY&LnҢN'P7 9`5p(ąs['$&ׯԉG"~~*DP4yZq DUs-R"M1 A +EDޯ'~B5W͖&)imXYy6>1gƍ>8k%@`*@TI[k7J @>HY +. /** * This plugin is used to access recent used files * * @since Moodle 2.0 * @package repository_recent * @copyright 2010 Dongsheng Cai {@link http://dongsheng.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once($CFG->dirroot . '/repository/lib.php'); /** * repository_recent class is used to browse recent used files * * @since Moodle 2.0 * @package repository_recent * @copyright 2010 Dongsheng Cai {@link http://dongsheng.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ define('DEFAULT_RECENT_FILES_NUM', 50); /** * DEFAULT_RECENT_FILES_TIME_LIMIT - default time limit. */ define('DEFAULT_RECENT_FILES_TIME_LIMIT', 6 * 4 * WEEKSECS); class repository_recent extends repository { /** @var int only retrieve files within the time limit */ protected $timelimit; /** @var int recent files number configuration. */ protected $number; /** * Initialize recent plugin * @param int $repositoryid * @param int $context * @param array $options */ public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array()) { parent::__construct($repositoryid, $context, $options); $number = get_config('recent', 'recentfilesnumber'); $number = (int)$number; if (empty($number)) { $this->number = DEFAULT_RECENT_FILES_NUM; } else { $this->number = $number; } $timelimit = get_config('recent', 'recentfilestimelimit'); $this->timelimit = (int)$timelimit; } /** * recent plugin doesn't require login, so list all files * @return mixed */ public function print_login() { return $this->get_listing(); } /** * Only return files within the time limit * * @param int $limitfrom retrieve the files from * @param int $limit limit number of the files * @param int $timelimit only return files with the time limit * @return array list of recent files */ private function get_recent_files($limitfrom = 0, $limit = DEFAULT_RECENT_FILES_NUM, $timelimit = 0) { // XXX: get current itemid global $USER, $DB, $itemid; $timelimitsql = ''; if ($timelimit > 0) { $timelimitsql = "AND timemodified >= :timelimit"; $timelimitparam = ['timelimit' => time() - $timelimit]; } // This SQL will ignore draft files if not owned by current user. // Ignore all file references. $sql = "SELECT files1.id, files1.contextid, files1.component, files1.filearea, files1.itemid, files1.filepath, files1.filename, files1.pathnamehash FROM {files} files1 JOIN ( SELECT contenthash, filename, MAX(id) AS id FROM {files} WHERE userid = :userid AND referencefileid is NULL AND filename != :filename AND ((filearea = :filearea1 AND itemid = :itemid) OR filearea != :filearea2) $timelimitsql GROUP BY contenthash, filename ) files2 ON files1.id = files2.id ORDER BY files1.timemodified DESC"; $params = array( 'userid' => $USER->id, 'filename' => '.', 'filearea1' => 'draft', 'itemid' => $itemid, 'filearea2' => 'draft'); if (isset($timelimitparam)) { $params = array_merge($params, $timelimitparam); } $rs = $DB->get_recordset_sql($sql, $params, $limitfrom, $limit); $result = array(); foreach ($rs as $file_record) { $info = array(); $info['contextid'] = $file_record->contextid; $info['itemid'] = $file_record->itemid; $info['filearea'] = $file_record->filearea; $info['component'] = $file_record->component; $info['filepath'] = $file_record->filepath; $info['filename'] = $file_record->filename; $result[$file_record->pathnamehash] = $info; } $rs->close(); return $result; } /** * Get file listing * * @param string $encodedpath * @param string $path not used by this plugin * @return mixed */ public function get_listing($encodedpath = '', $page = '') { global $OUTPUT; $ret = array(); $ret['dynload'] = true; $ret['nosearch'] = true; $ret['nologin'] = true; $list = array(); $files = $this->get_recent_files(0, $this->number, $this->timelimit); try { foreach ($files as $file) { // Check that file exists and accessible, retrieve size/date info $browser = get_file_browser(); $context = context::instance_by_id($file['contextid']); $fileinfo = $browser->get_file_info($context, $file['component'], $file['filearea'], $file['itemid'], $file['filepath'], $file['filename']); if ($fileinfo) { $params = base64_encode(json_encode($file)); $node = array( 'title' => $fileinfo->get_visible_name(), 'size' => $fileinfo->get_filesize(), 'datemodified' => $fileinfo->get_timemodified(), 'datecreated' => $fileinfo->get_timecreated(), 'author' => $fileinfo->get_author(), 'license' => $fileinfo->get_license(), 'source'=> $params, 'icon' => $OUTPUT->image_url(file_file_icon($fileinfo))->out(false), 'thumbnail' => $OUTPUT->image_url(file_file_icon($fileinfo))->out(false), ); if ($imageinfo = $fileinfo->get_imageinfo()) { $fileurl = new moodle_url($fileinfo->get_url()); $node['realthumbnail'] = $fileurl->out(false, array('preview' => 'thumb', 'oid' => $fileinfo->get_timemodified())); $node['realicon'] = $fileurl->out(false, array('preview' => 'tinyicon', 'oid' => $fileinfo->get_timemodified())); $node['image_width'] = $imageinfo['width']; $node['image_height'] = $imageinfo['height']; } $list[] = $node; } } } catch (Exception $e) { throw new repository_exception('emptyfilelist', 'repository_recent'); } $ret['list'] = array_filter($list, array($this, 'filter')); return $ret; } public static function get_type_option_names() { return array('recentfilesnumber', 'recentfilestimelimit', 'pluginname'); } public static function type_config_form($mform, $classname = 'repository') { parent::type_config_form($mform, $classname); $number = get_config('repository_recent', 'recentfilesnumber'); if (empty($number)) { $number = DEFAULT_RECENT_FILES_NUM; } $mform->addElement('text', 'recentfilesnumber', get_string('recentfilesnumber', 'repository_recent')); $mform->setType('recentfilesnumber', PARAM_INT); $mform->setDefault('recentfilesnumber', $number); $mform->addElement('duration', 'recentfilestimelimit', get_string('timelimit', 'repository_recent'), ['units' => [DAYSECS, WEEKSECS], 'optional' => true]); $mform->addHelpButton('recentfilestimelimit', 'timelimit', 'repository_recent'); $mform->setDefault('recentfilestimelimit', DEFAULT_RECENT_FILES_TIME_LIMIT); } /** * This plugin doesn't support to link to external links * * @return int */ public function supported_returntypes() { return FILE_INTERNAL; } /** * Repository method to make sure that user can access particular file. * * This is checked when user tries to pick the file from repository to deal with * potential parameter substitutions is request * * @todo MDL-33805 remove this function when recent files are managed correctly * * @param string $source * @return bool whether the file is accessible by current user */ public function file_is_accessible($source) { global $USER; $reference = $this->get_file_reference($source); $file = self::get_moodle_file($reference); return (!empty($file) && $file->get_userid() == $USER->id); } /** * Does this repository used to browse moodle files? * * @return boolean */ public function has_moodle_files() { return true; } /** * Is this repository accessing private data? * * @return bool */ public function contains_private_data() { return false; } } version.php000064400000002304152266404500006745 0ustar00. /** * Version details * * @package repository * @subpackage recent * @copyright 2010 Dongsheng Cai * @author Dongsheng Cai * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); $plugin->version = 2025041400; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2025040800; // Requires this Moodle version. $plugin->component = 'repository_recent'; // Full name of the plugin (used for diagnostics) classes/privacy/provider.php000064400000002764152266404500012236 0ustar00. /** * Privacy Subsystem implementation for repository_recent. * * @package repository_recent * @copyright 2018 Zig Tan * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace repository_recent\privacy; defined('MOODLE_INTERNAL') || die(); /** * Privacy Subsystem for repository_recent implementing null_provider. * * @copyright 2018 Zig Tan * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class provider implements \core_privacy\local\metadata\null_provider { /** * Get the language string identifier with the component's language * file to explain why this plugin stores no data. * * @return string */ public static function get_reason(): string { return 'privacy:metadata'; } } tests/generator/lib.php000064400000003213152266404500011156 0ustar00. /** * Recent repository data generator * * @package repository_recent * @category test * @copyright 2013 Frédéric Massart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** * Recent repository data generator class * * @package repository_recent * @category test * @copyright 2013 Frédéric Massart * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class repository_recent_generator extends testing_repository_generator { /** * Fill in type record defaults. * * @param array $record * @return array */ protected function prepare_type_record(array $record) { $record = parent::prepare_type_record($record); if (!isset($record['recentfilesnumber'])) { $record['recentfilesnumber'] = ''; } if (!isset($record['recentfilestimelimit'])) { $record['recentfilestimelimit'] = ''; } return $record; } } tests/lib_test.php000064400000017035152266404500010236 0ustar00. /** * Unit test for recent repository * * @package repository_recent * * @author Nathan Nguyen * @copyright Catalyst IT * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace repository_recent; use repository; defined('MOODLE_INTERNAL') || die(); global $CFG; require_once($CFG->dirroot . '/repository/lib.php'); require_once($CFG->dirroot . '/files/externallib.php'); /** * Unit test for recent repository * * @package repository_recent * * @author Nathan Nguyen * @copyright Catalyst IT * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ final class lib_test extends \advanced_testcase { /** @var repository Recent repository */ private $repo; /** @var \context repository */ private $usercontext; /** * SetUp to create an repository instance. */ protected function setUp(): void { global $USER; parent::setUp(); $this->setAdminUser(); $this->usercontext = \context_user::instance($USER->id); $repoid = $this->getDataGenerator()->create_repository('recent')->id; $this->repo = repository::get_repository_by_id($repoid, $this->usercontext); } /** * Test get listing */ public function test_get_listing_with_duplicate_file(): void { global $itemid; $this->resetAfterTest(true); // Set global itemid for draft file (file manager mockup). $itemid = file_get_unused_draft_itemid(); // No recent file. $filelist = $this->repo->get_listing()['list']; $this->assertCount(0, $filelist); // Create test file 1. $this->create_test_file('TestFile1', 'draft', $itemid); $filelist = $this->repo->get_listing()['list']; $this->assertCount(1, $filelist); // Due to create_test_file function, same filename means same content as the content is the filename hash. $this->create_test_file('TestFile1', 'private'); $filelist = $this->repo->get_listing()['list']; $this->assertCount(1, $filelist); // Create test file 2, different area. $this->create_test_file('TestFile2', 'private'); $filelist = $this->repo->get_listing()['list']; $this->assertCount(2, $filelist); } /** * Test get listing reference file */ public function test_get_listing_with_reference_file(): void { $this->resetAfterTest(true); // Create test file 1. $file1 = $this->create_test_file('TestFile1', 'private'); $filelist = $this->repo->get_listing()['list']; $this->assertCount(1, $filelist); // Create reference file. $file2 = $this->create_reference_file($file1, 'TestFile2', 'private'); $filelist = $this->repo->get_listing()['list']; $this->assertCount(1, $filelist); // Delete reference. $file2->delete_reference(); $filelist = $this->repo->get_listing()['list']; $this->assertCount(2, $filelist); } /** * Test number limit */ public function test_get_listing_number_limit(): void { $this->resetAfterTest(true); $this->create_multiple_test_files('private', 75); $filelist = $this->repo->get_listing()['list']; $this->assertCount(50, $filelist); // The number limit is set as property of the repo, so we need to create new repo instance. set_config('recentfilesnumber', 100, 'recent'); $repoid = $this->getDataGenerator()->create_repository('recent')->id; $repo = repository::get_repository_by_id($repoid, $this->usercontext); $filelist = $repo->get_listing()['list']; $this->assertCount(75, $filelist); } /** * Test time limit */ public function test_get_listing_time_limit(): void { $this->resetAfterTest(true); $this->create_multiple_test_files('private', 25); $file1 = $this->create_test_file('TestFileTimeLimit', 'private'); // Set time modified back to a year ago. $file1->set_timemodified(time() - YEARSECS); // There is no time limit by default. $filelist = $this->repo->get_listing()['list']; $this->assertCount(26, $filelist); // The time limit is set as property of the repo, so we need to create new repo instance. set_config('recentfilestimelimit', 3600, 'recent'); $repoid = $this->getDataGenerator()->create_repository('recent')->id; $repo = repository::get_repository_by_id($repoid, $this->usercontext); $filelist = $repo->get_listing()['list']; // Only get the recent files in the last hour. $this->assertCount(25, $filelist); } /** * Create multiple test file * * @param string $filearea file area * @param int $numberoffiles number of files to be created */ private function create_multiple_test_files($filearea, $numberoffiles) { for ($i = 0; $i < $numberoffiles; ++$i) { $filename = "TestFile$i" . time(); $this->create_test_file($filename, $filearea); } } /** * Create test file * * @param string $filename file name * @param string $filearea file area * @param int $itemid item id * @return \stored_file the newly created file */ private function create_test_file($filename, $filearea, $itemid = 0) { global $USER; $filerecord = array(); $filerecord['contextid'] = $this->usercontext->id; $filerecord['component'] = 'user'; $filerecord['filearea'] = $filearea; $filerecord['itemid'] = $itemid; $filerecord['filepath'] = '/'; $filerecord['filename'] = $filename; $filerecord['userid'] = $USER->id; $fs = get_file_storage(); $content = hash("md5", $filename); return $fs->create_file_from_string($filerecord, $content); } /** * Create reference file * * @param \stored_file $file source file * @param string $filename file name * @param string $filearea file area * @param int $itemid item id * @return \stored_file the newly created file */ private function create_reference_file($file, $filename, $filearea, $itemid = 0) { global $USER, $DB; $newfilerecord = array(); $newfilerecord['contextid'] = $this->usercontext->id; $newfilerecord['component'] = 'user'; $newfilerecord['filearea'] = $filearea; $newfilerecord['itemid'] = $itemid; $newfilerecord['filepath'] = '/'; $newfilerecord['filename'] = $filename; $newfilerecord['userid'] = $USER->id; $fs = get_file_storage(); $oldfilerecord = $DB->get_record('files', ['id' => $file->get_id()]); $ref = $fs->pack_reference($oldfilerecord); return $fs->create_file_from_reference($newfilerecord, $this->repo->id, $ref); } } tests/behat/add_recent.feature000064400000002620152266404500012442 0ustar00@repository @repository_recent @_file_upload Feature: Recent files repository lists the recently used files In order to save time when selecting files As a user I need to use again the files I've just used @javascript Scenario: Add files recently uploaded Given the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | And the following "blocks" exist: | blockname | contextlevel | reference | pagetypepattern | defaultregion | | private_files | System | 1 | my-index | side-post | And the following "activities" exist: | activity | course | name | intro | | folder | C1 | Folder name | Folder description | And I log in as "admin" And I follow "Manage private files" And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager And I upload "lib/tests/fixtures/upload_users.csv" file to "Files" filemanager And I press "Save changes" And I am on the "Folder name" "folder activity" page And I press "Edit" And I add "empty.txt" file from "Recent files" to "Files" filemanager And I add "empty.txt" file from "Recent files" to "Files" filemanager as: | Save as | empty_copy.txt | And I press "Save changes" Then I should see "empty.txt" And I should see "empty_copy.txt" And I should see "Folder description"