themes lib MDL-24895 Multiple fixes to better handle overflow.
[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 $showsidepre = ($hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT));
7 $showsidepost = ($hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT));
9 $custommenu = $OUTPUT->custom_menu();
10 $hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
12 $bodyclasses = array();
13 if ($showsidepre && !$showsidepost) {
14     $bodyclasses[] = 'side-pre-only';
15 } else if ($showsidepost && !$showsidepre) {
16     $bodyclasses[] = 'side-post-only';
17 } else if (!$showsidepost && !$showsidepre) {
18     $bodyclasses[] = 'content-only';
19 }
20 if ($hassidepre || $hassidepost) {
21         $bodyclasses[] = 'background';
22 }
24 if (!empty($PAGE->theme->settings->logo)) {
25     $logourl = $PAGE->theme->settings->logo;
26 } else {
27     $logourl = NULL;
28 }
30 if (!empty($PAGE->theme->settings->footnote)) {
31     $footnote = $PAGE->theme->settings->footnote;
32 } else {
33     $footnote = '<!-- There was no custom footnote set -->';
34 }
36 echo $OUTPUT->doctype() ?>
37 <html <?php echo $OUTPUT->htmlattributes() ?>>
38 <head>
39     <title><?php echo $PAGE->title ?></title>
40     <link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
41     <meta name="description" content="<?php echo strip_tags(format_text($SITE->summary, FORMAT_HTML)) ?>" />
42     <?php echo $OUTPUT->standard_head_html() ?>
43 </head>
44 <body id="<?php echo $PAGE->bodyid ?>" class="<?php echo $PAGE->bodyclasses.' '.join(' ', $bodyclasses) ?>">
45 <?php echo $OUTPUT->standard_top_of_body_html() ?>
47 <div id="page">
48         <div id="wrapper" class="clearfix">
49         
50 <!-- START OF HEADER -->
51    
52     <div id="page-header" class="clearfix">
53                 <div id="page-header-wrapper">
54                         <?php if($logourl == NULL) { ?>
55                          <h1 class="headermain">
56                         <?php echo $PAGE->heading ?>
57                 </h1>
58                 <?php } else { ?>
59                <img class="logo" src="<?php echo $logourl;?>" alt="Custom logo here" /><h1 class="headerwlogo">- <?php echo $PAGE->heading ?></h1>
60                 <?php } ?>
61               
62                 
63             <div class="headermenu">
64                         <?php
65                                 echo $OUTPUT->login_info();
66                                         if (!empty($PAGE->layout_options['langmenu'])) {
67                                         echo $OUTPUT->lang_menu();
68                                     }
69                                 echo $PAGE->headingmenu
70                                 ?>
71                 </div>
72             </div>
73     </div>
74           
75 <!-- END OF HEADER -->
77 <!-- START OF CONTENT -->
78 <?php if ($hascustommenu) { ?>
79       <div id="custommenu"><?php echo $custommenu; ?></div>
80 <?php } ?>
81 <div class="navbar clearfix">
82             <?php if ($hasnavbar) { ?>
83             <div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
84             <div class="navbutton"> <?php echo $PAGE->button; ?></div>
85             <?php } ?>
86       </div>
88         
89         
90         
91 <div id="page-content-wrapper">
92     <div id="page-content">
93         <div id="region-main-box">
94             <div id="region-post-box">
95             
96                 <div id="region-main-wrap">
97                     <div id="region-main">
98                         <div class="region-content">
99                             <?php echo core_renderer::MAIN_CONTENT_TOKEN ?>
100                         </div>
101                     </div>
102                 </div>
103                 
104                 <?php if ($hassidepre) { ?>
105                 <div id="region-pre" class="block-region">
106                     <div class="region-content">
107                         <?php echo $OUTPUT->blocks_for_region('side-pre') ?>
108                     </div>
109                 </div>
110                 <?php } ?>
111                 
112                 <?php if ($hassidepost) { ?>
113                 <div id="region-post" class="block-region">
114                     <div class="region-content">
115                         <?php echo $OUTPUT->blocks_for_region('side-post') ?>
116                     </div>
117                 </div>
118                 <?php } ?>
119                 
120             </div>
121         </div>
122     </div>
123 </div>
125 <!-- END OF CONTENT -->
127         
129 <!-- START OF FOOTER -->
131     <div id="page-footer">
132                 <div class="footnote"><?php echo $footnote; ?></div>
133         <?php
134         echo $OUTPUT->login_info();
135         echo $OUTPUT->standard_footer_html();
136         ?>
137     </div>
139 <!-- END OF FOOTER -->
140 </div>
141 </div>
142         <p class="helplink">
143         <?php echo page_doc_link(get_string('moodledocslink')) ?>
144     </p><center>
145         <?php 
146         echo $OUTPUT->home_link();
147         echo $OUTPUT->standard_end_of_body_html() ?>
148 </center>
149 </body>
150 </html>