MDL-26047 - added new theme called Nimble
[moodle.git] / theme / nimble / 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 $hassidepost = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-post', $OUTPUT));
8 $showsidepost = ($hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT));
10 $custommenu = $OUTPUT->custom_menu();
11 $hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
13 $bodyclasses = array();
14   if ($showsidepost) {
15     $bodyclasses[] = 'side-post-only';
16 } else if (!$showsidepost) {
17     $bodyclasses[] = 'content-only';
18 }
19 if ($hascustommenu) {
20     $bodyclasses[] = 'has_custom_menu';
21 }
23 if (!empty($PAGE->theme->settings->footertext)) {
24     $footnote = $PAGE->theme->settings->footertext;
25 } else {
26     $footnote = '<!-- There was no custom footnote set -->';
27 }
30 echo $OUTPUT->doctype() ?>
31 <html <?php echo $OUTPUT->htmlattributes() ?>>
32 <head>
33     <title><?php echo $PAGE->title ?></title>
34     <link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
35     <?php echo $OUTPUT->standard_head_html() ?>
36 </head>
38 <body id="<?php echo $PAGE->bodyid ?>" class="<?php echo $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-wrap1">
46                 <div id="page-wrap2">
48                         <div id="wrapper" class="clearfix">
50 <!-- START OF HEADER -->
52                         <div id="page-header" class="inside">
53                                         <div id="page-header-wrapper" class="wrapper clearfix">
54                         
55                                         <?php if ($hasheading) { ?>
56                                             <div id="headermenus" class="shrinkwrapper clearfix">
57                                                     <?php if ($hascustommenu) { ?>
58                                                                         <div id="custommenu"><?php echo $custommenu; ?></div>
59                                                                 <?php } else { ?>
60                                                                         <div id="custommenu" style="line-height:1em;">&nbsp;</div> <!-- temporary until I find a better fix -->
61                                                                 <?php } ?>
63                                                                 <div class="headermenu">
64                                                                 <?php if (!empty($PAGE->layout_options['langmenu'])) {
65                                                                 echo $OUTPUT->lang_menu();
66                                                         }
67                                                         echo $OUTPUT->login_info();     
68                                                         echo $PAGE->headingmenu 
69                                                             ?>
70                                                         </div>
71                                             </div>
72                                     <?php } ?>
73                     
74                                 </div>
75                                 </div>
77 <!-- END OF HEADER -->
79         <?php } ?>
82 <!-- START OF CONTENT -->
84                 <div id="page-content-wrapper" class="shrinkwrapper clearfix">
85                     <div id="page-content">
86                     <div id="region-main-box">
87                             <div id="region-post-box">
88             
89                             <div id="region-main-wrap">
90                             <div id="region-main">
91                                     <div class="region-content">
93                                                                         <div id="region-header" class="inside clearfix">
94                                                                     <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
95                                                                 </div>
97                                                             <?php if ($hasnavbar) { ?>
98                                                                     <div class="navbar">
99                                                                         <div class="wrapper clearfix">
100                                                                             <div class="breadcrumb">
101                                                                                 <?php echo $OUTPUT->navbar(); ?>
102                                                                             </div>
103                                                                             <div class="navbutton">
104                                                                                 <?php echo $PAGE->button; ?>
105                                                                             </div>
106                                                                             </div>
107                                                                     </div>
108                                                                 <?php } ?>
109                                     
110                                     <?php echo core_renderer::MAIN_CONTENT_TOKEN ?>
111                                         </div>
112                                 </div>
113                             </div>
114                 
115                                 <?php if ($hassidepost) { ?>
116                             <div id="region-post" class="block-region">
117                                 <div id="region-post-wrap-1">
118                                         <div id="region-post-wrap-2">
119                                                     <div class="region-content">
120                                                     <?php echo $OUTPUT->blocks_for_region('side-post') ?>
121                                                     </div>
122                                                 </div>
123                                         </div>
124                                 </div>
125                             <?php } ?>
126                 
127                     </div>
128                     </div>
129                 </div>
130         </div>
132 <!-- END OF CONTENT -->
134         <?php if ($hasheading || $hasnavbar) { ?>
135                 </div>
137                 </div>
138         </div>
140                 
141         <?php } ?>
142         
143 <!-- START OF FOOTER -->
145         <?php if ($hasfooter) { ?>
146                     <div id="page-footer" class="wrapper">
147                          <?php echo $footnote ?>
148                         <p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
149                         <?php
150                                 echo $OUTPUT->login_info();
151                             echo $OUTPUT->home_link();
152                                 echo $OUTPUT->standard_footer_html();
153                         ?>
154                     </div>
155             <?php } ?>
156             
157 </div>
158 <?php echo $OUTPUT->standard_end_of_body_html() ?>
159 </body>
160 </html>