Instantly share code, notes, and snippets.
Last active
August 29, 2015 14:00
-
Star
(0)
0
You must be signed in to star a gist -
Fork
(0)
0
You must be signed in to fork a gist
-
Save lazydaisy/11236138 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This file is part of Moodle - http://moodle.org/ | |
// | |
// Moodle is free software: you can redistribute it and/or modify | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation, either version 3 of the License, or | |
// (at your option) any later version. | |
// | |
// Moodle is distributed in the hope that it will be useful, | |
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// GNU General Public License for more details. | |
// | |
// You should have received a copy of the GNU General Public License | |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | |
/** | |
* The Essential theme is built upon the Bootstrapbase theme. | |
* | |
* @package theme | |
* @subpackage Essential | |
* @author Julian (@moodleman) Ridden | |
* @author Based on code originally written by G J Bernard, Mary Evans, Bas Brands, Stuart Lamour and David Scotson. | |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | |
*/ | |
$haslogo = (!empty($PAGE->theme->settings->logo)); | |
$hasboringlayout = (empty($PAGE->theme->settings->layout)) ? false : $PAGE->theme->settings->layout; | |
$hasanalytics = (empty($PAGE->theme->settings->useanalytics)) ? false : $PAGE->theme->settings->useanalytics; | |
$sideregionsmaxwidth = (!empty($PAGE->theme->settings->sideregionsmaxwidth)); | |
theme_essential_check_colours_switch(); | |
theme_essential_initialise_colourswitcher($PAGE); | |
$bodyclasses = array(); | |
$bodyclasses[] = 'three-column'; | |
$bodyclasses[] = 'essential-colours-' . theme_essential_get_colours(); | |
if ($sideregionsmaxwidth) { | |
$bodyclasses[] = 'side-regions-with-max-width'; | |
} | |
if (right_to_left()) { | |
$regionbsid = 'region-bs-main-and-post'; | |
} else { | |
$regionbsid = 'region-bs-main-and-pre'; | |
} | |
echo $OUTPUT->doctype() ?> | |
<html <?php echo $OUTPUT->htmlattributes(); ?>> | |
<head> | |
<title><?php echo $OUTPUT->page_title(); ?></title> | |
<link rel="shortcut icon" href="<?php echo $OUTPUT->favicon(); ?>" /> | |
<?php echo $OUTPUT->standard_head_html() ?> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- Google web fonts --> | |
<?php require_once(dirname(__FILE__).'/includes/fonts.php'); ?> | |
<!-- iOS Homescreen Icons --> | |
<?php require_once(dirname(__FILE__).'/includes/iosicons.php'); ?> | |
</head> | |
<body <?php echo $OUTPUT->body_attributes($bodyclasses); ?>> | |
<?php echo $OUTPUT->standard_top_of_body_html() ?> | |
<?php require_once(dirname(__FILE__).'/includes/header.php'); ?> | |
<header role="banner" class="navbar navbar"> | |
<nav role="navigation" class="navbar-inner"> | |
<div class="container-fluid"> | |
<a class="brand" href="<?php echo $CFG->wwwroot;?>"><?php echo $SITE->shortname; ?></a> | |
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</a> | |
<div class="nav-collapse collapse"> | |
<?php echo $OUTPUT->custom_menu(); ?> | |
<ul class="nav pull-right"> | |
<li><?php echo $OUTPUT->page_heading_menu(); ?></li> | |
<li class="navbar-text"><?php echo $OUTPUT->login_info() ?></li> | |
</ul> | |
</div> | |
</div> | |
</nav> | |
</header> | |
<!-- Start Main Regions --> | |
<div id="page" class="container-fluid"> | |
<div id="page-content" class="row-fluid"> | |
<div id="<?php echo $regionbsid ?>" class="span9"> | |
<div class="row-fluid"> | |
<?php if ($hasboringlayout) { ?> | |
<section id="region-main" class="span8 pull-right"> | |
<?php } else { ?> | |
<section id="region-main" class="span8 desktop-first-column"> | |
<?php } ?> | |
<div id="page-navbar" class="clearfix"> | |
<nav class="breadcrumb-button"><?php echo $OUTPUT->page_heading_button(); ?></nav> | |
<div class="breadcrumb-nav"><?php echo $OUTPUT->navbar(); ?></div> | |
</div> | |
<?php | |
echo $OUTPUT->course_content_header(); | |
echo $OUTPUT->main_content(); | |
echo $OUTPUT->course_content_footer(); | |
?> | |
</section> | |
<?php if ($hasboringlayout) { ?> | |
<?php echo $OUTPUT->blocks('side-pre', 'span4 desktop-first-column'); ?> | |
<?php } else { ?> | |
<?php echo $OUTPUT->blocks('side-pre', 'span4 pull-right'); ?> | |
<?php } ?> | |
</div> | |
</div> | |
<?php echo $OUTPUT->blocks('side-post', 'span3'); ?> | |
</div> | |
<!-- End Main Regions --> | |
</div> <!-- End of page --> | |
<!-- Start fixed page-footer --> | |
<div id="page-footer" class="> | |
<footer class="container-fluid"> | |
<?php require_once(dirname(__FILE__).'/includes/footer.php'); ?> | |
</footer> | |
</div> | |
<?php echo $OUTPUT->standard_end_of_body_html() ?> | |
<!-- Start Google Analytics --> | |
<?php if ($hasanalytics) { ?> | |
<?php require_once(dirname(__FILE__).'/includes/analytics.php'); ?> | |
<?php } ?> | |
<!-- End Google Analytics --> | |
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
var offset = 220; | |
var duration = 500; | |
jQuery(window).scroll(function() { | |
if (jQuery(this).scrollTop() > offset) { | |
jQuery('.back-to-top').fadeIn(duration); | |
} else { | |
jQuery('.back-to-top').fadeOut(duration); | |
} | |
}); | |
jQuery('.back-to-top').click(function(event) { | |
event.preventDefault(); | |
jQuery('html, body').animate({scrollTop: 0}, duration); | |
return false; | |
}) | |
}); | |
</script> | |
<a href="#top" class="back-to-top" title="<?php print_string('backtotop', 'theme_essential'); ?>"><i class="fa fa-angle-up "></i></a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment