From b38e2e28a1733902605fbb64d94da229be0e12ac Mon Sep 17 00:00:00 2001 From: "Andrew Davis (andyjdavis)" Date: Fri, 17 Jun 2011 16:23:10 +0800 Subject: [PATCH] MDL-27829 blocks: altered the algorithm used to find plugin page types --- blog/lib.php | 2 +- course/lib.php | 2 +- .../lang/en/coursereport_completion.php | 2 +- course/report/completion/lib.php | 15 +++ course/report/lib.php | 20 +-- .../report/log/lang/en/coursereport_log.php | 2 +- course/report/log/lib.php | 15 +++ .../outline/lang/en/coursereport_outline.php | 2 +- course/report/outline/lib.php | 15 +++ .../lang/en/coursereport_participation.php | 2 +- course/report/participation/lib.php | 15 +++ .../lang/en/coursereport_progress.php | 2 +- course/report/progress/lib.php | 15 +++ .../stats/lang/en/coursereport_stats.php | 2 +- course/report/stats/lib.php | 15 +++ lib/blocklib.php | 123 ++++++++---------- lib/questionlib.php | 4 +- message/lib.php | 2 +- mod/assignment/lib.php | 2 +- mod/chat/lib.php | 2 +- mod/choice/lib.php | 2 +- mod/data/lib.php | 2 +- mod/feedback/lib.php | 2 +- mod/folder/lib.php | 2 +- mod/forum/lib.php | 2 +- mod/glossary/lib.php | 2 +- mod/imscp/lib.php | 2 +- mod/lesson/lib.php | 2 +- mod/page/lib.php | 2 +- mod/quiz/lib.php | 2 +- mod/resource/lib.php | 2 +- mod/scorm/lib.php | 2 +- mod/survey/lib.php | 2 +- mod/url/lib.php | 2 +- mod/wiki/lib.php | 2 +- mod/workshop/lib.php | 2 +- notes/lib.php | 2 +- tag/lib.php | 2 +- user/lib.php | 2 +- 39 files changed, 180 insertions(+), 117 deletions(-) diff --git a/blog/lib.php b/blog/lib.php index 0f25fb4b92f45..c37af10a1a343 100644 --- a/blog/lib.php +++ b/blog/lib.php @@ -1035,7 +1035,7 @@ function blog_comment_validate($comment_param) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function blog_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function blog_page_type_list($pagetype, $parentcontext, $currentcontext) { return array( '*'=>get_string('page-x', 'pagetype'), 'blog-*'=>get_string('page-blog-x', 'blog'), diff --git a/course/lib.php b/course/lib.php index c329f65079c9f..8517148404a86 100644 --- a/course/lib.php +++ b/course/lib.php @@ -4218,7 +4218,7 @@ protected function notify($touser, $fromuser, $name='courserequested', $subject, * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function course_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function course_page_type_list($pagetype, $parentcontext, $currentcontext) { // if above course context ,display all course fomats list($currentcontext, $course, $cm) = get_context_info_array($currentcontext->id); if ($course->id == SITEID) { diff --git a/course/report/completion/lang/en/coursereport_completion.php b/course/report/completion/lang/en/coursereport_completion.php index 042b004d67bfd..2ec123a2526c9 100644 --- a/course/report/completion/lang/en/coursereport_completion.php +++ b/course/report/completion/lang/en/coursereport_completion.php @@ -2,5 +2,5 @@ $string['completion:view'] = 'View course completion report'; $string['completiondate']='Completion date'; -$string['pluginpagetype'] = 'Any completion course report'; +$string['pluginpagetype'] = 'Completion course report'; $string['pluginname']='Course completion'; diff --git a/course/report/completion/lib.php b/course/report/completion/lib.php index a84f3a256513a..7bf087e06945a 100644 --- a/course/report/completion/lib.php +++ b/course/report/completion/lib.php @@ -44,3 +44,18 @@ function completion_report_extend_navigation($navigation, $course, $context) { } } } + +/** + * Return a list of page types + * @param string $pagetype current page type + * @param stdClass $parentcontext Block's parent context + * @param stdClass $currentcontext Current context of block + */ +function completion_page_type_list($pagetype, $parentcontext, $currentcontext) { + $array = array( + '*' => get_string('page-x', 'pagetype'), + 'course-report-*' => get_string('page-course-report-x', 'pagetype'), + 'course-report-completion-*' => get_string('pluginpagetype', 'coursereport_completion') + ); + return $array; +} diff --git a/course/report/lib.php b/course/report/lib.php index 33cef7f2e4fe2..3ed43f7325749 100644 --- a/course/report/lib.php +++ b/course/report/lib.php @@ -16,31 +16,23 @@ // along with Moodle. If not, see . /** - * This file contains functions used by the outline report + * This file contains functions used by course reports * * @since 2.1 * @package course-report * @copyright 2011 Andrew Davis * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ - /** * Return a list of page types * @param string $pagetype current page type * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function coursereport_pagetypelist($pagetype, $parentcontext, $currentcontext) { - $array = array('*'=>get_string('page-x', 'pagetype'), - 'course-report-*'=>get_string('page-course-report-x', 'pagetype') - ); - - //extract course-report-outline from course-report-outline-index - $bits = explode('-', $pagetype); - if (count($bits >= 3)) { - $report = array_slice($bits, 2, 1); - $array['course-report-'.$report[0].'-*'] = get_string('pluginpagetype', 'coursereport_'.$report); - } - +function coursereport_page_type_list($pagetype, $parentcontext, $currentcontext) { + $array = array( + '*' => get_string('page-x', 'pagetype'), + 'course-report-*' => get_string('page-course-report-x', 'pagetype') + ); return $array; } \ No newline at end of file diff --git a/course/report/log/lang/en/coursereport_log.php b/course/report/log/lang/en/coursereport_log.php index b41bcc34e6eda..431e260135cf7 100644 --- a/course/report/log/lang/en/coursereport_log.php +++ b/course/report/log/lang/en/coursereport_log.php @@ -27,5 +27,5 @@ $string['log:view'] = 'View course logs'; $string['log:viewlive'] = 'View live logs'; $string['log:viewtoday'] = 'View today\'s logs'; -$string['pluginpagetype'] = 'Any log course report'; +$string['pluginpagetype'] = 'Log course report'; $string['pluginname'] = 'Logs'; diff --git a/course/report/log/lib.php b/course/report/log/lib.php index 96cbdc70c9a4d..de2769280a4a3 100644 --- a/course/report/log/lib.php +++ b/course/report/log/lib.php @@ -537,3 +537,18 @@ function log_report_extend_navigation($navigation, $course, $context) { $navigation->add(get_string('pluginname', 'coursereport_log'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', '')); } } + +/** + * Return a list of page types + * @param string $pagetype current page type + * @param stdClass $parentcontext Block's parent context + * @param stdClass $currentcontext Current context of block + */ +function log_page_type_list($pagetype, $parentcontext, $currentcontext) { + $array = array( + '*' => get_string('page-x', 'pagetype'), + 'course-report-*' => get_string('page-course-report-x', 'pagetype'), + 'course-report-log-*' => get_string('pluginpagetype', 'coursereport_log') + ); + return $array; +} \ No newline at end of file diff --git a/course/report/outline/lang/en/coursereport_outline.php b/course/report/outline/lang/en/coursereport_outline.php index a13861ec780c6..6bce7b869135d 100644 --- a/course/report/outline/lang/en/coursereport_outline.php +++ b/course/report/outline/lang/en/coursereport_outline.php @@ -24,5 +24,5 @@ */ $string['outline:view'] = 'View course activity report'; -$string['pluginpagetype'] = 'Any outline course report'; +$string['pluginpagetype'] = 'Course activity report'; $string['pluginname'] = 'Course activity'; diff --git a/course/report/outline/lib.php b/course/report/outline/lib.php index c020dcc6a0d76..f3632b3718502 100644 --- a/course/report/outline/lib.php +++ b/course/report/outline/lib.php @@ -37,4 +37,19 @@ function outline_report_extend_navigation($navigation, $course, $context) { $url = new moodle_url('/course/report/outline/index.php', array('id'=>$course->id)); $navigation->add(get_string( 'activityreport' ), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', '')); } +} + +/** + * Return a list of page types + * @param string $pagetype current page type + * @param stdClass $parentcontext Block's parent context + * @param stdClass $currentcontext Current context of block + */ +function outline_page_type_list($pagetype, $parentcontext, $currentcontext) { + $array = array( + '*' => get_string('page-x', 'pagetype'), + 'course-report-*' => get_string('page-course-report-x', 'pagetype'), + 'course-report-outline-*' => get_string('pluginpagetype', 'coursereport_outline') + ); + return $array; } \ No newline at end of file diff --git a/course/report/participation/lang/en/coursereport_participation.php b/course/report/participation/lang/en/coursereport_participation.php index 3bf2aaee2d16b..16e5eaa176333 100644 --- a/course/report/participation/lang/en/coursereport_participation.php +++ b/course/report/participation/lang/en/coursereport_participation.php @@ -24,5 +24,5 @@ */ $string['participation:view'] = 'View course participation report'; -$string['pluginpagetype'] = 'Any participation course report'; +$string['pluginpagetype'] = 'Participation course report'; $string['pluginname'] = 'Course participation'; diff --git a/course/report/participation/lib.php b/course/report/participation/lib.php index 7071876adede6..62429c9bbe85e 100644 --- a/course/report/participation/lib.php +++ b/course/report/participation/lib.php @@ -37,4 +37,19 @@ function participation_report_extend_navigation($navigation, $course, $context) $url = new moodle_url('/course/report/participation/index.php', array('id'=>$course->id)); $navigation->add(get_string('participationreport'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', '')); } +} + +/** + * Return a list of page types + * @param string $pagetype current page type + * @param stdClass $parentcontext Block's parent context + * @param stdClass $currentcontext Current context of block + */ +function participation_page_type_list($pagetype, $parentcontext, $currentcontext) { + $array = array( + '*' => get_string('page-x', 'pagetype'), + 'course-report-*' => get_string('page-course-report-x', 'pagetype'), + 'course-report-participation-*' => get_string('pluginpagetype', 'coursereport_participation') + ); + return $array; } \ No newline at end of file diff --git a/course/report/progress/lang/en/coursereport_progress.php b/course/report/progress/lang/en/coursereport_progress.php index 774cd1387f3ef..dd27c662acbed 100644 --- a/course/report/progress/lang/en/coursereport_progress.php +++ b/course/report/progress/lang/en/coursereport_progress.php @@ -24,5 +24,5 @@ */ $string['pluginname'] = 'Activity completion'; -$string['pluginpagetype'] = 'Any progress course report'; +$string['pluginpagetype'] = 'Progress course report'; $string['progress:view'] = 'View activity completion reports'; diff --git a/course/report/progress/lib.php b/course/report/progress/lib.php index f4c74f6a5e627..23a9686f9339b 100644 --- a/course/report/progress/lib.php +++ b/course/report/progress/lib.php @@ -49,3 +49,18 @@ function progress_report_extend_navigation($navigation, $course, $context) { $navigation->add(get_string('pluginname','coursereport_progress'), $url, navigation_node::TYPE_SETTING, null, null, new pix_icon('i/report', '')); } } + +/** + * Return a list of page types + * @param string $pagetype current page type + * @param stdClass $parentcontext Block's parent context + * @param stdClass $currentcontext Current context of block + */ +function progress_page_type_list($pagetype, $parentcontext, $currentcontext) { + $array = array( + '*' => get_string('page-x', 'pagetype'), + 'course-report-*' => get_string('page-course-report-x', 'pagetype'), + 'course-report-progress-*' => get_string('pluginpagetype', 'coursereport_progress') + ); + return $array; +} \ No newline at end of file diff --git a/course/report/stats/lang/en/coursereport_stats.php b/course/report/stats/lang/en/coursereport_stats.php index e47c77c03e3f5..38815c858987e 100644 --- a/course/report/stats/lang/en/coursereport_stats.php +++ b/course/report/stats/lang/en/coursereport_stats.php @@ -24,5 +24,5 @@ */ $string['pluginname'] = 'Course statistics'; -$string['pluginpagetype'] = 'Any stats course report'; +$string['pluginpagetype'] = 'Statistics course report'; $string['stats:view'] = 'View course statistics report'; diff --git a/course/report/stats/lib.php b/course/report/stats/lib.php index ed31e78cc9a86..220e8dff67715 100644 --- a/course/report/stats/lib.php +++ b/course/report/stats/lib.php @@ -91,3 +91,18 @@ function stats_report_extend_navigation($navigation, $course, $context) { } } } + +/** + * Return a list of page types + * @param string $pagetype current page type + * @param stdClass $parentcontext Block's parent context + * @param stdClass $currentcontext Current context of block + */ +function stats_page_type_list($pagetype, $parentcontext, $currentcontext) { + $array = array( + '*' => get_string('page-x', 'pagetype'), + 'course-report-*' => get_string('page-course-report-x', 'pagetype'), + 'course-report-stats-*' => get_string('pluginpagetype', 'coursereport_stats') + ); + return $array; +} \ No newline at end of file diff --git a/lib/blocklib.php b/lib/blocklib.php index d120c15535715..9e7522f7917d5 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -1563,57 +1563,72 @@ function generate_page_type_patterns($pagetype, $parentcontext = null, $currentc $bits = explode('-', $pagetype); - $function = 'default_pagetypelist'; - $core = get_core_subsystems(); $plugins = get_plugin_types(); //progressively strip pieces off the page type looking for a match - //eg: for pagetype "course-report-outline-index" try coursereportoutlineindex - // then coursereportoutline then coursereport then course $componentarray = null; - for($i = count($bits); $i > 0; $i--) { - $componentarray = array_slice($bits, 0, $i); - $component = implode($componentarray); - - // Look for special case components like course reports - $libfile = $CFG->dirroot.'/'.implode('/', $componentarray).'/lib.php'; - if (file_exists($libfile)) { - require_once($libfile); - if (function_exists($component.'_pagetypelist')) { - $function = $component.'_pagetypelist'; - break; - } - } + for ($i = count($bits); $i > 0; $i--) { + $possiblecomponentarray = array_slice($bits, 0, $i); + $possiblecomponent = implode('', $possiblecomponentarray); - // Then check to see if the component is a core component - if (array_key_exists($component, $core) && !empty($core[$component])) { - $libfile = $CFG->dirroot.'/'.$core[$component].'/lib.php'; + // Check to see if the component is a core component + if (array_key_exists($possiblecomponent, $core) && !empty($core[$possiblecomponent])) { + $libfile = $CFG->dirroot.'/'.$core[$possiblecomponent].'/lib.php'; if (file_exists($libfile)) { require_once($libfile); - if (function_exists($component.'_pagetypelist')) { - $function = $component.'_pagetypelist'; - break; + $function = $possiblecomponent.'_page_type_list'; + if (function_exists($function)) { + if ($patterns = $function($pagetype, $parentcontext, $currentcontext)) { + break; + } } } } - // If its not a special or core component check to see if it is a plugin component - if (array_key_exists($component, $plugins) && !empty($plugins[$component])) { - $function = 'plugin_pagetypelist'; - if (function_exists($component.'_pagetypelist')) { - $function = $component.'_pagetypelist'; - break; + //check the plugin directory and look for a callback + if (array_key_exists($possiblecomponent, $plugins) && !empty($plugins[$possiblecomponent])) { + + //We've found a plugin type. Look for a plugin name by getting the next section of page type + if (count($bits) > $i) { + $pluginname = $bits[$i]; + $directory = get_plugin_directory($possiblecomponent, $pluginname); + if (!empty($directory)){ + $libfile = $directory.'/lib.php'; + if (file_exists($libfile)) { + require_once($libfile); + $function = $pluginname.'_page_type_list'; + if (function_exists($function)) { + if ($patterns = $function($pagetype, $parentcontext, $currentcontext)) { + break; + } + } + } + } + } + + //we'll only get to here if we still don't have any patterns + //the plugin type may have a callback + $directory = get_plugin_directory($possiblecomponent, null); + if (!empty($directory)){ + $libfile = $directory.'/lib.php'; + if (file_exists($libfile)) { + require_once($libfile); + $function = $possiblecomponent.'_page_type_list'; + if (function_exists($function)) { + if ($patterns = $function($pagetype, $parentcontext, $currentcontext)) { + break; + } + } + } } } } - // Call the most appropriate function we could determine - $patterns = $function($pagetype, $parentcontext, $currentcontext); if (empty($patterns)) { - // If there are no patterns default to just the current pattern. - $patterns = array($pagetype => $pagetype); + $patterns = default_page_type_list($pagetype, $parentcontext, $currentcontext); } + return $patterns; } @@ -1625,7 +1640,7 @@ function generate_page_type_patterns($pagetype, $parentcontext = null, $currentc * @param stdClass $currentcontext * @return array */ -function default_pagetypelist($pagetype, $parentcontext = null, $currentcontext = null) { +function default_page_type_list($pagetype, $parentcontext = null, $currentcontext = null) { // Generate page type patterns based on current page type if // callbacks haven't been defined $patterns = array($pagetype => $pagetype); @@ -1645,40 +1660,6 @@ function default_pagetypelist($pagetype, $parentcontext = null, $currentcontext return $patterns; } -/** - * Generates a page type list for plugins - * - * @param string $pagetype - * @param stdClass $parentcontext - * @param stdClass $currentcontext - * @return array - */ -function plugin_pagetypelist($pagetype, $parentcontext = null, $currentcontext = null) { - global $CFG; - - // for modules - $bits = explode('-', $pagetype); - $plugintype = $bits[0]; - $pluginname = $bits[1]; - $directory = get_plugin_directory($plugintype, $pluginname); - if (empty($directory)) { - return array(); - } - $libfile = $directory.'/lib.php'; - require_once($libfile); - $function = $pluginname.'_pagetypelist'; - if (!function_exists($function)) { - return array(); - } - $patterns = $function($pagetype, $parentcontext, $currentcontext); - if ($parentcontext->contextlevel == CONTEXT_COURSE) { - // including course page type - require_once("$CFG->dirroot/course/lib.php"); - $patterns = array_merge(course_pagetypelist($pagetype, $parentcontext, $currentcontext), $patterns); - } - return $patterns; -} - /** * Generates the page type list for the my moodle page * @@ -1687,7 +1668,7 @@ function plugin_pagetypelist($pagetype, $parentcontext = null, $currentcontext = * @param stdClass $currentcontext * @return array */ -function my_pagetypelist($pagetype, $parentcontext = null, $currentcontext = null) { +function my_page_type_list($pagetype, $parentcontext = null, $currentcontext = null) { return array('my-index' => 'my-index'); } @@ -1700,8 +1681,8 @@ function my_pagetypelist($pagetype, $parentcontext = null, $currentcontext = nul * @param stdClass $currentcontext * @return array */ -function mod_pagetypelist($pagetype, $parentcontext = null, $currentcontext = null) { - $patterns = plugin_pagetypelist($pagetype, $parentcontext, $currentcontext); +function mod_page_type_list($pagetype, $parentcontext = null, $currentcontext = null) { + $patterns = plugin_page_type_list($pagetype, $parentcontext, $currentcontext); if (empty($patterns)) { // if modules don't have callbacks // generate two default page type patterns for modules only diff --git a/lib/questionlib.php b/lib/questionlib.php index b1133e4cc8235..6a8da4ff1d1b7 100644 --- a/lib/questionlib.php +++ b/lib/questionlib.php @@ -1822,7 +1822,7 @@ function question_make_export_url($contextid, $categoryid, $format, $withcategor * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function question_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function question_page_type_list($pagetype, $parentcontext, $currentcontext) { global $CFG; $types = array( 'question-*'=>get_string('page-question-x', 'question'), @@ -1833,7 +1833,7 @@ function question_pagetypelist($pagetype, $parentcontext, $currentcontext) { ); if ($currentcontext->contextlevel == CONTEXT_COURSE) { require_once($CFG->dirroot . '/course/lib.php'); - return array_merge(course_pagetypelist($pagetype, $parentcontext, $currentcontext), $types); + return array_merge(course_page_type_list($pagetype, $parentcontext, $currentcontext), $types); } else { return $types; } diff --git a/message/lib.php b/message/lib.php index 80204539506dc..9de50e00417c5 100644 --- a/message/lib.php +++ b/message/lib.php @@ -2369,6 +2369,6 @@ function translate_message_default_setting($plugindefault, $processorname) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function message_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function message_page_type_list($pagetype, $parentcontext, $currentcontext) { return array('messages-*'=>get_string('page-message-x', 'message')); } diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 170c7f83036d1..627fe43999751 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -3720,7 +3720,7 @@ function assignment_get_file_areas($course, $cm, $context) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function assignment_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function assignment_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array( 'mod-assignment-*'=>get_string('page-mod-assignment-x', 'assignment'), 'mod-assignment-view'=>get_string('page-mod-assignment-view', 'assignment'), diff --git a/mod/chat/lib.php b/mod/chat/lib.php index c40b833bc730a..a59a5e2fe7b43 100644 --- a/mod/chat/lib.php +++ b/mod/chat/lib.php @@ -1312,7 +1312,7 @@ function chat_user_logout($user) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function chat_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function chat_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-chat-*'=>get_string('page-mod-chat-x', 'chat')); return $module_pagetype; } diff --git a/mod/choice/lib.php b/mod/choice/lib.php index b9b1fa0315817..a03db2684d6e9 100644 --- a/mod/choice/lib.php +++ b/mod/choice/lib.php @@ -863,7 +863,7 @@ function choice_get_completion_state($course, $cm, $userid, $type) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function choice_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function choice_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-choice-*'=>get_string('page-mod-choice-x', 'choice')); return $module_pagetype; } diff --git a/mod/data/lib.php b/mod/data/lib.php index 671a795c86f0a..c75400dc4571f 100644 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -3344,7 +3344,7 @@ function data_comment_validate($comment_param) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function data_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function data_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-data-*'=>get_string('page-mod-data-x', 'data')); return $module_pagetype; } diff --git a/mod/feedback/lib.php b/mod/feedback/lib.php index b777e7e98f7aa..59f574fa5c184 100644 --- a/mod/feedback/lib.php +++ b/mod/feedback/lib.php @@ -2788,7 +2788,7 @@ function feedback_init_feedback_session() { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function feedback_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function feedback_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-feedback-*'=>get_string('page-mod-feedback-x', 'feedback')); return $module_pagetype; } diff --git a/mod/folder/lib.php b/mod/folder/lib.php index 20775d53556c0..491e5edbd2925 100644 --- a/mod/folder/lib.php +++ b/mod/folder/lib.php @@ -343,7 +343,7 @@ function folder_extend_navigation($navigation, $course, $module, $cm) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function folder_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function folder_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-folder-*'=>get_string('page-mod-folder-x', 'folder')); return $module_pagetype; } diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 6331f6c00378c..b7ff84e890186 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -7961,7 +7961,7 @@ function forum_cm_info_view(cm_info $cm) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function forum_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function forum_page_type_list($pagetype, $parentcontext, $currentcontext) { $forum_pagetype = array( 'mod-forum-*'=>get_string('page-mod-forum-x', 'forum'), 'mod-forum-view'=>get_string('page-mod-forum-view', 'forum'), diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index 19848ae20feb5..5b4a9f7071097 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -2863,7 +2863,7 @@ function glossary_comment_validate($comment_param) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function glossary_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function glossary_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-glossary-*'=>get_string('page-mod-glossary-x', 'glossary')); return $module_pagetype; } diff --git a/mod/imscp/lib.php b/mod/imscp/lib.php index 697c293472480..af804cf43352f 100644 --- a/mod/imscp/lib.php +++ b/mod/imscp/lib.php @@ -407,7 +407,7 @@ function imscp_extend_navigation($navigation, $course, $module, $cm) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function imscp_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function imscp_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-imscp-*'=>get_string('page-mod-imscp-x', 'imscp')); return $module_pagetype; } diff --git a/mod/lesson/lib.php b/mod/lesson/lib.php index 58226d4b9a913..e87fa0cdce06d 100644 --- a/mod/lesson/lib.php +++ b/mod/lesson/lib.php @@ -996,7 +996,7 @@ function lesson_get_file_info($browser, $areas, $course, $cm, $context, $fileare * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function lesson_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function lesson_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-lesson-*'=>get_string('page-mod-lesson-x', 'lesson')); return $module_pagetype; } diff --git a/mod/page/lib.php b/mod/page/lib.php index 300051b0de814..2fcd0261eb9da 100644 --- a/mod/page/lib.php +++ b/mod/page/lib.php @@ -411,7 +411,7 @@ function page_extend_navigation($navigation, $course, $module, $cm) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function page_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function page_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-page-*'=>get_string('page-mod-page-x', 'page')); return $module_pagetype; } diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index b2da5dc207961..857e310a5ab03 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -1711,7 +1711,7 @@ function mod_quiz_question_pluginfile($course, $context, $component, * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function quiz_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function quiz_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-quiz-*'=>get_string('page-mod-quiz-x', 'quiz')); return $module_pagetype; } diff --git a/mod/resource/lib.php b/mod/resource/lib.php index 803c89b7a84dc..be79a32c6c902 100644 --- a/mod/resource/lib.php +++ b/mod/resource/lib.php @@ -436,7 +436,7 @@ function resource_pluginfile($course, $cm, $context, $filearea, $args, $forcedow * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function resource_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function resource_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-resource-*'=>get_string('page-mod-resource-x', 'resource')); return $module_pagetype; } diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index bbddc92e0882b..b79990787205d 100644 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -1078,7 +1078,7 @@ function scorm_print_overview($courses, &$htmlarray) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function scorm_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function scorm_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-scorm-*'=>get_string('page-mod-scorm-x', 'scorm')); return $module_pagetype; } diff --git a/mod/survey/lib.php b/mod/survey/lib.php index 9c3d3805bd9c8..bed1fa1ced7af 100644 --- a/mod/survey/lib.php +++ b/mod/survey/lib.php @@ -871,7 +871,7 @@ function survey_extend_settings_navigation($settings, $surveynode) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function survey_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function survey_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-survey-*'=>get_string('page-mod-survey-x', 'survey')); return $module_pagetype; } diff --git a/mod/url/lib.php b/mod/url/lib.php index 9e43a41aa5f8a..e354511bc18ed 100644 --- a/mod/url/lib.php +++ b/mod/url/lib.php @@ -318,7 +318,7 @@ function url_extend_navigation($navigation, $course, $module, $cm) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function url_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function url_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-url-*'=>get_string('page-mod-url-x', 'url')); return $module_pagetype; } diff --git a/mod/wiki/lib.php b/mod/wiki/lib.php index 42c84294ffe4b..7f9a3d61bf138 100644 --- a/mod/wiki/lib.php +++ b/mod/wiki/lib.php @@ -665,7 +665,7 @@ function wiki_comment_validate($comment_param) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function wiki_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function wiki_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array( 'mod-wiki-*'=>get_string('page-mod-wiki-x', 'wiki'), 'mod-wiki-view'=>get_string('page-mod-wiki-view', 'wiki'), diff --git a/mod/workshop/lib.php b/mod/workshop/lib.php index a4d86a3603457..26880ed92f4b1 100644 --- a/mod/workshop/lib.php +++ b/mod/workshop/lib.php @@ -1382,7 +1382,7 @@ function workshop_extend_settings_navigation(settings_navigation $settingsnav, n * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function workshop_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function workshop_page_type_list($pagetype, $parentcontext, $currentcontext) { $module_pagetype = array('mod-workshop-*'=>get_string('page-mod-workshop-x', 'workshop')); return $module_pagetype; } diff --git a/notes/lib.php b/notes/lib.php index f01d8700d778b..0744211b697eb 100644 --- a/notes/lib.php +++ b/notes/lib.php @@ -284,6 +284,6 @@ function note_delete_all($courseid) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function note_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function note_page_type_list($pagetype, $parentcontext, $currentcontext) { return array('notes-*'=>get_string('page-notes-x', 'notes')); } diff --git a/tag/lib.php b/tag/lib.php index 7d33ccbbc4fbd..2284a41fb2237 100644 --- a/tag/lib.php +++ b/tag/lib.php @@ -1124,7 +1124,7 @@ function tag_unset_flag($tagids) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function tag_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function tag_page_type_list($pagetype, $parentcontext, $currentcontext) { return array( 'tag-*'=>get_string('page-tag-x', 'tag'), 'tag-index'=>get_string('page-tag-index', 'tag'), diff --git a/user/lib.php b/user/lib.php index b5df18c170d24..3e9296dbf569c 100644 --- a/user/lib.php +++ b/user/lib.php @@ -102,7 +102,7 @@ function user_get_users_by_id($userids) { * @param stdClass $parentcontext Block's parent context * @param stdClass $currentcontext Current context of block */ -function user_pagetypelist($pagetype, $parentcontext, $currentcontext) { +function user_page_type_list($pagetype, $parentcontext, $currentcontext) { return array( 'user-profile'=>get_string('page-user-profile', 'pagetype'), 'my-index'=>get_string('page-my-index', 'pagetype')