MDL-29614 theme_formal_white: Change the way Formal White theme shrinks pages
[moodle.git] / theme / formal_white / layout / frontpage.php
1 <?php
3 defined('MOODLE_INTERNAL') || die();
5 $hasheading = $PAGE->heading;
6 $hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
7 $hasfooter = (empty($PAGE->layout_options['nofooter']));
9 $hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
10 $hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
12 $showsidepre = $hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT);
13 $showsidepost = $hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT);
15 $custommenu = $OUTPUT->custom_menu();
16 $hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
18 $bodyclasses = array();
19 if ($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 }
27 if ($hascustommenu) {
28     $bodyclasses[] = 'has_custom_menu';
29 }
31 /************************************************************************************************/
32 if (!empty($PAGE->theme->settings->frontpagelogo)) {
33     $logourl = $PAGE->theme->settings->frontpagelogo;
34 } else if (!empty($PAGE->theme->settings->logo)) {
35     $logourl = $PAGE->theme->settings->logo;
36 } else {
37     $logourl = $OUTPUT->pix_url('logo', 'theme');
38 }
40 $hasframe = !isset($PAGE->theme->settings->noframe) || !$PAGE->theme->settings->noframe;
42 $displaylogo = !isset($PAGE->theme->settings->displaylogo) || $PAGE->theme->settings->displaylogo;
43 /************************************************************************************************/
45 echo $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>
52 <body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
53     <?php echo $OUTPUT->standard_top_of_body_html(); ?>
54     <div id="page">
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">
65 <?php } ?>
67 <!-- begin of page-header -->
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 } ?>
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 } ?>
89 <!-- end of page-header -->
91 <!-- begin of custom menu -->
92                             <?php if ($hascustommenu) { ?>
93                             <div id="custommenu"><?php echo $custommenu; ?></div>
94                             <?php } ?>
95 <!-- end of custom menu -->
97 <!-- begin of navigation bar -->
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 } ?>
104 <!-- end of navigation bar -->
106 <!-- start of moodle content -->
107                             <div id="page-content">
108                                 <div id="region-main-box">
109                                     <div id="region-post-box">
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 -->
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... -->
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... -->
142                                     </div>
143                                 </div>
144                             </div>
145 <!-- end of moodle content -->
147                             <div class="clearfix"></div>
149 <?php if ($hasframe) { ?>
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> -->
159 <?php }
161 if ($hasfooter) {
162     if ($hasframe) { ?>
164         <!-- START OF FOOTER -->
165         <div id="page-footer">
166             <?php if (!empty($PAGE->theme->settings->footnote)) { ?>
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">
175                             <!-- the content to show -->
176                             <div id="footerwrapper">
177                                 <?php echo $PAGE->theme->settings->footnote; ?>
178                             </div> <!-- </footerwrapper> -->
180                         </div> <!-- </footerframeright> -->
181                     </div> <!-- </footerframeleft> -->
182                     <div id="footerframebottomright">
183                         <div>&nbsp;</div>
184                     </div>
185                 </div> <!-- </footerframebottom> -->
186             </div> <!-- </footerframetop> -->
187             <?php }
188             //one more div is waiting to be closed
190     } else { ?>
192         <!-- START OF FOOTER -->
193         <div id="page-footer" class="noframefooter">
194             <?php if (!empty($PAGE->theme->settings->footnote)) { ?>
195             <div id="page-footer-content">
197                 <!-- the content to show -->
198                 <div id="footerwrapper">
199                     <?php echo $PAGE->theme->settings->footnote; ?>
200                 </div> <!-- </footerwrapper> -->
202             </div> <!-- </page-footer-content> -->
203             <?php }
204             //one more div is waiting to be closed
206     } ?>
208             <div class="moodledocsleft">
209                 <?php
210                 echo $OUTPUT->login_info();
211                 if ($PAGE->theme->settings->creditstomoodleorg) {
212                     echo $OUTPUT->home_link();
213                 }
214                 echo $OUTPUT->standard_footer_html();
215                 ?>
216             </div>
217             <div class="moodledocs">
218                 <?php echo page_doc_link(get_string('moodledocslink')); ?>
219             </div>
220         </div> <!-- </page-footer> -->
221     </div> <!-- </page"> -->
223     <div class="clearfix"></div>
225 <?php  } //the waiting div has been closed: </page-footer>
226     echo $OUTPUT->standard_end_of_body_html(); ?>
227 </body>
228 </html>