MDL-41566 page resource: fix page heading levels.

Also removing printheading options setting.
This commit is contained in:
Rossiani Wijaya 2013-09-05 11:39:02 +08:00
parent 3b42864d65
commit 4e5f53e90e
8 changed files with 5 additions and 29 deletions

View File

@ -73,7 +73,7 @@ class moodle1_mod_page_handler extends moodle1_resource_successor_handler {
$page['timemodified'] = $data['timemodified'];
// populate display and displayoptions fields
$options = array('printheading' => 0, 'printintro' => 0);
$options = array('printintro' => 0);
if ($data['popup']) {
$page['display'] = RESOURCELIB_DISPLAY_POPUP;
$rawoptions = explode(',', $data['popup']);

View File

@ -47,7 +47,7 @@ $PAGE->set_title($course->shortname.': '.$strpages);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add($strpages);
echo $OUTPUT->header();
echo $OUTPUT->heading($strpages);
if (!$pages = get_all_instances_in_course('page', $course)) {
notice(get_string('thereareno', 'moodle', $strpages), "$CFG->wwwroot/course/view.php?id=$course->id");
exit;

View File

@ -57,7 +57,5 @@ $string['popupheight'] = 'Pop-up height (in pixels)';
$string['popupheightexplain'] = 'Specifies default height of popup windows.';
$string['popupwidth'] = 'Pop-up width (in pixels)';
$string['popupwidthexplain'] = 'Specifies default width of popup windows.';
$string['printheading'] = 'Display page name';
$string['printheadingexplain'] = 'Display page name above content?';
$string['printintro'] = 'Display page description';
$string['printintroexplain'] = 'Display page description above content?';

View File

@ -97,7 +97,6 @@ function page_add_instance($data, $mform = null) {
$displayoptions['popupwidth'] = $data->popupwidth;
$displayoptions['popupheight'] = $data->popupheight;
}
$displayoptions['printheading'] = $data->printheading;
$displayoptions['printintro'] = $data->printintro;
$data->displayoptions = serialize($displayoptions);
@ -143,7 +142,6 @@ function page_update_instance($data, $mform) {
$displayoptions['popupwidth'] = $data->popupwidth;
$displayoptions['popupheight'] = $data->popupheight;
}
$displayoptions['printheading'] = $data->printheading;
$displayoptions['printintro'] = $data->printintro;
$data->displayoptions = serialize($displayoptions);
@ -510,7 +508,6 @@ function page_dndupload_handle($uploadinfo) {
$data->display = $config->display;
$data->popupheight = $config->popupheight;
$data->popupwidth = $config->popupwidth;
$data->printheading = $config->printheading;
$data->printintro = $config->printintro;
return page_add_instance($data, null);

View File

@ -89,8 +89,6 @@ class mod_page_mod_form extends moodleform_mod {
$mform->setDefault('popupheight', $config->popupheight);
}
$mform->addElement('advcheckbox', 'printheading', get_string('printheading', 'page'));
$mform->setDefault('printheading', $config->printheading);
$mform->addElement('advcheckbox', 'printintro', get_string('printintro', 'page'));
$mform->setDefault('printintro', $config->printintro);
@ -126,9 +124,6 @@ class mod_page_mod_form extends moodleform_mod {
if (isset($displayoptions['printintro'])) {
$default_values['printintro'] = $displayoptions['printintro'];
}
if (isset($displayoptions['printheading'])) {
$default_values['printheading'] = $displayoptions['printheading'];
}
if (!empty($displayoptions['popupwidth'])) {
$default_values['popupwidth'] = $displayoptions['popupwidth'];
}

View File

@ -42,8 +42,6 @@ if ($ADMIN->fulltree) {
//--- modedit defaults -----------------------------------------------------------------------------------
$settings->add(new admin_setting_heading('pagemodeditdefaults', get_string('modeditdefaults', 'admin'), get_string('condifmodeditdefaults', 'admin')));
$settings->add(new admin_setting_configcheckbox('page/printheading',
get_string('printheading', 'page'), get_string('printheadingexplain', 'page'), 1));
$settings->add(new admin_setting_configcheckbox('page/printintro',
get_string('printintro', 'page'), get_string('printintroexplain', 'page'), 0));
$settings->add(new admin_setting_configselect('page/display',

View File

@ -78,9 +78,6 @@ class mod_page_generator extends testing_module_generator {
} else {
$record->cmidnumber = '';
}
if (!isset($record->printheading)) {
$record->printheading = 1;
}
if (!isset($record->printintro)) {
$record->printintro = 0;
}

View File

@ -65,23 +65,14 @@ $options = empty($page->displayoptions) ? array() : unserialize($page->displayop
if ($inpopup and $page->display == RESOURCELIB_DISPLAY_POPUP) {
$PAGE->set_pagelayout('popup');
$PAGE->set_title($course->shortname.': '.$page->name);
if (!empty($options['printheading'])) {
$PAGE->set_heading($page->name);
} else {
$PAGE->set_heading('');
}
echo $OUTPUT->header();
$PAGE->set_heading(format_string($course->fullname));
} else {
$PAGE->set_title($course->shortname.': '.$page->name);
$PAGE->set_heading($course->fullname);
$PAGE->set_activity_record($page);
echo $OUTPUT->header();
if (!empty($options['printheading'])) {
echo $OUTPUT->heading(format_string($page->name), 2, 'main', 'pageheading');
}
}
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($page->name), 2);
if (!empty($options['printintro'])) {
if (trim(strip_tags($page->intro))) {