3ac633675fec84bafd1513740e674c56ef281e23
[moodle.git] / theme / base / layout / general.php
1 <?php
3 $hasheading = ($PAGE->heading);
4 $hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
5 $hasfooter = (empty($PAGE->layout_options['nofooter']));
6 $hassidepre = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-pre', $OUTPUT));
7 $hassidepost = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-post', $OUTPUT));
9 $showsidepre = ($hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT));
10 $showsidepost = ($hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT));
12 $custommenu = $OUTPUT->custom_menu();
13 $hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
15 $bodyclasses = array();
16 if ($showsidepre && !$showsidepost) {
17     $bodyclasses[] = 'side-pre-only';
18 } else if ($showsidepost && !$showsidepre) {
19     $bodyclasses[] = 'side-post-only';
20 } else if (!$showsidepost && !$showsidepre) {
21     $bodyclasses[] = 'content-only';
22 }
23 if ($hascustommenu) {
24     $bodyclasses[] = 'has_custom_menu';
25 }
27 echo $OUTPUT->doctype() ?>
28 <html <?php echo $OUTPUT->htmlattributes() ?>>
29 <head>
30     <title><?php echo $PAGE->title ?></title>
31     <link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
32     <?php echo $OUTPUT->standard_head_html() ?>
33 </head>
34 <body id="<?php echo $PAGE->bodyid ?>" class="<?php echo $PAGE->bodyclasses.' '.join(' ', $bodyclasses) ?>">
35 <?php echo $OUTPUT->standard_top_of_body_html() ?>
36 <div id="page">
37 <?php if ($hasheading || $hasnavbar) { ?>
38     <div id="page-header">
39         <?php if ($hasheading) { ?>
40         <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
41         <div class="headermenu"><?php
42             echo $OUTPUT->login_info();
43             if (!empty($PAGE->layout_options['langmenu'])) {
44                 echo $OUTPUT->lang_menu();
45             }
46             echo $PAGE->headingmenu
47         ?></div><?php } ?>
48         <?php if ($hascustommenu) { ?>
49         <div id="custommenu"><?php echo $custommenu; ?></div>
50         <?php } ?>
51         <?php if ($hasnavbar) { ?>
52             <div class="navbar clearfix">
53                 <div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
54                 <div class="navbutton"> <?php echo $PAGE->button; ?></div>
55             </div>
56         <?php } ?>
57     </div>
58 <?php } ?>
59 <!-- END OF HEADER -->
61     <div id="page-content">
62         <div id="region-main-box">
63             <div id="region-post-box">
64             
65                 <div id="region-main-wrap">
66                     <div id="region-main">
67                         <div class="region-content">
68                             <?php echo core_renderer::MAIN_CONTENT_TOKEN ?>
69                         </div>
70                     </div>
71                 </div>
72                 
73                 <?php if ($hassidepre) { ?>
74                 <div id="region-pre" class="block-region">
75                     <div class="region-content">
76                         <?php echo $OUTPUT->blocks_for_region('side-pre') ?>
77                     </div>
78                 </div>
79                 <?php } ?>
80                 
81                 <?php if ($hassidepost) { ?>
82                 <div id="region-post" class="block-region">
83                     <div class="region-content">
84                         <?php echo $OUTPUT->blocks_for_region('side-post') ?>
85                     </div>
86                 </div>
87                 <?php } ?>
88             </div>
89         </div>
90     </div>
92 <!-- START OF FOOTER -->
93     <?php if ($hasfooter) { ?>
94     <div id="page-footer" class="clearfix">
95         <p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
96         <?php
97         echo $OUTPUT->login_info();
98         echo $OUTPUT->home_link();
99         echo $OUTPUT->standard_footer_html();
100         ?>
101     </div>
102     <?php } ?>
103 </div>
104 <?php echo $OUTPUT->standard_end_of_body_html() ?>
105 </body>
106 </html>