/theme/formal_white/layout/frontpage.php

https://github.com/netspotau/moodle · PHP · 228 lines · 187 code · 37 blank · 4 comment · 37 complexity · 534f08b61d05bbbb685c90fed14e13f1 MD5 · raw file

  1. <?php
  2. defined('MOODLE_INTERNAL') || die();
  3. $hasheading = $PAGE->heading;
  4. $hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
  5. $hasfooter = (empty($PAGE->layout_options['nofooter']));
  6. $hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
  7. $hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
  8. $showsidepre = $hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT);
  9. $showsidepost = $hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT);
  10. $custommenu = $OUTPUT->custom_menu();
  11. $hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
  12. $bodyclasses = array();
  13. if ($showsidepre && !$showsidepost) {
  14. $bodyclasses[] = 'side-pre-only';
  15. } else if ($showsidepost && !$showsidepre) {
  16. $bodyclasses[] = 'side-post-only';
  17. } else if (!$showsidepost && !$showsidepre) {
  18. $bodyclasses[] = 'content-only';
  19. }
  20. if ($hascustommenu) {
  21. $bodyclasses[] = 'has_custom_menu';
  22. }
  23. /************************************************************************************************/
  24. if (!empty($PAGE->theme->settings->frontpagelogo)) {
  25. $logourl = $PAGE->theme->settings->frontpagelogo;
  26. } else if (!empty($PAGE->theme->settings->logo)) {
  27. $logourl = $PAGE->theme->settings->logo;
  28. } else {
  29. $logourl = $OUTPUT->pix_url('logo', 'theme');
  30. }
  31. $hasframe = !isset($PAGE->theme->settings->noframe) || !$PAGE->theme->settings->noframe;
  32. $displaylogo = !isset($PAGE->theme->settings->displaylogo) || $PAGE->theme->settings->displaylogo;
  33. /************************************************************************************************/
  34. echo $OUTPUT->doctype() ?>
  35. <html <?php echo $OUTPUT->htmlattributes() ?>>
  36. <head>
  37. <title><?php echo $PAGE->title ?></title>
  38. <link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
  39. <?php echo $OUTPUT->standard_head_html() ?>
  40. </head>
  41. <body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
  42. <?php echo $OUTPUT->standard_top_of_body_html(); ?>
  43. <div id="page">
  44. <?php if ($hasframe) { ?>
  45. <div id="frametop">
  46. <div id="framebottom">
  47. <div id="frametopright">
  48. <div>&nbsp;</div>
  49. </div>
  50. <div id="frameleft">
  51. <div id="frameright">
  52. <div id="wrapper">
  53. <?php } ?>
  54. <!-- begin of page-header -->
  55. <?php if ($hasheading) { ?>
  56. <div id="page-header">
  57. <?php if ($displaylogo) { ?>
  58. <div id="headerlogo">
  59. <img src="<?php echo $logourl ?>" alt="Custom logo here" />
  60. </div>
  61. <?php } else { ?>
  62. <h1 class="headerheading"><?php echo $PAGE->heading ?></h1>
  63. <?php } ?>
  64. <div class="headermenu">
  65. <?php
  66. echo $OUTPUT->login_info();
  67. if (($CFG->langmenu) && (!empty($PAGE->layout_options['langmenu']))) {
  68. echo $OUTPUT->lang_menu();
  69. }
  70. echo $PAGE->headingmenu;
  71. ?>
  72. </div>
  73. </div>
  74. <?php } ?>
  75. <!-- end of page-header -->
  76. <!-- begin of custom menu -->
  77. <?php if ($hascustommenu) { ?>
  78. <div id="custommenu"><?php echo $custommenu; ?></div>
  79. <?php } ?>
  80. <!-- end of custom menu -->
  81. <!-- begin of navigation bar -->
  82. <?php if ($hasnavbar) { ?>
  83. <div class="navbar clearfix">
  84. <div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
  85. <div class="navbutton"><?php echo $PAGE->button; ?></div>
  86. </div>
  87. <?php } ?>
  88. <!-- end of navigation bar -->
  89. <!-- start of moodle content -->
  90. <div id="page-content">
  91. <div id="region-main-box">
  92. <div id="region-post-box">
  93. <!-- main mandatory content of the moodle page -->
  94. <div id="region-main-wrap">
  95. <div id="region-main">
  96. <div class="region-content">
  97. <?php echo $OUTPUT->main_content() ?>
  98. </div>
  99. </div>
  100. </div>
  101. <!-- end of main mandatory content of the moodle page -->
  102. <!-- left column block - diplayed only if... -->
  103. <?php if ($hassidepre) { ?>
  104. <div id="region-pre" class="block-region">
  105. <div class="region-content">
  106. <?php echo $OUTPUT->blocks_for_region('side-pre') ?>
  107. </div>
  108. </div>
  109. <?php } ?>
  110. <!-- end of left column block - diplayed only if... -->
  111. <!-- right column block - diplayed only if... -->
  112. <?php if ($hassidepost) { ?>
  113. <div id="region-post" class="block-region">
  114. <div class="region-content">
  115. <?php echo $OUTPUT->blocks_for_region('side-post') ?>
  116. </div>
  117. </div>
  118. <?php } ?>
  119. <!-- end of right column block - diplayed only if... -->
  120. </div>
  121. </div>
  122. </div>
  123. <!-- end of moodle content -->
  124. <div class="clearfix"></div>
  125. <?php if ($hasframe) { ?>
  126. </div> <!-- </wrapper> -->
  127. </div> <!-- </frameright> -->
  128. </div> <!-- </frameleft> -->
  129. <div id="framebottomright">
  130. <div>&nbsp;</div>
  131. </div>
  132. </div> <!-- </framebottom> -->
  133. </div> <!-- </frametop> -->
  134. <?php }
  135. if ($hasfooter) {
  136. if ($hasframe) { ?>
  137. <!-- START OF FOOTER -->
  138. <div id="page-footer">
  139. <?php if (!empty($PAGE->theme->settings->footnote)) { ?>
  140. <div id="footerframetop">
  141. <div id="footerframebottom">
  142. <div id="footerframetopright">
  143. <div>&nbsp;</div>
  144. </div>
  145. <div id="footerframeleft">
  146. <div id="footerframeright">
  147. <!-- the content to show -->
  148. <div id="footerwrapper">
  149. <?php echo $PAGE->theme->settings->footnote; ?>
  150. </div> <!-- </footerwrapper> -->
  151. </div> <!-- </footerframeright> -->
  152. </div> <!-- </footerframeleft> -->
  153. <div id="footerframebottomright">
  154. <div>&nbsp;</div>
  155. </div>
  156. </div> <!-- </footerframebottom> -->
  157. </div> <!-- </footerframetop> -->
  158. <?php }
  159. //one more div is waiting to be closed
  160. } else { ?>
  161. <!-- START OF FOOTER -->
  162. <div id="page-footer" class="noframefooter">
  163. <?php if (!empty($PAGE->theme->settings->footnote)) { ?>
  164. <div id="page-footer-content">
  165. <!-- the content to show -->
  166. <div id="footerwrapper">
  167. <?php echo $PAGE->theme->settings->footnote; ?>
  168. </div> <!-- </footerwrapper> -->
  169. </div> <!-- </page-footer-content> -->
  170. <?php }
  171. //one more div is waiting to be closed
  172. } ?>
  173. <div class="moodledocsleft">
  174. <?php
  175. echo $OUTPUT->login_info();
  176. if ($PAGE->theme->settings->creditstomoodleorg) {
  177. echo $OUTPUT->home_link();
  178. }
  179. echo $OUTPUT->standard_footer_html();
  180. ?>
  181. </div>
  182. <div class="moodledocs">
  183. <?php echo page_doc_link(get_string('moodledocslink')); ?>
  184. </div>
  185. </div> <!-- </page-footer> -->
  186. </div> <!-- </page"> -->
  187. <div class="clearfix"></div>
  188. <?php } //the waiting div has been closed: </page-footer>
  189. echo $OUTPUT->standard_end_of_body_html(); ?>
  190. </body>
  191. </html>