mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-19816 upgraded calls to print_table, print_single_button, print_user_picture, print_container* and notice_yesno
This commit is contained in:
parent
fcd1243be8
commit
02f78a2688
@ -32,6 +32,8 @@
|
||||
notice(get_string('thereareno', 'moodle', $strsurveys), "../../course/view.php?id=$course->id");
|
||||
}
|
||||
|
||||
$table = new html_table();
|
||||
|
||||
if ($course->format == "weeks") {
|
||||
$table->head = array ($strweek, $strname, $strstatus);
|
||||
$table->align = array ("CENTER", "LEFT", "LEFT");
|
||||
@ -78,7 +80,7 @@
|
||||
}
|
||||
|
||||
echo "<br />";
|
||||
print_table($table);
|
||||
echo $OUTPUT->table($table);
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
?>
|
||||
|
@ -170,11 +170,11 @@ function survey_user_outline($course, $user, $mod, $survey) {
|
||||
* @param object $survey
|
||||
*/
|
||||
function survey_user_complete($course, $user, $mod, $survey) {
|
||||
global $CFG, $DB;
|
||||
global $CFG, $DB, $OUTPUT;
|
||||
|
||||
if (survey_already_done($survey->id, $user->id)) {
|
||||
if ($survey->template == SURVEY_CIQ) { // print out answers for critical incidents
|
||||
$table = NULL;
|
||||
$table = new html_table();
|
||||
$table->align = array("left", "left");
|
||||
|
||||
$questions = $DB->get_records_list("survey_questions", "id", explode(',', $survey->questions));
|
||||
@ -191,7 +191,7 @@ function survey_user_complete($course, $user, $mod, $survey) {
|
||||
}
|
||||
$table->data[] = array("<b>$questiontext</b>", $answertext);
|
||||
}
|
||||
print_table($table);
|
||||
echo $OUTPUT->table($table);
|
||||
|
||||
} else {
|
||||
|
||||
@ -463,19 +463,19 @@ function survey_count_responses($surveyid, $groupid, $groupingid) {
|
||||
* @param int $courseid
|
||||
*/
|
||||
function survey_print_all_responses($cmid, $results, $courseid) {
|
||||
|
||||
$table = new object();
|
||||
global $OUTPUT;
|
||||
$table = new html_table();
|
||||
$table->head = array ("", get_string("name"), get_string("time"));
|
||||
$table->align = array ("", "left", "left");
|
||||
$table->size = array (35, "", "" );
|
||||
|
||||
foreach ($results as $a) {
|
||||
$table->data[] = array(print_user_picture($a->id, $courseid, $a->picture, false, true, false),
|
||||
"<a href=\"report.php?action=student&student=$a->id&id=$cmid\">".fullname($a)."</a>",
|
||||
$table->data[] = array($OUTPUT->user_picture(moodle_user_picture::make($a, $courseid)),
|
||||
$OUTPUT->link("report.php?action=student&student=$a->id&id=$cmid", fullname($a)),
|
||||
userdate($a->time));
|
||||
}
|
||||
|
||||
print_table($table);
|
||||
echo $OUTPUT->table($table);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -236,7 +236,7 @@
|
||||
echo "</a></p>";
|
||||
|
||||
} else {
|
||||
$table = NULL;
|
||||
$table = new html_table();
|
||||
$table->head = array($question->text);
|
||||
$table->align = array ("left");
|
||||
|
||||
@ -254,7 +254,7 @@
|
||||
|
||||
$table->data[] = array($contents);
|
||||
|
||||
print_table($table);
|
||||
echo $OUTPUT->table($table);
|
||||
print_spacer(30);
|
||||
}
|
||||
}
|
||||
@ -279,7 +279,7 @@
|
||||
$strpreferred = get_string("preferred", "survey");
|
||||
$strdateformat = get_string("strftimedatetime");
|
||||
|
||||
$table = NULL;
|
||||
$table = new html_table();
|
||||
$table->head = array("", $strname, $strtime, $stractual, $strpreferred);
|
||||
$table->align = array ("left", "left", "left", "left", "right");
|
||||
$table->size = array (35, "", "", "", "");
|
||||
@ -296,9 +296,10 @@
|
||||
} else {
|
||||
$answer2 = " ";
|
||||
}
|
||||
|
||||
$userpic = moodle_user_picture::make($a, $course->id);
|
||||
$userpic->link = true;
|
||||
$table->data[] = array(
|
||||
print_user_picture($a->userid, $course->id, $a->picture, false, true, true),
|
||||
$OUTPUT->user_picture($userpic),
|
||||
"<a href=\"report.php?id=$id&action=student&student=$a->userid\">".fullname($a)."</a>",
|
||||
userdate($a->time),
|
||||
$answer1, $answer2);
|
||||
@ -306,7 +307,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
print_table($table);
|
||||
echo $OUTPUT->table($table);
|
||||
|
||||
break;
|
||||
|
||||
@ -346,7 +347,7 @@
|
||||
}
|
||||
|
||||
echo "<p <p class=\"centerpara\">";
|
||||
print_user_picture($user->id, $course->id, $user->picture, true);
|
||||
echo $OUTPUT->user_picture(moodle_user_picture::make($user->id, $course->id));
|
||||
echo "</p>";
|
||||
|
||||
$questions = $DB->get_records_list("survey_questions", "id", explode(',', $survey->questions));
|
||||
@ -388,12 +389,12 @@
|
||||
$question = $questions[$val];
|
||||
if ($question->type == 0 or $question->type == 1) {
|
||||
if ($answer = survey_get_user_answer($survey->id, $question->id, $user->id)) {
|
||||
$table = NULL;
|
||||
$table = new html_table();
|
||||
$table->head = array(get_string($question->text, "survey"));
|
||||
$table->align = array ("left");
|
||||
$table->data[] = array(s($answer->answer1)); // no html here, just plain text
|
||||
print_table($table);
|
||||
print_spacer(30);
|
||||
echo $OUTPUT->table($table);
|
||||
echo $OUTPUT->spacer(30);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -430,20 +431,20 @@
|
||||
|
||||
echo '<p class="centerpara">'.get_string("downloadinfo", "survey").'</p>';
|
||||
|
||||
echo '<div class="reportbuttons">';
|
||||
$optons = array();
|
||||
echo $OUTPUT->container_start('reportbuttons');
|
||||
$options = array();
|
||||
$options["id"] = "$cm->id";
|
||||
$options["group"] = $currentgroup;
|
||||
|
||||
$options["type"] = "ods";
|
||||
print_single_button("download.php", $options, get_string("downloadods"));
|
||||
echo $OUTPUT->button(html_form::make_button("download.php", $options, get_string("downloadods")));
|
||||
|
||||
$options["type"] = "xls";
|
||||
print_single_button("download.php", $options, get_string("downloadexcel"));
|
||||
echo $OUTPUT->button(html_form::make_button("download.php", $options, get_string("downloadexcel")));
|
||||
|
||||
$options["type"] = "txt";
|
||||
print_single_button("download.php", $options, get_string("downloadtext"));
|
||||
echo '</div>';
|
||||
echo $OUTPUT->button(html_form::make_button("download.php", $options, get_string("downloadtext")));
|
||||
echo $OUTPUT->container_end();
|
||||
|
||||
break;
|
||||
|
||||
|
@ -90,11 +90,11 @@
|
||||
$question = $questions[$val];
|
||||
if ($question->type == 0 or $question->type == 1) {
|
||||
if ($answer = survey_get_user_answer($survey->id, $question->id, $USER->id)) {
|
||||
$table = NULL;
|
||||
$table = new html_table();
|
||||
$table->head = array(get_string($question->text, "survey"));
|
||||
$table->align = array ("left");
|
||||
$table->data[] = array(s($answer->answer1));//no html here, just plain text
|
||||
print_table($table);
|
||||
echo $OUTPUT->table($table);
|
||||
echo $OUTPUT->spacer(clone($spacer)) . '<br />';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user