Revert "MDL-39871 Blocks,Themes: Swap block regions in RTL mode (using pre-defined...
[moodle.git] / theme / base / layout / frontpage.php
1 <?php
3 $hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
4 $hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
5 $showsidepre = $hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT);
6 $showsidepost = $hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT);
8 $custommenu = $OUTPUT->custom_menu();
9 $hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
11 $bodyclasses = array();
12 if ($showsidepre && !$showsidepost) {
13     if (!right_to_left()) {
14         $bodyclasses[] = 'side-pre-only';
15     }else{
16         $bodyclasses[] = 'side-post-only';
17     }
18 } else if ($showsidepost && !$showsidepre) {
19     if (!right_to_left()) {
20         $bodyclasses[] = 'side-post-only';
21     }else{
22         $bodyclasses[] = 'side-pre-only';
23     }
24 } else if (!$showsidepost && !$showsidepre) {
25     $bodyclasses[] = 'content-only';
26 }
27 if ($hascustommenu) {
28     $bodyclasses[] = 'has_custom_menu';
29 }
31 echo $OUTPUT->doctype() ?>
32 <html <?php echo $OUTPUT->htmlattributes() ?>>
33 <head>
34     <title><?php echo $PAGE->title ?></title>
35     <link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
36     <meta name="description" content="<?php p(strip_tags(format_text($SITE->summary, FORMAT_HTML))) ?>" />
37     <?php echo $OUTPUT->standard_head_html() ?>
38 </head>
39 <body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
40 <?php echo $OUTPUT->standard_top_of_body_html() ?>
42 <div id="page">
44     <div id="page-header" class="clearfix">
45         <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
46         <div class="headermenu"><?php
47             echo $OUTPUT->login_info();
48             echo $OUTPUT->lang_menu();
49             echo $PAGE->headingmenu;
50         ?></div>
51         <?php if ($hascustommenu) { ?>
52         <div id="custommenu"><?php echo $custommenu; ?></div>
53          <?php } ?>
54     </div>
55 <!-- END OF HEADER -->
57     <div id="page-content">
58         <div id="region-main-box">
59             <div id="region-post-box">
61                 <div id="region-main-wrap">
62                     <div id="region-main">
63                         <div class="region-content">
64                             <?php echo $OUTPUT->main_content() ?>
65                         </div>
66                     </div>
67                 </div>
69                 <?php if ($hassidepre OR (right_to_left() AND $hassidepost)) { ?>
70                 <div id="region-pre" class="block-region">
71                     <div class="region-content">
72                             <?php
73                         if (!right_to_left()) {
74                             echo $OUTPUT->blocks_for_region('side-pre');
75                         } elseif ($hassidepost) {
76                             echo $OUTPUT->blocks_for_region('side-post');
77                     } ?>
79                     </div>
80                 </div>
81                 <?php } ?>
83                 <?php if ($hassidepost OR (right_to_left() AND $hassidepre)) { ?>
84                 <div id="region-post" class="block-region">
85                     <div class="region-content">
86                            <?php
87                        if (!right_to_left()) {
88                            echo $OUTPUT->blocks_for_region('side-post');
89                        } elseif ($hassidepre) {
90                            echo $OUTPUT->blocks_for_region('side-pre');
91                     } ?>
92                     </div>
93                 </div>
94                 <?php } ?>
96             </div>
97         </div>
98     </div>
100 <!-- START OF FOOTER -->
101     <div id="page-footer">
102         <p class="helplink">
103         <?php echo page_doc_link(get_string('moodledocslink')) ?>
104         </p>
106         <?php
107         echo $OUTPUT->login_info();
108         echo $OUTPUT->home_link();
109         echo $OUTPUT->standard_footer_html();
110         ?>
111     </div>
112     <div class="clearfix"></div>
113 </div>
114 <?php echo $OUTPUT->standard_end_of_body_html() ?>
115 </body>
116 </html>