]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19816 Upgraded calls to helpbutton, print_simple_box* and notify
authornicolasconnault <nicolasconnault>
Tue, 18 Aug 2009 05:17:04 +0000 (05:17 +0000)
committernicolasconnault <nicolasconnault>
Tue, 18 Aug 2009 05:17:04 +0000 (05:17 +0000)
mod/survey/lib.php
mod/survey/report.php
mod/survey/view.php

index b517d4cc726213cb14479bc3e0692ed1a40b65b1..34902e457dc85a6aa48ad4d46541068b4b56373c 100644 (file)
@@ -619,7 +619,7 @@ function survey_print_multi($question) {
  * @param object $question
  */
 function survey_print_single($question) {
-    global $DB, $qnum;
+    global $DB, $qnum, $OUTPUT;
 
     $rowclass = survey_question_rowclass(0);
 
@@ -649,7 +649,7 @@ function survey_print_single($question) {
 
     } else if ($question->type < 0) {     // Choose several of a number
         $options = explode( ",", $question->options);
-        notify("This question type not supported yet");
+        echo $OUTPUT->notification("This question type not supported yet");
     }
 
     echo "</td></tr></table>";
index ca0c9e4e74672d7caab39764ec29f9e30afe95ae..2f0fdff5db4441f8b12690e44988d7d781b54974 100644 (file)
@@ -92,7 +92,7 @@
 
     $groupingid = $cm->groupingid;
     
-    print_simple_box_start("center");
+    echo $OUTPUT->box_start("generalbox boxaligncenter");
     if ($showscales) {
         echo "<a href=\"report.php?action=summary&amp;id=$id\">$strsummary</a>";
         echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"report.php?action=scales&amp;id=$id\">$strscales</a>";
             $action = "questions";
         }
     }
-    print_simple_box_end();
+    echo $OUTPUT->box_end();
 
     $spacer = new html_image();
     $spacer->height = 30;
             survey_print_graph("id=$id&amp;group=$currentgroup&amp;type=overall.png");
             echo "</a></div>";
         } else {
-            notify(get_string("nobodyyet","survey"));
+            echo $OUTPUT->notification(get_string("nobodyyet","survey"));
         }
         break;
 
         echo $OUTPUT->heading($strscales);
 
         if (! $results = survey_get_responses($survey->id, $currentgroup, $groupingid) ) {
-            notify(get_string("nobodyyet","survey"));
+            echo $OUTPUT->notification(get_string("nobodyyet","survey"));
 
         } else {
 
         }
 
         if (! $results = survey_get_responses($survey->id, $currentgroup, $groupingid) ) {
-            notify(get_string("nobodyyet","survey"));
+            echo $OUTPUT->notification(get_string("nobodyyet","survey"));
 
         } else {
 
          echo $OUTPUT->heading(get_string("analysisof", "survey", get_string('participants')));
 
          if (! $results = survey_get_responses($survey->id, $currentgroup, $groupingid) ) {
-             notify(get_string("nobodyyet","survey"));
+             echo $OUTPUT->notification(get_string("nobodyyet","survey"));
          } else {
              survey_print_all_responses($cm->id, $results, $course->id);
          }
          if ($notes != '' and confirm_sesskey()) {
              if (survey_get_analysis($survey->id, $user->id)) {
                  if (! survey_update_analysis($survey->id, $user->id, $notes)) {
-                     notify("An error occurred while saving your notes.  Sorry.");
+                     echo $OUTPUT->notification("An error occurred while saving your notes.  Sorry.");
                  } else {
-                     notify(get_string("savednotes", "survey"));
+                     echo $OUTPUT->notification(get_string("savednotes", "survey"));
                  }
              } else {
                  if (! survey_add_analysis($survey->id, $user->id, $notes)) {
-                     notify("An error occurred while saving your notes.  Sorry.");
+                     echo $OUTPUT->notification("An error occurred while saving your notes.  Sorry.");
                  } else {
-                     notify(get_string("savednotes", "survey"));
+                     echo $OUTPUT->notification(get_string("savednotes", "survey"));
                  }
              }
          }
index 907e06f9ba8f67a48a1331ba224446faf33abab1..89bfc558055d4314f0395d569fd0da94b9e5df4e 100644 (file)
@@ -59,7 +59,7 @@
     }
 
     if (isguest()) {
-        notify(get_string("guestsnotallowed", "survey"));
+        echo $OUTPUT->notification(get_string("guestsnotallowed", "survey"));
     }
 
 
     echo '<div>';
     echo "<input type=\"hidden\" name=\"id\" value=\"$id\" />";
 
-    print_simple_box(format_module_intro('survey', $survey, $cm->id), 'center', '70%', '', 5, 'generalbox', 'intro');
+    echo $OUTPUT->box(format_module_intro('survey', $survey, $cm->id), 'generalbox boxaligncenter bowidthnormal', 'intro');
 
 // Get all the major questions and their proper order
     if (! $questions = $DB->get_records_list("survey_questions", "id", explode(',', $survey->questions))) {