MDL-34916 theme_formal_white: added support for relative path of logos
[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/************************************************************************************************/
9ad11a6c
K
32if (!empty($PAGE->theme->settings->customlogourl)) {
33 $logourl = $PAGE->theme->settings->customlogourl;
e765d3c3
K
34 if (strtolower(substr($logourl, 0, 4)) != 'http') {
35 $logourl = $CFG->wwwroot.'/'.$logourl;
36 }
57bfc29a 37} else {
4afb01db 38 $logourl = $OUTPUT->pix_url('logo_small', 'theme');
57bfc29a
AB
39}
40
4afb01db 41$hasframe = !isset($PAGE->theme->settings->noframe) || !$PAGE->theme->settings->noframe;
42
9ad11a6c 43$displaylogo = !isset($PAGE->theme->settings->headercontent) || $PAGE->theme->settings->headercontent;
4afb01db 44/************************************************************************************************/
57bfc29a
AB
45
46echo $OUTPUT->doctype() ?>
47<html <?php echo $OUTPUT->htmlattributes() ?>>
48<head>
49 <title><?php echo $PAGE->title ?></title>
50 <link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
51 <?php echo $OUTPUT->standard_head_html() ?>
52</head>
0ae36f66 53<body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
1bc47427
K
54 <?php echo $OUTPUT->standard_top_of_body_html(); ?>
55 <div id="page">
56
57 <?php if ($hasframe) { ?>
58 <div id="frametop">
59 <div id="framebottom">
60 <div id="frametopright">
61 <div>&nbsp;</div>
62 </div>
63 <div id="frameleft">
64 <div id="frameright">
65 <div id="wrapper">
4afb01db 66<?php } ?>
57bfc29a 67
4afb01db 68<!-- begin of page-header -->
1bc47427
K
69 <?php if ($hasheading) { ?>
70 <div id="page-header">
71 <?php if ($displaylogo) { ?>
72 <div id="headerlogo">
73 <img src="<?php echo $logourl ?>" alt="Custom logo here" />
74 </div>
75 <?php } else { ?>
76 <h1 class="headerheading"><?php echo $PAGE->heading ?></h1>
77 <?php } ?>
78
79 <div class="headermenu">
80 <?php
81 echo $OUTPUT->login_info();
82 if (($CFG->langmenu) && (!empty($PAGE->layout_options['langmenu']))) {
83 echo $OUTPUT->lang_menu();
84 }
85 echo $PAGE->headingmenu;
86 ?>
87 </div>
88 </div>
89 <?php } ?>
4afb01db 90<!-- end of page-header -->
91
92<!-- begin of custom menu -->
1bc47427
K
93 <?php if ($hascustommenu) { ?>
94 <div id="custommenu"><?php echo $custommenu; ?></div>
95 <?php } ?>
4afb01db 96<!-- end of custom menu -->
97
98<!-- begin of navigation bar -->
1bc47427
K
99 <?php if ($hasnavbar) { ?>
100 <div class="navbar clearfix">
101 <div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
102 <div class="navbutton"><?php echo $PAGE->button; ?></div>
103 </div>
104 <?php } ?>
4afb01db 105<!-- end of navigation bar -->
106
107<!-- start of moodle content -->
1bc47427
K
108 <div id="page-content">
109 <div id="region-main-box">
110 <div id="region-post-box">
111
112 <!-- main mandatory content of the moodle page -->
113 <div id="region-main-wrap">
114 <div id="region-main">
115 <div class="region-content">
116 <?php echo $OUTPUT->main_content() ?>
117 </div>
118 </div>
119 </div>
120 <!-- end of main mandatory content of the moodle page -->
121
1bc47427
K
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>
57bfc29a 143 </div>
57bfc29a 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
e1f517fc
SH
175 <!-- the content to show -->
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
K
195 <div id="page-footer-content">
196
197 <!-- the content to show -->
198 <div id="footerwrapper">
199 <?php echo $PAGE->theme->settings->footnote; ?>
200 </div> <!-- </footerwrapper> -->
201
202 </div> <!-- </page-footer-content> -->
4afb01db 203 <?php }
1bc47427
K
204 //one more div is waiting to be closed
205
4afb01db 206 } ?>
0e412e87 207 <div class="moodledocsleft">
1bc47427 208 <?php
e0523b97 209 echo $OUTPUT->login_info();
4afb01db 210 //echo $OUTPUT->home_link();
1bc47427 211 ?>
e0523b97 212 <div class="moodledocs">
213 <?php echo page_doc_link(get_string('moodledocslink')); ?>
214 </div>
1bc47427 215 <?php
e0523b97 216 if ($PAGE->theme->settings->creditstomoodleorg == 2) {
217 // can not use $OUTPUT->home_link() here because whether $OUTPUT->page->pagetype != 'site-index'
218 // the output of the function is not the classic nice moodle logo $this->pix_url('moodlelogo')
1bc47427 219 ?>
e0523b97 220 <div class="sitelink">
221 <a title="Moodle" href="http://moodle.org/">
222 <img style="width:100px;height:30px" src="<?php echo $this->pix_url('moodlelogo') ?>" alt="moodlelogo" />
223 </a>
224 </div>
1bc47427 225 <?php
e0523b97 226 }
4afb01db 227 echo $OUTPUT->standard_footer_html();
1bc47427 228 ?>
4afb01db 229 </div>
1bc47427
K
230 </div> <!-- </page-footer> -->
231 </div> <!-- </page"> -->
232
233 <div class="clearfix"></div>
234
235<?php } //the waiting div has been closed: </page-footer>
4afb01db 236 echo $OUTPUT->standard_end_of_body_html(); ?>
57bfc29a
AB
237</body>
238</html>