MDL-19812 Upgraded calls to helpbutton, print_simple_box* and notify
authornicolasconnault <nicolasconnault>
Tue, 18 Aug 2009 05:15:52 +0000 (05:15 +0000)
committernicolasconnault <nicolasconnault>
Tue, 18 Aug 2009 05:15:52 +0000 (05:15 +0000)
13 files changed:
mod/lesson/action/addbranchtable.php
mod/lesson/action/addpage.php
mod/lesson/action/editpage.php
mod/lesson/edit.php
mod/lesson/format.php
mod/lesson/highscores.php
mod/lesson/import.php
mod/lesson/importppt.php
mod/lesson/lib.php
mod/lesson/locallib.php
mod/lesson/mediafile.php
mod/lesson/report.php
mod/lesson/view.php

index 3f4019cbcb425afa196c343c7b299fe453ae13a3..f2b7a3595d064051a3648486a7818023bd4c5614 100644 (file)
@@ -70,7 +70,7 @@
             // answer 1 jumpto next page
             echo $OUTPUT->select(html_select::make($jump, "jumpto[$i]", LESSON_NEXTPAGE, false));
         }
-        helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+        echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
         echo "</td></tr>\n";
     }
     // close table and form
index 070cae350812473766fb6a6009418d1e09875755..06c2152c106a963db904f7064b5e0d9f0e80d83f 100644 (file)
@@ -52,7 +52,7 @@
     <input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
       <?php
         echo '<b>'.get_string("questiontype", "lesson").":</b> \n";
-        echo helpbutton("questiontypes", get_string("questiontype", "lesson"), "lesson")."<br />";
+        echo $OUTPUT->help_icon(moodle_help_icon::make("questiontypes", get_string("questiontype", "lesson"), "lesson"))."<br />";
         lesson_qtype_menu($LESSON_QUESTION_TYPE, $qtype, 
                           "lesson.php?id=$cm->id&amp;action=addpage&amp;pageid=".$pageid.$linkadd);
 
@@ -64,7 +64,7 @@
                 $qoptionstr = get_string('multianswer', 'lesson');
             }
             echo "<label for=\"qoption\"><strong>$qoptionstr</strong></label><input type=\"checkbox\" id=\"qoption\" name=\"qoption\" value=\"1\"/>";
-            helpbutton("questionoption", get_string("questionoption", "lesson"), "lesson");
+            echo $OUTPUT->help_icon(moodle_help_icon::make("questionoption", get_string("questionoption", "lesson"), "lesson"));
             echo '</p>';
         }
     ?>
@@ -95,7 +95,7 @@
                     // answer 1 jumpto next page
                     echo $OUTPUT->select(html_select::make($jump, "jumpto[$i]", LESSON_NEXTPAGE, false));
                 }
-                helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                 if($lesson->custom) {
                     if ($i) {
                         echo get_string("score", "lesson")." $iplus1: <input type=\"text\" name=\"score[$i]\" value=\"0\" size=\"5\" />";
         case LESSON_ESSAY :
                 echo "<tr><td><b>".get_string("jump", "lesson").":</b> \n";
                 echo $OUTPUT->select(html_select::make($jump, "jumpto[0]", LESSON_NEXTPAGE, false));
-                helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                 if ($lesson->custom) {
                     echo get_string("score", "lesson").": <input type=\"text\" name=\"score[0]\" value=\"1\" size=\"5\" />";
                 }
                 if ($i == 2) {
                     echo "<tr><td><b>".get_string("correctanswerjump", "lesson").":</b> \n";
                     echo $OUTPUT->select(html_select::make($jump, "jumpto[$i]", LESSON_NEXTPAGE, false));
-                    helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                    echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                     if($lesson->custom) {
                         echo get_string("correctanswerscore", "lesson").": <input type=\"text\" name=\"score[$i]\" value=\"1\" size=\"5\" />";
                     }
                 } elseif ($i == 3) {
                     echo "<tr><td><b>".get_string("wronganswerjump", "lesson").":</b> \n";
                     echo $OUTPUT->select(html_select::make($jump, "jumpto[$i]", 0, false));
-                    helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                    echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                     if($lesson->custom) {
                         echo get_string("wronganswerscore", "lesson").": <input type=\"text\" name=\"score[$i]\" value=\"0\" size=\"5\" />";
                     }
                     // answer 1 jumpto next page
                     echo $OUTPUT->select(html_select::make($jump, "jumpto[$i]", LESSON_NEXTPAGE, false));
                 }
-                helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                 if($lesson->custom) {
                     if ($i) {
                         echo get_string("score", "lesson")." $iplus1: <input type=\"text\" name=\"score[$i]\" value=\"0\" size=\"5\" />";
index 14e548e54df4e193a2bdc5ecd7dcf6a175f94ed4..e6f27f10f57d4f452bcf6dc8863f89054f6ba689 100644 (file)
@@ -66,7 +66,7 @@
         switch ($page->qtype) {
             case LESSON_MULTICHOICE :
                 echo '<b>'.get_string("questiontype", "lesson").":</b> \n";
-                echo helpbutton("questiontypes", get_string("questiontype", "lesson"), "lesson")."<br />";
+                echo $OUTPUT->help_icon(moodle_help_icon::make("questiontypes", get_string("questiontype", "lesson"), "lesson"))."<br />";
                 lesson_qtype_menu($LESSON_QUESTION_TYPE, $page->qtype, 
                                   "lesson.php?id=$cm->id&amp;action=editpage&amp;pageid=$page->id",
                                   "getElementById('editpage').redisplay.value=1;getElementById('editpage').submit();");
                 } else {
                     echo "<input type=\"checkbox\" id=\"qoption\" name=\"qoption\" value=\"1\" />";
                 }
-                helpbutton("questionoption", get_string("questionoption", "lesson"), "lesson");
+                echo $OUTPUT->help_icon(moodle_help_icon::make("questionoption", get_string("questionoption", "lesson"), "lesson"));
                 echo "</p>\n";
                 break;
             case LESSON_SHORTANSWER :
                 echo '<b>'.get_string("questiontype", "lesson").":</b> \n";
-                echo helpbutton("questiontypes", get_string("questiontype", "lesson"), "lesson")."<br />";
+                echo $OUTPUT->help_icon(moodle_help_icon::make("questiontypes", get_string("questiontype", "lesson"), "lesson"))."<br />";
                 lesson_qtype_menu($LESSON_QUESTION_TYPE, $page->qtype, 
                                   "lesson.php?id=$cm->id&amp;action=editpage&amp;pageid=$page->id",
                                   "getElementById('editpage').redisplay.value=1;getElementById('editpage').submit();");
@@ -91,7 +91,7 @@
                 } else {
                     echo "<input type=\"checkbox\" id=\"qoption\" name=\"qoption\" value=\"1\" />";
                 }
-                helpbutton("questionoption", get_string("questionoption", "lesson"), "lesson");
+                echo $OUTPUT->help_icon(moodle_help_icon::make("questionoption", get_string("questionoption", "lesson"), "lesson"));
                 echo "</p>\n";
                 break;
             case LESSON_TRUEFALSE :
@@ -99,7 +99,7 @@
             case LESSON_MATCHING :
             case LESSON_NUMERICAL :
                 echo '<b>'.get_string("questiontype", "lesson").":</b> \n";
-                echo helpbutton("questiontypes", get_string("questiontype", "lesson"), "lesson")."<br />";
+                echo $OUTPUT->help_icon(moodle_help_icon::make("questiontypes", get_string("questiontype", "lesson"), "lesson"))."<br />";
                 lesson_qtype_menu($LESSON_QUESTION_TYPE, $page->qtype, 
                                   "lesson.php?id=$cm->id&amp;action=editpage&amp;pageid=$page->id",
                                   "getElementById('editpage').redisplay.value=1;getElementById('editpage').submit();");
                         if ($flags & LESSON_ANSWER_EDITOR) {
                             echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
                                 "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" checked=\"checked\" />";
-                            helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                            echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                             echo "]<br />\n";
                             print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
                         } else {
                             echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
                                 "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" />";
-                            helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                            echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                             echo "]<br />\n";
                             print_textarea(false, 6, 70, 630, 300, "answer[$n]", $answer->answer);
                         }
                         if ($flags & LESSON_ANSWER_EDITOR) {
                             echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
                                 "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" checked=\"checked\" />";
-                            helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                            echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                             echo "]<br />\n";
                             print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
                         } else {
                             echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
                                 "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" />";
-                            helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                            echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                             echo "]<br />\n";
                             print_textarea(false, 6, 70, 630, 300, "answer[$n]", $answer->answer);
                         }
                         if ($flags & LESSON_ANSWER_EDITOR) {
                             echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
                                 "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" checked=\"checked\" />"; 
-                            helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                            echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                             echo "]<br />\n";
                             print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
                         } else {
                             echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
                                 "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" />";
-                            helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                            echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                             echo "]<br />\n";
                             print_textarea(false, 6, 70, 630, 300, "answer[$n]", $answer->answer);
                         }
                         if ($flags & LESSON_RESPONSE_EDITOR) {
                             echo " [<label for=\"responseeditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
                                 "<input type=\"checkbox\" id=\"responseeditor[$n]\" name=\"responseeditor[$n]\" value=\"1\" checked=\"checked\" />";
-                            helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                            echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                             echo "]<br />\n";
                             print_textarea($usehtmleditor, 20, 70, 630, 300, "response[$n]", $answer->response);
                         } else {
                             echo " [<label for=\"responseeditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
                                 "<input type=\"checkbox\" id=\"responseeditor[$n]\" name=\"responseeditor[$n]\" value=\"1\" />";
-                            helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                            echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                             echo "]<br />\n";
                             print_textarea(false, 6, 70, 630, 300, "response[$n]", $answer->response);
                         }
                     if ($flags & LESSON_ANSWER_EDITOR and $page->qtype != LESSON_SHORTANSWER and $page->qtype != LESSON_NUMERICAL) {
                         echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
                             "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" checked=\"checked\" />";
-                        helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                        echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                         echo "]<br />\n";
                         print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
                     } else {
                         if ($page->qtype != LESSON_SHORTANSWER and $page->qtype != LESSON_NUMERICAL) {
                             echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
                                 "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" />";
-                            helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                            echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                             echo "]<br />\n";
                             print_textarea(false, 6, 70, 630, 300, "answer[$n]", $answer->answer);
                         } else {
                     if ($flags & LESSON_RESPONSE_EDITOR) {
                         echo " [<label for=\"responseeditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
                             "<input type=\"checkbox\" id=\"responseeditor[$n]\" name=\"responseeditor[$n]\" value=\"1\" checked=\"checked\" />";
-                        helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                        echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                         echo "]<br />\n";
                         print_textarea($usehtmleditor, 20, 70, 630, 300, "response[$n]", $answer->response);
                     } else {
                         echo " [<label for=\"responseeditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
                             "<input type=\"checkbox\" id=\"responseeditor[$n]\" name=\"responseeditor[$n]\" value=\"1\" />";
-                        helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                        echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                         echo "]<br />\n";
                         print_textarea(false, 6, 70, 630, 300, "response[$n]", $answer->response);
                     }
                     if ($flags & LESSON_ANSWER_EDITOR) {
                         echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
                             "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" checked=\"checked\" />";
-                        helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                        echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                         echo "]<br />\n";
                         print_textarea($usehtmleditor, 20, 70, 630, 300, "answer[$n]", $answer->answer);
                     } else {
                         echo " [<label for=\"answereditor[$n]\">".get_string("useeditor", "lesson")."</label>: ".
                             "<input type=\"checkbox\" id=\"answereditor[$n]\" name=\"answereditor[$n]\" value=\"1\" />";
-                        helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                        echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                         echo "]<br />\n";
                         print_textarea(false, 10, 70, 630, 300, "answer[$n]", $answer->answer);
                     }
                     if ($n == 2) {
                         echo "<tr><td><b>".get_string("correctanswerjump", "lesson").":</b> \n";
                         echo $OUTPUT->select(html_select::make($jump, "jumpto[$n]", $answer->jumpto, false));
-                        helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                        echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                         if($lesson->custom)
                             echo get_string("correctanswerscore", "lesson").": <input type=\"text\" name=\"score[$n]\" value=\"$answer->score\" size=\"5\" />";
                         echo "</td></tr>\n";
                     }
                     if ($n == 3) {
                         echo "<tr><td><b>".get_string("wronganswerjump", "lesson").":</b> \n";
-                        echo $OUTPUT->select(html_select::make($jump, "jumpto[$n]", $answer->jumpto, false);
-                        helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                        echo $OUTPUT->select(html_select::make($jump, "jumpto[$n]", $answer->jumpto, false));
+                        echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                         if($lesson->custom)
                             echo get_string("wronganswerscore", "lesson").": <input type=\"text\" name=\"score[$n]\" value=\"$answer->score\" size=\"5\" />";
                         echo "</td></tr>\n";
                 case LESSON_ESSAY :
                     echo "<tr><td><b>".get_string("jump", "lesson").":</b> \n";
                     echo $OUTPUT->select(html_select::make($jump, "jumpto[$n]", $answer->jumpto, false));
-                    helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                    echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                     if($lesson->custom) {
                         echo get_string("score", "lesson").": <input type=\"text\" name=\"score[$n]\" value=\"$answer->score\" size=\"5\" />";
                     }
                 case LESSON_NUMERICAL:
                     echo "<tr><td><b>".get_string("jump", "lesson")." $nplus1:</b> \n";
                     echo $OUTPUT->select(html_select::make($jump, "jumpto[$n]", $answer->jumpto, false));
-                    helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                    echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                     if($lesson->custom) {
                         echo get_string("score", "lesson")." $nplus1: <input type=\"text\" name=\"score[$n]\" value=\"$answer->score\" size=\"5\" />";
                     }
                 case LESSON_ENDOFBRANCH:
                     echo "<tr><td><b>".get_string("jump", "lesson")." $nplus1:</b> \n";
                     echo $OUTPUT->select(html_select::make($jump, "jumpto[$n]", $answer->jumpto, false));
-                    helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                    echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                     echo "</td></tr>\n";
                     break;
             }
                     echo "<tr><td><b>".get_string("answer", "lesson")." $icorrected:</b>\n";
                     echo " [".get_string("useeditor", "lesson").": ".
                         "<input type=\"checkbox\" name=\"answereditor[$i]\" value=\"1\" />";
-                    helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                    echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                     echo "]<br />\n";
                     print_textarea(false, 10, 70, 630, 300, "answer[$i]");
                     echo "</td></tr>\n";
                     echo "<tr><td><b>".get_string("matchesanswer", "lesson")." $icorrected:</b>\n";
                     echo " [".get_string("useeditor", "lesson").": ".
                         "<input type=\"checkbox\" name=\"responseeditor[$i]\" value=\"1\" />";
-                    helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                    echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                     echo "]<br />\n";
                     print_textarea(false, 10, 70, 630, 300, "response[$i]");
                     echo "</td></tr>\n";
                     if ($page->qtype != LESSON_SHORTANSWER and $page->qtype != LESSON_NUMERICAL) {
                         echo " [".get_string("useeditor", "lesson").": ".
                             "<input type=\"checkbox\" name=\"answereditor[$i]\" value=\"1\" />";
-                        helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                        echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                         echo "]<br />\n";
                         print_textarea(false, 10, 70, 630, 300, "answer[$i]");
                     } else {
                     echo "<tr><td><b>".get_string("response", "lesson")." $iplus1:</b>\n";
                     echo " [".get_string("useeditor", "lesson").": ".
                         "<input type=\"checkbox\" name=\"responseeditor[$i]\" value=\"1\" />";
-                    helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                    echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                     echo "]<br />\n";
                     print_textarea(false, 10, 70, 630, 300, "response[$i]");
                     echo "</td></tr>\n";
                     echo "<tr><td><b>".get_string("description", "lesson")." $iplus1:</b>\n";
                     echo " [".get_string("useeditor", "lesson").": ".
                         "<input type=\"checkbox\" name=\"answereditor[$i]\" value=\"1\" />";
-                    helpbutton("useeditor", get_string("useeditor", "lesson"), "lesson");
+                    echo $OUTPUT->help_icon(moodle_help_icon::make("useeditor", get_string("useeditor", "lesson"), "lesson"));
                     echo "]<br />\n";
                     print_textarea(false, 10, 70, 630, 300, "answer[$i]");
                     echo "</td></tr>\n";
                     if ($i < 1) {
                         echo "<tr><td><b>".get_string("jump", "lesson").":</b> \n";
                         echo $OUTPUT->select(html_select::make($jump, "jumpto[$i]", 0, false));
-                        helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                        echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                         if($lesson->custom) {
                             echo get_string("score", "lesson").": <input type=\"text\" name=\"score[$i]\" value=\"1\" size=\"5\" />";
                         }
                     if ($i == 2) {
                         echo "<tr><td><b>".get_string("correctanswerjump", "lesson").":</b> \n";
                         echo $OUTPUT->select(html_select::make($jump, "jumpto[$i]", $answer->jumpto, false));
-                        helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                        echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                         if ($lesson->custom) {
                             echo get_string("correctanswerscore", "lesson").": <input type=\"text\" name=\"score[$i]\" value=\"$answer->score\" size=\"5\" />";
                         }
                     if ($i == 3) {
                         echo "<tr><td><b>".get_string("wronganswerjump", "lesson").":</b> \n";
                         echo $OUTPUT->select(html_select::make($jump, "jumpto[$i]", $answer->jumpto, false));
-                        helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                        echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                         if ($lesson->custom) {
                             echo get_string("wronganswerscore", "lesson").": <input type=\"text\" name=\"score[$i]\" value=\"$answer->score\" size=\"5\" />";
                         }
                 case LESSON_NUMERICAL:
                     echo "<tr><td><b>".get_string("jump", "lesson")." $iplus1:</b> \n";
                     echo $OUTPUT->select(html_select::make($jump, "jumpto[$i]", 0, false));
-                    helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                    echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                     if($lesson->custom) {
                         echo get_string("score", "lesson")." $iplus1: <input type=\"text\" name=\"score[$i]\" value=\"0\" size=\"5\" />";
                     }
                 case LESSON_BRANCHTABLE :
                     echo "<tr><td><b>".get_string("jump", "lesson")." $iplus1:</b> \n";
                     echo $OUTPUT->select(html_select::make($jump, "jumpto[$i]", 0, false));
-                    helpbutton("jumpto", get_string("jump", "lesson"), "lesson");
+                    echo $OUTPUT->help_icon(moodle_help_icon::make("jumpto", get_string("jump", "lesson"), "lesson"));
                     echo "</td></tr>\n";
                     break;
             }
index 94adf5f542c41d5b6b820a43e44ce0b8c407669e..308606ee4e5661d559a4a80ae7000378ee8e2c35 100644 (file)
@@ -43,7 +43,7 @@
     if (empty($firstpage)) {
         // There are no pages; give teacher some options
         if (has_capability('mod/lesson:edit', $context)) {
-            print_simple_box( "<table cellpadding=\"5\" border=\"0\">\n<tr><th scope=\"col\">".get_string("whatdofirst", "lesson")."</th></tr><tr><td>".
+            echo $OUTPUT->box( "<table cellpadding=\"5\" border=\"0\">\n<tr><th scope=\"col\">".get_string("whatdofirst", "lesson")."</th></tr><tr><td>".
                 "<a href=\"import.php?id=$cm->id&amp;pageid=0\">".
                 get_string("importquestions", "lesson")."</a></td></tr><tr><td>".
                 "<a href=\"importppt.php?id=$cm->id&amp;pageid=0\">".
index eb8dc7230dcab72e5214f1f37cede3f4d46809be..6ac183826769004b12f20a17a3cf982ce791e99b 100644 (file)
@@ -31,22 +31,22 @@ class qformat_default {
     }
 
     function importprocess($filename, $lesson, $pageid) {
-        global $DB;
+        global $DB, $OUTPUT;
         
     /// Processes a given file.  There's probably little need to change this
         $timenow = time();
 
         if (! $lines = $this->readdata($filename)) {
-            notify("File could not be read, or was empty");
+            echo $OUTPUT->notification("File could not be read, or was empty");
             return false;
         }
 
         if (! $questions = $this->readquestions($lines)) {   // Extract all the questions
-            notify("There are no questions in this file!");
+            echo $OUTPUT->notification("There are no questions in this file!");
             return false;
         }
         
-        notify(get_string('importcount', 'lesson', sizeof($questions)));
+        echo $OUTPUT->notification(get_string('importcount', 'lesson', sizeof($questions)));
 
         $count = 0;
 
@@ -128,18 +128,18 @@ class qformat_default {
                     $result = lesson_save_question_options($question);
 
                     if (!empty($result->error)) {
-                        notify($result->error);
+                        echo $OUTPUT->notification($result->error);
                         return false;
                     }
 
                     if (!empty($result->notice)) {
-                        notify($result->notice);
+                        echo $OUTPUT->notification($result->notice);
                         return true;
                     }
                     break;
             // the Bad ones
                 default :
-                    notify(get_string('unsupportedqtype', 'lesson', $question->qtype));
+                    echo $OUTPUT->notification(get_string('unsupportedqtype', 'lesson', $question->qtype));
             }
  
         }
index 09d6a546a1ad7bd9eb5e9327589e5e94c3cec434..7a5a9c8097ba503276b05771946af3c2032defbb 100644 (file)
 
     switch ($mode) {
         case 'add':
-            print_simple_box_start('center');
+            echo $OUTPUT->box_start('generalbox boxaligncenter');
             echo '<div class="mdl-align">
                  <form id="nickname" method ="post" action="'.$CFG->wwwroot.'/mod/lesson/highscores.php" autocomplete="off">
                  <input type="hidden" name="id" value="'.$cm->id.'" />
             echo get_string("entername", "lesson").": <input type=\"text\" name=\"name\" size=\"7\" maxlength=\"5\" />\n<p>\n";
             lesson_print_submit_link(get_string("submitname", "lesson"), 'nickname');
             echo "</p>\n</form>\n</div>\n";
-            print_simple_box_end();
+            echo $OUTPUT->box_end();
             break;
         default:
             $params = array ("lessonid" => $lesson->id);
index 7d8540a4724c4d3ade6f963f490b929c5eff30cd..8dc26d8dcc145fc4681f698913d50eef1ab01a6a 100644 (file)
         $form->format = clean_param($form->format, PARAM_SAFEDIR); // For safety
 
         if (empty($_FILES['newfile'])) {      // file was just uploaded
-            notify(get_string("uploadproblem") );
+            echo $OUTPUT->notification(get_string("uploadproblem") );
         }
 
         if ((!is_uploaded_file($_FILES['newfile']['tmp_name']) or $_FILES['newfile']['size'] == 0)) {
-            notify(get_string("uploadnofilefound") );
+            echo $OUTPUT->notification(get_string("uploadnofilefound") );
 
         } else {  // Valid file is found
 
@@ -74,7 +74,7 @@
             }
 
             echo "<hr>";
-            print_continue("view.php?id=$cm->id");
+            echo $OUTPUT->continue_button("view.php?id=$cm->id");
             echo $OUTPUT->footer();
             exit;
         }
@@ -86,7 +86,7 @@
 
     print_heading_with_help($strimportquestions, "import", "lesson");
 
-    print_simple_box_start("center");
+    echo $OUTPUT->box_start('generalbox boxaligncenter');
     echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"import.php\">";
     echo "<input type=\"hidden\" name=\"id\" value=\"$cm->id\" />\n";
     echo "<input type=\"hidden\" name=\"pageid\" value=\"$pageid\" />\n";
 
     echo "</table>";
     echo "</form>";
-    print_simple_box_end();
+    echo $OUTPUT->box_end();
 
     echo $OUTPUT->footer();
 
index cdfecb4ac3c0d6af127a3196f323d1df923af7d9..1e885e3f7e45ce32a20264b3eb8b568bb61cda77 100644 (file)
     if ($form = data_submitted()) {   /// Filename
 
         if (empty($_FILES['newfile'])) {      // file was just uploaded
-            notify(get_string("uploadproblem") );
+            echo $OUTPUT->notification(get_string("uploadproblem") );
         }
 
         if ((!is_uploaded_file($_FILES['newfile']['tmp_name']) or $_FILES['newfile']['size'] == 0)) {
-            notify(get_string("uploadnofilefound") );
+            echo $OUTPUT->notification(get_string("uploadnofilefound") );
 
         } else {  // Valid file is found
             
@@ -75,7 +75,7 @@
             }
 
             echo "<hr>";
-            print_continue("$CFG->wwwroot/mod/$modname/view.php?id=$cm->id");
+            echo $OUTPUT->continue_button("$CFG->wwwroot/mod/$modname/view.php?id=$cm->id");
             echo $OUTPUT->footer();
             exit;
         }
@@ -85,7 +85,7 @@
 
     print_heading_with_help($strimportppt, "importppt", "lesson");
 
-    print_simple_box_start("center");
+    echo $OUTPUT->box_start('generalbox boxaligncenter');
     echo "<form id=\"theform\" enctype=\"multipart/form-data\" method=\"post\">";
     echo "<input type=\"hidden\" name=\"id\" value=\"$cm->id\" />\n";
     echo "<input type=\"hidden\" name=\"pageid\" value=\"$pageid\" />\n";
 
     echo "</table>";
     echo "</form>";
-    print_simple_box_end();
+    echo $OUTPUT->box_end();
 
     echo $OUTPUT->footer();
     
index 4fb86ffd0cd362a347ad433be10596b2027de7a1..024d1eef05397f1bd7c39840cbd47a1c4afd30c3 100644 (file)
@@ -151,14 +151,14 @@ function lesson_delete_instance($id) {
  * @return boolean
  */
 function lesson_delete_course($course, $feedback=true) {
-    global $DB;
+    global $DB, $OUTPUT;
 
     $count = $DB->count_records('lesson_default', array('course'=>$course->id));
     $DB->delete_records('lesson_default', array('course' => $course->id));
 
     //Inform about changes performed if feedback is enabled
     if ($feedback) {
-        notify(get_string('deletedefaults', 'lesson', $count));
+        echo $OUTPUT->notification(get_string('deletedefaults', 'lesson', $count));
     }
 
     return true;
@@ -213,12 +213,12 @@ function lesson_user_outline($course, $user, $mod, $lesson) {
  * @return bool
  */
 function lesson_user_complete($course, $user, $mod, $lesson) {
-    global $DB;
+    global $DB, $OUTPUT;
 
     $params = array ("lessonid" => $lesson->id, "userid" => $user->id);
     if ($attempts = $DB->get_records_select("lesson_attempts", "lessonid = :lessonid AND userid = :userid", $params,
                 "retry, timeseen")) {
-        print_simple_box_start();
+        echo $OUTPUT->box_start();
         $table->head = array (get_string("attempt", "lesson"),  get_string("numberofpagesviewed", "lesson"),
             get_string("numberofcorrectanswers", "lesson"), get_string("time"));
         $table->width = "100%";
@@ -253,7 +253,7 @@ function lesson_user_complete($course, $user, $mod, $lesson) {
                 $table->data[] = array($retry + 1, $npages, $ncorrect, userdate($timeseen));
         }
         print_table($table);
-        print_simple_box_end();
+        echo $OUTPUT->box_end();
         // also print grade summary
         $params = array ("lessonid" => $lesson->id, "userid" => $user->id);
         if ($grades = $DB->get_records_select("lesson_grades", "lessonid = :lessonid AND userid = :userid", $params,
index af8b35371832f363d184fb9905dc2aaeb72b5668..fe96145e82ceaa046a78dc48858663576c1964fa 100644 (file)
@@ -347,7 +347,7 @@ function lesson_set_message($message, $class="notifyproblem", $align='center') {
  * @return boolean
  **/
 function lesson_print_messages() {
-    global $SESSION;
+    global $SESSION, $OUTPUT;
     
     if (empty($SESSION->lesson_messages)) {
         // No messages to print
@@ -355,7 +355,7 @@ function lesson_print_messages() {
     }
     
     foreach($SESSION->lesson_messages as $message) {
-        notify($message[0], $message[1], $message[2]);
+        echo $OUTPUT->notification($message[0], $message[1], $message[2]);
     }
     
     // Reset
@@ -1530,7 +1530,7 @@ function lesson_grade($lesson, $ntries, $userid = 0) {
  * @return void
  **/
 function lesson_print_ongoing_score($lesson) {
-    global $USER, $DB;
+    global $USER, $DB, $OUTPUT;
 
     $cm = get_coursemodule_from_instance('lesson', $lesson->id);
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
@@ -1548,11 +1548,11 @@ function lesson_print_ongoing_score($lesson) {
         if ($lesson->custom) {
             $a->score = $gradeinfo->earned;
             $a->currenthigh = $gradeinfo->total;
-            print_simple_box(get_string("ongoingcustom", "lesson", $a), "center");
+            echo $OUTPUT->box(get_string("ongoingcustom", "lesson", $a), "generalbox boxaligncenter");
         } else {
             $a->correct = $gradeinfo->earned;
             $a->viewed = $gradeinfo->attempts;
-            print_simple_box(get_string("ongoingnormal", "lesson", $a), "center");
+            echo $OUTPUT->box(get_string("ongoingnormal", "lesson", $a), "generalbox boxaligncenter");
         }
     }
 }
@@ -1591,7 +1591,7 @@ function lesson_qtype_menu($qtypes, $selected="", $link="", $onclick="") {
  * @return boolean The return is not significant as of yet.  Will return true/false.
  **/
 function lesson_print_progress_bar($lesson, $course) {
-    global $CFG, $USER, $DB;
+    global $CFG, $USER, $DB, $OUTPUT;
 
     $cm = get_coursemodule_from_instance('lesson', $lesson->id);
     $context = get_context_instance(CONTEXT_MODULE, $cm->id);
@@ -1603,7 +1603,7 @@ function lesson_print_progress_bar($lesson, $course) {
     
     // catch teachers
     if (has_capability('mod/lesson:manage', $context)) {
-        notify(get_string('progressbarteacherwarning2', 'lesson'));
+        echo $OUTPUT->notification(get_string('progressbarteacherwarning2', 'lesson'));
         return false;
     }
     if (!isset($USER->modattempts[$lesson->id])) {
@@ -1756,6 +1756,7 @@ function lesson_add_pretend_blocks($page, $cm, $lesson, $timer = null) {
  * @return block_contents
  **/
 function lesson_mediafile_block_contents($cmid, $lesson) {
+    global $OUTPUT;
     if (empty($lesson->mediafile)) {
         return null;
     }
@@ -1765,7 +1766,7 @@ function lesson_mediafile_block_contents($cmid, $lesson) {
     $name     = 'lessonmediafile';
 
     $content  = link_to_popup_window ($url, $name, get_string('mediafilepopup', 'lesson'), '', '', get_string('mediafilepopup', 'lesson'), $options, true);
-    $content .= helpbutton("mediafilestudent", get_string("mediafile", "lesson"), "lesson", true, false, '', true);
+    $content .= $OUTPUT->help_icon(moodle_help_icon::make("mediafilestudent", get_string("mediafile", "lesson"), "lesson"));
 
     $bc = new block_contents();
     $bc->title = get_string('linkedmedia', 'lesson');
index 9483910640d3d14cfa99cafe86627fe0bb465cfd..b7516c80ca1fa589ddcf1cbba03fbb2e4c5b4f14 100644 (file)
         $filename = basename($file['basename'], '.'.$file['extension']);
 
         echo "<div class=\"lessonmediafilecontrol\"><p>";
-        notify(get_string('clicktodownload', 'lesson'));
+        echo $OUTPUT->notification(get_string('clicktodownload', 'lesson'));
         echo "<a href=\"$fullurl\">".format_string($filename).'</a>';
         echo "</p></div>";
         
index 56b1315450b3f2e3bcae3a58c92c624a558768da..fcf7f0092cece3a997e4779cfab6feb4329c4001 100644 (file)
     }
 
     if ($nothingtodisplay) {
-        notify(get_string('nolessonattempts', 'lesson'));
+        echo $OUTPUT->notification(get_string('nolessonattempts', 'lesson'));
         echo $OUTPUT->footer();
         exit();
     }
index 88f11a45f13b152325bb198a53d64927ec50724f..6f97df90e86f367361d415ce72f9894506a6ea9d 100644 (file)
@@ -70,7 +70,7 @@
                 echo '<fieldset class="invisiblefieldset">';
                 echo '<input type="hidden" name="id" value="'. $cm->id .'" />' . "\n";
                 if (optional_param('userpassword', 0, PARAM_CLEAN)) {
-                    notify(get_string('loginfail', 'lesson'));
+                    echo $OUTPUT->notification(get_string('loginfail', 'lesson'));
                 }
 
                 echo get_string('passwordprotectedlesson', 'lesson', format_string($lesson->name))."<br /><br />\n".