Skip to content

Commit

Permalink
Stop abusing the current element of the page configuration, and inste…
Browse files Browse the repository at this point in the history
…ad add a

proper option to set body classes if appropriate.
  • Loading branch information
LawnGnome committed Sep 7, 2012
1 parent f1f0406 commit 0f25c08
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cal.php
Expand Up @@ -4,7 +4,7 @@
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';

$site_header_config = array(
"current" => "calendar",
"current" => "community",
"css" => array('calendar.css'),
);

Expand Down Expand Up @@ -56,7 +56,7 @@

// 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) {
Expand Down
2 changes: 1 addition & 1 deletion include/header.inc
Expand Up @@ -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">
Expand Down
2 changes: 2 additions & 0 deletions include/layout.inc
Expand Up @@ -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";
Expand Down
14 changes: 7 additions & 7 deletions styles/calendar.css
Expand Up @@ -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;
}

0 comments on commit 0f25c08

Please sign in to comment.