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