Commit 2b6cd906 authored by Stacey Walker's avatar Stacey Walker
Browse files

dropdown menu styles and configuration option



bug #801081

Change-Id: I88f594d2c5dcf7d42aa17d069adb2eb59d9a69e1
Signed-off-by: default avatarStacey Walker <stacey@catalyst-eu.net>
Signed-off-by: default avatarPaul Walker <paul.walker@catalyst-eu.net>
parent 70227096
......@@ -100,6 +100,13 @@ $siteoptionform = array(
'help' => true,
'disabled' => in_array('theme', $OVERRIDDEN),
),
'dropdownmenu' => array(
'type' => 'checkbox',
'title' => get_string('dropdownmenu', 'admin'),
'description' => get_string('dropdownmenudescription', 'admin'),
'defaultvalue' => get_config('dropdownmenu'),
'disabled' => in_array('dropdownmenu', $OVERRIDDEN),
),
'homepageinfo' => array(
'type' => 'checkbox',
'title' => get_string('homepageinfo', 'admin'),
......@@ -558,7 +565,7 @@ function siteoptions_fail(Pieform $form, $field) {
function siteoptions_submit(Pieform $form, $values) {
$fields = array(
'sitename','lang','theme', 'pathtoclam',
'sitename','lang','theme', 'pathtoclam', 'dropdownmenu',
'defaultaccountlifetime', 'defaultaccountinactiveexpire', 'defaultaccountinactivewarn',
'allowpublicviews', 'allowpublicprofiles', 'generatesitemap',
'registration_sendweeklyupdates', 'institutionexpirynotification', 'institutionautosuspend',
......
......@@ -225,6 +225,8 @@ $string['anonymouscomments'] = 'Anonymous Comments';
$string['anonymouscommentsdescription'] = 'If checked, logged-out users can leave comments on public pages or pages they can access by secret URL.';
$string['antispam'] = 'Anti-spam';
$string['antispamdescription'] = 'The type of anti-spam measures used on publicly visible forms';
$string['dropdownmenu'] = 'Dropdown navigation';
$string['dropdownmenudescription'] = 'If checked, the main Mahara navigation will use a dropdown format for the sub-navigation.';
$string['defaultaccountinactiveexpire'] = 'Default account inactivity time';
$string['defaultaccountinactiveexpiredescription'] = 'How long a user account will remain active without the user logging in';
$string['defaultaccountinactivewarn'] = 'Warning time for inactivity/expiry';
......
......@@ -2468,5 +2468,9 @@ function xmldb_core_upgrade($oldversion=0) {
add_field($table, $field);
}
if ($oldversion < 2011062700) {
set_config('dropdownmenu', 0);
}
return $status;
}
......@@ -722,6 +722,7 @@ function core_install_firstcoredata_defaults() {
set_config('footerlinks', serialize(array('privacystatement', 'about', 'contactus')));
set_config('searchusernames', 1);
set_config('onlineuserssideblockmaxusers', 10);
set_config('dropdownmenu', 0);
// install the applications
$app = new StdClass;
......
......@@ -28,7 +28,7 @@
defined('INTERNAL') || die();
$config = new StdClass;
$config->version = 2011062400;
$config->version = 2011062700;
$config->release = '1.5.0dev';
$config->minupgradefrom = 2008040200;
$config->minupgraderelease = '1.0.0 (release tag 1.0.0_RELEASE)';
......
......@@ -365,6 +365,10 @@ EOF;
$smarty->assign('THEMELIST', json_encode(array_merge((array)json_decode($smarty->get_template_vars('THEMELIST')), $theme_list)));
}
$dropdownmenu = get_config('dropdownmenu');
if ($dropdownmenu) {
$smarty->assign('DROPDOWNMENU', $dropdownmenu);
}
$sitename = get_config('sitename');
if (!$sitename) {
......
......@@ -579,4 +579,28 @@ div.sideblock h3 a:hover {
/* collection */
ul.colnav li a {
color: #FFF;
}
\ No newline at end of file
}
/**************** DROPDOWN NAVIGATION ****************/
/**************** SUB NAVIGATION *********************/
#main-nav .dropdown-sub {
background: #F3F3F3 !important;
top: 27px !important;
border-width:1px;
border-style:solid;
border-color: transparent #DDDDDD #DDDDDD #DDDDDD;
}
#main-nav .dropdown-sub li a,
#main-nav .dropdown-sub li a:link,
#main-nav .dropdown-sub li a:visited,
#main-nav .dropdown-sub li a:active {
color: #0B1960;
font-weight: bold;
text-decoration: none !important;
}
#main-nav .dropdown-sub li a:hover,
#main-nav .dropdown-sub li.selected a:hover {
color: #1A428F !important;
text-decoration: underline !important;
}
......@@ -541,3 +541,22 @@ div.sideblock h3 a:hover {
.attachments tbody th {
color: #333;
}
/**************** DROPDOWN NAVIGATION ****************/
/**************** SUB NAVIGATION *********************/
#main-nav .dropdown-sub {
background: #ECECEC !important;
}
#main-nav .dropdown-sub li a,
#main-nav .dropdown-sub li a:link,
#main-nav .dropdown-sub li a:visited,
#main-nav .dropdown-sub li a:active {
color: #474220;
text-decoration: none !important;
}
#main-nav .dropdown-sub li a:hover,
#main-nav .dropdown-sub li.selected a:hover {
color: #7E7327 !important;
text-decoration: none !important;
}
......@@ -744,4 +744,28 @@ ul.colnav li a {
tr.editrow, tr.editrow td {
background: #1C3740 !important;
border: 0 !important;
}
\ No newline at end of file
}
/**************** DROPDOWN NAVIGATION ****************/
/**************** SUB NAVIGATION *********************/
#main-nav .dropdown-sub {
background: #254E5C !important;
top: 30px !important;
}
#main-nav li.selected .dropdown-sub {
background: #2EBFF4 !important;
}
#main-nav .dropdown-sub li a,
#main-nav .dropdown-sub li a:link,
#main-nav .dropdown-sub li a:visited,
#main-nav .dropdown-sub li a:active {
color: #FFFFFF;
font-weight: bold;
text-decoration: none !important;
}
#main-nav .dropdown-sub li a:hover,
#main-nav .dropdown-sub li.selected a:hover {
color: #FFFFFF !important;
text-decoration: underline !important;
}
/**************** DROPDOWN NAVIGATION ****************/
/**************** MAIN NAVIGATION ********************/
#top-wrapper {
height: 100px;
background-position: left bottom;
}
#main-nav.dropdown-main li {
position: relative;
height: auto;
}
/**************** SUB NAVIGATION *********************/
#main-nav li {
z-index: 3000;
}
#main-nav .dropdown-sub {
display: none !important;
position: absolute;
top: 25px;
left:0;
z-index: 1000;
clear: both;
padding: 4px 20px 10px 10px !important;
margin: 0;
background: #FFFFFF;
}
#main-nav .dropdown-sub li {
display: block;
float: none !important;
margin: 0 !important;
list-style-type: none;
background: transparent !important;
}
#main-nav .dropdown-sub li a,
#main-nav .dropdown-sub li a:link,
#main-nav .dropdown-sub li a:visited,
#main-nav .dropdown-sub li a:active {
padding: 4px 0 !important;
background: transparent !important;
border: none;
float: none;
width: 150px;
white-space: normal;
line-height: 1.3em;
text-align: left;
height: auto;
}
#main-nav .dropdown-sub li.selected {
margin: 0;
background: transparent !important;
}
#main-nav li:hover .dropdown-sub {
display: block !important;
}
......@@ -9,7 +9,11 @@
<div id="loading-box"></div>
<div id="top-wrapper"><h1 id="site-logo"><a href="{$WWWROOT}"><img src="{theme_url filename='images/site-logo.png'}" alt="{$sitename}"></a></h1>
{include file="header/topright.tpl"}
{if $DROPDOWNMENU}
{include file="header/dropdown.tpl"}
{else}
{include file="header/navigation.tpl"}
{/if}
<div class="cb"></div>
</div>
<div id="main-wrapper">
......
{if $MAINNAV}
<div id="main-nav" class="dropdown-main">
<ul id="dropdown-nav">
{strip}
{foreach from=$MAINNAV item=item}
{if $item.weight == 10}
<li class="{if $item.selected}selected{/if} dropdown-nav-home"{if $item.accesskey} id="{$item.accesskey}"{/if}>
<a href="{$WWWROOT}{$item.url}"{if $item.accesskey} accesskey="{$item.accesskey}"{/if}>{$item.title}</a>
{else}
<li{if $item.accesskey} id="{$item.accesskey}"{/if} {if $item.selected} class="selected"{/if} >
<a href="{if $INSTITUTIONALADMIN}{$WWWROOT}{$item.url}{else}#{/if}"{if $item.accesskey} accesskey="{$item.accesskey}"{/if}>{$item.title}</a>
{/if}
{if $item.submenu}
<ul class="dropdown-sub">
{strip}
{foreach from=$item.submenu item=subitem}
<li>
<a href="{$WWWROOT}{$subitem.url}"{if $subitem.accesskey} accesskey="{$subitem.accesskey}"{/if}>{$subitem.title}</a>
</li>
{/foreach}
{/strip}
</ul>
{/if}
</li>
{/foreach}
{if $ADMIN || $INSTITUTIONALADMIN}
<li><a href="{$WWWROOT}" accesskey="h">{str tag="returntosite"}</a></li>
{elseif $USER->get('admin')}
<li><a href="{$WWWROOT}admin/" accesskey="a">{str tag="siteadministration"}</a></li>
{elseif $USER->is_institutional_admin()}
<li><a href="{$WWWROOT}admin/users/search.php" accesskey="a">{str tag="institutionadministration"}</a></li>
{/if}
{/strip}
</ul>
</div>
{/if}
......@@ -30,6 +30,9 @@
<link rel="stylesheet" type="text/css" href="{$cssurl}">
{/foreach}
<link rel="stylesheet" type="text/css" href="{theme_url filename='style/print.css'}" media="print">
{if $DROPDOWNMENU}
<link rel="stylesheet" type="text/css" href="{theme_url filename='style/dropdown.css'}">
{/if}
<script type="text/javascript" src="{$WWWROOT}js/css.js"></script>
<link rel="shortcut icon" href="{$WWWROOT}favicon.ico" type="image/vnd.microsoft.icon">
</head>
......
......@@ -573,4 +573,26 @@ body#micro #footer-wrap {
#containerX #top-wrapper a:hover,
#containerX #top-wrapper a:active {
color: #ffffff;
}
\ No newline at end of file
}
/**************** DROPDOWN NAVIGATION ****************/
/**************** SUB NAVIGATION *********************/
#main-nav .dropdown-sub {
background: #F3F3F3 !important;
top: 33px !important;
}
#main-nav .dropdown-sub li a,
#main-nav .dropdown-sub li a:link,
#main-nav .dropdown-sub li a:visited,
#main-nav .dropdown-sub li a:active {
color: #8E1901;
font-size: 85%;
font-weight: bold;
text-decoration: none !important;
}
#main-nav .dropdown-sub li a:hover,
#main-nav .dropdown-sub li.selected a:hover {
color: #8E1901 !important;
text-decoration: underline !important;
}
......@@ -585,4 +585,28 @@ div.sideblock #friendscontrol label {
/* collection */
ul.colnav li a {
color: #FFF;
}
\ No newline at end of file
}
/**************** DROPDOWN NAVIGATION ****************/
/**************** SUB NAVIGATION *********************/
#main-nav .dropdown-sub {
border-width:1px;
border-style:solid;
border-color: #5C0758 #F3D2F4 #F3D2F4 #F3D2F4;
background: #F3D2F4 !important;
top: 33px !important;
}
#main-nav .dropdown-sub li a,
#main-nav .dropdown-sub li a:link,
#main-nav .dropdown-sub li a:visited,
#main-nav .dropdown-sub li a:active {
color: #5C0758;
font-weight: bold;
text-decoration: none !important;
}
#main-nav .dropdown-sub li a:hover,
#main-nav .dropdown-sub li.selected a:hover {
color: #5C0758 !important;
text-decoration: underline !important;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment