Skip to content

Commit

Permalink
themes: MDL-19077 new $OUTPUT->header/footer to replace print_header/…
Browse files Browse the repository at this point in the history
…footer.

Also, part of the change from weblib.php functions to $OUTPUT-> methods.

This is part of http://docs.moodle.org/en/Development:Theme_engines_for_Moodle%3F

This is a big change, and the result is not perfect yet. Expect some debugging output
on some pages.

The main part of these changes are that $OUTPUT->header now looks for a file
in the theme called layout.php, rather than header.html and footer.html. Also
you can have special templates for certain pages like layout-home.php. There is
fallback code for Moodle 1.9 themes, so they still work.

A few of the old arguments to print_header are no longer supported. (You get an
exception if you try to use them.) Sam H will be cleaning those up.

All the weblib functions that have been replaced with $OUTPUT-> have version in
deprecatedlib, so existing code will go on working for the foreseeable future.
  • Loading branch information
tjhunt committed Jun 26, 2009
1 parent 520cea9 commit 34a2777
Show file tree
Hide file tree
Showing 31 changed files with 1,724 additions and 858 deletions.
1 change: 0 additions & 1 deletion admin/report/unittest/test_tables.php
Expand Up @@ -35,7 +35,6 @@
$CFG->config_php_settings = $real_cfg->config_php_settings;
$CFG->frametarget = $real_cfg->frametarget;
$CFG->framename = $real_cfg->framename;
$CFG->footer = $real_cfg->footer;
$CFG->debug = 0;

$DB = moodle_database::get_driver_instance($CFG->dbtype, $CFG->dblibrary);
Expand Down
2 changes: 1 addition & 1 deletion course/view.php
Expand Up @@ -255,6 +255,6 @@
}


print_footer(NULL, $course);
print_footer();

?>
4 changes: 2 additions & 2 deletions grade/lib.php
Expand Up @@ -811,7 +811,7 @@ public function __construct($id, $link, $string, $parent=null) {
* @return string HTML code or nothing if $return == false
*/
function print_grade_page_head($courseid, $active_type, $active_plugin=null,
$heading = false, $return=false, $bodytags='',
$heading = false, $return=false,
$buttons=false, $extracss=array()) {
global $CFG, $COURSE;
$strgrades = get_string('grades');
Expand Down Expand Up @@ -867,7 +867,7 @@ function print_grade_page_head($courseid, $active_type, $active_plugin=null,
}

$returnval = print_header_simple($strgrades . ': ' . $stractive_type, $title, $navigation, '',
$bodytags, true, $buttons, navmenu($COURSE), false, '', $return);
'', true, $buttons, navmenu($COURSE), false, '', $return);

// Guess heading if not given explicitly
if (!$heading) {
Expand Down
2 changes: 1 addition & 1 deletion grade/report/grader/index.php
Expand Up @@ -130,7 +130,7 @@

// make sure separate group does not prevent view
if ($report->currentgroup == -2) {
print_grade_page_head($COURSE->id, 'report', 'grader', $reportname, false, null, $buttons);
print_grade_page_head($COURSE->id, 'report', 'grader', $reportname, false, $buttons);
print_heading(get_string("notingroup"));
print_footer($course);
exit;
Expand Down
7 changes: 3 additions & 4 deletions index.php
Expand Up @@ -96,15 +96,14 @@
$PAGE->set_other_editing_capability('moodle/course:manageactivities');
$PAGE->set_url('');
$PAGE->set_docs_path('');
$PAGE->set_generaltype('home');
$pageblocks = blocks_setup($PAGE);
$editing = $PAGE->user_is_editing();
$preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),
BLOCK_L_MAX_WIDTH);
$preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
BLOCK_R_MAX_WIDTH);
print_header($SITE->fullname, $SITE->fullname, 'home', '',
'<meta name="description" content="'. strip_tags(format_text($SITE->summary, FORMAT_HTML)) .'" />',
true, '', user_login_string($SITE).$langmenu);
print_header($SITE->fullname, $SITE->fullname, 'home', '', '', true, '', user_login_string($SITE).$langmenu);

?>

Expand Down Expand Up @@ -277,5 +276,5 @@


<?php
print_footer('home'); // Please do not modify this line
print_footer();
?>

0 comments on commit 34a2777

Please sign in to comment.