diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 790750c393..92aa975787 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,17 @@ +2009-02-06 Evi Vanoost + + * include/styles/menu.css: Updated to make it look good again + + * general/main_menu.php: Updated to make it look good again. Also + simplified to allow easier modification. If you want to make things + visible/selected again externally (JS or COOKIE), use the IF/ELSE + construction with the big warning. + + * general/links_menu.php: Updated to conform to CSS + + * include/javascript/jquery.cookie.js: Added to mess with cookies for + menu. I will do this in a future update + 2009-02-05 Evi Vanoost * general/header.php: Added alt tags to images diff --git a/pandora_console/general/links_menu.php b/pandora_console/general/links_menu.php index 10aa2512e2..c439144c41 100644 --- a/pandora_console/general/links_menu.php +++ b/pandora_console/general/links_menu.php @@ -19,9 +19,9 @@ $sql = 'SELECT link, name FROM tlink ORDER BY name'; $result = get_db_all_rows_sql ($sql); if ($result !== false) { echo '
:: '.__('Links').' ::
'; - echo ''; + echo ''; } echo '
:: '.__('Operation').' ::
'; diff --git a/pandora_console/include/javascript/jquery.cookie.js b/pandora_console/include/javascript/jquery.cookie.js new file mode 100644 index 0000000000..a80bfa29d6 --- /dev/null +++ b/pandora_console/include/javascript/jquery.cookie.js @@ -0,0 +1,97 @@ +/** + * Cookie plugin + * + * Copyright (c) 2006 Klaus Hartl (stilbuero.de) + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ + +/** + * Create a cookie with the given name and value and other optional parameters. + * + * @example $.cookie('the_cookie', 'the_value'); + * @desc Set the value of a cookie. + * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true }); + * @desc Create a cookie with all available options. + * @example $.cookie('the_cookie', 'the_value'); + * @desc Create a session cookie. + * @example $.cookie('the_cookie', null); + * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain + * used when the cookie was set. + * + * @param String name The name of the cookie. + * @param String value The value of the cookie. + * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. + * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. + * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. + * If set to null or omitted, the cookie will be a session cookie and will not be retained + * when the the browser exits. + * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). + * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). + * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will + * require a secure protocol (like HTTPS). + * @type undefined + * + * @name $.cookie + * @cat Plugins/Cookie + * @author Klaus Hartl/klaus.hartl@stilbuero.de + */ + +/** + * Get the value of a cookie with the given name. + * + * @example $.cookie('the_cookie'); + * @desc Get the value of a cookie. + * + * @param String name The name of the cookie. + * @return The value of the cookie. + * @type String + * + * @name $.cookie + * @cat Plugins/Cookie + * @author Klaus Hartl/klaus.hartl@stilbuero.de + */ +jQuery.cookie = function(name, value, options) { + if (typeof value != 'undefined') { // name and value given, set cookie + options = options || {}; + if (value === null) { + value = ''; + options = $.extend({}, options); // clone object since it's unexpected behavior if the expired property were changed + options.expires = -1; + } + var expires = ''; + if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { + var date; + if (typeof options.expires == 'number') { + date = new Date(); + date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); + } else { + date = options.expires; + } + expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE + } + // NOTE Needed to parenthesize options.path and options.domain + // in the following expressions, otherwise they evaluate to undefined + // in the packed version for some reason... + var path = options.path ? '; path=' + (options.path) : ''; + var domain = options.domain ? '; domain=' + (options.domain) : ''; + var secure = options.secure ? '; secure' : ''; + document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); + } else { // only name given, get cookie + var cookieValue = null; + if (document.cookie && document.cookie != '') { + var cookies = document.cookie.split(';'); + for (var i = 0; i < cookies.length; i++) { + var cookie = jQuery.trim(cookies[i]); + // Does this cookie string begin with the name we want? + if (cookie.substring(0, name.length + 1) == (name + '=')) { + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); + break; + } + } + } + return cookieValue; + } +}; \ No newline at end of file diff --git a/pandora_console/include/styles/menu.css b/pandora_console/include/styles/menu.css index 28fd0d20bc..a012532a3f 100644 --- a/pandora_console/include/styles/menu.css +++ b/pandora_console/include/styles/menu.css @@ -31,16 +31,14 @@ padding: 0; margin: 0; } -.menu li.menu_option { +.menu li.selected, .menu li.not_selected { border: 0px solid black; border-bottom: 1px solid #d4d4d4; margin: 0; } -li.not_selected a { - background: #E9F3D2; -} -.menu a { +.menu li a { + background-color: inherit; color: #000000; display:block; /* This makes it so that the whole li is clickable */ text-decoration:none; @@ -52,142 +50,97 @@ li.not_selected a { text-decoration:none; color: #D54E21; } -/* This is for the dropout menu */ -.menu.int ul { - height: 26px; -} -/* a selected ul has a height set in the style tag */ -.menu.int ul.selected { - height: inherit; -} - -/* Force the hovered ul to be 28px unless the ul is selected */ -.menu.int ul:hover { - height: 26px; -} -.menu.int ul:hover.selected { - height: inherit; -} - -.menu.int ul.selected > .submenu { - height: 14px; -} .submenu { - background: #FFFFFF !important; - border-bottom-color: #AAAAAA !important; - border-bottom-style: solid; - border-bottom-width: 1px; - border-right-color: #D6D6D6 !important; - border-right-style: solid; - border-right-width: 1px; font-family: Georgia,"Times New Roman","Bitstream Charter",Times,serif; margin: 0px 10px 0px 0; - + width:155px; } -.submenu ul li a { - background: #FFFFFF !important; - border-style: none solid none none; - border-width: 0 1px 0 0; - border-color: #E9F3D2; - margin-left: 0; -} -.submenu ul li a:hover { - background: #D6DCC6 !important; -} -.submenu_selected { - font-weight: bold; - background-color: #F5F5F5 !important; -} -.not_selected .submenu_not_selected a { - background-color: #FFFFFF !important; -} -.menu li.selected .title { - background: #71AC6B; -} -.menu .not_selected .title { +.submenu li a { background-color: #E9F3D2; + margin-left: 0px; + padding-left: 29px; + display:block; + border-width: 1px 0 0 1px; + border-style: solid; + border-color: #dadbdc; } -.menu .toggle { - clear: right; - float: right; - height: 27px; - width: 22px; - z-index: 1; +.menu li.has_submenu.selected > a, .menu li:hover.has_submenu > a { + background: transparent url(images/toggle.gif) no-repeat 110px 2px; } -.menu .menu_icon { - clear: left; - float: left; - height: 27px; - width: 22px; +.menu li:hover.has_submenu ul.invisible { + display:block; } -.menu ul li:hover > .title > .toggle, .menu ul li.selected > .title > .toggle { - background: transparent url(images/toggle.gif) no-repeat scroll !important; +.menu li.links { + background: #E9F3D2 url(../../images/link.png) no-repeat 4px 8px; + border-width: 1px 0 0 1px; + border-style: solid; + border-color: #dadbdc; } /* Icons specified here */ -div#icon_oper-agents { - background: transparent url(../../images/bricks.png) no-repeat 4px 8px; +#icon_oper-agents { + background: #E9F3D2 url(../../images/bricks.png) no-repeat 4px 4px; } -div#icon_oper-servers { - background: transparent url(../../images/server_database.png) no-repeat 4px 8px; +#icon_oper-servers { + background: #E9F3D2 url(../../images/server_database.png) no-repeat 4px 4px; } -div#icon_oper-incidents { - background: transparent url(../../images/book_edit.png) no-repeat 4px 8px; +#icon_oper-incidents { + background: #E9F3D2 url(../../images/book_edit.png) no-repeat 4px 4px; } -div#icon_oper-events { - background: transparent url(../../images/lightning_go.png) no-repeat 4px 8px; +#icon_oper-events { + background: #E9F3D2 url(../../images/lightning_go.png) no-repeat 4px 4px; } /* users */ -div#icon_oper-users { - background: transparent url(../../images/group.png) no-repeat 4px 8px; +#icon_oper-users { + background: #E9F3D2 url(../../images/group.png) no-repeat 4px 4px; } /* trap console */ -div#icon_oper-snmpc, #god-snmpc { - background: transparent url(../../images/computer_error.png) no-repeat 4px 8px; +#icon_oper-snmpc, #icon_god-snmpc { + background: #E9F3D2 url(../../images/computer_error.png) no-repeat 4px 4px; } -div#icon_oper-messages { - background: transparent url(../../images/email.png) no-repeat 4px 8px; +#icon_oper-messages { + background: #E9F3D2 url(../../images/email.png) no-repeat 4px 4px; } -div#icon_oper-reporting { - background: transparent url(../../images/reporting.png) no-repeat 4px 8px; +#icon_oper-reporting { + background: #E9F3D2 url(../../images/reporting.png) no-repeat 4px 4px; } -div#icon_oper-visualc { - background: transparent url(../../images/monitor.png) no-repeat 4px 8px; +#icon_oper-visualc { + background: #E9F3D2 url(../../images/monitor.png) no-repeat 4px 4px; } -div#icon_oper-extensions, div#icon_god-extensions { - background: transparent url(../../images/extensions.png) no-repeat 4px 8px; +#icon_oper-extensions, #icon_god-extensions { + background: #E9F3D2 url(../../images/extensions.png) no-repeat 4px 4px; } /* Godmode images */ -div#icon_god-agents { - background: transparent url(../../images/god1.png) no-repeat 4px 8px; +#icon_god-agents { + background: #E9F3D2 url(../../images/god1.png) no-repeat 4px 4px; } -div#icon_god-modules { - background: transparent url(../../images/brick.png) no-repeat 4px 8px; +#icon_god-modules { + background: #E9F3D2 url(../../images/brick.png) no-repeat 4px 4px; } -div#icon_god-alerts { - background: transparent url(../../images/god2.png) no-repeat 4px 8px; +#icon_god-alerts { + background: #E9F3D2 url(../../images/god2.png) no-repeat 4px 4px; } -div#icon_god-dbmaint { - background: transparent url(../../images/god8.png) no-repeat 4px 8px; +#icon_god-dbmaint { + background: #E9F3D2 url(../../images/god8.png) no-repeat 4px 4px; } -div#icon_god-users { - background: transparent url(../../images/god3.png) no-repeat 4px 8px; +#icon_god-users { + background: #E9F3D2 url(../../images/god3.png) no-repeat 4px 4px; } -div#icon_god-reporting { - background: transparent url(../../images/reporting_edit.png) no-repeat 4px 8px; +#icon_god-reporting { + background: #E9F3D2 url(../../images/reporting_edit.png) no-repeat 4px 4px; } -div#icon_god-profiles { - background: transparent url(../../images/god4.png) no-repeat 4px 8px; +#icon_god-profiles { + background: #E9F3D2 url(../../images/god4.png) no-repeat 4px 4px; } -div#icon_god-servers { - background: transparent url(../../images/god5.png) no-repeat 4px 8px; +#icon_god-servers { + background: #E9F3D2 url(../../images/god5.png) no-repeat 4px 4px; } -div#icon_god-audit { - background: transparent url(../../images/god6.png) no-repeat 4px 8px; +#icon_god-audit { + background: #E9F3D2 url(../../images/god6.png) no-repeat 4px 4px; } -div#icon_god-setup { - background: transparent url(../../images/god7.png) no-repeat 4px 8px; -} -div#icon_oper-inventory { - background: transparent url(../../images/page_white_text.png) no-repeat 4px 8px; +#icon_god-setup { + background: #E9F3D2 url(../../images/god7.png) no-repeat 4px 4px; } +#icon_oper-inventory { + background: #E9F3D2 url(../../images/page_white_text.png) no-repeat 4px 4px; +} \ No newline at end of file