diff --git a/modules/calendarview/controllers/calendarview.php b/modules/calendarview/controllers/calendarview.php index 9312d8fe..0f628bc8 100644 --- a/modules/calendarview/controllers/calendarview.php +++ b/modules/calendarview/controllers/calendarview.php @@ -103,14 +103,14 @@ public function day($display_year, $display_user, $display_month, $display_day) ->order_by("captured", "ASC") ->find_all($page_size, $offset)); } - +/* // Set up breadcrumbs $calendar_breadcrumbs[0] = new Calendar_Breadcrumb($display_year, url::site("calendarview/calendar/" . $display_year . "/" . $display_user)); $calendar_breadcrumbs[1] = new Calendar_Breadcrumb(t(date("F", mktime(0, 0, 0, $display_month, $display_day, $display_year))), url::site("calendarview/month/" . $display_year . "/" . $display_user . "/" . $display_month)); $fake_item = new Calendar_Breadcrumb($display_day, ""); $template->set_global("item", $fake_item); $template->set_global("parents", $calendar_breadcrumbs); - +*/ // Finish setting up and then display the page. $template->set_global("children_count", $day_count); $template->content = new View("dynamic.html"); @@ -179,13 +179,13 @@ public function month($display_year, $display_user, $display_month) { ->order_by("captured", "ASC") ->find_all($page_size, $offset)); } - +/* // Set up breadcrumbs for this page. $calendar_breadcrumbs[0] = new Calendar_Breadcrumb($display_year, url::site("calendarview/calendar/" . $display_year . "/" . $display_user)); $fake_item = new Calendar_Breadcrumb(t(date("F", mktime(0, 0, 0, $display_month, 1, $display_year))), ""); $template->set_global("item", $fake_item); $template->set_global("parents", $calendar_breadcrumbs); - +*/ // Finish setting up and then display the page. $template->set_global("children_count", $day_count); $template->content = new View("dynamic.html"); diff --git a/modules/calendarview/libraries/PHPCalendar.php b/modules/calendarview/libraries/PHPCalendar.php index de866431..9b212a05 100644 --- a/modules/calendarview/libraries/PHPCalendar.php +++ b/modules/calendarview/libraries/PHPCalendar.php @@ -4,6 +4,7 @@ class PHPCalendar_Core { // Month and year to use for calendaring protected $month; protected $year; + protected $month_url; // First Day of the Week (0 = Sunday, 1 = Monday, etc.). protected $week_start = 1; @@ -11,7 +12,7 @@ class PHPCalendar_Core { // Events for the current month. protected $event_data = Array(); - public function __construct($month = NULL, $year = NULL) + public function __construct($month = NULL, $year = NULL, $url = NULL) { empty($month) and $month = date('n'); // Current month empty($year) and $year = date('Y'); // Current year @@ -19,6 +20,7 @@ public function __construct($month = NULL, $year = NULL) // Set the month and year $this->month = (int) $month; $this->year = (int) $year; + $this->month_url = $url; } @@ -28,7 +30,7 @@ public function event($day_of_the_week, $event_url = NULL, $css_id = NULL, $cust public function render() { - return $this->generate_calendar($this->year, $this->month, $this->event_data, 2, NULL, $this->week_start, NULL); + return $this->generate_calendar($this->year, $this->month, $this->event_data, 2, $this->month_url, $this->week_start, NULL); } # PHP Calendar (version 2.3), written by Keith Devens diff --git a/modules/calendarview/views/calendarview_year.html.php b/modules/calendarview/views/calendarview_year.html.php index 8db9a511..4219ac01 100644 --- a/modules/calendarview/views/calendarview_year.html.php +++ b/modules/calendarview/views/calendarview_year.html.php @@ -9,8 +9,9 @@ // Loop through January to November in the current year. while ($counter_months <12) { print ""; - - $calendar = new PHPCalendar($counter_months, $calendar_year); + + $month_url = url::site("calendarview/month/" . $calendar_year . "/" . $calendar_user . "/" . $counter_months . "/"); + $calendar = new PHPCalendar($counter_months, $calendar_year, $month_url); // Figure out if any photos were taken for the current month. if ($calendar_user == "-1") { @@ -108,7 +109,8 @@ // Do December seperately, because the mktime code is different. print ""; - $calendar = new PHPCalendar($counter_months, $calendar_year); + $month_url = url::site("calendarview/month/" . $calendar_year . "/" . $calendar_user . "/" . $counter_months . "/"); + $calendar = new PHPCalendar($counter_months, $calendar_year, $month_url); if ($calendar_user == "-1") { $month_count = ORM::factory("item") ->viewable()