MDL-41566 page resource: fix page heading levels.
authorRossiani Wijaya <rwijaya@moodle.com>
Thu, 5 Sep 2013 03:39:02 +0000 (11:39 +0800)
committerRossiani Wijaya <rwijaya@moodle.com>
Mon, 9 Sep 2013 02:19:11 +0000 (10:19 +0800)
Also removing printheading options setting.

mod/page/backup/moodle1/lib.php
mod/page/index.php
mod/page/lang/en/page.php
mod/page/lib.php
mod/page/mod_form.php
mod/page/settings.php
mod/page/tests/generator/lib.php
mod/page/view.php

index 468cd34..51b8a2f 100644 (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']);
index 9843372..6383083 100644 (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;
index 11707f0..605f664 100644 (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?';
index 9216337..f2cf884 100644 (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);
index 6d576f4..d982d7a 100644 (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'];
             }
index 208e51f..b622d35 100644 (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',
index 533c9ff..f788391 100644 (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;
         }
index e04a2ec..73e72e1 100644 (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))) {