ÿØÿà 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#\z} db/access.phpnu[. /** * Blog recent block caps. * * @package block_blog_recent * @copyright Mark Nelson * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); $capabilities = array( 'block/blog_recent: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#\W s:kklang/en/block_blog_recent.phpnu[. /** * Strings for component 'block_blog_recent', language 'en', branch 'MOODLE_20_STABLE' * * @package block_blog_recent * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ $string['blog_recent:addinstance'] = 'Add a new recent blog entries block'; $string['norecentblogentries'] = 'No recent entries'; $string['numentriestodisplay'] = 'Number of recent entries to display'; $string['pluginname'] = 'Recent blog entries'; $string['recentinterval'] = 'Interval of time considered "recent"'; $string['privacy:metadata'] = 'The Recent blog entries block only shows data stored in other locations.'; PK#\{  edit_form.phpnu[. /** * Form for editing tag block instances. * * @package block_blog_recent * @copyright 2009 Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ /** * Form for editing tag block instances. * * @package block_blog_recent * @copyright 2009 Tim Hunt * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class block_blog_recent_edit_form extends block_edit_form { protected function specific_definition($mform) { // Fields for editing HTML block title and contents. $mform->addElement('header', 'configheader', get_string('blocksettings', 'block')); $numberofentries = array(); for ($i = 1; $i <= 20; $i++) { $numberofentries[$i] = $i; } $mform->addElement('select', 'config_numberofrecentblogentries', get_string('numentriestodisplay', 'block_blog_recent'), $numberofentries); $mform->setDefault('config_numberofrecentblogentries', 4); $intervals = array( 7200 => get_string('numhours', '', 2), 14400 => get_string('numhours', '', 4), 21600 => get_string('numhours', '', 6), 43200 => get_string('numhours', '', 12), 86400 => get_string('numhours', '', 24), 172800 => get_string('numdays', '', 2), 604800 => get_string('numdays', '', 7) ); $mform->addElement('select', 'config_recentbloginterval', get_string('recentinterval', 'block_blog_recent'), $intervals); $mform->setDefault('config_recentbloginterval', 86400); } } PK#\=_ version.phpnu[. /** * Version details * * @package block_blog_recent * @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_blog_recent'; // Full name of the plugin (used for diagnostics) PK#\dJclasses/privacy/provider.phpnu[. /** * Privacy Subsystem implementation for block_blog_recent. * * @package block_blog_recent * @copyright 2018 Zig Tan * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace block_blog_recent\privacy; defined('MOODLE_INTERNAL') || die(); /** * Privacy Subsystem for block_blog_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'; } } PK#\ttests/blog_recent_test.phpnu[. namespace block_blog_recent; use advanced_testcase; use block_blog_recent; use context_course; /** * PHPUnit block_blog_recent tests * * @package block_blog_recent * @category test * @copyright 2021 Sara Arjona (sara@moodle.com) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @coversDefaultClass \block_blog_recent */ final class blog_recent_test extends advanced_testcase { public static function setUpBeforeClass(): void { require_once(__DIR__ . '/../../moodleblock.class.php'); require_once(__DIR__ . '/../block_blog_recent.php'); parent::setUpBeforeClass(); } /** * Test the behaviour of can_block_be_added() method. * * @covers ::can_block_be_added */ public function test_can_block_be_added(): void { $this->resetAfterTest(); $this->setAdminUser(); // Create a course and prepare the page where the block will be added. $course = $this->getDataGenerator()->create_course(); $page = new \moodle_page(); $page->set_context(context_course::instance($course->id)); $page->set_pagelayout('course'); $block = new block_blog_recent(); // If blogs advanced feature is enabled, the method should return true. set_config('enableblogs', true); $this->assertTrue($block->can_block_be_added($page)); // However, if the blogs advanced feature is disabled, the method should return false. set_config('enableblogs', false); $this->assertFalse($block->can_block_be_added($page)); } } PK#\k~ ,tests/behat/block_blog_recent_course.featurenu[@block @block_blog_menu @block_blog_recent Feature: Students can use the recent blog entries block to view recent entries on a course page In order to enable the recent blog entries block a course page As a teacher I can add the recent blog entries block to a course page Background: Given the following "users" exist: | username | firstname | lastname | email | idnumber | | student1 | Student | 1 | student1@example.com | S1 | | teacher1 | Teacher | 1 | teacher1@example.com | T1 | And the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | And the following "blocks" exist: | blockname | contextlevel | reference | pagetypepattern | defaultregion | | blog_menu | Course | C1 | course-view-* | side-pre | | blog_recent | Course | C1 | course-view-* | side-pre | And the "multilang" filter is "on" And the "multilang" filter applies to "content and headings" Scenario: Students use the recent blog entries block to view blogs Given I am on the "Course 1" course page logged in as student1 And I follow "Add an entry about this course" When I set the following fields to these values: | Entry title | S1 First Blog RUSSIANENGLISH | | Blog entry body | This is my awesome blog! | And I press "Save changes" Then I should see "S1 First Blog ENGLISH" And I should see "This is my awesome blog!" And I am on "Course 1" course homepage And I should see "S1 First Blog ENGLISH" And I follow "S1 First Blog" And I should see "This is my awesome blog!" Scenario: Students only see a few entries in the recent blog entries block Given I am on the "Course 1" course page logged in as student1 And I follow "Add an entry about this course" # Blog 1 of 5 And I set the following fields to these values: | Entry title | S1 First Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I wait "1" seconds And I am on "Course 1" course homepage And I follow "Add an entry about this course" # Blog 2 of 5 And I set the following fields to these values: | Entry title | S1 Second Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I wait "1" seconds And I should see "S1 Second Blog" And I should see "This is my awesome blog!" And I am on "Course 1" course homepage And I follow "Add an entry about this course" # Blog 3 of 5 And I set the following fields to these values: | Entry title | S1 Third Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I wait "1" seconds And I should see "S1 Third Blog" And I should see "This is my awesome blog!" And I am on "Course 1" course homepage And I follow "Add an entry about this course" # Blog 4 of 5 And I set the following fields to these values: | Entry title | S1 Fourth Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I wait "1" seconds And I should see "S1 Fourth Blog" And I should see "This is my awesome blog!" And I am on "Course 1" course homepage And I follow "Add an entry about this course" # Blog 5 of 5 And I set the following fields to these values: | Entry title | S1 Fifth Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I should see "S1 Fifth Blog" And I should see "This is my awesome blog!" When I am on "Course 1" course homepage And I should not see "S1 First Blog" And I should see "S1 Second Blog" And I should see "S1 Third Blog" And I should see "S1 Fourth Blog" And I should see "S1 Fifth Blog" And I follow "S1 Fifth Blog" And I should see "This is my awesome blog!" Then I log out And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I configure the "Recent blog entries" block And I set the following fields to these values: | config_numberofrecentblogentries | 2 | And I press "Save changes" And I should see "S1 Fourth Blog" And I should see "S1 Fifth Blog" PK#\UH|.tests/behat/block_blog_recent_activity.featurenu[@block @block_blog_menu @mod_assign @block_blog_recent Feature: Students can use the recent blog entries block to view recent entries on an activity page In order to enable the recent blog entries block an activity page As a teacher I can add the recent blog entries block to an activity page Background: Given the following "users" exist: | username | firstname | lastname | email | idnumber | | teacher1 | Teacher | 1 | teacher1@example.com | T1 | | student1 | Student | 1 | student1@example.com | S1 | | student2 | Student | 2 | student2@example.com | S2 | And the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | And the following "activity" exists: | activity | assign | | course | C1 | | idnumber | 0001 | | name | Test assignment 1 | | intro | Offline text | | section | 1 | | assignsubmission_file_enabled | 0 | And the following "blocks" exist: | blockname | contextlevel | reference | pagetypepattern | defaultregion | | blog_menu | Activity module | 0001 | mod-assign-view | side-pre | | blog_recent | Activity module | 0001 | mod-assign-view | side-pre | Scenario: Students use the recent blog entries block to view blogs Given I am on the "Test assignment 1" "assign activity" page logged in as student1 And I follow "Add an entry about this Assignment" When I set the following fields to these values: | Entry title | S1 First Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" Then I should see "S1 First Blog" And I should see "This is my awesome blog!" And I follow "Test assignment 1" And I should see "S1 First Blog" And I follow "S1 First Blog" And I should see "This is my awesome blog!" Scenario: Students only see a few entries in the recent blog entries block Given I am on the "Test assignment 1" "assign activity" page logged in as student1 And I follow "Add an entry about this Assignment" # Blog 1 of 5 And I set the following fields to these values: | Entry title | S1 First Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I wait "1" seconds And I follow "Test assignment 1" And I follow "Add an entry about this Assignment" # Blog 2 of 5 And I set the following fields to these values: | Entry title | S1 Second Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I wait "1" seconds And I should see "S1 Second Blog" And I should see "This is my awesome blog!" And I follow "Test assignment 1" And I follow "Add an entry about this Assignment" # Blog 3 of 5 And I set the following fields to these values: | Entry title | S1 Third Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I wait "1" seconds And I should see "S1 Third Blog" And I should see "This is my awesome blog!" And I follow "Test assignment 1" And I follow "Add an entry about this Assignment" # Blog 4 of 5 And I set the following fields to these values: | Entry title | S1 Fourth Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I wait "1" seconds And I should see "S1 Fourth Blog" And I should see "This is my awesome blog!" And I follow "Test assignment 1" And I follow "Add an entry about this Assignment" # Blog 5 of 5 And I set the following fields to these values: | Entry title | S1 Fifth Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I should see "S1 Fifth Blog" And I should see "This is my awesome blog!" When I follow "Test assignment 1" And I should not see "S1 First Blog" And I should see "S1 Second Blog" And I should see "S1 Third Blog" And I should see "S1 Fourth Blog" And I should see "S1 Fifth Blog" And I follow "S1 Fifth Blog" And I should see "This is my awesome blog!" Then I log out And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I follow "Test assignment 1" And I configure the "Recent blog entries" block And I set the following fields to these values: | config_numberofrecentblogentries | 2 | And I press "Save changes" And I should see "S1 Fourth Blog" And I should see "S1 Fifth Blog" PK#\b3SS%tests/behat/block_blog_recent.featurenu[@block @block_blog_recent Feature: Feature: Users can use the recent blog entries block to view recent blog entries. In order to enable the recent blog entries in a course As a teacher I can add recent blog entries block to a course Background: Given the following "users" exist: | username | firstname | lastname | email | idnumber | | teacher1 | Teacher | 1 | teacher1@example.com | T1 | And the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | Scenario: Add the recent blogs block to a course when blogs are disabled Given I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on When I add the "Recent blog entries" block And the following config values are set as admin: | enableblogs | 0 | And I reload the page Then I should see "Blogging is disabled!" in the "Recent blog entries" "block" Scenario: Add the recent blogs block to a course when there are not any blog posts Given I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on When I add the "Recent blog entries" block Then I should see "No recent entries" in the "Recent blog entries" "block" PK#\s\w/tests/behat/block_blog_recent_frontpage.featurenu[@block @block_blog_recent Feature: Feature: Students can use the recent blog entries block to view recent entries on the frontpage In order to enable the recent blog entries block on the frontpage As an admin I can add the recent blog entries block to the frontpage Background: Given the following "users" exist: | username | firstname | lastname | email | idnumber | | student1 | Student | 1 | student1@example.com | S1 | And the following "blocks" exist: | blockname | contextlevel | reference | pagetypepattern | defaultregion | | blog_recent | System | 1 | site-index | side-pre | And the following config values are set as admin: | unaddableblocks | | theme_boost| And I log in as "admin" And I am on site homepage And I turn editing mode on # TODO MDL-57120 site "Blogs" link not accessible without navigation block. And I add the "Navigation" block if not present And I log out Scenario: Students use the recent blog entries block to view blogs Given I log in as "student1" And I am on site homepage And I click on "Site blogs" "link" in the "Navigation" "block" And I follow "Add a new entry" When I set the following fields to these values: | Entry title | S1 First Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" Then I should see "S1 First Blog" And I should see "This is my awesome blog!" And I am on site homepage And I should see "S1 First Blog" And I follow "S1 First Blog" And I should see "This is my awesome blog!" Scenario: Students only see a few entries in the recent blog entries block Given I log in as "student1" And I am on site homepage And I click on "Site blogs" "link" in the "Navigation" "block" And I follow "Add a new entry" # Blog 1 of 5 And I set the following fields to these values: | Entry title | S1 First Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I wait "1" seconds And I follow "Add a new entry" # Blog 2 of 5 And I set the following fields to these values: | Entry title | S1 Second Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I wait "1" seconds And I should see "S1 Second Blog" And I should see "This is my awesome blog!" And I follow "Add a new entry" # Blog 3 of 5 And I set the following fields to these values: | Entry title | S1 Third Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I wait "1" seconds And I should see "S1 Third Blog" And I should see "This is my awesome blog!" And I follow "Add a new entry" # Blog 4 of 5 And I set the following fields to these values: | Entry title | S1 Fourth Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I wait "1" seconds And I should see "S1 Fourth Blog" And I should see "This is my awesome blog!" And I follow "Add a new entry" # Blog 5 of 5 And I set the following fields to these values: | Entry title | S1 Fifth Blog | | Blog entry body | This is my awesome blog! | And I press "Save changes" And I should see "S1 Fifth Blog" And I should see "This is my awesome blog!" When I am on site homepage And I should not see "S1 First Blog" And I should see "S1 Second Blog" And I should see "S1 Third Blog" And I should see "S1 Fourth Blog" And I should see "S1 Fifth Blog" And I follow "S1 Fifth Blog" And I should see "This is my awesome blog!" Then I log out And I log in as "admin" And I am on site homepage And I turn editing mode on And I configure the "Recent blog entries" block And I set the following fields to these values: | config_numberofrecentblogentries | 2 | And I press "Save changes" And I should see "S1 Fourth Blog" And I should see "S1 Fifth Blog" PK#\zblock_blog_recent.phpnu[. /** * Recent Blog Entries Block page. * * @package block_blog_recent * @copyright 2009 Nicolas Connault * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); /** * This block simply outputs a list of links to recent blog entries, depending on * the context of the current page. */ class block_blog_recent extends block_base { function init() { $this->title = get_string('pluginname', 'block_blog_recent'); $this->content_type = BLOCK_TYPE_TEXT; } function applicable_formats() { return array('all' => true, 'my' => false, 'tag' => false); } function instance_allow_config() { return true; } function get_content() { global $CFG; if ($this->content !== NULL) { return $this->content; } // verify blog is enabled if (empty($CFG->enableblogs)) { $this->content = new stdClass(); $this->content->text = ''; if ($this->page->user_is_editing()) { $this->content->text = get_string('blogdisable', 'blog'); } return $this->content; } else if ($CFG->bloglevel < BLOG_GLOBAL_LEVEL and (!isloggedin() or isguestuser())) { $this->content = new stdClass(); $this->content->text = ''; return $this->content; } require_once($CFG->dirroot .'/blog/lib.php'); require_once($CFG->dirroot .'/blog/locallib.php'); if (empty($this->config)) { $this->config = new stdClass(); } if (empty($this->config->recentbloginterval)) { $this->config->recentbloginterval = 8400; } if (empty($this->config->numberofrecentblogentries)) { $this->config->numberofrecentblogentries = 4; } $this->content = new stdClass(); $this->content->footer = ''; $this->content->text = ''; $context = $this->page->context; $url = new moodle_url('/blog/index.php'); $filter = array(); if ($context->contextlevel == CONTEXT_MODULE) { $filter['module'] = $context->instanceid; $a = new stdClass; $a->type = get_string('modulename', $this->page->cm->modname); $strview = get_string('viewallmodentries', 'blog', $a); $url->param('modid', $context->instanceid); } else if ($context->contextlevel == CONTEXT_COURSE) { $filter['course'] = $context->instanceid; $a = new stdClass; $a->type = get_string('course'); $strview = get_string('viewblogentries', 'blog', $a); $url->param('courseid', $context->instanceid); } else { $strview = get_string('viewsiteentries', 'blog'); } $filter['since'] = $this->config->recentbloginterval; $bloglisting = new blog_listing($filter); $entries = $bloglisting->get_entries(0, $this->config->numberofrecentblogentries, 4); if (!empty($entries)) { $entrieslist = array(); $viewblogurl = new moodle_url('/blog/index.php'); foreach ($entries as $entryid => $entry) { $viewblogurl->param('entryid', $entryid); $entrylink = html_writer::link($viewblogurl, shorten_text(format_string($entry->subject, true, ['context' => $context]))); $entrieslist[] = $entrylink; } $this->content->text .= html_writer::alist($entrieslist, array('class'=>'list')); $viewallentrieslink = html_writer::link($url, $strview); $this->content->text .= $viewallentrieslink; } else { $this->content->text .= get_string('norecentblogentries', 'block_blog_recent'); } } /** * 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(), ]; } /** * This block shouldn't be added to a page if the blogs advanced feature is disabled. * * @param moodle_page $page * @return bool */ public function can_block_be_added(moodle_page $page): bool { global $CFG; return $CFG->enableblogs; } } PK#\z} db/access.phpnu[PK#\W s:kkPlang/en/block_blog_recent.phpnu[PK#\{   edit_form.phpnu[PK#\=_ Kversion.phpnu[PK#\dJ)classes/privacy/provider.phpnu[PK#\titests/blog_recent_test.phpnu[PK#\k~ ,(tests/behat/block_blog_recent_course.featurenu[PK#\UH|.:tests/behat/block_blog_recent_activity.featurenu[PK#\b3SS%Ntests/behat/block_blog_recent.featurenu[PK#\s\w/QTtests/behat/block_blog_recent_frontpage.featurenu[PK#\zdblock_blog_recent.phpnu[PK y