MDL-41622 workshop mod: fix page heading levels.

Also, changing couple of the sub header to use notification, which is more appropriate.
This commit is contained in:
Rossiani Wijaya 2013-09-17 12:44:25 +08:00
parent 83f26f6407
commit 764d7ba9b4
10 changed files with 23 additions and 14 deletions

View File

@ -57,6 +57,7 @@ $initresult = $allocator->init();
//
$output = $PAGE->get_renderer('mod_workshop');
echo $output->header();
echo $OUTPUT->heading(format_string($workshop->name));
$allocators = workshop::installed_allocators();
if (!empty($allocators)) {

View File

@ -101,11 +101,13 @@ if ($assessmenteditable and $workshop->useexamples and $workshop->examplesmode =
and !has_capability('mod/workshop:manageexamples', $workshop->context)) {
// the reviewer must have submitted their own submission
$reviewersubmission = $workshop->get_submission_by_author($assessment->reviewerid);
$output = $PAGE->get_renderer('mod_workshop');
if (!$reviewersubmission) {
// no money, no love
$assessmenteditable = false;
echo $output->header();
echo $output->heading(get_string('exampleneedsubmission', 'workshop'), 2);
echo $output->heading(format_string($workshop->name));
notice(get_string('exampleneedsubmission', 'workshop'), new moodle_url('/mod/workshop/view.php', array('id' => $cm->id)));
echo $output->footer();
exit;
} else {
@ -114,7 +116,8 @@ if ($assessmenteditable and $workshop->useexamples and $workshop->examplesmode =
if (is_null($example->grade)) {
$assessmenteditable = false;
echo $output->header();
echo $output->heading(get_string('exampleneedassessed', 'workshop'), 2);
echo $output->heading(format_string($workshop->name));
notice(get_string('exampleneedassessed', 'workshop'), new moodle_url('/mod/workshop/view.php', array('id' => $cm->id)));
echo $output->footer();
exit;
}
@ -236,7 +239,8 @@ if ($canoverridegrades or $cansetassessmentweight) {
// output starts here
$output = $PAGE->get_renderer('mod_workshop'); // workshop renderer
echo $output->header();
echo $output->heading(get_string('assessedsubmission', 'workshop'), 2);
echo $output->heading(format_string($workshop->name));
echo $output->heading(get_string('assessedsubmission', 'workshop'), 3);
$submission = $workshop->get_submission_by_id($submission->id); // reload so can be passed to the renderer
echo $output->render($workshop->prepare_submission($submission, has_capability('mod/workshop:viewauthornames', $workshop->context)));

View File

@ -74,7 +74,8 @@ if ($mform->is_cancelled()) {
// Output starts here
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('pluginname', 'workshopform_' . $workshop->strategy));
echo $OUTPUT->heading(format_string($workshop->name));
echo $OUTPUT->heading(get_string('pluginname', 'workshopform_' . $workshop->strategy), 3);
$mform->display();

View File

@ -54,6 +54,7 @@ $mform = $strategy->get_assessment_form($workshop->editform_url(), 'preview');
// output starts here
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('assessmentform', 'workshop'), 2);
echo $OUTPUT->heading(format_string($workshop->name));
echo $OUTPUT->heading(get_string('assessmentform', 'workshop'), 3);
$mform->display();
echo $OUTPUT->footer();

View File

@ -144,7 +144,8 @@ if ($mform->is_cancelled()) {
// output starts here
$output = $PAGE->get_renderer('mod_workshop'); // workshop renderer
echo $output->header();
echo $output->heading(get_string('assessedexample', 'workshop'), 2);
echo $output->heading(format_string($workshop->name));
echo $output->heading(get_string('assessedexample', 'workshop'), 3);
$example = $workshop->get_example_by_id($example->id); // reload so can be passed to the renderer
echo $output->render($workshop->prepare_example_submission(($example)));

View File

@ -74,7 +74,8 @@ $PAGE->navbar->add(get_string('examplecomparing', 'workshop'));
// Output starts here
$output = $PAGE->get_renderer('mod_workshop');
echo $output->header();
echo $output->heading(get_string('assessedexample', 'workshop'), 2);
echo $output->heading(format_string($workshop->name));
echo $output->heading(get_string('assessedexample', 'workshop'), 3);
echo $output->render($workshop->prepare_example_submission($example));

View File

@ -48,8 +48,8 @@ echo $OUTPUT->header();
/// Get all the appropriate data
if (! $workshops = get_all_instances_in_course('workshop', $course)) {
echo $OUTPUT->heading(get_string('noworkshops', 'workshop'), 2);
echo $OUTPUT->continue_button(new moodle_url('/course/view.php', array('id' => $course->id)));
echo $OUTPUT->heading(get_string('modulenameplural', 'workshop'));
notice(get_string('noworkshops', 'workshop'), new moodle_url('/course/view.php', array('id' => $course->id)));
echo $OUTPUT->footer();
die();
}
@ -84,7 +84,6 @@ foreach ($workshops as $workshop) {
$table->data[] = array($link);
}
}
echo $OUTPUT->heading(get_string('modulenameplural', 'workshop'), 2);
echo $OUTPUT->heading(get_string('modulenameplural', 'workshop'), 3);
echo html_writer::table($table);
echo $OUTPUT->footer();

View File

@ -99,7 +99,7 @@ class mod_workshop_renderer extends plugin_renderer_base {
$title = html_writer::link($submission->url, $title);
}
$o .= $this->output->heading($title, 3, 'title');
$o .= $this->output->heading($title, 3);
if (!$anonymous) {
$author = new stdclass();
@ -229,7 +229,7 @@ class mod_workshop_renderer extends plugin_renderer_base {
$classes = 'submission-full example';
$o .= $this->output->container_start($classes);
$o .= $this->output->container_start('header');
$o .= $this->output->heading(format_string($example->title), 3, 'title');
$o .= $this->output->container(format_string($example->title), array('class' => 'title'));
$o .= $this->output->container_end(); // end of header
$content = file_rewrite_pluginfile_urls($example->content, 'pluginfile.php', $this->page->context->id,

View File

@ -60,6 +60,7 @@ $PAGE->navbar->add(get_string('switchingphase', 'workshop'));
// Output starts here
//
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($workshop->name));
echo $OUTPUT->confirm(get_string('switchphase' . $phase . 'info', 'workshop'),
new moodle_url($PAGE->url, array('confirm' => 1)), $workshop->view_url());
echo $OUTPUT->footer();

View File

@ -371,7 +371,7 @@ case workshop::PHASE_ASSESSMENT:
print_collapsible_region_start('', 'workshop-viewlet-assignedassessments', get_string('assignedassessments', 'workshop'));
if (! $assessments = $workshop->get_assessments_by_reviewer($USER->id)) {
echo $output->box_start('generalbox assessment-none');
echo $output->heading(get_string('assignedassessmentsnone', 'workshop'), 3);
echo $output->notification(get_string('assignedassessmentsnone', 'workshop'));
echo $output->box_end();
} else {
$shownames = has_capability('mod/workshop:viewauthornames', $PAGE->context);