Hi!
With my limited PHP knowledge, I’m trying to modify LiveCalendarWidget for it to show only the dates associated with an specific event. If I’m not missing something, this is not possible for the time being, at least not without assigning a different Calendar to every CalendarEvent. I’m surprised nobody asked for it before… :)
I extended CalendarEvent and added to the new controller a Widget function without the reference to the Parent (the Calendar) in the constructor:
class ActivityPage_Controller extends CalendarEvent_Controller {
protected function Widget($type) {
if($date = CalendarUtil::getDateFromURL())
$date_obj = new sfDate($date);
elseif($date = DataObject::get_one($this->getDateTimeClass(),"EventID = {$this->ID}", "StartDate ASC"))
$date_obj = new sfDate($date->StartDate);
else
return false;
// $this->Parent() for obtaining all ActivityHolder events (ActivityPage)
//return new $type($this->Parent(),$date_obj,$date_obj);
return new $type($this,$date_obj,$date_obj);
}
public function LiveCalendarWidget() {
return $this->Widget('LiveCalendarWidget');
}
}
That does not work before Events(), getStandardEvents() , getEventDateTimeClass()… and other functions from several classes of the module are included in ActivityPage, with some modifications. Finally, I can get the widget to show the events of the first month, but the functions for navigating through months don’t work. Argh!
Well, what can we expect of those methods ripping to pieces UncleCheese work (a price for the ugliest hack ever?).
Please vote for this wish: LiveCalendarWidget should show specific events, at least in CalendarEvent pages.
Best regards,
Juan