Skip to content

Commit

Permalink
Merge branch 'MDL-27829_block_pagetype_master' of git://github.com/an…
Browse files Browse the repository at this point in the history
…dyjdavis/moodle
  • Loading branch information
stronk7 committed Jul 1, 2011
2 parents 3bd43d3 + 2f9bdad commit 67fcc99
Show file tree
Hide file tree
Showing 20 changed files with 34 additions and 20 deletions.
4 changes: 2 additions & 2 deletions admin/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
*/
function admin_page_type_list($pagetype, $parentcontext, $currentcontext) {
$array = array(
'admin-setting-*' => get_string('page-admin-setting-x', 'pagetype'),
$pagetype => get_string('page-admin-setting', 'pagetype')
'admin-*' => get_string('page-admin-x', 'pagetype'),
$pagetype => get_string('page-admin-current', 'pagetype')
);
return $array;
}
4 changes: 2 additions & 2 deletions blocks/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ function definition() {
$contextoptions = array();
if ( ($parentcontext->contextlevel == CONTEXT_COURSE && $parentcontext->instanceid == SITEID) ||
($parentcontext->contextlevel == CONTEXT_SYSTEM)) { // Home page
if ($bits[0] == 'tag' || ($bits[0] == 'admin' && $bits[1] == 'setting')) {
// tag and admin settings always use system context
if ($bits[0] == 'tag' || $bits[0] == 'admin') {
// tag and admin pages always use system context
// the contexts options don't make differences, so we use
// page type patterns only
$mform->addElement('hidden', 'bui_contexts', BUI_CONTEXTS_ENTIRE_SITE);
Expand Down
2 changes: 1 addition & 1 deletion course/report/completion/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ 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')
'course-report-completion-index' => get_string('pluginpagetype', 'coursereport_completion')
);
return $array;
}
2 changes: 1 addition & 1 deletion course/report/log/lang/en/coursereport_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] = 'Log course report';
$string['pluginpagetype'] = 'Logs course report';
$string['pluginname'] = 'Logs';
3 changes: 2 additions & 1 deletion course/report/log/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,8 @@ 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')
'course-report-log-index' => get_string('pluginpagetype', 'coursereport_log')
//course-report-log-live not included as theres no blocks on the live log page
);
return $array;
}
2 changes: 1 addition & 1 deletion course/report/outline/lang/en/coursereport_outline.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
*/

$string['outline:view'] = 'View course activity report';
$string['pluginpagetype'] = 'Course activity report';
$string['pluginpagetype'] = 'Activity course report';
$string['pluginname'] = 'Course activity';
2 changes: 1 addition & 1 deletion course/report/outline/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ 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')
'course-report-outline-index' => get_string('pluginpagetype', 'coursereport_outline')
);
return $array;
}
2 changes: 1 addition & 1 deletion course/report/participation/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ 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')
'course-report-participation-index' => get_string('pluginpagetype', 'coursereport_participation')
);
return $array;
}
2 changes: 1 addition & 1 deletion course/report/progress/lang/en/coursereport_progress.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
*/

$string['pluginname'] = 'Activity completion';
$string['pluginpagetype'] = 'Progress course report';
$string['pluginpagetype'] = 'Activity completion report';
$string['progress:view'] = 'View activity completion reports';
2 changes: 1 addition & 1 deletion course/report/progress/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ 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')
'course-report-progress-index' => get_string('pluginpagetype', 'coursereport_progress')
);
return $array;
}
2 changes: 1 addition & 1 deletion course/report/stats/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ 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')
'course-report-stats-index' => get_string('pluginpagetype', 'coursereport_stats')
);
return $array;
}
4 changes: 2 additions & 2 deletions lang/en/pagetype.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

$string['page-admin-setting'] = 'The current admin setting page';
$string['page-admin-setting-x'] = 'Any admin setting page';
$string['page-admin-current'] = 'The current site administration page';
$string['page-admin-x'] = 'Any site administration page';
$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';
Expand Down
2 changes: 2 additions & 0 deletions mod/glossary/lang/en/glossary.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@
$string['numberofentries'] = 'Number of entries';
$string['onebyline'] = '(one per line)';
$string['page-mod-glossary-x'] = 'Any glossary module page';
$string['page-mod-glossary-edit'] = 'Glossary add/edit entry page';
$string['page-mod-glossary-view'] = 'View glossary edit page';
$string['pluginadministration'] = 'Glossary administration';
$string['pluginname'] = 'Glossary';
$string['popupformat'] = 'Popup format';
Expand Down
5 changes: 4 additions & 1 deletion mod/glossary/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2862,6 +2862,9 @@ function glossary_comment_validate($comment_param) {
* @param stdClass $currentcontext Current context of block
*/
function glossary_page_type_list($pagetype, $parentcontext, $currentcontext) {
$module_pagetype = array('mod-glossary-*'=>get_string('page-mod-glossary-x', 'glossary'));
$module_pagetype = array(
'mod-glossary-*'=>get_string('page-mod-glossary-x', 'glossary'),
'mod-glossary-view'=>get_string('page-mod-glossary-view', 'glossary'),
'mod-glossary-edit'=>get_string('page-mod-glossary-edit', 'glossary'));
return $module_pagetype;
}
1 change: 0 additions & 1 deletion mod/glossary/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
}

/// setting the defaut number of entries per page if not set

if ( !$entriesbypage = $glossary->entbypage ) {
$entriesbypage = $CFG->glossary_entbypage;
}
Expand Down
1 change: 1 addition & 0 deletions mod/lesson/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
$lessonoutput = $PAGE->get_renderer('mod_lesson');
$PAGE->navbar->add(get_string('edit'));
echo $lessonoutput->header($lesson, $cm, $mode);

if (!$lesson->has_pages()) {
// There are no pages; give teacher some options
require_capability('mod/lesson:edit', $context);
Expand Down
4 changes: 3 additions & 1 deletion mod/lesson/lang/en/lesson.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@
$string['overview'] = 'Overview';
$string['overview_help'] = 'A lesson is made up of a number of pages and optionally content pages. A page contains some content and usually ends with a question. Associated with each answer to the question is a jump. The jump can be relative, such as this page or next page, or absolute, specifying any one of the pages in the lesson. A content page is a page containing a set of links to other pages in the lesson, for example a Table of Contents.';
$string['page'] = 'Page: {$a}';
$string['page-mod-lesson-x'] = 'Any lesson module page';
$string['page-mod-lesson-x'] = 'Any lesson page';
$string['page-mod-lesson-view'] = 'View or preview lesson page';
$string['page-mod-lesson-edit'] = 'Edit lesson page';
$string['pagecontents'] = 'Page contents';
$string['pages'] = 'Pages';
$string['pagetitle'] = 'Page title';
Expand Down
5 changes: 4 additions & 1 deletion mod/lesson/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,9 @@ function lesson_get_file_info($browser, $areas, $course, $cm, $context, $fileare
* @param stdClass $currentcontext Current context of block
*/
function lesson_page_type_list($pagetype, $parentcontext, $currentcontext) {
$module_pagetype = array('mod-lesson-*'=>get_string('page-mod-lesson-x', 'lesson'));
$module_pagetype = array(
'mod-lesson-*'=>get_string('page-mod-lesson-x', 'lesson'),
'mod-lesson-view'=>get_string('page-mod-lesson-view', 'lesson'),
'mod-lesson-edit'=>get_string('page-mod-lesson-edit', 'lesson'));
return $module_pagetype;
}
1 change: 1 addition & 0 deletions mod/quiz/lang/en/quiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@
$string['overrideuser'] = 'Override user';
$string['overrideusereventname'] = '{$a->quiz} - Override';
$string['page-mod-quiz-x'] = 'Any quiz module page';
$string['page-mod-quiz-edit'] = 'Edit quiz page';
$string['pagesize'] = 'Attempts shown per page:';
$string['parent'] = 'Parent';
$string['parentcategory'] = 'Parent category';
Expand Down
4 changes: 3 additions & 1 deletion mod/quiz/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,8 @@ function mod_quiz_question_pluginfile($course, $context, $component,
* @param stdClass $currentcontext Current context of block
*/
function quiz_page_type_list($pagetype, $parentcontext, $currentcontext) {
$module_pagetype = array('mod-quiz-*'=>get_string('page-mod-quiz-x', 'quiz'));
$module_pagetype = array(
'mod-quiz-*'=>get_string('page-mod-quiz-x', 'quiz'),
'mod-quiz-edit'=>get_string('page-mod-quiz-edit', 'quiz'));
return $module_pagetype;
}

0 comments on commit 67fcc99

Please sign in to comment.