Skip to content

Commit

Permalink
added support for adding classes to event links
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Weller committed Oct 13, 2010
1 parent fcd6c95 commit 5ddc524
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions classes/calendar.php
Expand Up @@ -11,8 +11,9 @@ public static function factory()
public function fetchCalendar($events, $day_link_base = '')
{

$month = (int) (@$_GET['month'] ? $_GET['month'] : date('m'));
$year = (int) (@$_GET['year'] ? $_GET['year'] : date('Y'));
$month = (int) (@$_GET['month'] ? $_GET['month'] : date('m'));
$year = (int) (@$_GET['year'] ? $_GET['year'] : date('Y'));

/* draw table */
$calendar = '<table cellpadding="0" cellspacing="0" class="calendar">';

Expand Down Expand Up @@ -52,11 +53,11 @@ public function fetchCalendar($events, $day_link_base = '')
if( isset($event['detail']) ){
$calendar.= "<b>".$event['detail']."</b> - ";
}
$calendar .= '<a href="'.$event['url'].'">'.$event['title'].'</a>';
$calendar .= '<a href="'.$event['url'].'" '.( isset($event['class']) ? 'class="' . $event['class'] .'"' : '' ).'>'.$event['title'].'</a>';
$calendar .= '</div>';
}
}
//$calendar.= str_repeat('<p>&nbsp;</p>',2);

$calendar.= '</td>';
if($running_day == 6):
$calendar.= '</tr>';
Expand Down

0 comments on commit 5ddc524

Please sign in to comment.