MDL-44213 theme_standardold: unified @package use and improved coding style
[moodle.git] / theme / standardold / layout / frontpage.php
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
17 /**
18  * The frontpage layout.
19  *
20  * @package   theme_standardold
21  * @copyright 1999 onwards Martin Dougiamas (http://dougiamas.com)
22  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23  */
25 $hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
26 $hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
27 $showsidepre = $hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT);
28 $showsidepost = $hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT);
30 $custommenu = $OUTPUT->custom_menu();
31 $hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
33 $bodyclasses = array();
34 if ($showsidepre && !$showsidepost) {
35     $bodyclasses[] = 'side-pre-only';
36 } else if ($showsidepost && !$showsidepre) {
37     $bodyclasses[] = 'side-post-only';
38 } else if (!$showsidepost && !$showsidepre) {
39     $bodyclasses[] = 'content-only';
40 }
41 if ($hascustommenu) {
42     $bodyclasses[] = 'has_custom_menu';
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     <meta name="description" content="<?php p(strip_tags(format_text($SITE->summary, FORMAT_HTML))) ?>" />
51     <?php echo $OUTPUT->standard_head_html() ?>
52 </head>
53 <body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
54 <?php echo $OUTPUT->standard_top_of_body_html() ?>
56 <div id="page">
58     <div id="page-header" class="clearfix">
59         <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
60         <div class="headermenu"><?php
61             echo $OUTPUT->login_info();
62             echo $OUTPUT->lang_menu();
63             echo $PAGE->headingmenu;
64         ?></div>
65         <?php if ($hascustommenu) { ?>
66         <div id="custommenu"><?php echo $custommenu; ?></div>
67          <?php } ?>
68     </div>
69 <!-- END OF HEADER -->
71     <div id="page-content">
72         <table id="region-main-box" class="layout-table" summary="layout">
73             <tr id="region-post-box">
74                 <?php if ($hassidepre) { ?>
75                 <td id="region-pre" class="block-region">
76                     <div class="region-content">
77                             <?php echo $OUTPUT->blocks_for_region('side-pre') ?>
78                     </div>
79                 </td>
80                 <?php } ?>
81                 <td id="region-main-wrap">
82                     <div id="region-main">
83                         <div class="region-content">
84                             <?php echo $OUTPUT->main_content() ?>
85                         </div>
86                     </div>
87                 </td>
88                 <?php if ($hassidepost) { ?>
89                 <td id="region-post" class="block-region">
90                     <div class="region-content">
91                         <?php echo $OUTPUT->blocks_for_region('side-post') ?>
92                     </div>
93                 </td>
94                 <?php } ?>
95             </tr>
96         </table>
97     </div>
99 <!-- START OF FOOTER -->
100     <div id="page-footer">
101         <p class="helplink">
102         <?php echo page_doc_link(get_string('moodledocslink')) ?>
103         </p>
105         <?php
106         echo $OUTPUT->login_info();
107         echo $OUTPUT->home_link();
108         echo $OUTPUT->standard_footer_html();
109         ?>
110     </div>
111 </div>
112 <?php echo $OUTPUT->standard_end_of_body_html() ?>
113 </body>
114 </html>