From 92e01ab77172b7d9000084855ffab731502ea4b4 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Wed, 23 Dec 2009 17:44:17 +0000 Subject: [PATCH] MDL-21125 obsoleting global $THEME --- admin/langimport.php | 2 +- admin/mnet/mnet_themes.html | 3 +++ admin/mnet/mnet_themes.php | 3 +++ admin/roles/assign.php | 4 ++-- admin/webservice/service_users.php | 4 ++-- course/importstudents.html | 4 ++-- grade/edit/outcome/course_form.html | 4 ++-- group/assign.php | 4 ++-- group/members.php | 4 ++-- lib/outputrenderers.php | 28 +++++++++++++++++++++++++++- lib/weblib.php | 8 ++++---- mod/quiz/edit.php | 4 ++-- mod/quiz/editlib.php | 4 ++-- 13 files changed, 54 insertions(+), 22 deletions(-) diff --git a/admin/langimport.php b/admin/langimport.php index 732f179010..d7fef7508a 100755 --- a/admin/langimport.php +++ b/admin/langimport.php @@ -377,7 +377,7 @@ } if ($remote) { echo ''; - echo '
'; + echo '
'; } echo ''; echo ''; diff --git a/admin/mnet/mnet_themes.html b/admin/mnet/mnet_themes.html index 60393083c9..a18e4db05a 100644 --- a/admin/mnet/mnet_themes.html +++ b/admin/mnet/mnet_themes.html @@ -1,4 +1,7 @@ heading(get_string('themes')); $original_theme = fullclone($THEME); diff --git a/admin/mnet/mnet_themes.php b/admin/mnet/mnet_themes.php index 8e842a171b..9d1cf87dd5 100644 --- a/admin/mnet/mnet_themes.php +++ b/admin/mnet/mnet_themes.php @@ -1,6 +1,9 @@ libdir.'/adminlib.php'); include_once($CFG->dirroot.'/mnet/lib.php'); diff --git a/admin/roles/assign.php b/admin/roles/assign.php index a5e48501c8..e362dc85df 100755 --- a/admin/roles/assign.php +++ b/admin/roles/assign.php @@ -322,7 +322,7 @@
-
+
@@ -342,7 +342,7 @@
- +
diff --git a/admin/webservice/service_users.php b/admin/webservice/service_users.php index 03c8321c01..939c44c629 100644 --- a/admin/webservice/service_users.php +++ b/admin/webservice/service_users.php @@ -86,11 +86,11 @@ $alloweduserselector = new service_user_selector('removeselect', array('servicei
-
+
- +
diff --git a/course/importstudents.html b/course/importstudents.html index 2828982e2e..5b8d742309 100644 --- a/course/importstudents.html +++ b/course/importstudents.html @@ -20,9 +20,9 @@

- +
- +

diff --git a/grade/edit/outcome/course_form.html b/grade/edit/outcome/course_form.html index 29a64465fe..6b0271e826 100755 --- a/grade/edit/outcome/course_form.html +++ b/grade/edit/outcome/course_form.html @@ -38,9 +38,9 @@ ?>

- +
- +

diff --git a/group/assign.php b/group/assign.php index 32381ea2fb..78fec568ce 100644 --- a/group/assign.php +++ b/group/assign.php @@ -148,9 +148,9 @@ echo $OUTPUT->header();

- +
- +

diff --git a/group/members.php b/group/members.php index 8fdec28389..0c0f92885b 100644 --- a/group/members.php +++ b/group/members.php @@ -106,8 +106,8 @@ echo $OUTPUT->header();

-
- +
+

diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 5d7fef96d9..6c00352a53 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -587,7 +587,7 @@ class core_renderer extends renderer_base { * @return string HTML code */ protected function render_page_layout($layoutfile) { - global $CFG, $SITE, $THEME, $USER; + global $CFG, $SITE, $USER; // The next lines are a bit tricky. The point is, here we are in a method // of a renderer class, and this object may, or may not, be the same as // the global $OUTPUT object. When rendering the page layout file, we want to use @@ -2111,6 +2111,32 @@ class core_renderer extends renderer_base { public function navbar() { return $this->page->navbar->content(); } + + /** + * Accessibility: Right arrow-like character is + * used in the breadcrumb trail, course navigation menu + * (previous/next activity), calendar, and search forum block. + * If the theme does not set characters, appropriate defaults + * are set automatically. Please DO NOT + * use < > » - these are confusing for blind users. + * @return string + */ + public function rarrow() { + return $this->page->theme->rarrow; + } + + /** + * Accessibility: Right arrow-like character is + * used in the breadcrumb trail, course navigation menu + * (previous/next activity), calendar, and search forum block. + * If the theme does not set characters, appropriate defaults + * are set automatically. Please DO NOT + * use < > » - these are confusing for blind users. + * @return string + */ + public function larrow() { + return $this->page->theme->larrow; + } } diff --git a/lib/weblib.php b/lib/weblib.php index eb0946c365..99c1dfb792 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2006,12 +2006,12 @@ function user_login_string($course=NULL, $user=NULL) { * @return string HTML string. */ function link_arrow_right($text, $url='', $accesshide=false, $addclass='') { - global $THEME; + global $OUTPUT; //TODO: move to output renderer $arrowclass = 'arrow '; if (! $url) { $arrowclass .= $addclass; } - $arrow = ''.$THEME->rarrow.''; + $arrow = ''.$OUTPUT->rarrow().''; $htmltext = ''; if ($text) { $htmltext = ''.$text.' '; @@ -2040,12 +2040,12 @@ function link_arrow_right($text, $url='', $accesshide=false, $addclass='') { * @return string HTML string. */ function link_arrow_left($text, $url='', $accesshide=false, $addclass='') { - global $THEME; + global $OUTPUT; // TODO: move to utput renderer $arrowclass = 'arrow '; if (! $url) { $arrowclass .= $addclass; } - $arrow = ''.$THEME->larrow.''; + $arrow = ''.$OUTPUT->larrow().''; $htmltext = ''; if ($text) { $htmltext = ' '.$text.''; diff --git a/mod/quiz/edit.php b/mod/quiz/edit.php index 1b1576ba1b..bc36f1c2df 100644 --- a/mod/quiz/edit.php +++ b/mod/quiz/edit.php @@ -59,14 +59,14 @@ $PAGE->requires->yui2_lib('dragdrop'); * Displays button in form with checkboxes for each question. */ function module_specific_buttons($cmid, $cmoptions) { - global $THEME; + global $OUTPUT; if ($cmoptions->hasattempts) { $disabled = 'disabled="disabled" '; } else { $disabled = ''; } $straddtoquiz = get_string('addtoquiz', 'quiz'); - $out = '\n"; return $out; } diff --git a/mod/quiz/editlib.php b/mod/quiz/editlib.php index 8290d41353..9f65e0a3cd 100644 --- a/mod/quiz/editlib.php +++ b/mod/quiz/editlib.php @@ -748,7 +748,7 @@ function quiz_print_singlequestion($question, $returnurl, $quiz) { * @param boolean $quiz_qbanktool Indicate to this function if the question bank window open */ function quiz_print_randomquestion(&$question, &$pageurl, &$quiz, $quiz_qbanktool) { - global $DB, $QTYPES, $THEME, $OUTPUT; + global $DB, $QTYPES, $OUTPUT; echo '
'; if (!$category = $DB->get_record('question_categories', array('id' => $question->category))) { @@ -762,7 +762,7 @@ function quiz_print_randomquestion(&$question, &$pageurl, &$quiz, $quiz_qbanktoo echo ' ' . get_string('randomfromcategory', 'quiz') . '
'; $a = new stdClass; - $a->arrow = $THEME->rarrow; + $a->arrow = $OUTPUT->rarrow(); $strshowcategorycontents = get_string('showcategorycontents', 'quiz', $a); $openqbankurl = $pageurl->out(false, array('qbanktool' => 1, -- 2.39.5