Merge branch 'MDL-40687' of git://github.com/rwijaya/moodle
authorSam Hemelryk <sam@moodle.com>
Tue, 10 Sep 2013 21:47:41 +0000 (09:47 +1200)
committerSam Hemelryk <sam@moodle.com>
Tue, 10 Sep 2013 21:47:41 +0000 (09:47 +1200)
16 files changed:
mod/feedback/analysis.php
mod/feedback/complete.php
mod/feedback/complete_guest.php
mod/feedback/delete_completed.php
mod/feedback/delete_item.php
mod/feedback/delete_template.php
mod/feedback/edit.php
mod/feedback/edit_item.php
mod/feedback/import.php
mod/feedback/index.php
mod/feedback/mapcourse.php
mod/feedback/show_entries.php
mod/feedback/show_entries_anonym.php
mod/feedback/use_templ.php
mod/feedback/use_templ_form.php
mod/feedback/view.php

index 02a8d39..32f8504 100644 (file)
@@ -80,6 +80,7 @@ $PAGE->navbar->add(get_string('analysis', 'feedback'));
 $PAGE->set_heading(format_string($course->fullname));
 $PAGE->set_title(format_string($feedback->name));
 echo $OUTPUT->header();
+echo $OUTPUT->heading(format_string($feedback->name));
 
 /// print the tabs
 require('tabs.php');
@@ -157,7 +158,7 @@ if ($check_anonymously) {
 } else {
     echo $OUTPUT->heading_with_help(get_string('insufficient_responses_for_this_group', 'feedback'),
                                     'insufficient_responses',
-                                    'feedback');
+                                    'feedback', '', '', 3);
 }
 echo '</td></tr></table></div>';
 echo $OUTPUT->box_end();
index d4dc00b..0d57c66 100644 (file)
@@ -181,11 +181,10 @@ $feedback_is_closed = ($feedback->timeopen > $checktime) OR
                             $feedback->timeclose > 0);
 
 if ($feedback_is_closed) {
+    echo $OUTPUT->heading(format_string($feedback->name));
     echo $OUTPUT->box_start('generalbox boxaligncenter');
-        echo '<h2><font color="red">';
-        echo get_string('feedback_is_not_open', 'feedback');
-        echo '</font></h2>';
-        echo $OUTPUT->continue_button($CFG->wwwroot.'/course/view.php?id='.$course->id);
+    echo $OUTPUT->notification(get_string('feedback_is_not_open', 'feedback'));
+    echo $OUTPUT->continue_button($CFG->wwwroot.'/course/view.php?id='.$course->id);
     echo $OUTPUT->box_end();
     echo $OUTPUT->footer();
     exit;
@@ -356,7 +355,7 @@ if ($feedback_can_submit) {
     if ($courseid > 0) {
         $analysisurl->param('courseid', $courseid);
     }
-    echo $OUTPUT->heading(format_text($feedback->name));
+    echo $OUTPUT->heading(format_string($feedback->name));
 
     if ( (intval($feedback->publish_stats) == 1) AND
             ( has_capability('mod/feedback:viewanalysepage', $context)) AND
@@ -591,13 +590,10 @@ if ($feedback_can_submit) {
         }
     }
 } else {
+    echo $OUTPUT->heading(format_string($feedback->name));
     echo $OUTPUT->box_start('generalbox boxaligncenter');
-        echo '<h2>';
-        echo '<font color="red">';
-        echo get_string('this_feedback_is_already_submitted', 'feedback');
-        echo '</font>';
-        echo '</h2>';
-        echo $OUTPUT->continue_button($CFG->wwwroot.'/course/view.php?id='.$course->id);
+    echo $OUTPUT->notification(get_string('this_feedback_is_already_submitted', 'feedback'));
+    echo $OUTPUT->continue_button($CFG->wwwroot.'/course/view.php?id='.$course->id);
     echo $OUTPUT->box_end();
 }
 /// Finish the page
index 695cf41..8dd1571 100644 (file)
@@ -183,10 +183,8 @@ $feedback_is_closed = ($feedback->timeopen > $checktime) OR
 
 if ($feedback_is_closed) {
     echo $OUTPUT->box_start('generalbox boxaligncenter');
-        echo '<h2><font color="red">';
-        echo get_string('feedback_is_not_open', 'feedback');
-        echo '</font></h2>';
-        echo $OUTPUT->continue_button($CFG->wwwroot.'/course/view.php?id='.$course->id);
+    echo $OUTPUT->notification(get_string('feedback_is_not_open', 'feedback'));
+    echo $OUTPUT->continue_button($CFG->wwwroot.'/course/view.php?id='.$course->id);
     echo $OUTPUT->box_end();
     echo $OUTPUT->footer();
     exit;
@@ -528,10 +526,8 @@ if ($feedback_can_submit) {
     }
 } else {
     echo $OUTPUT->box_start('generalbox boxaligncenter');
-        echo '<h2><font color="red">';
-        echo get_string('this_feedback_is_already_submitted', 'feedback');
-        echo '</font></h2>';
-        echo $OUTPUT->continue_button($CFG->wwwroot.'/course/view.php?id='.$course->id);
+    echo $OUTPUT->notification(get_string('this_feedback_is_already_submitted', 'feedback'));
+    echo $OUTPUT->continue_button($CFG->wwwroot.'/course/view.php?id='.$course->id);
     echo $OUTPUT->box_end();
 }
 /// Finish the page
index d5eacb4..c35b8f7 100644 (file)
@@ -104,9 +104,9 @@ echo $OUTPUT->header();
 ///////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////
-echo $OUTPUT->heading(format_text($feedback->name));
+echo $OUTPUT->heading(format_string($feedback->name));
 echo $OUTPUT->box_start('generalbox errorboxcontent boxaligncenter boxwidthnormal');
-echo $OUTPUT->heading(get_string('confirmdeleteentry', 'feedback'));
+echo html_writer::tag('p', get_string('confirmdeleteentry', 'feedback'), array('class' => 'bold'));
 $mform->display();
 echo $OUTPUT->box_end();
 
index d0840fb..7ecf986 100644 (file)
@@ -79,9 +79,9 @@ echo $OUTPUT->header();
 ///////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////
-echo $OUTPUT->heading(format_text($feedback->name));
+echo $OUTPUT->heading(format_string($feedback->name));
 echo $OUTPUT->box_start('generalbox errorboxcontent boxaligncenter boxwidthnormal');
-echo $OUTPUT->heading(get_string('confirmdeleteitem', 'feedback'));
+echo html_writer::tag('p', get_string('confirmdeleteitem', 'feedback'), array('class' => 'bold'));
 print_string('relateditemsdeleted', 'feedback');
 $mform->display();
 echo $OUTPUT->box_end();
index de240d8..b68c5c5 100644 (file)
@@ -110,7 +110,7 @@ $strdeletefeedback = get_string('delete_template', 'feedback');
 $PAGE->set_heading(format_string($course->fullname));
 $PAGE->set_title(format_string($feedback->name));
 echo $OUTPUT->header();
-
+echo $OUTPUT->heading(format_string($feedback->name));
 /// print the tabs
 require('tabs.php');
 
@@ -118,11 +118,11 @@ require('tabs.php');
 ///////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////
-echo $OUTPUT->heading($strdeletefeedback);
+echo $OUTPUT->heading($strdeletefeedback, 3);
 if ($shoulddelete == 1) {
 
     echo $OUTPUT->box_start('generalbox errorboxcontent boxaligncenter boxwidthnormal');
-    echo $OUTPUT->heading(get_string('confirmdeletetemplate', 'feedback'));
+    echo html_writer::tag('p', get_string('confirmdeletetemplate', 'feedback'), array('class' => 'bold'));
     $mform->display();
     echo $OUTPUT->box_end();
 } else {
@@ -132,7 +132,7 @@ if ($shoulddelete == 1) {
         echo $OUTPUT->box(get_string('no_templates_available_yet', 'feedback'),
                          'generalbox boxaligncenter');
     } else {
-        echo $OUTPUT->heading(get_string('course'), 3);
+        echo $OUTPUT->heading(get_string('course'), 4);
         echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');
         $tablecolumns = array('template', 'action');
         $tableheaders = array(get_string('template', 'feedback'), '');
@@ -172,7 +172,7 @@ if ($shoulddelete == 1) {
             echo $OUTPUT->box(get_string('no_templates_available_yet', 'feedback'),
                               'generalbox boxaligncenter');
         } else {
-            echo $OUTPUT->heading(get_string('public', 'feedback'), 3);
+            echo $OUTPUT->heading(get_string('public', 'feedback'), 4);
             echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');
             $tablecolumns = array('template', 'action');
             $tableheaders = array(get_string('template', 'feedback'), '');
index f8af903..0b09213 100644 (file)
@@ -172,6 +172,7 @@ if (count($feedbackitems) > 1) {
 }
 
 echo $OUTPUT->header();
+echo $OUTPUT->heading(format_string($feedback->name));
 
 /// print the tabs
 require('tabs.php');
@@ -245,7 +246,7 @@ if ($do_show == 'edit') {
 
         $helpbutton = $OUTPUT->help_icon('preview', 'feedback');
 
-        echo $OUTPUT->heading($helpbutton . get_string('preview', 'feedback'));
+        echo $OUTPUT->heading(get_string('preview', 'feedback').$helpbutton, 3);
         if (isset($SESSION->feedback->moving) AND $SESSION->feedback->moving->shouldmoving == 1) {
             $anker = '<a href="edit.php?id='.$id.'">';
             $anker .= get_string('cancel_moving', 'feedback');
index 8a7a304..20425c4 100644 (file)
@@ -125,10 +125,13 @@ if ($item->id) {
 $PAGE->set_heading(format_string($course->fullname));
 $PAGE->set_title(format_string($feedback->name));
 echo $OUTPUT->header();
+
+// Print the main part of the page.
+echo $OUTPUT->heading(format_string($feedback->name));
+
 /// print the tabs
 require('tabs.php');
-/// Print the main part of the page
-echo $OUTPUT->heading(format_text($feedback->name));
+
 //print errormsg
 if (isset($error)) {
     echo $error;
index 5678f98..cbc3f25 100644 (file)
@@ -95,7 +95,7 @@ $strfeedback  = get_string("modulename", "feedback");
 $PAGE->set_heading(format_string($course->fullname));
 $PAGE->set_title(format_string($feedback->name));
 echo $OUTPUT->header();
-
+echo $OUTPUT->heading(format_string($feedback->name));
 /// print the tabs
 require('tabs.php');
 
@@ -103,7 +103,7 @@ require('tabs.php');
 ///////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////
-echo $OUTPUT->heading(get_string('import_questions', 'feedback'));
+echo $OUTPUT->heading(get_string('import_questions', 'feedback'), 3);
 
 if (isset($importerror->msg) AND is_array($importerror->msg)) {
     echo $OUTPUT->box_start('generalbox errorboxcontent boxaligncenter');
index a1a42ff..5262d9c 100644 (file)
@@ -51,6 +51,7 @@ $PAGE->navbar->add($strfeedbacks);
 $PAGE->set_heading(format_string($course->fullname));
 $PAGE->set_title(get_string('modulename', 'feedback').' '.get_string('activities'));
 echo $OUTPUT->header();
+echo $OUTPUT->heading($strfeedbacks);
 
 /// Get all the appropriate data
 
index ba33874..57bf266 100644 (file)
@@ -87,6 +87,7 @@ $strfeedback  = get_string("modulename", "feedback");
 $PAGE->set_heading(format_string($course->fullname));
 $PAGE->set_title(format_string($feedback->name));
 echo $OUTPUT->header();
+echo $OUTPUT->heading(format_string($feedback->name));
 
 require('tabs.php');
 
@@ -144,7 +145,7 @@ if ($coursemap = feedback_get_courses_from_sitecourse_map($feedback->id)) {
 
     $table->print_html();
 } else {
-    echo '<h3>'.get_string('mapcoursenone', 'feedback').'</h3>';
+    echo $OUTPUT->heading(get_string('mapcoursenone', 'feedback'), 3);
 }
 
 
index dceb7fb..b698c37 100644 (file)
@@ -92,6 +92,7 @@ $strfeedback  = get_string("modulename", "feedback");
 $PAGE->set_heading(format_string($course->fullname));
 $PAGE->set_title(format_string($feedback->name));
 echo $OUTPUT->header();
+echo $OUTPUT->heading(format_string($feedback->name));
 
 require('tabs.php');
 
index bf69bf3..8f21ac1 100644 (file)
@@ -65,6 +65,7 @@ $strfeedback  = get_string("modulename", "feedback");
 $PAGE->set_heading(format_string($course->fullname));
 $PAGE->set_title(format_string($feedback->name));
 echo $OUTPUT->header();
+echo $OUTPUT->heading(format_string($feedback->name));
 
 /// Print the main part of the page
 ///////////////////////////////////////////////////////////////////////////
@@ -72,8 +73,6 @@ echo $OUTPUT->header();
 ///////////////////////////////////////////////////////////////////////////
 require('tabs.php');
 
-echo $OUTPUT->heading(format_text($feedback->name));
-
 //print the list with anonymous completeds
 if (!$showcompleted) {
 
index 12f62ce..be562f5 100644 (file)
@@ -90,10 +90,10 @@ echo $OUTPUT->header();
 ///////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////
-echo $OUTPUT->heading(format_text($feedback->name));
+echo $OUTPUT->heading(format_string($feedback->name));
 
 echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthnormal');
-echo $OUTPUT->heading(get_string('confirmusetemplate', 'feedback'));
+echo $OUTPUT->heading(get_string('confirmusetemplate', 'feedback'), 3);
 
 $mform->display();
 
index c483991..30ee9c4 100644 (file)
@@ -33,7 +33,7 @@ class mod_feedback_use_templ_form extends moodleform {
         $mform =& $this->_form;
 
         //headline
-        $mform->addElement('header', 'general', '');
+        $mform->addElement('header', 'general', get_string('general', 'form'));
 
         // visible elements
         $mform->addElement('radio', 'deleteolditems', '1)', get_string('delete_old_items', 'feedback'), 1);
index c16fdcd..bffc6f4 100644 (file)
@@ -132,13 +132,14 @@ if ((empty($cm->visible) and !$cap_viewhiddenactivities) AND $courseid == SITEID
 ///////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////
 
-/// print the tabs
-require('tabs.php');
-
 $previewimg = $OUTPUT->pix_icon('t/preview', get_string('preview'));
-$previewlnk = '<a href="'.$CFG->wwwroot.'/mod/feedback/print.php?id='.$id.'">'.$previewimg.'</a>';
+$previewlnk = new moodle_url('/mod/feedback/print.php', array('id' => $id));
+$preview = html_writer::link($previewlnk, $previewimg);
 
-echo $OUTPUT->heading(format_text($feedback->name.' '.$previewlnk));
+echo $OUTPUT->heading(format_string($feedback->name) . $preview);
+
+// Print the tabs.
+require('tabs.php');
 
 //show some infos to the feedback
 if (has_capability('mod/feedback:edititems', $context)) {
@@ -193,9 +194,9 @@ if (has_capability('mod/feedback:edititems', $context)) {
 }
 
 if (has_capability('mod/feedback:edititems', $context)) {
-    echo $OUTPUT->heading(get_string('description', 'feedback'), 4);
+    echo $OUTPUT->heading(get_string('description', 'feedback'), 3);
 }
-echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');
+echo $OUTPUT->box_start('generalbox boxwidthwide');
 $options = (object)array('noclean'=>true);
 echo format_module_intro('feedback', $feedback, $cm->id);
 echo $OUTPUT->box_end();
@@ -210,7 +211,7 @@ if (has_capability('mod/feedback:edititems', $context)) {
                                                             'page_after_submit',
                                                             0);
 
-    echo $OUTPUT->heading(get_string("page_after_submit", "feedback"), 4);
+    echo $OUTPUT->heading(get_string("page_after_submit", "feedback"), 3);
     echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');
     echo format_text($page_after_submit_output,
                      $feedback->page_after_submitformat,
@@ -261,7 +262,7 @@ if ($feedback_complete_cap) {
     if (($feedback->timeopen > $checktime) OR
             ($feedback->timeclose < $checktime AND $feedback->timeclose > 0)) {
 
-        echo '<h2><font color="red">'.get_string('feedback_is_not_open', 'feedback').'</font></h2>';
+        echo $OUTPUT->notification(get_string('feedback_is_not_open', 'feedback'));
         echo $OUTPUT->continue_button($CFG->wwwroot.'/course/view.php?id='.$course->id);
         echo $OUTPUT->box_end();
         echo $OUTPUT->footer();
@@ -297,9 +298,7 @@ if ($feedback_complete_cap) {
             echo '<a href="'.$completeurl->out().'">'.get_string('complete_the_form', 'feedback').'</a>';
         }
     } else {
-        echo '<h2><font color="red">';
-        echo get_string('this_feedback_is_already_submitted', 'feedback');
-        echo '</font></h2>';
+        echo $OUTPUT->notification(get_string('this_feedback_is_already_submitted', 'feedback'));
         if ($courseid) {
             echo $OUTPUT->continue_button($CFG->wwwroot.'/course/view.php?id='.$courseid);
         } else {