Skip to content

Commit

Permalink
Update yii2fullcalendar.php
Browse files Browse the repository at this point in the history
Clean the theme functionality and moved theme option into a main config param
  • Loading branch information
philippfrenzel committed Dec 19, 2015
1 parent cf4011a commit da52587
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions yii2fullcalendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)
Expand All @@ -203,7 +203,7 @@ protected function registerPlugin()
* $js[] = "jQuery('#$id').fullCalendar('renderEvent',$jsonEvent,$isSticky);";
* }
* }
*/
*/

$view->registerJs(implode("\n", $js),View::POS_READY);
}
Expand Down

0 comments on commit da52587

Please sign in to comment.