MDL-29614 theme_formal_white: Change the way Formal White theme shrinks pages
[moodle.git] / theme / formal_white / layout / general.php
CommitLineData
57bfc29a
AB
1<?php
2
4afb01db 3defined('MOODLE_INTERNAL') || die();
4
5$hasheading = $PAGE->heading;
57bfc29a
AB
6$hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
7$hasfooter = (empty($PAGE->layout_options['nofooter']));
57bfc29a 8
4afb01db 9$hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
10$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
11
12$showsidepre = $hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT);
13$showsidepost = $hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT);
57bfc29a
AB
14
15$custommenu = $OUTPUT->custom_menu();
16$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
17
18$bodyclasses = array();
19if ($showsidepre && !$showsidepost) {
20 $bodyclasses[] = 'side-pre-only';
21} else if ($showsidepost && !$showsidepre) {
22 $bodyclasses[] = 'side-post-only';
23} else if (!$showsidepost && !$showsidepre) {
24 $bodyclasses[] = 'content-only';
25}
4afb01db 26
57bfc29a
AB
27if ($hascustommenu) {
28 $bodyclasses[] = 'has_custom_menu';
29}
30
4afb01db 31/************************************************************************************************/
57bfc29a
AB
32if (!empty($PAGE->theme->settings->logo)) {
33 $logourl = $PAGE->theme->settings->logo;
34} else {
4afb01db 35 $logourl = $OUTPUT->pix_url('logo_small', 'theme');
57bfc29a
AB
36}
37
4afb01db 38$hasframe = !isset($PAGE->theme->settings->noframe) || !$PAGE->theme->settings->noframe;
39
40$displaylogo = !isset($PAGE->theme->settings->displaylogo) || $PAGE->theme->settings->displaylogo;
41/************************************************************************************************/
57bfc29a
AB
42
43echo $OUTPUT->doctype() ?>
44<html <?php echo $OUTPUT->htmlattributes() ?>>
45<head>
46 <title><?php echo $PAGE->title ?></title>
47 <link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
48 <?php echo $OUTPUT->standard_head_html() ?>
49</head>
0ae36f66 50<body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
1bc47427
K
51 <?php echo $OUTPUT->standard_top_of_body_html(); ?>
52 <div id="page">
53
54 <?php if ($hasframe) { ?>
55 <div id="frametop">
56 <div id="framebottom">
57 <div id="frametopright">
58 <div>&nbsp;</div>
59 </div>
60 <div id="frameleft">
61 <div id="frameright">
62 <div id="wrapper">
4afb01db 63<?php } ?>
57bfc29a 64
4afb01db 65<!-- begin of page-header -->
1bc47427
K
66 <?php if ($hasheading) { ?>
67 <div id="page-header">
68 <?php if ($displaylogo) { ?>
69 <div id="headerlogo">
70 <img src="<?php echo $logourl ?>" alt="Custom logo here" />
71 </div>
72 <?php } else { ?>
73 <h1 class="headerheading"><?php echo $PAGE->heading ?></h1>
74 <?php } ?>
75
76 <div class="headermenu">
77 <?php
78 echo $OUTPUT->login_info();
79 if (($CFG->langmenu) && (!empty($PAGE->layout_options['langmenu']))) {
80 echo $OUTPUT->lang_menu();
81 }
82 echo $PAGE->headingmenu;
83 ?>
84 </div>
85 </div>
86 <?php } ?>
4afb01db 87<!-- end of page-header -->
88
89<!-- begin of custom menu -->
1bc47427
K
90 <?php if ($hascustommenu) { ?>
91 <div id="custommenu"><?php echo $custommenu; ?></div>
92 <?php } ?>
4afb01db 93<!-- end of custom menu -->
94
95<!-- begin of navigation bar -->
1bc47427
K
96 <?php if ($hasnavbar) { ?>
97 <div class="navbar clearfix">
98 <div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
99 <div class="navbutton"><?php echo $PAGE->button; ?></div>
100 </div>
101 <?php } ?>
4afb01db 102<!-- end of navigation bar -->
103
104<!-- start of moodle content -->
1bc47427
K
105 <div id="page-content">
106 <div id="region-main-box">
107 <div id="region-post-box">
108
109 <!-- main mandatory content of the moodle page -->
110 <div id="region-main-wrap">
111 <div id="region-main">
112 <div class="region-content">
113 <?php echo $OUTPUT->main_content() ?>
114 </div>
115 </div>
116 </div>
117 <!-- end of main mandatory content of the moodle page -->
118
119
120 <!-- left column block - diplayed only if... -->
121 <?php if ($hassidepre) { ?>
122 <div id="region-pre" class="block-region">
123 <div class="region-content">
124 <?php echo $OUTPUT->blocks_for_region('side-pre') ?>
125 </div>
126 </div>
127 <?php } ?>
128 <!-- end of left column block - diplayed only if... -->
129
130 <!-- right column block - diplayed only if... -->
131 <?php if ($hassidepost) { ?>
132 <div id="region-post" class="block-region">
133 <div class="region-content">
134 <?php echo $OUTPUT->blocks_for_region('side-post') ?>
135 </div>
136 </div>
137 <?php } ?>
138 <!-- end of right column block - diplayed only if... -->
139
140 </div>
57bfc29a 141 </div>
57bfc29a 142 </div>
4afb01db 143<!-- end of moodle content -->
144
1bc47427 145 <div class="clearfix"></div>
4afb01db 146
147<?php if ($hasframe) { ?>
1bc47427
K
148 </div> <!-- </wrapper> -->
149 </div> <!-- </frameright> -->
150 </div> <!-- </frameleft> -->
151 <div id="framebottomright">
152 <div>&nbsp;</div>
153 </div>
154 </div> <!-- </framebottom> -->
155 </div> <!-- </frametop> -->
4afb01db 156
157<?php }
158
4afb01db 159if ($hasfooter) {
160 if ($hasframe) { ?>
161
162 <!-- START OF FOOTER -->
163 <div id="page-footer">
1bc47427 164 <?php if (!empty($PAGE->theme->settings->footnote)) { ?>
e1f517fc
SH
165 <div id="footerframetop">
166 <div id="footerframebottom">
167 <div id="footerframetopright">
168 <div>&nbsp;</div>
169 </div>
170 <div id="footerframeleft">
171 <div id="footerframeright">
1bc47427 172
e1f517fc
SH
173 <!-- the content to show -->
174 <div id="footerwrapper">
175 <?php echo $PAGE->theme->settings->footnote; ?>
1bc47427
K
176 </div> <!-- </footerwrapper> -->
177
178 </div> <!-- </footerframeright> -->
179 </div> <!-- </footerframeleft> -->
e1f517fc
SH
180 <div id="footerframebottomright">
181 <div>&nbsp;</div>
182 </div>
1bc47427
K
183 </div> <!-- </footerframebottom> -->
184 </div> <!-- </footerframetop> -->
185 <?php }
186 //one more div is waiting to be closed
4afb01db 187
188 } else { ?>
189
190 <!-- START OF FOOTER -->
0e412e87 191 <div id="page-footer" class="noframefooter">
192 <?php if (!empty($PAGE->theme->settings->footnote)) { ?>
1bc47427
K
193 <div id="page-footer-content">
194
195 <!-- the content to show -->
196 <div id="footerwrapper">
197 <?php echo $PAGE->theme->settings->footnote; ?>
198 </div> <!-- </footerwrapper> -->
199
200 </div> <!-- </page-footer-content> -->
4afb01db 201 <?php }
1bc47427
K
202 //one more div is waiting to be closed
203
4afb01db 204 } ?>
0e412e87 205 <div class="moodledocsleft">
1bc47427 206 <?php
e0523b97 207 echo $OUTPUT->login_info();
4afb01db 208 //echo $OUTPUT->home_link();
1bc47427 209 ?>
e0523b97 210 <div class="moodledocs">
211 <?php echo page_doc_link(get_string('moodledocslink')); ?>
212 </div>
1bc47427 213 <?php
e0523b97 214 if ($PAGE->theme->settings->creditstomoodleorg == 2) {
215 // can not use $OUTPUT->home_link() here because whether $OUTPUT->page->pagetype != 'site-index'
216 // the output of the function is not the classic nice moodle logo $this->pix_url('moodlelogo')
1bc47427 217 ?>
e0523b97 218 <div class="sitelink">
219 <a title="Moodle" href="http://moodle.org/">
220 <img style="width:100px;height:30px" src="<?php echo $this->pix_url('moodlelogo') ?>" alt="moodlelogo" />
221 </a>
222 </div>
1bc47427 223 <?php
e0523b97 224 }
4afb01db 225 echo $OUTPUT->standard_footer_html();
1bc47427 226 ?>
4afb01db 227 </div>
1bc47427
K
228 </div> <!-- </page-footer> -->
229 </div> <!-- </page"> -->
230
231 <div class="clearfix"></div>
232
233<?php } //the waiting div has been closed: </page-footer>
4afb01db 234 echo $OUTPUT->standard_end_of_body_html(); ?>
57bfc29a
AB
235</body>
236</html>