]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-21125 obsoleting global $THEME
authorPetr Skoda <skodak@moodle.org>
Wed, 23 Dec 2009 17:44:17 +0000 (17:44 +0000)
committerPetr Skoda <skodak@moodle.org>
Wed, 23 Dec 2009 17:44:17 +0000 (17:44 +0000)
13 files changed:
admin/langimport.php
admin/mnet/mnet_themes.html
admin/mnet/mnet_themes.php
admin/roles/assign.php
admin/webservice/service_users.php
course/importstudents.html
grade/edit/outcome/course_form.html
group/assign.php
group/members.php
lib/outputrenderers.php
lib/weblib.php
mod/quiz/edit.php
mod/quiz/editlib.php

index 732f1790106a9a0d5e49ca8c930ec717fcb8c706..d7fef7508a313160d8834c315d34f03546770da0 100755 (executable)
     }
     if ($remote) {
         echo '</select>';
-        echo '<br /><input type="submit" value="'.$THEME->larrow.' '.get_string('install','admin').'" />';
+        echo '<br /><input type="submit" value="'.$OUTPUT->larrow().' '.get_string('install','admin').'" />';
     }
     echo '</fieldset>';
     echo '</form>';
index 60393083c92fa01a73d08696f50527c7b8dcc786..a18e4db05a08bfd1fedf668e1f1331d0ad55b597 100644 (file)
@@ -1,4 +1,7 @@
 <?php
+
+//TODO: this code needs to be redesigned, see MDL-21137
+
 admin_externalpage_print_header();
 echo $OUTPUT->heading(get_string('themes'));
 $original_theme = fullclone($THEME);
index 8e842a171b0be98f6c008370c2860cec9694edf1..9d1cf87dd59a711a77444017231a4e004ebb2a55 100644 (file)
@@ -1,6 +1,9 @@
 <?php
     // Allows the admin to configure services for remote hosts
 
+die;
+//TODO: this code needs to be redesigned, see MDL-21137
+
     require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
     require_once($CFG->libdir.'/adminlib.php');
     include_once($CFG->dirroot.'/mnet/lib.php');
index a5e48501c8140f65fcd6f602e78d7ee8c01737ef..e362dc85dfe97e29d066ae35ed2cab7442d76894 100755 (executable)
       </td>
       <td id="buttonscell">
           <div id="addcontrols">
-              <input name="add" id="add" type="submit" value="<?php echo $THEME->larrow.'&nbsp;'.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
+              <input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().'&nbsp;'.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
 
               <?php print_collapsible_region_start('', 'assignoptions', get_string('enrolmentoptions', 'role'),
                     'assignoptionscollapse', true); ?>
           </div>
 
           <div id="removecontrols">
-              <input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').'&nbsp;'.$THEME->rarrow; ?>" title="<?php print_string('remove'); ?>" />
+              <input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').'&nbsp;'.$OUTPUT->rarrow(); ?>" title="<?php print_string('remove'); ?>" />
           </div>
       </td>
       <td id="potentialcell">
index 03c8321c0143a19f17e202fb260439262266c3cd..939c44c6294663a199c75d5404724c79c15989d6 100644 (file)
@@ -86,11 +86,11 @@ $alloweduserselector = new service_user_selector('removeselect', array('servicei
       </td>
       <td id="buttonscell">
           <div id="addcontrols">
-              <input name="add" id="add" type="submit" value="<?php echo $THEME->larrow.'&nbsp;'.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
+              <input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().'&nbsp;'.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
           </div>
 
           <div id="removecontrols">
-              <input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').'&nbsp;'.$THEME->rarrow; ?>" title="<?php print_string('remove'); ?>" />
+              <input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').'&nbsp;'.$OUTPUT->rarrow(); ?>" title="<?php print_string('remove'); ?>" />
           </div>
       </td>
       <td id="potentialcell">
index 2828982e2ec00c32c932457ec01c34a18257949e..5b8d74230982c83956ebf0cdffd8e0f4f9337bcc 100644 (file)
@@ -20,9 +20,9 @@
           </select></td>
       <td valign="top">
         <p class="arrow_button">
-            <input name="add" id="add" type="submit" value="<?php echo '&nbsp;'.$THEME->larrow.' &nbsp; &nbsp; '.get_string('add'); ?>" title="<?php print_string('add'); ?>" />
+            <input name="add" id="add" type="submit" value="<?php echo '&nbsp;'.$OUTPUT->larrow().' &nbsp; &nbsp; '.get_string('add'); ?>" title="<?php print_string('add'); ?>" />
             <br />
-            <input name="remove" id="remove" type="submit" value="<?php echo '&nbsp; '.$THEME->rarrow.' &nbsp; &nbsp; '.get_string('remove'); ?>" title="<?php print_string('remove'); ?>" />
+            <input name="remove" id="remove" type="submit" value="<?php echo '&nbsp; '.$OUTPUT->rarrow().' &nbsp; &nbsp; '.get_string('remove'); ?>" title="<?php print_string('remove'); ?>" />
         </p>
       </td>
       <td valign="top">
index 29a64465feb5ddd0c9b6522530f120146540d423..6b0271e826033dba88e50052f3730755e9080ea5 100755 (executable)
@@ -38,9 +38,9 @@
         ?>
         <td>
             <p class="arrow_button">
-                <input name="add" id="add" type="submit" value="<?php echo '&nbsp; '.$THEME->larrow.' &nbsp; &nbsp; '.get_string('add'); ?>" title="<?php print_string('add'); ?>" />
+                <input name="add" id="add" type="submit" value="<?php echo '&nbsp; '.$OUTPUT->larrow().' &nbsp; &nbsp; '.get_string('add'); ?>" title="<?php print_string('add'); ?>" />
                 <br />
-                <input name="remove" id="remove" type="submit" value="<?php echo '&nbsp;'.$THEME->rarrow.' &nbsp; &nbsp; '.get_string('remove'); ?>" title="<?php print_string('remove'); ?>" />
+                <input name="remove" id="remove" type="submit" value="<?php echo '&nbsp;'.$OUTPUT->rarrow().' &nbsp; &nbsp; '.get_string('remove'); ?>" title="<?php print_string('remove'); ?>" />
             </p>
         </td>
         <?php } ?>
index 32381ea2fb8692111ebd6b912cdbbdcf85fa53bc..78fec568ce3bb1d2d6a6e4e8bff287f1063b5bc8 100644 (file)
@@ -148,9 +148,9 @@ echo $OUTPUT->header();
       <td valign="top">
 
         <p class="arrow_button">
-            <input name="add" id="add" type="submit" value="<?php echo '&nbsp;'.$THEME->larrow.' &nbsp; &nbsp; '.get_string('add'); ?>" title="<?php print_string('add'); ?>" />
+            <input name="add" id="add" type="submit" value="<?php echo '&nbsp;'.$OUTPUT->larrow().' &nbsp; &nbsp; '.get_string('add'); ?>" title="<?php print_string('add'); ?>" />
             <br />
-            <input name="remove" id="remove" type="submit" value="<?php echo '&nbsp; '.$THEME->rarrow.' &nbsp; &nbsp; '.get_string('remove'); ?>" title="<?php print_string('remove'); ?>" />
+            <input name="remove" id="remove" type="submit" value="<?php echo '&nbsp; '.$OUTPUT->rarrow().' &nbsp; &nbsp; '.get_string('remove'); ?>" title="<?php print_string('remove'); ?>" />
         </p>
       </td>
       <td valign="top">
index 8fdec28389e8a39f19ee3bcc81835a624d84c997..0c0f92885ba98e91a45749c583e78d9c875eea94 100644 (file)
@@ -106,8 +106,8 @@ echo $OUTPUT->header();
           </td>
       <td id='buttonscell'>
         <p class="arrow_button">
-            <input name="add" id="add" type="submit" value="<?php echo $THEME->larrow.'&nbsp;'.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
-            <input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').'&nbsp;'.$THEME->rarrow; ?>" title="<?php print_string('remove'); ?>" />
+            <input name="add" id="add" type="submit" value="<?php echo $OUTPUT->larrow().'&nbsp;'.get_string('add'); ?>" title="<?php print_string('add'); ?>" /><br />
+            <input name="remove" id="remove" type="submit" value="<?php echo get_string('remove').'&nbsp;'.$OUTPUT->rarrow(); ?>" title="<?php print_string('remove'); ?>" />
         </p>
       </td>
       <td id='potentialcell'>
index 5d7fef96d9153e53fc2d4ed6e392926eff541ef5..6c00352a53854319febf196546a91aac17422c24 100644 (file)
@@ -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 &lt; &gt; &raquo; - 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 &lt; &gt; &raquo; - these are confusing for blind users.
+     * @return string
+     */
+    public function larrow() {
+        return $this->page->theme->larrow;
+    }
 }
 
 
index eb0946c36505023efb056d29dad717dfec4285fd..99c1dfb79218e03df12d4d1b5dd8736a2d686683 100644 (file)
@@ -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 = '<span class="'.$arrowclass.'">'.$THEME->rarrow.'</span>';
+    $arrow = '<span class="'.$arrowclass.'">'.$OUTPUT->rarrow().'</span>';
     $htmltext = '';
     if ($text) {
         $htmltext = '<span class="arrow_text">'.$text.'</span>&nbsp;';
@@ -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 = '<span class="'.$arrowclass.'">'.$THEME->larrow.'</span>';
+    $arrow = '<span class="'.$arrowclass.'">'.$OUTPUT->larrow().'</span>';
     $htmltext = '';
     if ($text) {
         $htmltext = '&nbsp;<span class="arrow_text">'.$text.'</span>';
index 1b1576ba1bc2a53efb9d339b843c6d0ef7587f21..bc36f1c2df8cb223a47803220d29fbee35aba9d1 100644 (file)
@@ -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 = '<input type="submit" name="add" value="' . $THEME->larrow . ' ' . $straddtoquiz .
+    $out = '<input type="submit" name="add" value="' . $OUTPUT->larrow() . ' ' . $straddtoquiz .
             '" ' . $disabled . "/>\n";
     return $out;
 }
index 8290d413533f7cb32f4886a296e37c5e5d8e6800..9f65e0a3cde2f02d39e3a6e0691e681f065ba339 100644 (file)
@@ -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 '<div class="quiz_randomquestion">';
 
     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') . '</div>';
 
     $a = new stdClass;
-    $a->arrow = $THEME->rarrow;
+    $a->arrow = $OUTPUT->rarrow();
     $strshowcategorycontents = get_string('showcategorycontents', 'quiz', $a);
 
     $openqbankurl = $pageurl->out(false, array('qbanktool' => 1,