]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19805 Upgraded calls to helpbutton, print_simple_box* and notify
authornicolasconnault <nicolasconnault>
Tue, 18 Aug 2009 05:13:36 +0000 (05:13 +0000)
committernicolasconnault <nicolasconnault>
Tue, 18 Aug 2009 05:13:36 +0000 (05:13 +0000)
mod/choice/view.php

index 523e7af6b9bc05d8b3407914e3d2fa55627ba460..6836fca034c36a98e231cfb07d7833381b746511 100644 (file)
@@ -56,7 +56,7 @@
         } else {
             choice_user_submit_response($answer, $choice, $USER->id, $course->id, $cm);
         }
-        notify(get_string('choicesaved', 'choice'),'notifysuccess');
+        echo $OUTPUT->notification(get_string('choicesaved', 'choice'),'notifysuccess');
     }
 
 
@@ -87,7 +87,7 @@
     //if user has already made a selection, and they are not allowed to update it, show their selected answer.
     if (!empty($USER->id) && ($current = $DB->get_record('choice_answers', array('choiceid' => $choice->id, 'userid' => $USER->id))) &&
         empty($choice->allowupdate) ) {
-        print_simple_box(get_string("yourselection", "choice", userdate($choice->timeopen)).": ".format_string(choice_get_option_text($choice, $current->optionid)), "center");
+        echo $OUTPUT->box(get_string("yourselection", "choice", userdate($choice->timeopen)).": ".format_string(choice_get_option_text($choice, $current->optionid)));
     }
 
 /// Print the form
     $timenow = time();
     if ($choice->timeclose !=0) {
         if ($choice->timeopen > $timenow ) {
-            print_simple_box(get_string("notopenyet", "choice", userdate($choice->timeopen)), "center");
+            echo $OUTPUT->box(get_string("notopenyet", "choice", userdate($choice->timeopen)));
             echo $OUTPUT->footer();
             exit;
         } else if ($timenow > $choice->timeclose) {
-            print_simple_box(get_string("expired", "choice", userdate($choice->timeclose)), "center");
+            echo $OUTPUT->box(get_string("expired", "choice", userdate($choice->timeclose)));
             $choiceopen = false;
         }
     }
             $SESSION->wantsurl = $FULLME;
             $SESSION->enrolcancel = $_SERVER['HTTP_REFERER'];
 
-            print_simple_box_start('center', '60%', '', 5, 'generalbox', 'notice');
+            echo $OUTPUT->box_start('generalbox', 'notice');
             echo '<p align="center">'. get_string('noguestchoose', 'choice') .'</p>';
             echo '<div class="continuebutton">';
             print_single_button($CFG->wwwroot.'/course/enrol.php?id='.$course->id, NULL,
                                 get_string('enrolme', '', format_string($course->shortname)), 'post', $CFG->framename);
             echo '</div>'."\n";
-            print_simple_box_end();
+            echo $OUTPUT->box_end();
 
         }
     }
         choice_show_results($choice, $course, $cm, $allresponses); //show table with students responses.
 
     } else if (!$choiceformshown) {
-        print_simple_box(get_string('noresultsviewable', 'choice'), 'center');
+        echo $OUTPUT->box(get_string('noresultsviewable', 'choice'));
     }
 
     echo $OUTPUT->footer();