ÿØÿà 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/access.php000064400000003051152266461710007114 0ustar00. /** * Admin bookmarks block caps. * * @package block_admin_bookmarks * @copyright Mark Nelson * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); $capabilities = array( 'block/admin_bookmarks:myaddinstance' => array( 'captype' => 'write', 'contextlevel' => CONTEXT_SYSTEM, 'archetypes' => array( 'user' => CAP_ALLOW ), 'clonepermissionsfrom' => 'moodle/my:manageblocks' ), 'block/admin_bookmarks:addinstance' => array( 'riskbitmask' => RISK_SPAM | RISK_XSS, 'captype' => 'write', 'contextlevel' => CONTEXT_BLOCK, 'archetypes' => array( 'editingteacher' => CAP_ALLOW, 'manager' => CAP_ALLOW ), 'clonepermissionsfrom' => 'moodle/site:manageblocks' ), ); lang/en/block_admin_bookmarks.php000064400000002403152266461710013123 0ustar00. /** * Strings for component 'block_admin_bookmarks', language 'en', branch 'MOODLE_20_STABLE' * * @package block_admin_bookmarks * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ $string['admin_bookmarks:addinstance'] = 'Add a new admin bookmarks block'; $string['admin_bookmarks:myaddinstance'] = 'Add a new admin bookmarks block to Dashboard'; $string['pluginname'] = 'Admin bookmarks'; $string['privacy:metadata'] = 'The Admin bookmarks block only shows data stored in other locations.'; delete.php000064400000004655152266461710006543 0ustar00. /** * Delete admin bookmarks. * * @package block_admin_bookmarks * @copyright 2006 vinkmar * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require('../../config.php'); require_once($CFG->libdir.'/adminlib.php'); require_login(); $context = context_system::instance(); $PAGE->set_context($context); $adminroot = admin_get_root(false, false); // settings not required - only pages // We clean section with safe path here for compatibility with external pages that include a slash in their name. if ($section = optional_param('section', '', PARAM_SAFEPATH) and confirm_sesskey()) { if (get_user_preferences('admin_bookmarks')) { $bookmarks = explode(',', get_user_preferences('admin_bookmarks')); $key = array_search($section, $bookmarks); if ($key === false) { throw new \moodle_exception('nonexistentbookmark', 'admin'); die; } unset($bookmarks[$key]); $bookmarks = implode(',', $bookmarks); set_user_preference('admin_bookmarks', $bookmarks); $temp = $adminroot->locate($section); if ($temp instanceof admin_externalpage) { redirect($temp->url, get_string('bookmarkdeleted','admin')); } elseif ($temp instanceof admin_settingpage) { redirect($CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=' . $section); } else if ($temp instanceof admin_category) { redirect($CFG->wwwroot . '/' . $CFG->admin . '/category.php?category=' . $section); } else { redirect($CFG->wwwroot); } die; } throw new \moodle_exception('nobookmarksforuser', 'admin'); die; } else { throw new \moodle_exception('invalidsection', 'admin'); die; } version.php000064400000002253152266461710006756 0ustar00. /** * Version details * * @package block_admin_bookmarks * @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com) * @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 = 'block_admin_bookmarks'; // Full name of the plugin (used for diagnostics) classes/privacy/provider.php000064400000003004152266461710012230 0ustar00. /** * Privacy Subsystem implementation for block_admin_bookmarks. * * @package block_admin_bookmarks * @copyright 2018 Zig Tan * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace block_admin_bookmarks\privacy; defined('MOODLE_INTERNAL') || die(); /** * Privacy Subsystem for block_admin_bookmarks 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'; } } block_admin_bookmarks.php000064400000011654152266461710011610 0ustar00. /** * Admin Bookmarks Block page. * * @package block_admin_bookmarks * @copyright 2011 Moodle * @author 2006 vinkmar * 2011 Rossiani Wijaya (updated) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** * The admin bookmarks block class */ class block_admin_bookmarks extends block_base { /** @var string */ public $blockname = null; /** @var bool|null */ protected $docked = null; /** * Set the initial properties for the block */ function init() { $this->blockname = get_class($this); $this->title = get_string('pluginname', $this->blockname); } /** * All multiple instances of this block * @return bool Returns false */ function instance_allow_multiple() { return false; } /** * Set the applicable formats for this block to all * @return array */ function applicable_formats() { if (has_capability('moodle/site:config', context_system::instance())) { return array('all' => true); } else { return array('site' => true); } } /** * Gets the content for this block */ function get_content() { global $CFG; // First check if we have already generated, don't waste cycles if ($this->content !== null) { return $this->content; } $this->content = new stdClass(); if (get_user_preferences('admin_bookmarks')) { require_once($CFG->libdir.'/adminlib.php'); $adminroot = admin_get_root(false, false); // settings not required - only pages $bookmarks = explode(',', get_user_preferences('admin_bookmarks')); /// Accessibility: markup as a list. $contents = array(); foreach($bookmarks as $bookmark) { $temp = $adminroot->locate($bookmark); if ($temp instanceof admin_settingpage) { $contenturl = new moodle_url('/admin/settings.php', array('section'=>$bookmark)); $contentlink = html_writer::link($contenturl, $temp->visiblename); $contents[] = html_writer::tag('li', $contentlink); } else if ($temp instanceof admin_externalpage) { $contenturl = new moodle_url($temp->url); $contentlink = html_writer::link($contenturl, $temp->visiblename); $contents[] = html_writer::tag('li', $contentlink); } else if ($temp instanceof admin_category) { $contenturl = new moodle_url('/admin/category.php', array('category' => $bookmark)); $contentlink = html_writer::link($contenturl, $temp->visiblename); $contents[] = html_writer::tag('li', $contentlink); } } $this->content->text = html_writer::tag('ol', implode('', $contents), array('class' => 'list')); } else { $bookmarks = array(); } $this->content->footer = ''; $this->page->settingsnav->initialise(); $node = $this->page->settingsnav->get('root', navigation_node::TYPE_SITE_ADMIN); if (!$node || !$node->contains_active_node()) { return $this->content; } $section = $node->find_active_node()->key; if ($section == 'search' || empty($section)){ // the search page can't be properly bookmarked at present $this->content->footer = ''; } else if (in_array($section, $bookmarks)) { $deleteurl = new moodle_url('/blocks/admin_bookmarks/delete.php', array('section'=>$section, 'sesskey'=>sesskey())); $this->content->footer = html_writer::link($deleteurl, get_string('unbookmarkthispage','admin')); } else { $createurl = new moodle_url('/blocks/admin_bookmarks/create.php', array('section'=>$section, 'sesskey'=>sesskey())); $this->content->footer = html_writer::link($createurl, get_string('bookmarkthispage','admin')); } return $this->content; } /** * Returns the role that best describes the admin bookmarks block. * * @return string */ public function get_aria_role() { return 'navigation'; } } tests/behat/bookmark_admin_pages.feature000064400000003257152266461710014523 0ustar00@block @block_admin_bookmarks Feature: Add a bookmarks to an admin pages In order to speed up common tasks As an admin I need to add and access pages through bookmarks Background: Given I log in as "admin" And I navigate to "Server > Tasks > Scheduled tasks" in site administration And I click on "Bookmark this page" "link" in the "Admin bookmarks" "block" And I log out # Test bookmark functionality using the "User profile fields" page as our bookmark. Scenario: Admin page can be bookmarked Given I log in as "admin" And I navigate to "Users > Accounts > User profile fields" in site administration When I click on "Bookmark this page" "link" in the "Admin bookmarks" "block" Then I should see "User profile fields" in the "Admin bookmarks" "block" # See the existing bookmark is there too. And I should see "Scheduled tasks" in the "Admin bookmarks" "block" Scenario: Admin page can be accessed through bookmarks block Given I log in as "admin" And I navigate to "Notifications" in site administration And I click on "Scheduled tasks" "link" in the "Admin bookmarks" "block" # Verify that we are on the right page. Then I should see "Day of week" in the "admintable" "table" Scenario: Admin page can be removed from bookmarks Given I log in as "admin" And I navigate to "Notifications" in site administration And I click on "Scheduled tasks" "link" in the "Admin bookmarks" "block" When I click on "Unbookmark this page" "link" in the "Admin bookmarks" "block" Then I should see "Bookmark deleted" And I wait to be redirected And I should not see "Scheduled tasks" in the "Admin bookmarks" "block" create.php000064400000004674152266461710006545 0ustar00. /** * Create admin bookmarks. * * @package block_admin_bookmarks * @copyright 2006 vinkmar * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require('../../config.php'); require_once($CFG->libdir.'/adminlib.php'); require_login(); $context = context_system::instance(); $PAGE->set_context($context); $adminroot = admin_get_root(false, false); // settings not required - only pages // We clean section with safe path here for compatibility with external pages that include a slash in their name. if ($section = optional_param('section', '', PARAM_SAFEPATH) and confirm_sesskey()) { if (get_user_preferences('admin_bookmarks')) { $bookmarks = explode(',', get_user_preferences('admin_bookmarks')); if (in_array($section, $bookmarks)) { throw new \moodle_exception('bookmarkalreadyexists', 'admin'); die; } } else { $bookmarks = array(); } $temp = $adminroot->locate($section); if ($temp instanceof admin_settingpage || $temp instanceof admin_externalpage || $temp instanceof admin_category) { $bookmarks[] = $section; $bookmarks = implode(',', $bookmarks); set_user_preference('admin_bookmarks', $bookmarks); } else { throw new \moodle_exception('invalidsection', 'admin'); die; } if ($temp instanceof admin_settingpage) { redirect($CFG->wwwroot . '/' . $CFG->admin . '/settings.php?section=' . $section); } elseif ($temp instanceof admin_externalpage) { redirect($temp->url); } else if ($temp instanceof admin_category) { redirect($CFG->wwwroot . '/' . $CFG->admin . '/category.php?category=' . $section); } } else { throw new \moodle_exception('invalidsection', 'admin'); die; }