Skip to content

Commit

Permalink
Added custom menu support to Leatherbound theme, MDL-25212
Browse files Browse the repository at this point in the history
  • Loading branch information
stabijoh authored and stabijoh committed Mar 10, 2011
1 parent c096042 commit d60cc8d
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 6 deletions.
14 changes: 13 additions & 1 deletion theme/leatherbound/layout/frontpage.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

$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) {
Expand All @@ -18,7 +20,9 @@
} else if (!$showsidepost && !$showsidepre) {
$bodyclasses[] = 'content-only';
}

if ($hascustommenu) {
$bodyclasses[] = 'has_custom_menu';
}

echo $OUTPUT->doctype() ?>
<html <?php echo $OUTPUT->htmlattributes() ?>>
Expand Down Expand Up @@ -50,9 +54,17 @@

<!-- END OF HEADER -->

<?php if ($hascustommenu) { ?>
<div id="custommenuwrap"><div id="custommenu"><?php echo $custommenu; ?></div></div>
<?php } ?>

<!-- START OF CONTENT -->

<div id="page-content-wrapper" class="wrapper clearfix">




<div id="page-content">
<div id="region-main-box">
<div id="region-post-box">
Expand Down
9 changes: 9 additions & 0 deletions theme/leatherbound/layout/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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() ?>>
Expand Down Expand Up @@ -42,6 +47,10 @@
<?php } ?>
</div>
</div>

<?php if ($hascustommenu) { ?>
<div id="custommenuwrap"><div id="custommenu"><?php echo $custommenu; ?></div></div>
<?php } ?>

<?php if ($hasnavbar) { ?>
<div class="navbar">
Expand Down
9 changes: 9 additions & 0 deletions theme/leatherbound/layout/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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() ?>>
Expand Down Expand Up @@ -43,6 +48,10 @@
</div>
</div>

<?php if ($hascustommenu) { ?>
<div id="custommenuwrap"><div id="custommenu"><?php echo $custommenu; ?></div></div>
<?php } ?>

<?php if ($hasnavbar) { ?>
<div class="navbar">
<div class="wrapper clearfix">
Expand Down
92 changes: 87 additions & 5 deletions theme/leatherbound/style/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ a:active {
padding: 5px 0;
}

.breadcrumb {
padding-left: 10px;
}

.navbar .navbutton {
margin-top: 0;
}
Expand Down Expand Up @@ -163,10 +167,7 @@ h2.headingblock {

.course-content .current {
background: #da5013;
}

.course-content .current .left {
color: #fff;
color: #fff;
}

.course-content .main .content {
Expand Down Expand Up @@ -287,4 +288,85 @@ h2.headingblock {

.ie6 #dock .bd.oversized_content {
width: 100%;
}
}

/*custom menu styles */
#custommenuwrap {
background-color: #F7F6F1;
border-bottom: 1px solid #DDDDDD;
padding: 3px 0px;
}

#custommenu {
border: none !important;
border: 0px solid #fff !important;
margin: 0 25px;
}

#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: #35251B;
font-weight: 400;
}

.custom_menu_submenu .yui3-menu-label, .custom_menu_submenu .yui3-menuitem-content {
color: #35251B !important;
}

.yui3-skin-sam #page .yui3-menu-label.yui3-menu-label-active, .yui3-skin-sam #page .yui3-menuitem-active .yui3-menuitem-content {
color: #DA5013;
}

.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: 2px solid #DA5013 !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;
}

0 comments on commit d60cc8d

Please sign in to comment.