Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Commit

Permalink
MDL-41622 workshop mod: fix page heading levels.
Browse files Browse the repository at this point in the history
Also, changing couple of the sub header to use notification, which is more appropriate.
  • Loading branch information
Rossiani Wijaya committed Sep 17, 2013
1 parent 83f26f6 commit 764d7ba
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 14 deletions.
1 change: 1 addition & 0 deletions mod/workshop/allocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
//
$output = $PAGE->get_renderer('mod_workshop');
echo $output->header();
echo $OUTPUT->heading(format_string($workshop->name));

$allocators = workshop::installed_allocators();
if (!empty($allocators)) {
Expand Down
10 changes: 7 additions & 3 deletions mod/workshop/assessment.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@
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 {
Expand All @@ -114,7 +116,8 @@
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;
}
Expand Down Expand Up @@ -236,7 +239,8 @@
// 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)));
Expand Down
3 changes: 2 additions & 1 deletion mod/workshop/editform.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
// 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();

Expand Down
3 changes: 2 additions & 1 deletion mod/workshop/editformpreview.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

// 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();
3 changes: 2 additions & 1 deletion mod/workshop/exassessment.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@
// 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)));
Expand Down
3 changes: 2 additions & 1 deletion mod/workshop/excompare.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
// 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));

Expand Down
7 changes: 3 additions & 4 deletions mod/workshop/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
/// 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();
}
Expand Down Expand Up @@ -84,7 +84,6 @@
$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();
4 changes: 2 additions & 2 deletions mod/workshop/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected function render_workshop_submission(workshop_submission $submission) {
$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();
Expand Down Expand Up @@ -229,7 +229,7 @@ protected function render_workshop_example_submission(workshop_example_submissio
$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,
Expand Down
1 change: 1 addition & 0 deletions mod/workshop/switchphase.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
// 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();
2 changes: 1 addition & 1 deletion mod/workshop/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@
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);
Expand Down

0 comments on commit 764d7ba

Please sign in to comment.