* @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'),
* @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) {
'mod-*'=>get_string('page-mod-x', 'pagetype')
);
}
-}
+}
\ No newline at end of file
$string['completion:view'] = 'View course completion report';
$string['completiondate']='Completion date';
+$string['pluginpagetype'] = 'Completion course report';
$string['pluginname']='Course completion';
}
}
}
+
+/**
+ * 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;
+}
--- /dev/null
+<?php
+
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * 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_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
$string['log:view'] = 'View course logs';
$string['log:viewlive'] = 'View live logs';
$string['log:viewtoday'] = 'View today\'s logs';
+$string['pluginpagetype'] = 'Log course report';
$string['pluginname'] = 'Logs';
$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
$reportrow->cells[] = $numviewscell;
if ($CFG->useblogassociations) {
+ require_once($CFG->dirroot.'/blog/lib.php');
$blogcell = new html_table_cell();
$blogcell->attributes['class'] = 'blog';
if ($blogcount = blog_get_associated_count($course->id, $cm->id)) {
*/
$string['outline:view'] = 'View course activity report';
+$string['pluginpagetype'] = 'Course activity report';
$string['pluginname'] = 'Course activity';
$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
*/
$string['participation:view'] = 'View course participation report';
+$string['pluginpagetype'] = 'Participation course report';
$string['pluginname'] = 'Course participation';
$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
*/
$string['pluginname'] = 'Activity completion';
+$string['pluginpagetype'] = 'Progress course report';
$string['progress:view'] = 'View activity completion reports';
$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
*/
$string['pluginname'] = 'Course statistics';
+$string['pluginpagetype'] = 'Statistics course report';
$string['stats:view'] = 'View course statistics 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 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
$string['page-course-view-x'] = 'Any type of course main page';
$string['page-course-x'] = 'Any course page';
+$string['page-course-report-x'] = 'Any course report';
$string['page-mod-x'] = 'Any activity module page';
$string['page-mod-x-view'] = 'Any main activity module page';
$string['page-my-index'] = 'My home page';
$bits = explode('-', $pagetype);
- $component = clean_param(reset($bits), PARAM_ALPHANUMEXT);
- $function = 'default_pagetypelist';
-
$core = get_core_subsystems();
$plugins = get_plugin_types();
- // First check to see if the initial component is a core component
- // if its not check to see if it is a plugin component.
- if (array_key_exists($component, $core) && !empty($core[$component])) {
- $libfile = $CFG->dirroot.'/'.$core[$component].'/lib.php';
- if (file_exists($libfile)) {
- require_once($libfile);
- if (function_exists($component.'_pagetypelist')) {
- $function = $component.'_pagetypelist';
+ //progressively strip pieces off the page type looking for a match
+ $componentarray = null;
+ for ($i = count($bits); $i > 0; $i--) {
+ $possiblecomponentarray = array_slice($bits, 0, $i);
+ $possiblecomponent = implode('', $possiblecomponentarray);
+
+ // 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);
+ $function = $possiblecomponent.'_page_type_list';
+ if (function_exists($function)) {
+ if ($patterns = $function($pagetype, $parentcontext, $currentcontext)) {
+ break;
+ }
+ }
}
}
- } else if (array_key_exists($component, $plugins) && !empty($plugins[$component])) {
- $function = 'plugin_pagetypelist';
- if (function_exists($component.'_pagetypelist')) {
- $function = $component.'_pagetypelist';
+
+ //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;
}
* @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);
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
*
* @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');
}
* @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
// Find out if user has configured this output
$userisconfigured = $processor->object->is_user_configured($eventdata->userto);
- // DEBUG: noify if we are forcing unconfigured output
+ // DEBUG: notify if we are forcing unconfigured output
if ($permitted == 'forced' && !$userisconfigured) {
debugging('Attempt to force message delivery to user who has "'.$processor->name.'" output unconfigured', DEBUG_NORMAL);
}
* @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'),
);
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;
}
* @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'));
}
Only teachers who are able to grade the particular assignment are notified. So, for example, if the course uses separate groups, teachers restricted to particular groups won\'t receive notification about students in other groups.';
$string['emptysubmission'] = 'You have not submitted anything yet';
-$string['enableemailnotification'] = 'Send notification emails';
-$string['enableemailnotification_help'] = 'If enabled, students will receive email notification when their assignment submissions are graded.';
+$string['enablenotification'] = 'Send notifications';
+$string['enablenotification_help'] = 'If enabled, students will be notified when their assignment submissions are graded.';
$string['errornosubmissions'] = 'There are no submissions to download';
$string['existingfiledeleted'] = 'Existing file has been deleted: {$a}';
$string['failedupdatefeedback'] = 'Failed to update submission feedback for user {$a}';
$mformdata->submissioncommentformat= FORMAT_HTML;
$mformdata->submission_content= $this->print_user_files($user->id,true);
$mformdata->filter = $filter;
+ $mformdata->mailinfo = get_user_preferences('assignment_mailinfo', 0);
if ($assignment->assignmenttype == 'upload') {
$mformdata->fileui_options = array('subdirs'=>1, 'maxbytes'=>$assignment->maxbytes, 'maxfiles'=>$assignment->var1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL);
} elseif ($assignment->assignmenttype == 'uploadsingle') {
if (get_user_preferences('assignment_mailinfo', 1)) {
$mailinfopref = true;
}
- $emailnotification = html_writer::checkbox('mailinfo', 1, $mailinfopref, get_string('enableemailnotification','assignment'));
+ $emailnotification = html_writer::checkbox('mailinfo', 1, $mailinfopref, get_string('enablenotification','assignment'));
- $emailnotification .= $OUTPUT->help_icon('enableemailnotification', 'assignment');
+ $emailnotification .= $OUTPUT->help_icon('enablenotification', 'assignment');
echo html_writer::tag('div', $emailnotification, array('class'=>'emailnotification'));
$savefeedback = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'fastg', 'value'=>get_string('saveallfeedback', 'assignment')));
$eventdata->fullmessage = $posttext;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = $posthtml;
- $eventdata->smallmessage = '';
+ $eventdata->smallmessage = $postsubject;
$eventdata->name = 'assignment_updates';
$eventdata->component = 'mod_assignment';
default :
break;
}
- $lastmailinfo = get_user_preferences('assignment_mailinfo', 1) ? array('checked'=>'checked') : array();
$mform->addElement('hidden', 'mailinfo_h', "0");
$mform->setType('mailinfo_h', PARAM_INT);
- $mform->addElement('checkbox', 'mailinfo',get_string('enableemailnotification','assignment').
- $OUTPUT->help_icon('enableemailnotification', 'assignment') .':' );
- $mform->updateElementAttr('mailinfo', $lastmailinfo);
+ $mform->addElement('checkbox', 'mailinfo',get_string('enablenotification','assignment').
+ $OUTPUT->help_icon('enablenotification', 'assignment') .':' );
$mform->setType('mailinfo', PARAM_INT);
}
}
$eventdata->fullmessage = $posttext;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = $posthtml;
- $eventdata->smallmessage = '';
+ $eventdata->smallmessage = $postsubject;
$eventdata->name = 'assignment_updates';
$eventdata->component = 'mod_assignment';
$eventdata->notification = 1;
+ $eventdata->contexturl = $assignmentinfo->url;
+ $eventdata->contexturlname = $assignmentinfo->assignment;
message_send($eventdata);
}
* @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'),
* @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;
}
* @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;
}
* @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;
}
$analysedVals = $analysedItem[2];
$pixnr = 0;
foreach($analysedVals as $val) {
- if( function_exists("bcmod")) {
- $intvalue = bcmod($pixnr, 10);
- }else {
- $intvalue = 0;
- }
+ $intvalue = $pixnr % 10;
$pix = "pics/$intvalue.gif";
$pixnr++;
$pixwidth = intval($val->quotient * FEEDBACK_MAX_PIX_LENGTH);
$pixnr = 0;
$avg = 0.0;
foreach($analysedVals as $val) {
- if( function_exists("bcmod")) {
- $intvalue = bcmod($pixnr, 10);
- }else {
- $intvalue = 0;
- }
+ $intvalue = $pixnr % 10;
$pix = "pics/$intvalue.gif";
$pixnr++;
$pixwidth = intval($val->quotient * FEEDBACK_MAX_PIX_LENGTH);
* @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;
}
* @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;
}
* @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'),
* @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;
}
* @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;
}
* @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;
}
* @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;
}
* @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;
}
* @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;
}
* @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;
}
* @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;
}
* @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;
}
* @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'),
* @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;
}
* @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'));
}
// ========================================================================================================================
} else if ($component === 'user') {
if ($filearea === 'icon' and $context->contextlevel == CONTEXT_USER) {
+ // XXX: pix_url will initialize $PAGE, so we have to set up context here
+ // this temp hack should be fixed by better solution
+ $PAGE->set_context(get_system_context());
if (!empty($CFG->forcelogin) and !isloggedin()) {
// protect images if login required and not logged in;
// do not use require_login() because it is expensive and not suitable here anyway
* @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'),
* @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')