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