Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added custom menu to nonzero theme, MDL-26711

  • Loading branch information...
commit fab058e5d5f1c639c356b9d531cf9f01eb7a6fee 1 parent c096042
stabijoh authored
View
10 theme/nonzero/layout/frontpage.php
@@ -10,6 +10,9 @@
$showsidepre = ($hassidepre && !$PAGE->blocks->region_completely_docked('side-pre', $OUTPUT));
$showsidepost = ($hassidepost && !$PAGE->blocks->region_completely_docked('side-post', $OUTPUT));
+$custommenu = $OUTPUT->custom_menu();
+$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
+
$bodyclasses = array();
if ($showsidepre && !$showsidepost) {
$bodyclasses[] = 'side-pre-only';
@@ -18,6 +21,9 @@
} else if (!$showsidepost && !$showsidepre) {
$bodyclasses[] = 'content-only';
}
+if ($hascustommenu) {
+ $bodyclasses[] = 'has_custom_menu';
+}
echo $OUTPUT->doctype() ?>
@@ -45,7 +51,11 @@
echo $PAGE->headingmenu;
?>
</div>
+ <?php if ($hascustommenu) { ?>
+<div id="custommenuwrap"><div id="custommenu"><?php echo $custommenu; ?></div></div>
+<?php } ?>
</div>
+
</div>
<!-- END OF HEADER -->
View
11 theme/nonzero/layout/general.php
@@ -5,6 +5,8 @@
$hasfooter = (empty($PAGE->layout_options['nofooter']));
$hassidepre = $PAGE->blocks->region_has_content('side-pre', $OUTPUT);
$hassidepost = $PAGE->blocks->region_has_content('side-post', $OUTPUT);
+$custommenu = $OUTPUT->custom_menu();
+$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
$bodyclasses = array();
if ($hassidepre && !$hassidepost) {
@@ -14,6 +16,9 @@
} else if (!$hassidepost && !$hassidepre) {
$bodyclasses[] = 'content-only';
}
+if ($hascustommenu) {
+ $bodyclasses[] = 'has_custom_menu';
+}
echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
@@ -28,7 +33,7 @@
<div id="page">
<?php if ($hasheading || $hasnavbar) { ?>
- <div id="page-header" class="inside">
+ <div id="page-header" >
<div id="page-header-wrapper" class="wrapper clearfix">
<?php if ($hasheading) { ?>
<h1 class="headermain"><?php echo $PAGE->heading ?></h1>
@@ -39,7 +44,9 @@
}
echo $PAGE->headingmenu ?>
</div>
- <?php } ?>
+ <?php } if ($hascustommenu) { ?>
+ <div id="custommenuwrap"><div id="custommenu"><?php echo $custommenu; ?></div></div>
+ <?php } ?>
</div>
</div>
View
98 theme/nonzero/style/core.css
@@ -48,7 +48,7 @@ a:active {
---------------------------*/
#page-header {
- background: url([[pix:theme|n1]]) repeat-x 0 100%;
+ background: url([[pix:theme|n1]]) repeat-x 0 0;
color: #fff;
height: 122px;
}
@@ -57,6 +57,11 @@ a:active {
font-size:2.5em;
padding-top:70px;
margin: 0;
+ text-shadow: 0 -1px 1px #000;
+}
+
+.has_custom_menu #page-header h1 {
+ padding-top:60px;
}
#page-header.inside {
@@ -148,12 +153,97 @@ a:active {
.course-content .current {
background: #1f5480;
-}
-
-.course-content .current .left {
color: #fff;
}
.course-content .main .content {
background: #fff;
}
+
+/* Custom Menu */
+/*custom menu styles */
+#custommenuwrap {
+ clear: both;
+ padding-top: 4px;
+}
+
+#custommenu {
+ border: none !important;
+ border: 0px solid #fff !important;
+}
+
+#custommenu * {
+ border: none !important;
+}
+
+/*YUI Reset */
+.yui3-skin-sam #page .yui3-menu-horizontal .yui3-menu-content{
+ background-position: -10000px -10000px;
+}
+
+.yui3-skin-sam #page .yui3-menu-horizontal .yui3-menu-label{
+ background-position: -10000px -10000px;
+}
+
+.yui3-skin-sam #page .yui3-menu-horizontal .yui3-menu-label-active,.yui3-skin-sam #page .yui3-menu-horizontal .yui3-menuitem-active .yui3-menuitem-content,.yui3-skin-sam #page .yui3-menu-horizontal .yui3-menu-label-menuvisible{
+ background-position: -10000px -10000px;
+}
+
+.yui3-skin-sam #page .yui3-menu-label,
+.yui3-skin-sam #page .yui3-menu .yui3-menu .yui3-menu-label {
+ background-position: right center;
+}
+
+.yui3-skin-sam #page .yui3-menubuttonnav .yui3-menu-label em {
+ background-position: right center;
+}
+
+.yui3-skin-sam #page .yui3-splitbuttonnav .yui3-menu-label .yui3-menu-toggle {
+ background-position: 3px center;
+}
+
+.yui3-skin-sam #page .yui3-splitbuttonnav .yui3-menu-label-menuvisible .yui3-menu-toggle {
+ background-position: 0% 50%;
+}
+
+.yui3-skin-sam #page .yui3-menu-label, .yui3-skin-sam #page .yui3-menuitem-content {
+ color: #fff;
+ font-weight: 600;
+ text-decoration: none;
+ padding-left: 0px;
+ padding-right: 20px !important;
+ text-shadow: 0 -1px 1px #000;
+}
+
+.custom_menu_submenu .yui3-menu-label, .custom_menu_submenu .yui3-menuitem-content {
+ color: #333 !important;
+ padding-left: 5px !important;
+ text-shadow:none !important;
+}
+
+.yui3-skin-sam #page .yui3-menu-label.yui3-menu-label-active, .yui3-skin-sam #page .yui3-menuitem-active .yui3-menuitem-content {
+ color: #ccc;
+}
+
+.yui3-skin-sam #page .yui3-menu-content, .yui3-skin-sam #page .yui3-menu-content, .yui3-skin-sam #page .yui3-menu .yui3-menu .yui3-menu-content, .yui3-skin-sam #page .yui3-menu-horizontal .yui3-menu-label, .yui3-skin-sam #page .yui3-menu-horizontal .yui3-menuitem-content {
+ border: none;
+}
+
+.yui3-skin-sam .yui3-menu-horizontal .yui3-menu-label, .yui3-skin-sam .yui3-menu-horizontal .yui3-menuitem-content {
+ border-color:#808080;
+ border-style:solid;
+ border-width:0px 0;
+}
+
+#page .custom_menu_submenu {
+ border: 1px solid #27608d !important;
+ border-top: none !important;
+ background: #fff;
+ -webkit-border-radius: 2px;
+ -moz-border-radius: 2px;
+ border-radius: 2px;
+ -webkit-box-shadow: 0px 1px 3px #ccc;
+ -moz-box-shadow: 0px 1px 3px #ccc;
+ box-shadow: 0px 1px 3px #ccc;
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.