From da525878a48ff8a332a60caee17a350d684ff9b2 Mon Sep 17 00:00:00 2001 From: Philipp Frenzel Date: Sat, 19 Dec 2015 09:17:12 +0100 Subject: [PATCH] Update yii2fullcalendar.php Clean the theme functionality and moved theme option into a main config param --- yii2fullcalendar.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/yii2fullcalendar.php b/yii2fullcalendar.php index b556ddd..e5961c7 100644 --- a/yii2fullcalendar.php +++ b/yii2fullcalendar.php @@ -27,9 +27,13 @@ class yii2fullcalendar extends elWidget * If a value is null, the corresponding attribute will not be rendered. */ public $options = [ - 'class' => 'fullcalendar', - 'theme' => true, + 'class' => 'fullcalendar' ]; + + /** + * @var bool $theme default is true and will render the jui theme for the calendar + */ + public $theme = true; /** * @var array clientOptions the HTML attributes for the widget container tag. @@ -120,10 +124,6 @@ public function init() if (!isset($this->options['class'])) { $this->options['class'] = 'fullcalendar'; } - //checks for the theme - if (!isset($this->options['theme'])) { - $this->options['theme'] = true; - } parent::init(); } @@ -159,7 +159,7 @@ protected function registerPlugin() $assets = CoreAsset::register($view); //by default we load the jui theme, but if you like you can set the theme to false and nothing gets loaded.... - if($this->options['theme'] == true) + if($this->theme == true) { ThemeAsset::register($view); } @@ -191,9 +191,9 @@ protected function registerPlugin() $js[] = "jQuery('#$id').fullCalendar($cleanOptions);"; /** - * Loads events separately from the calendar creation. Uncomment if you need this functionality. - * - * lets check if we have an event for the calendar... + * Loads events separately from the calendar creation. Uncomment if you need this functionality. + * + * lets check if we have an event for the calendar... * if(count($this->events)>0) * { * foreach($this->events AS $event) @@ -203,7 +203,7 @@ protected function registerPlugin() * $js[] = "jQuery('#$id').fullCalendar('renderEvent',$jsonEvent,$isSticky);"; * } * } - */ + */ $view->registerJs(implode("\n", $js),View::POS_READY); }