ff182479f9ec7d0ef7d7c5bf596c479dde72da44
[moodle.git] / theme / sky_high / layout / general.php
1 <?php
3 $hassidepre = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-pre', $OUTPUT));
4 $hassidepost = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-post', $OUTPUT));
5 $hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
6 $hasfooter = (empty($PAGE->layout_options['nofooter']));
7 $showsidepre = ($hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $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 ($showsidepre && !$showsidepost) {
15     $bodyclasses[] = 'side-pre-only';
16 } else if ($showsidepost && !$showsidepre) {
17     $bodyclasses[] = 'side-post-only';
18 } else if (!$showsidepost && !$showsidepre) {
19     $bodyclasses[] = 'content-only';
20 }
21 if ($hassidepre || $hassidepost) {
22         $bodyclasses[] = 'background';
23 }
25 if (!empty($PAGE->theme->settings->logo)) {
26     $logourl = $PAGE->theme->settings->logo;
27 } else {
28     $logourl = NULL;
29 }
31 if (!empty($PAGE->theme->settings->footnote)) {
32     $footnote = $PAGE->theme->settings->footnote;
33 } else {
34     $footnote = '<!-- There was no custom footnote set -->';
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     <meta name="description" content="<?php p(strip_tags(format_text($SITE->summary, FORMAT_HTML))) ?>" />
43     <?php echo $OUTPUT->standard_head_html() ?>
44 </head>
45 <body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
46 <?php echo $OUTPUT->standard_top_of_body_html() ?>
48 <div id="page">
49         <div id="wrapper" class="clearfix">
51 <!-- START OF HEADER -->
53     <div id="page-header" class="clearfix">
54                 <div id="page-header-wrapper">
55                         <?php if($logourl == NULL) { ?>
56                          <h1 class="headermain">
57                         <?php echo $PAGE->heading ?>
58                 </h1>
59                 <?php } else { ?>
60                <img class="logo" src="<?php echo $logourl;?>" alt="Custom logo here" /><h1 class="headerwlogo">- <?php echo $PAGE->heading ?></h1>
61                 <?php } ?>
64             <div class="headermenu">
65                         <?php
66                                 echo $OUTPUT->login_info();
67                                         if (!empty($PAGE->layout_options['langmenu'])) {
68                                         echo $OUTPUT->lang_menu();
69                                     }
70                                 echo $PAGE->headingmenu
71                                 ?>
72                 </div>
73             </div>
74     </div>
76 <!-- END OF HEADER -->
78 <!-- START OF CONTENT -->
79 <?php if ($hascustommenu) { ?>
80       <div id="custommenu"><?php echo $custommenu; ?></div>
81 <?php } ?>
82 <div class="navbar clearfix">
83             <?php if ($hasnavbar) { ?>
84             <div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
85             <div class="navbutton"> <?php echo $PAGE->button; ?></div>
86             <?php } ?>
87       </div>
92 <div id="page-content-wrapper">
93     <div id="page-content">
94         <div id="region-main-box">
95             <div id="region-post-box">
97                 <div id="region-main-wrap">
98                     <div id="region-main">
99                         <div class="region-content">
100                             <?php echo $OUTPUT->main_content() ?>
101                         </div>
102                     </div>
103                 </div>
105                 <?php if ($hassidepre) { ?>
106                 <div id="region-pre" class="block-region">
107                     <div class="region-content">
108                         <?php echo $OUTPUT->blocks_for_region('side-pre') ?>
109                     </div>
110                 </div>
111                 <?php } ?>
113                 <?php if ($hassidepost) { ?>
114                 <div id="region-post" class="block-region">
115                     <div class="region-content">
116                         <?php echo $OUTPUT->blocks_for_region('side-post') ?>
117                     </div>
118                 </div>
119                 <?php } ?>
121             </div>
122         </div>
123     </div>
124 </div>
126 <!-- END OF CONTENT -->
128 </div>
130 <!-- END OF WRAPPER -->
132 <!-- START OF FOOTER -->
133         <?php if ($hasfooter) { ?>
134         <div id="page-footer">
136 <!-- START OF FOOTER-INNER -->
138                 <div id="page-footer-inner">
139                         <div class="footnote"><?php echo $footnote; ?></div>
140                         <?php
141                         echo $OUTPUT->login_info();
142                         ?>
143                 </div>
145 <!-- END OF FOOTER-INNER -->
147                 <p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')); ?></p>
148                 <?php echo $OUTPUT->home_link(); ?>
149                 <?php echo $OUTPUT->standard_footer_html(); ?>
152         </div>
153         <?php } ?>
155 <!-- END OF FOOTER -->
157 </div>
159 <!-- END OF PAGE -->
160 <?php echo $OUTPUT->standard_end_of_body_html() ?>
161 </body>
162 </html>