MDL-40255 theme_boxxie/theme_formfactor: Added block-region class to layout files...
[moodle.git] / theme / formfactor / 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 echo $OUTPUT->doctype() ?>
22 <html <?php echo $OUTPUT->htmlattributes() ?>>
23 <head>
24     <title><?php echo $PAGE->title ?></title>
25     <link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
26     <?php echo $OUTPUT->standard_head_html() ?>
27 </head>
28 <body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
29 <?php echo $OUTPUT->standard_top_of_body_html() ?>
31 <div id="page">
33 <?php if ($hasheading || $hasnavbar) { ?>
35     <div id="page-header" class="clearfix">
36         <div id="page-header-wrapper">
38             <?php if ($hasheading) { ?>
39                 <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
40                 <div class="headermenu">
41                     <?php
42                         echo $OUTPUT->login_info();
43                         if (!empty($PAGE->layout_options['langmenu'])) {
44                             echo $OUTPUT->lang_menu();
45                         }
46                         echo $PAGE->headingmenu
47                     ?>
48                 </div>
49             <?php } ?>
51         </div>
52     </div>
54     <?php if ($hasheading) { ?>
55       <?php if ($hascustommenu) { ?>
56         <div id="custommenu"><?php echo $custommenu; ?></div>
57       <?php } else { ?>
58         <ul id="page-navigation" class="clearfix">
59           <li>&nbsp;</li>
60         </ul>
61       <?php } ?>
62     <?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 } ?>
71 <?php } ?>
72 <!-- END OF HEADER -->
74 <div id="page-content-wrapper">
75     <div id="page-content">
76         <div id="region-main-box">
77             <div id="region-post-box">
79                 <div id="region-main-wrap">
80                     <div id="region-main">
81                         <div class="region-content">
82                             <?php echo $OUTPUT->main_content() ?>
83                         </div>
84                     </div>
85                 </div>
87                 <?php if ($hassidepre) { ?>
88                 <div id="region-pre" class="block-region">
89                     <div class="region-content">
90                         <?php echo $OUTPUT->blocks_for_region('side-pre') ?>
91                     </div>
92                 </div>
93                 <?php } ?>
95                 <?php if ($hassidepost) { ?>
96                 <div id="region-post" class="block-region">
97                     <div class="region-content">
98                         <?php echo $OUTPUT->blocks_for_region('side-post') ?>
99                     </div>
100                 </div>
101                 <?php } ?>
103             </div>
104         </div>
105     </div>
106 </div>
108 <!-- START OF FOOTER -->
109     <?php if ($hasfooter) { ?>
110     <div id="page-footer" class="clearfix">
111         <p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
112         <?php
113         echo $OUTPUT->login_info();
114         echo $OUTPUT->home_link();
115         echo $OUTPUT->standard_footer_html();
116         ?>
117     </div>
118     <?php } ?>
119 </div>
120 <?php echo $OUTPUT->standard_end_of_body_html() ?>
121 </body>
122 </html>