[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/theme/base/layout/ -> general.php (source)

   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/>.
  16  
  17  /**
  18   * The default layout for the base theme.
  19   *
  20   * @package   theme_base
  21   * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
  22   * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23   */
  24  
  25  $hasheading = ($PAGE->heading);
  26  $hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar());
  27  $hasfooter = (empty($PAGE->layout_options['nofooter']));
  28  $hassidepre = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-pre', $OUTPUT));
  29  $hassidepost = (empty($PAGE->layout_options['noblocks']) && $PAGE->blocks->region_has_content('side-post', $OUTPUT));
  30  $haslogininfo = (empty($PAGE->layout_options['nologininfo']));
  31  
  32  $showsidepre = ($hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT));
  33  $showsidepost = ($hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT));
  34  
  35  $custommenu = $OUTPUT->custom_menu();
  36  $hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
  37  
  38  $courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
  39  if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
  40      $courseheader = $OUTPUT->course_header();
  41      $coursecontentheader = $OUTPUT->course_content_header();
  42      if (empty($PAGE->layout_options['nocoursefooter'])) {
  43          $coursecontentfooter = $OUTPUT->course_content_footer();
  44          $coursefooter = $OUTPUT->course_footer();
  45      }
  46  }
  47  
  48  $bodyclasses = array();
  49  if ($showsidepre && !$showsidepost) {
  50      if (!right_to_left()) {
  51          $bodyclasses[] = 'side-pre-only';
  52      }else{
  53          $bodyclasses[] = 'side-post-only';
  54      }
  55  } else if ($showsidepost && !$showsidepre) {
  56      if (!right_to_left()) {
  57          $bodyclasses[] = 'side-post-only';
  58      }else{
  59          $bodyclasses[] = 'side-pre-only';
  60      }
  61  } else if (!$showsidepost && !$showsidepre) {
  62      $bodyclasses[] = 'content-only';
  63  }
  64  if ($hascustommenu) {
  65      $bodyclasses[] = 'has_custom_menu';
  66  }
  67  
  68  echo $OUTPUT->doctype() ?>
  69  <html <?php echo $OUTPUT->htmlattributes() ?>>
  70  <head>
  71      <title><?php echo $PAGE->title ?></title>
  72      <link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
  73      <?php echo $OUTPUT->standard_head_html() ?>
  74  </head>
  75  <body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
  76  <?php echo $OUTPUT->standard_top_of_body_html() ?>
  77  <div id="page">
  78  <?php if ($hasheading || $hasnavbar || !empty($courseheader)) { ?>
  79      <div id="page-header">
  80          <?php if ($hasheading) { ?>
  81          <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
  82          <div class="headermenu"><?php
  83              echo $OUTPUT->user_menu();
  84              if (!empty($PAGE->layout_options['langmenu'])) {
  85                  echo $OUTPUT->lang_menu();
  86              }
  87              echo $PAGE->headingmenu
  88          ?></div><?php } ?>
  89          <?php if (!empty($courseheader)) { ?>
  90              <div id="course-header"><?php echo $courseheader; ?></div>
  91          <?php } ?>
  92          <?php if ($hascustommenu) { ?>
  93          <div id="custommenu"><?php echo $custommenu; ?></div>
  94          <?php } ?>
  95          <?php if ($hasnavbar) { ?>
  96              <div class="navbar clearfix">
  97                  <div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
  98                  <div class="navbutton"> <?php echo $PAGE->button; ?></div>
  99              </div>
 100          <?php } ?>
 101      </div>
 102  <?php } ?>
 103  <!-- END OF HEADER -->
 104  
 105      <div id="page-content">
 106          <div id="region-main-box">
 107              <div id="region-post-box">
 108  
 109                  <div id="region-main-wrap">
 110                      <div id="region-main">
 111                          <div class="region-content">
 112                              <?php echo $coursecontentheader; ?>
 113                              <?php echo $OUTPUT->main_content() ?>
 114                              <?php echo $coursecontentfooter; ?>
 115                          </div>
 116                      </div>
 117                  </div>
 118  
 119                  <?php if ($hassidepre OR (right_to_left() AND $hassidepost)) { ?>
 120                  <div id="region-pre" class="block-region">
 121                      <div class="region-content">
 122                              <?php
 123                          if (!right_to_left()) {
 124                              echo $OUTPUT->blocks_for_region('side-pre');
 125                          } elseif ($hassidepost) {
 126                              echo $OUTPUT->blocks_for_region('side-post');
 127                      } ?>
 128  
 129                      </div>
 130                  </div>
 131                  <?php } ?>
 132  
 133                  <?php if ($hassidepost OR (right_to_left() AND $hassidepre)) { ?>
 134                  <div id="region-post" class="block-region">
 135                      <div class="region-content">
 136                             <?php
 137                         if (!right_to_left()) {
 138                             echo $OUTPUT->blocks_for_region('side-post');
 139                         } elseif ($hassidepre) {
 140                             echo $OUTPUT->blocks_for_region('side-pre');
 141                      } ?>
 142                      </div>
 143                  </div>
 144                  <?php } ?>
 145  
 146              </div>
 147          </div>
 148      </div>
 149  
 150  <!-- START OF FOOTER -->
 151      <?php if (!empty($coursefooter)) { ?>
 152          <div id="course-footer"><?php echo $coursefooter; ?></div>
 153      <?php } ?>
 154      <?php if ($hasfooter) { ?>
 155      <div id="page-footer" class="clearfix">
 156          <p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
 157          <?php
 158          echo $OUTPUT->login_info();
 159          echo $OUTPUT->home_link();
 160          echo $OUTPUT->standard_footer_html();
 161          ?>
 162      </div>
 163      <?php } ?>
 164      <div class="clearfix"></div>
 165  </div>
 166  <?php echo $OUTPUT->standard_end_of_body_html() ?>
 167  </body>
 168  </html>


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1