com web/php: Stop abusing the current element of the page configuration, and instead add a proper option to set body classes if appropriate.: cal.php
include/header.inc include/layout.inc styles/calendar.css
| From: | Adam Harvey | Date: | Fri, 07 Sep 2012 08:34:28 +0000 |
| Subject: | com web/php: Stop abusing the current element of the page configuration, and instead add a proper option to set body classes if appropriate.: cal.php include/header.inc include/layout.inc styles/calendar.css |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-14633@lists.php.net to get a copy of this message | ||
Commit: 0f25c08b5e159a628115f79c6fdfb08d83295b0d
Author: Adam Harvey <aharvey@php.net> Fri, 7 Sep 2012 16:33:57 +0800
Parents: f1f04062fe44614678ec048012d98940404cd9ed
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=0f25c08b5e159a628115f79c6fdfb08d83295b0d
Log:
Stop abusing the current element of the page configuration, and instead add a
proper option to set body classes if appropriate.
Changed paths:
M cal.php
M include/header.inc
M include/layout.inc
M styles/calendar.css
Diff:
diff --git a/cal.php b/cal.php
index 983e425..3248221 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 "<h2>", date("F j, Y", $date),
"</h2>\n";
foreach ($events as $event) {
diff --git a/include/header.inc b/include/header.inc
index 338b848..1226ae4 100644
--- a/include/header.inc
+++ b/include/header.inc
@@ -80,7 +80,7 @@ if (isset($shortname) && $shortname) {
<?php endif ?>
</head>
-<body class="<?php print $curr; ?>">
+<body class="<?php print $curr; ?> <?php echo $classes; ?>">
<div id="head-beta-warning">
<div id="beta-warning">
diff --git a/include/layout.inc b/include/layout.inc
index baa4ce3..06ddb43 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 4e2698e..176bec2 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;
}