MDL-19820 upgraded calls to print_table, print_single_button, print_user_picture, print_container* and notice_yesno

This commit is contained in:
nicolasconnault 2009-08-20 08:49:11 +00:00
parent c108068f6e
commit a941387a02
2 changed files with 14 additions and 13 deletions

View File

@ -1466,7 +1466,7 @@ class question_bank_view {
}
public function process_actions_needing_ui() {
global $DB;
global $DB, $OUTPUT;
if (optional_param('deleteselected', false, PARAM_BOOL)) {
// make a list of all the questions that are selected
$rawquestions = $_REQUEST; // This code is called by both POST forms and GET links, so cannot use data_submitted.
@ -1495,11 +1495,9 @@ class question_bank_view {
if ($inuse) {
$questionnames .= '<br />'.get_string('questionsinuse', 'quiz');
}
notice_yesno(get_string("deletequestionscheck", "quiz", $questionnames),
$this->baseurl->out_action(),
$this->baseurl->out(true),
array('deleteselected'=>$questionlist, 'confirm'=>md5($questionlist)),
$this->baseurl->params(), 'post', 'get');
echo $OUTPUT->confirm(get_string("deletequestionscheck", "quiz", $questionnames),
$this->baseurl->out_action(array('deleteselected'=>$questionlist, 'confirm'=>md5($questionlist))),
$this->baseurl);
return true;
}
@ -1913,8 +1911,11 @@ function create_new_question_button($categoryid, $params, $caption, $tooltip = '
global $CFG, $PAGE, $OUTPUT;
static $choiceformprinted = false;
$params['category'] = $categoryid;
print_single_button($CFG->wwwroot . '/question/addquestion.php', $params,
$caption,'get', '', false, $tooltip, $disabled);
$form = html_form::make_button($CFG->wwwroot . '/question/addquestion.php', $params, $caption,'get');
$form->button->title = $tooltip;
$form->button->disabled = $disabled;
echo $OUTPUT->button($form);
echo $OUTPUT->help_icon(moodle_help_icon::make('types', get_string('createnewquestion', 'question'), 'question'));
$PAGE->requires->yui_lib('dragdrop');
$PAGE->requires->yui_lib('container');

View File

@ -366,8 +366,8 @@ class default_questiontype {
}
if (!empty($result->noticeyesno)) {
notice_yesno($result->noticeyesno, "question.php?id=$question->id&amp;courseid={$course->id}",
"edit.php?courseid={$course->id}");
echo $OUTPUT->confirm($result->noticeyesno, "question.php?id=$question->id&courseid={$course->id}",
"edit.php?courseid={$course->id}");
echo $OUTPUT->footer();
exit;
}
@ -1066,7 +1066,7 @@ class default_questiontype {
* Used by print_question()
*/
function history($question, $state, $number, $cmoptions, $options) {
global $DB;
global $DB, $OUTPUT;
$history = '';
if(isset($options->history) and $options->history) {
if ($options->history == 'all') {
@ -1078,7 +1078,7 @@ class default_questiontype {
}
if (count($states) > 1) {
$strreviewquestion = get_string('reviewresponse', 'quiz');
$table = new stdClass;
$table = new html_table();
$table->width = '100%';
if ($options->scores) {
$table->head = array (
@ -1134,7 +1134,7 @@ class default_questiontype {
);
}
}
$history = print_table($table, true);
$history = $OUTPUT->table($table);
}
}
return $history;