Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » Event Calendar wish: LiveCalendarWidget for specific events

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1012 Views
  • Juanitou
    Avatar
    Community Member
    323 Posts

    Event Calendar wish: LiveCalendarWidget for specific events Link to this post

    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

    1012 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.