From 0f25c08b5e159a628115f79c6fdfb08d83295b0d Mon Sep 17 00:00:00 2001 From: Adam Harvey Date: Fri, 7 Sep 2012 16:33:57 +0800 Subject: [PATCH] Stop abusing the current element of the page configuration, and instead add a proper option to set body classes if appropriate. --- cal.php | 4 ++-- include/header.inc | 2 +- include/layout.inc | 2 ++ styles/calendar.css | 14 +++++++------- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/cal.php b/cal.php index 983e42561..324822101 100644 --- a/cal.php +++ b/cal.php @@ -4,7 +4,7 @@ $_SERVER['BASE_PAGE'] = 'cal.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; $site_header_config = array( - "current" => "calendar", + "current" => "community", "css" => array('calendar.css'), ); @@ -56,7 +56,7 @@ elseif ($cy && $cm && $cd) { // Try to load events for that day, and display them all if ($events = load_events($date)) { - $site_header_config = array('current' => 'calendar calendar-day') + $site_header_config; + $site_header_config = array('classes' => 'calendar calendar-day') + $site_header_config; site_header("Events: ".date("F j, Y", $date), $site_header_config); echo "

", date("F j, Y", $date), "

\n"; foreach ($events as $event) { diff --git a/include/header.inc b/include/header.inc index 338b848f4..1226ae4c2 100644 --- a/include/header.inc +++ b/include/header.inc @@ -80,7 +80,7 @@ if (isset($shortname) && $shortname) { - +
diff --git a/include/layout.inc b/include/layout.inc index baa4ce334..06ddb436f 100644 --- a/include/layout.inc +++ b/include/layout.inc @@ -814,12 +814,14 @@ function site_header_beta($title = '', $config = array()) "lang" => myphpnet_language(), "current" => "", "meta-navigation" => array(), + 'classes' => '', ); $config += $defaults; $lang = language_convert($config["lang"]); $curr = $config["current"]; + $classes = $config['classes']; if (empty($title)) { $title = "Hypertext Preprocessor"; diff --git a/styles/calendar.css b/styles/calendar.css index 4e2698ee1..176bec2cf 100644 --- a/styles/calendar.css +++ b/styles/calendar.css @@ -104,36 +104,36 @@ } /* Single day view: let's try putting the events into columns. */ -section.calendar-day .vevent { +.calendar-day .vevent { float: left; width: 33%; margin-bottom: 1.5em; } -section.calendar-day .vevent:nth-child(3n+2) { +.calendar-day .vevent:nth-child(3n+2) { clear: left; } -section.calendar-day .vevent td { +.calendar-day .vevent td { background: #eee; border-right: solid 2.5em white; padding: 0.4em; } -section.calendar-day .vevent .url { +.calendar-day .vevent .url { border-bottom: solid 1px #99c; color: #3f438d; font-size: 1em; } -section.calendar-day .vevent .url b { +.calendar-day .vevent .url b { font-weight: bold; } -section.calendar-day .vevent tr.description td { +.calendar-day .vevent tr.description td { padding-top: 1.5em; } -section.calendar-day > br { +.calendar-day section > br { display: none; }