コード例 #1
0
 /**
  * Remove the subscription for the calendar.
  * @param int $id
  */
 public function actionUnsubscribe($id)
 {
     $savedCalendarSubscription = SavedCalendarSubscription::getById(intval($id));
     $savedCalendarSubscription->delete();
     $dataProvider = CalendarUtil::getCalendarItemsDataProvider(Yii::app()->user->userModel);
     $savedCalendarSubscriptions = $dataProvider->getSavedCalendarSubscriptions();
     $content = CalendarUtil::makeCalendarItemsList($savedCalendarSubscriptions->getSubscribedToSavedCalendarsAndSelected(), 'sharedcalendar[]', 'sharedcalendar', 'shared');
     echo $content;
 }
コード例 #2
0
 /**
  * Renders content.
  * @return string
  */
 protected function renderContent()
 {
     $content = CalendarUtil::makeCalendarItemsList($this->data, $this->field, $this->itemClass, $this->listType);
     $content = $this->wrapContent($content);
     $title = $this->renderTitleContent();
     return ZurmoHtml::tag('div', array('class' => 'calendars-list-container'), $title . $content);
 }
コード例 #3
0
 public function testMakeCalendarItemsList()
 {
     $savedCalendarSubscriptions = SavedCalendarSubscriptions::makeByUser(Yii::app()->user->userModel);
     $content = CalendarUtil::makeCalendarItemsList($savedCalendarSubscriptions->getMySavedCalendarsAndSelected(), 'mycalendar[]', 'mycalendar', 'saved');
     $this->assertContains('Test Cal', $content);
     $content = CalendarUtil::makeCalendarItemsList($savedCalendarSubscriptions->getSubscribedToSavedCalendarsAndSelected(), 'sharedcalendar[]', 'sharedcalendar', 'shared');
     $this->assertContains('Test Cal New', $content);
 }