]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16676 Developer debug warning if you refer to the old text.html help file.
authortjhunt <tjhunt>
Thu, 25 Sep 2008 07:13:46 +0000 (07:13 +0000)
committertjhunt <tjhunt>
Thu, 25 Sep 2008 07:13:46 +0000 (07:13 +0000)
lib/weblib.php

index 3b2d44ab1eb1cc805a7f72d87694b41eb5d91a7d..d9917b4dc145392aca1031c65d7da4a60e0962ee 100644 (file)
@@ -5856,7 +5856,7 @@ function editorhelpbutton(){
  * @return string
  * @todo Finish documenting this function
  */
-function helpbutton ($page, $title, $module='moodle', $image=true, $linktext=false, $text='', $return=false,
+function helpbutton($page, $title, $module='moodle', $image=true, $linktext=false, $text='', $return=false,
                      $imagetext='') {
     global $CFG, $COURSE;
 
@@ -5864,7 +5864,7 @@ function helpbutton ($page, $title, $module='moodle', $image=true, $linktext=fal
     //$text option won't work properly because the text needs to be always cleaned and,
     // when cleaned... html tags always break, so it's unusable.
     if ( isset($text) && $text!='') {
-      debugging('Warning: it\'s not recommended to use $text parameter in helpbutton ($page=' . $page . ', $module=' . $module . ') function', DEBUG_DEVELOPER);
+        debugging('Warning: it\'s not recommended to use $text parameter in helpbutton ($page=' . $page . ', $module=' . $module . ') function', DEBUG_DEVELOPER);
     }
 
     // fix for MDL-7734
@@ -5874,6 +5874,16 @@ function helpbutton ($page, $title, $module='moodle', $image=true, $linktext=fal
         $forcelang = '';
     }
 
+    // Catch references to the old text.html and emoticons.html help files that
+    // were renamed in MDL-13233.
+    if (in_array($page, array('text', 'emoticons', 'richtext'))) {
+        $oldname = $page;
+        $page .= '2';
+        debugging("You are referring to the old help file '$oldname'. " .
+                "This was renamed to '$page' becuase of MDL-13233. " .
+                "Please update your code.", DEBUG_DEVELOPER);
+    }
+
     if ($module == '') {
         $module = 'moodle';
     }