MDL-21198 $OUTPUT->single_button() resurrection, hopefully much easier to use than $OUTPUT->button(); fixed some regressions and code style improvements

This commit is contained in:
Petr Skoda
2010-01-03 15:46:14 +00:00
parent 3cd5305f11
commit 5c2ed7e215
62 changed files with 170 additions and 243 deletions
@@ -126,8 +126,7 @@ class assignment_online extends assignment_base {
echo $OUTPUT->box_end();
if (!$editmode && $editable) {
echo "<div style='text-align:center'>";
echo $OUTPUT->button(html_form::make_button('view.php', array('id'=>$this->cm->id,'edit'=>'1'),
get_string('editmysubmission', 'assignment')));
echo $OUTPUT->single_button(new moodle_url('view.php', array('id'=>$this->cm->id, 'edit'=>'1')), get_string('editmysubmission', 'assignment'));
echo "</div>";
}
@@ -180,7 +180,7 @@ class assignment_upload extends assignment_base {
if ($this->can_update_notes($submission)) {
$options = array ('id'=>$this->cm->id, 'action'=>'editnotes');
echo '<div style="text-align:center">';
echo $OUTPUT->button(html_form::make_button('upload.php', $options, get_string('edit')));
echo $OUTPUT->single_button(new moodle_url('upload.php', $options), get_string('edit'));
echo '</div>';
}
}
@@ -376,10 +376,10 @@ class assignment_upload extends assignment_base {
if ($this->drafts_tracked() and $this->isopen() and has_capability('mod/assignment:grade', $this->context) and $mode != '') { // we do not want it on view.php page
if ($this->can_unfinalize($submission)) {
$options = array ('id'=>$this->cm->id, 'userid'=>$userid, 'action'=>'unfinalize', 'mode'=>$mode, 'offset'=>$offset);
$output .= $OUTPUT->button(html_form::make_button('upload.php', $options, get_string('unfinalize', 'assignment')));
$output .= $OUTPUT->single_button(new moodle_url('upload.php', $options), get_string('unfinalize', 'assignment'));
} else if ($this->can_finalize($submission)) {
$options = array ('id'=>$this->cm->id, 'userid'=>$userid, 'action'=>'finalizeclose', 'mode'=>$mode, 'offset'=>$offset);
$output .= $OUTPUT->button(html_form::make_button('upload.php', $options, get_string('finalize', 'assignment')));
$output .= $OUTPUT->single_button(new moodle_url('upload.php', $options), get_string('finalize', 'assignment'));
}
}