561ece539c21756cc5c67c9d644a77f02f9b4f6b
[moodle.git] / theme / standardold / 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 = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-pre', $OUTPUT));
7 $hassidepost = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-post', $OUTPUT));
9 $showsidepre = ($hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT));
10 $showsidepost = ($hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT));
12 $custommenu = $OUTPUT->custom_menu();
13 $hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
15 $courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
16 if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
17     $courseheader = $OUTPUT->course_header();
18     $coursecontentheader = $OUTPUT->course_content_header();
19     if (empty($PAGE->layout_options['nocoursefooter'])) {
20         $coursecontentfooter = $OUTPUT->course_content_footer();
21         $coursefooter = $OUTPUT->course_footer();
22     }
23 }
25 $bodyclasses = array();
26 if ($showsidepre && !$showsidepost) {
27     $bodyclasses[] = 'side-pre-only';
28 } else if ($showsidepost && !$showsidepre) {
29     $bodyclasses[] = 'side-post-only';
30 } else if (!$showsidepost && !$showsidepre) {
31     $bodyclasses[] = 'content-only';
32 }
33 if ($hascustommenu) {
34     $bodyclasses[] = 'has_custom_menu';
35 }
37 echo $OUTPUT->doctype() ?>
38 <html <?php echo $OUTPUT->htmlattributes() ?>>
39 <head>
40     <title><?php echo $PAGE->title ?></title>
41     <link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
42     <?php echo $OUTPUT->standard_head_html() ?>
43 </head>
44 <body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
45 <?php echo $OUTPUT->standard_top_of_body_html() ?>
46 <div id="page">
47 <?php if ($hasheading || $hasnavbar) { ?>
48     <div id="page-header">
49         <?php if ($hasheading) { ?>
50         <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
51         <div class="headermenu"><?php
52             echo $OUTPUT->login_info();
53             if (!empty($PAGE->layout_options['langmenu'])) {
54                 echo $OUTPUT->lang_menu();
55             }
56             echo $PAGE->headingmenu
57         ?></div><?php } ?>
58         <?php if ($hascustommenu) { ?>
59         <div id="custommenu"><?php echo $custommenu; ?></div>
60         <?php } ?>
61         <?php if (!empty($courseheader)) { ?>
62         <div id="course-header"><?php echo $courseheader; ?></div>
63         <?php } ?>
64         <?php if ($hasnavbar) { ?>
65             <div class="navbar clearfix">
66                 <div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
67                 <div class="navbutton"> <?php echo $PAGE->button; ?></div>
68             </div>
69         <?php } ?>
70     </div>
71 <?php } ?>
72 <!-- END OF HEADER -->
74     <div id="page-content">
75         <table id="region-main-box" class="layout-table" summary="layout">
76             <tr id="region-post-box">
77                 <?php if ($hassidepre) { ?>
78                 <td id="region-pre" class="block-region">
79                     <div class="region-content">
80                             <?php echo $OUTPUT->blocks_for_region('side-pre') ?>
81                     </div>
82                 </td>
83                 <?php } ?>
84                 <td id="region-main-wrap">
85                     <div id="region-main">
86                         <div class="region-content">
87                             <?php echo $coursecontentheader; ?>
88                             <?php echo $OUTPUT->main_content() ?>
89                             <?php echo $coursecontentfooter; ?>
90                         </div>
91                     </div>
92                 </td>
93                 <?php if ($hassidepost) { ?>
94                 <td id="region-post" class="block-region">
95                     <div class="region-content">
96                         <?php echo $OUTPUT->blocks_for_region('side-post') ?>
97                     </div>
98                 </td>
99                 <?php } ?>
100             </tr>
101         </table>
102     </div>
103     <?php if (!empty($coursefooter)) { ?>
104     <div id="course-footer"><?php echo $coursefooter; ?></div>
105     <?php } ?>
107 <!-- START OF FOOTER -->
108     <?php if ($hasfooter) { ?>
109     <div id="page-footer" class="clearfix">
110         <p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
111         <?php
112         echo $OUTPUT->login_info();
113         echo $OUTPUT->home_link();
114         echo $OUTPUT->standard_footer_html();
115         ?>
116     </div>
117     <?php } ?>
118 </div>
119 <?php echo $OUTPUT->standard_end_of_body_html() ?>
120 </body>
121 </html>