[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/theme/canvas/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 general layout for the Canvas theme.
  19   *
  20   * @package    theme_canvas
  21   * @copyright  2010 Patrick Malley
  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  $bodyclasses = array();
  39  if ($showsidepre && !$showsidepost) {
  40      $bodyclasses[] = 'side-pre-only';
  41  } else if ($showsidepost && !$showsidepre) {
  42      $bodyclasses[] = 'side-post-only';
  43  } else if (!$showsidepost && !$showsidepre) {
  44      $bodyclasses[] = 'content-only';
  45  }
  46  if ($hascustommenu) {
  47      $bodyclasses[] = 'has_custom_menu';
  48  }
  49  
  50  $courseheader = $coursecontentheader = $coursecontentfooter = $coursefooter = '';
  51  if (empty($PAGE->layout_options['nocourseheaderfooter'])) {
  52      $courseheader = $OUTPUT->course_header();
  53      $coursecontentheader = $OUTPUT->course_content_header();
  54      if (empty($PAGE->layout_options['nocoursefooter'])) {
  55          $coursecontentfooter = $OUTPUT->course_content_footer();
  56          $coursefooter = $OUTPUT->course_footer();
  57      }
  58  }
  59  
  60  echo $OUTPUT->doctype() ?>
  61  <html <?php echo $OUTPUT->htmlattributes() ?>>
  62  <head>
  63      <title><?php echo $PAGE->title ?></title>
  64      <link rel="shortcut icon" href="<?php echo $OUTPUT->pix_url('favicon', 'theme')?>" />
  65      <?php echo $OUTPUT->standard_head_html() ?>
  66  </head>
  67  <body id="<?php p($PAGE->bodyid) ?>" class="<?php p($PAGE->bodyclasses.' '.join(' ', $bodyclasses)) ?>">
  68  <?php echo $OUTPUT->standard_top_of_body_html() ?>
  69  
  70  <div id="page">
  71  
  72  <!-- START OF HEADER -->
  73  
  74      <?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
  75          <div id="wrapper" class="clearfix">
  76      <?php } ?>
  77  
  78          <?php if ($hasheading) { ?>
  79          <div id="page-header">
  80              <div id="page-header-wrapper" class="clearfix">
  81                  <h1 class="headermain"><?php echo $PAGE->heading ?></h1>
  82                  <div class="headermenu">
  83                      <?php
  84                          echo $OUTPUT->login_info();
  85                             if (!empty($PAGE->layout_options['langmenu'])) {
  86                                 echo $OUTPUT->lang_menu();
  87                             }
  88                             echo $PAGE->headingmenu;
  89                      ?>
  90                  </div>
  91              </div>
  92          </div>
  93          <?php } ?>
  94  
  95          <?php if ($hascustommenu) { ?>
  96              <div id="custommenu"><?php echo $custommenu; ?></div>
  97          <?php } ?>
  98  
  99          <?php if (!empty($courseheader)) { ?>
 100              <div id="course-header"><?php echo $courseheader; ?></div>
 101          <?php } ?>
 102  
 103          <?php if ($hasnavbar) { ?>
 104              <div class="navbar clearfix">
 105                  <div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
 106                  <div class="navbutton"> <?php echo $PAGE->button; ?></div>
 107              </div>
 108          <?php } ?>
 109  
 110  <!-- END OF HEADER -->
 111  
 112  <!-- START OF CONTENT -->
 113  
 114          <div id="page-content-wrapper" class="clearfix">
 115              <div id="page-content">
 116                  <div id="region-main-box">
 117                      <div id="region-post-box">
 118  
 119                          <div id="region-main-wrap">
 120                              <div id="region-main">
 121                                  <div class="region-content">
 122                                      <?php echo $coursecontentheader; ?>
 123                                      <?php echo $OUTPUT->main_content() ?>
 124                                      <?php echo $coursecontentfooter; ?>
 125                                  </div>
 126                              </div>
 127                          </div>
 128  
 129                          <?php if ($hassidepre) { ?>
 130                          <div id="region-pre" class="block-region">
 131                              <div class="region-content">
 132                                  <?php echo $OUTPUT->blocks_for_region('side-pre') ?>
 133                              </div>
 134                          </div>
 135                          <?php } ?>
 136  
 137                          <?php if ($hassidepost) { ?>
 138                          <div id="region-post" class="block-region">
 139                              <div class="region-content">
 140                                  <?php echo $OUTPUT->blocks_for_region('side-post') ?>
 141                              </div>
 142                          </div>
 143                          <?php } ?>
 144  
 145                      </div>
 146                  </div>
 147              </div>
 148          </div>
 149  
 150  <!-- END OF CONTENT -->
 151  
 152  <!-- START OF FOOTER -->
 153  
 154          <?php if (!empty($coursefooter)) { ?>
 155              <div id="course-footer"><?php echo $coursefooter; ?></div>
 156          <?php } ?>
 157          <?php if ($hasfooter) { ?>
 158          <div id="page-footer" class="clearfix">
 159              <p class="helplink"><?php echo page_doc_link(get_string('moodledocslink')) ?></p>
 160              <?php
 161                  echo $OUTPUT->login_info();
 162                  echo $OUTPUT->home_link();
 163                  echo $OUTPUT->standard_footer_html();
 164              ?>
 165          </div>
 166          <?php } ?>
 167  
 168      <?php if ($hasheading || $hasnavbar || !empty($courseheader) || !empty($coursefooter)) { ?>
 169          </div> <!-- END #wrapper -->
 170      <?php } ?>
 171  
 172  </div> <!-- END #page -->
 173  
 174  <?php echo $OUTPUT->standard_end_of_body_html() ?>
 175  </body>
 176  </html>


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