MDL-36339 Modify themes to add course headers and footers provided by course format
[moodle.git] / theme / formfactor / layout / general.php
bloba33ecd3b0b18be6e5b43e8e9de5ccaed8302d7d1
1 <?php
3 $hasheading = ($PAGE->heading);
4 $hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
5 $hasfooter = (empty($PAGE->layout_options['nofooter']));
6 $hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
7 $hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
9 $custommenu = $OUTPUT->custom_menu();
10 $hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
12 $courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
13 if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
14 $courseheader = $OUTPUT->course_header();
15 $coursecontentheader = $OUTPUT->course_content_header();
16 if (empty($PAGE->layout_options['nocoursefooter'])) {
17 $coursecontentfooter = $OUTPUT->course_content_footer();
18 $coursefooter = $OUTPUT->course_footer();
22 $bodyclasses = array();
23 if ($hassidepre && !$hassidepost) {
24 $bodyclasses[] = 'side-pre-only';
25 } else if ($hassidepost && !$hassidepre) {
26 $bodyclasses[] = 'side-post-only';
27 } else if (!$hassidepost && !$hassidepre) {
28 $bodyclasses[] = 'content-only';
31 echo $OUTPUT->doctype() ?>
32 <html <?php echo $OUTPUT->htmlattributes() ?>>
33 <head>
34 <title><?php echo $PAGE->title ?></title>
35 <link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
36 <?php echo $OUTPUT->standard_head_html() ?>
37 </head>
38 <body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
39 <?php echo $OUTPUT->standard_top_of_body_html() ?>
41 <div id="page">
43 <?php if ($hasheading || $hasnavbar) { ?>
45 <div id="page-header" class="clearfix">
46 <div id="page-header-wrapper">
48 <?php if ($hasheading) { ?>
49 <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
50 <div class="headermenu">
51 <?php
52 echo $OUTPUT->login_info();
53 if (!empty($PAGE->layout_options['langmenu'])) {
54 echo $OUTPUT->lang_menu();
56 echo $PAGE->headingmenu
58 </div>
59 <?php } ?>
61 </div>
62 </div>
64 <?php if ($hasheading) { ?>
65 <?php if ($hascustommenu) { ?>
66 <div id="custommenu"><?php echo $custommenu; ?></div>
67 <?php } else { ?>
68 <ul id="page-navigation" class="clearfix">
69 <li>&nbsp;</li>
70 </ul>
71 <?php } ?>
72 <?php } ?>
74 <?php if (!empty($courseheader)) { ?>
75 <div id="course-header"><?php echo $courseheader; ?></div>
76 <?php } ?>
78 <?php if ($hasnavbar) { ?>
79 <div class="navbar clearfix">
80 <div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
81 <div class="navbutton"> <?php echo $PAGE->button; ?></div>
82 </div>
83 <?php } ?>
85 <?php } ?>
86 <!-- END OF HEADER -->
88 <div id="page-content-wrapper">
89 <div id="page-content">
90 <div id="region-main-box">
91 <div id="region-post-box">
93 <div id="region-main-wrap">
94 <div id="region-main">
95 <div class="region-content">
96 <?php echo $coursecontentheader; ?>
97 <?php echo $OUTPUT->main_content() ?>
98 <?php echo $coursecontentfooter; ?>
99 </div>
100 </div>
101 </div>
103 <?php if ($hassidepre) { ?>
104 <div id="region-pre">
105 <div class="region-content">
106 <?php echo $OUTPUT->blocks_for_region('side-pre') ?>
107 </div>
108 </div>
109 <?php } ?>
111 <?php if ($hassidepost) { ?>
112 <div id="region-post">
113 <div class="region-content">
114 <?php echo $OUTPUT->blocks_for_region('side-post') ?>
115 </div>
116 </div>
117 <?php } ?>
119 </div>
120 </div>
121 </div>
122 </div>
124 <?php if (!empty($coursefooter)) { ?>
125 <div id="course-footer"><?php echo $coursefooter; ?></div>
126 <?php } ?>
128 <!-- START OF FOOTER -->
129 <?php if ($hasfooter) { ?>
130 <div id="page-footer" class="clearfix">
131 <p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
132 <?php
133 echo $OUTPUT->login_info();
134 echo $OUTPUT->home_link();
135 echo $OUTPUT->standard_footer_html();
137 </div>
138 <?php } ?>
139 </div>
140 <?php echo $OUTPUT->standard_end_of_body_html() ?>
141 </body>
142 </html>