ÿØÿà 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-Ї Ç PK\66 styles.cssnu[.block_tag_flickr .flickr-photos { padding: 3px; }PK\F  db/access.phpnu[. /** * Tag flickr block caps. * * @package block_tag_flickr * @copyright Mark Nelson * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); $capabilities = array( 'block/tag_flickr:addinstance' => array( 'riskbitmask' => RISK_SPAM | RISK_XSS, 'captype' => 'write', 'contextlevel' => CONTEXT_BLOCK, 'archetypes' => array( 'editingteacher' => CAP_ALLOW, 'manager' => CAP_ALLOW ), 'clonepermissionsfrom' => 'moodle/site:manageblocks' ), ); PK\!Klang/en/block_tag_flickr.phpnu[. /** * Strings for component 'block_tag_flickr', language 'en', branch 'MOODLE_20_STABLE' * * @package block_tag_flickr * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ $string['configtitle'] = 'Flickr block title'; $string['date-posted-asc'] = 'Date posted ASC'; $string['date-posted-desc'] = 'Date posted DESC'; $string['date-taken-asc'] = 'Date taken ASC'; $string['date-taken-desc'] = 'Date taken DESC'; $string['defaulttile'] = 'Flickr'; $string['getfromphotoset'] = 'Get photos from photoset with id'; $string['includerelatedtags'] = 'Include related tags in query'; $string['interestingness-asc'] = 'Interestingness ASC'; $string['interestingness-desc'] = 'Interestingness DESC'; $string['numberofphotos'] = 'Number of photos'; $string['pluginname'] = 'Flickr'; $string['relevance'] = 'Relevance'; $string['sortby'] = 'Sort by'; $string['tag_flickr:addinstance'] = 'Add a new flickr block'; $string['privacy:metadata:block_tag_flickr'] = 'The Flickr block plugin does not store any personal data, but does transmit user data from Moodle to the remote system.'; $string['privacy:metadata:block_tag_flickr:tags'] = 'The tag values sent as CSV format to search for Flickr images.'; PK\Z edit_form.phpnu[. /** * Form for editing tag_flickr block instances. * * @package block_tag_flickr * @copyright 2009 Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** * Form for editing tag_flickr block instances. * * @copyright 2009 Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class block_tag_flickr_edit_form extends block_edit_form { protected function specific_definition($mform) { $mform->addElement('header', 'configheader', get_string('blocksettings', 'block')); $mform->addElement('text', 'config_title', get_string('configtitle', 'block_tag_flickr')); $mform->setType('config_title', PARAM_TEXT); $mform->addElement('text', 'config_numberofphotos', get_string('numberofphotos', 'block_tag_flickr'), array('size' => 5)); $mform->setType('config_numberofphotos', PARAM_INT); $mform->addElement('selectyesno', 'config_includerelatedtags', get_string('includerelatedtags', 'block_tag_flickr')); $mform->setDefault('config_includerelatedtags', 0); $sortoptions = array( 'date-posted-asc' => get_string('date-posted-asc', 'block_tag_flickr'), 'date-posted-desc' => get_string('date-posted-desc', 'block_tag_flickr'), 'date-taken-asc' => get_string('date-taken-asc', 'block_tag_flickr'), 'date-taken-desc' => get_string('date-taken-desc', 'block_tag_flickr'), 'interestingness-asc' => get_string('interestingness-asc', 'block_tag_flickr'), 'interestingness-desc' => get_string('interestingness-desc', 'block_tag_flickr'), 'relevance' => get_string('relevance', 'block_tag_flickr'), ); $mform->addElement('select', 'config_sortby', get_string('sortby', 'block_tag_flickr'), $sortoptions); $mform->setDefault('config_sortby', 'relevance'); $mform->addElement('text', 'config_photoset', get_string('getfromphotoset', 'block_tag_flickr')); $mform->setType('config_photoset', PARAM_ALPHANUM); } } PK\Um version.phpnu[. /** * Version details * * @package block_tag_flickr * @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_tag_flickr'; // Full name of the plugin (used for diagnostics) PK\[block_tag_flickr.phpnu[. /** * Flickr tag block. * * @package block_tag_flickr * @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(); define('FLICKR_DEV_KEY', '4fddbdd7ff2376beec54d7f6afad425e'); define('DEFAULT_NUMBER_OF_PHOTOS', 6); require_once("{$CFG->libdir}/flickrclient.php"); class block_tag_flickr extends block_base { function init() { $this->title = get_string('pluginname','block_tag_flickr'); } function applicable_formats() { return array('tag' => true); } function specialization() { $this->title = !empty($this->config->title) ? $this->config->title : get_string('pluginname', 'block_tag_flickr'); } function instance_allow_multiple() { return true; } function get_content() { global $CFG, $USER; //note: do NOT include files at the top of this file require_once($CFG->libdir . '/filelib.php'); if ($this->content !== NULL) { return $this->content; } $tagid = optional_param('id', 0, PARAM_INT); // tag id - for backware compatibility $tag = optional_param('tag', '', PARAM_TAG); // tag $tc = optional_param('tc', 0, PARAM_INT); // Tag collection id. if ($tagid) { $tagobject = core_tag_tag::get($tagid); } else if ($tag) { $tagobject = core_tag_tag::get_by_name($tc, $tag); } if (empty($tagobject)) { $this->content = new stdClass; $this->content->text = ''; $this->content->footer = ''; return $this->content; } //include related tags in the photo query ? $tagscsv = $tagobject->name; if (!empty($this->config->includerelatedtags)) { foreach ($tagobject->get_related_tags() as $t) { $tagscsv .= ',' . $t->get_display_name(false); } } $tagscsv = urlencode($tagscsv); //number of photos to display $numberofphotos = DEFAULT_NUMBER_OF_PHOTOS; if( !empty($this->config->numberofphotos)) { $numberofphotos = $this->config->numberofphotos; } //sort search results by $sortby = 'relevance'; if( !empty($this->config->sortby)) { $sortby = $this->config->sortby; } //pull photos from a specific photoset if(!empty($this->config->photoset)){ $request = 'https://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos'; $request .= '&api_key='.FLICKR_DEV_KEY; $request .= '&photoset_id='.$this->config->photoset; $request .= '&per_page='.$numberofphotos; $request .= '&format=json'; // We need to add nojsoncallback=? here, otherwise, Flickr will return the jsonFlickrApi object. $request .= '&nojsoncallback=?'; $response = $this->fetch_request($request); $search = @json_decode($response, true); if (!is_array($search) || json_last_error() !== JSON_ERROR_NONE) { // The response didn't appear to be in correct format. return; } foreach ($search['photoset']['photo'] as $p){ $p['owner'] = $search['photoset']['owner']; } $photos = array_values($search['photoset']['photo']); } //search for photos tagged with $tagscsv else{ $request = 'https://api.flickr.com/services/rest/?method=flickr.photos.search'; $request .= '&api_key='.FLICKR_DEV_KEY; $request .= '&tags='.$tagscsv; $request .= '&per_page='.$numberofphotos; $request .= '&sort='.$sortby; $request .= '&format=json'; // We need to add nojsoncallback=? here, otherwise, Flickr will return the jsonFlickrApi object. $request .= '&nojsoncallback=?'; $response = $this->fetch_request($request); $search = @json_decode($response, true); if (!is_array($search) || json_last_error() !== JSON_ERROR_NONE) { // The response didn't appear to be in correct format. return; } $photos = array_values($search['photos']['photo']); } if(strcmp($search['stat'], 'ok') != 0) return; //if no results were returned, exit... //Accessibility: render the list of photos $text = '\n"; $this->content = new stdClass; $this->content->text = $text; $this->content->footer = ''; return $this->content; } function fetch_request($request){ $c = new curl(array('cache' => true, 'module_cache'=> 'tag_flickr')); // Set custom user agent as Flickr blocks our "MoodleBot" agent string. $c->setopt([ 'CURLOPT_USERAGENT' => flickr_client::user_agent(), ]); $response = $c->get($request); return $response; } function build_photo_url($photo, $size='medium') { //receives an array (can use the individual photo data returned //from an API call) and returns a URL (doesn't mean that the //file size exists) $sizes = array( 'square' => '_s', 'thumbnail' => '_t', 'small' => '_m', 'medium' => '', 'large' => '_b', 'original' => '_o' ); $size = strtolower($size); if (!array_key_exists($size, $sizes)) { $size = 'medium'; } if ($size == 'original') { $url = 'http://farm' . $photo['farm'] . '.static.flickr.com/' . $photo['server'] . '/' . $photo['id'] . '_' . $photo['originalsecret'] . '_o' . '.' . $photo['originalformat']; } else { $url = 'http://farm' . $photo['farm'] . '.static.flickr.com/' . $photo['server'] . '/' . $photo['id'] . '_' . $photo['secret'] . $sizes[$size] . '.jpg'; } return $url; } /** * Return the plugin config settings for external functions. * * @return stdClass the configs for both the block instance and plugin * @since Moodle 3.8 */ public function get_config_for_external() { // Return all settings for all users since it is safe (no private keys, etc..). $configs = !empty($this->config) ? $this->config : new stdClass(); return (object) [ 'instance' => $configs, 'plugin' => new stdClass(), ]; } } PK\҅classes/privacy/provider.phpnu[. /** * Privacy Subsystem implementation for block_tag_flickr. * * @package block_tag_flickr * @copyright 2018 Zig Tan * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace block_tag_flickr\privacy; use core_privacy\local\metadata\collection; use core_privacy\local\request\approved_contextlist; use core_privacy\local\request\context; use core_privacy\local\request\contextlist; use core_privacy\local\request\userlist; use core_privacy\local\request\approved_userlist; defined('MOODLE_INTERNAL') || die(); /** * Privacy Subsystem for block_tag_flickr implementing metadata and plugin 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\provider, \core_privacy\local\request\core_userlist_provider, \core_privacy\local\request\plugin\provider { /** * Returns meta data about this system. * * @param collection $collection The initialised collection to add items to. * @return collection A listing of user data stored through this system. */ public static function get_metadata(collection $collection): collection { $collection->add_external_location_link( 'flickr.com', [ 'tags' => 'privacy:metadata:block_tag_flickr:tags' ], 'privacy:metadata:block_tag_flickr' ); return $collection; } /** * Get the list of contexts that contain user information for the specified user. * * @param int $userid The user to search. * @return contextlist $contextlist The contextlist containing the list of contexts used in this plugin. */ public static function get_contexts_for_userid(int $userid): contextlist { return new contextlist(); } /** * Get the list of users who have data within a context. * * @param userlist $userlist The userlist containing the list of users who have data in this context/plugin combination. */ public static function get_users_in_context(userlist $userlist) { } /** * Export all user data for the specified user, in the specified contexts. * * @param approved_contextlist $contextlist The approved contexts to export information for. */ public static function export_user_data(approved_contextlist $contextlist) { } /** * Delete all data for all users in the specified context. * * @param \context $context The specific context to delete data for. */ public static function delete_data_for_all_users_in_context(\context $context) { } /** * Delete multiple users within a single context. * * @param approved_userlist $userlist The approved context and user information to delete information for. */ public static function delete_data_for_users(approved_userlist $userlist) { } /** * Delete all user data for the specified user, in the specified contexts. * * @param approved_contextlist $contextlist The approved contexts and user information to delete information for. */ public static function delete_data_for_user(approved_contextlist $contextlist) { } } PK\$E0tests/behat/configuring_tag_flickr_block.featurenu[@block @block_tag_flickr Feature: Adding and configuring Flickr block In order to have the Flickr block used As a admin I need to add the Flickr block to the tags site page Background: # We need to create a user to use tag here because the tags site page only shows the tag that currently being used. Given the following "users" exist: | username | interests | | student1 | Cats | And I log in as "admin" And I turn editing mode on And the following config values are set as admin: | unaddableblocks | | theme_boost| And the following "blocks" exist: | blockname | contextlevel | reference | pagetypepattern | defaultregion | | tag_flickr | System | 1 | tag-search | side-post | | tag_flickr | System | 1 | tag-index | side-post | # TODO MDL-57120 site "Tags" link not accessible without navigation block. And I add the "Navigation" block if not present And I click on "Site pages" "list_item" in the "Navigation" "block" And I click on "Tags" "link" in the "Navigation" "block" @javascript Scenario: Adding Flickr block to the tags site page Given "block_tag_flickr" "block" should exist When I configure the "Flickr" block Then I should see "Flickr block title" And I set the field "Flickr block title" to "The Flickr block header" And I press "Save changes" And "block_tag_flickr" "block" should exist And "The Flickr block header" "block" should exist @javascript Scenario: Adding Flickr block to a specific tag page Given I click on "Cats" "link" Then "block_tag_flickr" "block" should exist And ".flickr-photos" "css_element" should exist in the "block_tag_flickr" "block" PK\66 styles.cssnu[PK\F  pdb/access.phpnu[PK\!Klang/en/block_tag_flickr.phpnu[PK\Z  edit_form.phpnu[PK\Um version.phpnu[PK\[block_tag_flickr.phpnu[PK\҅<classes/privacy/provider.phpnu[PK\$E0Ltests/behat/configuring_tag_flickr_block.featurenu[PK^S