MDL-36048 Modify themes to add course headers and footers provided by course format
[moodle.git] / theme / boxxie / layout / general.php
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 $bodyclasses = array();
13 if ($hassidepre && !$hassidepost) {
14     $bodyclasses[] = 'side-pre-only';
15 } else if ($hassidepost && !$hassidepre) {
16     $bodyclasses[] = 'side-post-only';
17 } else if (!$hassidepost && !$hassidepre) {
18     $bodyclasses[] = 'content-only';
19 }
21 if ($hascustommenu) {
22     $bodyclasses[] = 'has-custom-menu';
23 }
25 $courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
26 if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
27     $courseheader = $OUTPUT->course_header();
28     $coursecontentheader = $OUTPUT->course_content_header();
29     if (empty($PAGE->layout_options['nocoursefooter'])) {
30         $coursecontentfooter = $OUTPUT->course_content_footer();
31         $coursefooter = $OUTPUT->course_footer();
32     }
33 }
35 echo $OUTPUT->doctype() ?>
36 <html <?php echo $OUTPUT->htmlattributes() ?>>
37 <head>
38   <title><?php echo $PAGE->title; ?></title>
39   <link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
40   <?php echo $OUTPUT->standard_head_html() ?>
41 </head>
43 <body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
45 <?php echo $OUTPUT->standard_top_of_body_html() ?>
47 <?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
49 <div id="page-wrapper">
50   <div id="page" class="clearfix">
52     <div id="page-header" class="clearfix">
53       <?php if ($PAGE->heading) { ?>
54         <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
55         <div class="headermenu">
56           <?php echo $OUTPUT->login_info();
57           if (!empty($PAGE->layout_options['langmenu'])) {
58             echo $OUTPUT->lang_menu();
59           }
60           echo $PAGE->headingmenu; ?>
61         </div>
62       <?php } ?>
63       <?php if ($hascustommenu) { ?>
64       <div id="custommenu"><?php echo $custommenu; ?></div>
65       <?php } ?>
66     </div>
68  <div class="myclear"></div>
70       <?php if (!empty($courseheader)) { ?>
71         <div id="course-header"><?php echo $courseheader; ?></div>
72       <?php } ?>
74       <?php if ($hasnavbar) { ?>
75         <div class="navbar clearfix">
76           <div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
77           <div class="navbutton"> <?php echo $PAGE->button; ?></div>
78         </div>
79       <?php } ?>
81 <?php } ?>
83     <div id="page-content">
84         <div id="region-main-box">
85             <div id="region-post-box">
87                 <div id="region-main-wrap">
88                     <div id="region-main">
89                         <div class="region-content">
90                             <?php echo $coursecontentheader; ?>
91                             <?php echo $OUTPUT->main_content() ?>
92                             <?php echo $coursecontentfooter; ?>
93                         </div>
94                     </div>
95                 </div>
97                 <?php if ($hassidepre) { ?>
98                 <div id="region-pre">
99                     <div class="region-content">
100                         <?php echo $OUTPUT->blocks_for_region('side-pre') ?>
101                     </div>
102                 </div>
103                 <?php } ?>
105                 <?php if ($hassidepost) { ?>
106                 <div id="region-post">
107                     <div class="region-content">
108                         <?php echo $OUTPUT->blocks_for_region('side-post') ?>
109                     </div>
110                 </div>
111                 <?php } ?>
113             </div>
114         </div>
115     </div>
117     <div class="myclear"></div>
118     <?php if (!empty($coursefooter)) { ?>
119         <div id="course-footer"><?php echo $coursefooter; ?></div>
120     <?php } ?>
121 <?php if ($hasfooter) { ?>
123     <div id="page-footer" class="clearfix">
124       <p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
125       <?php echo $OUTPUT->login_info(); ?>
126     </div>
128 <?php }
130 if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
131    <div class="myclear"></div>
132   </div> <!-- END #page -->
134 </div> <!-- END #page-wrapper -->
136 <?php } ?>
138 <div id="page-footer-bottom">
140 <?php if ($hasfooter) {
142   echo $OUTPUT->home_link();
143   echo $OUTPUT->standard_footer_html();
145 } ?>
147 </div>
150 <?php echo $OUTPUT->standard_end_of_body_html() ?>
151 </body>
152 </html>