<?php
namespace ALPCAL;


Class Defaults
{
	public $alpcal_options; // passed from Wordpress, contains defaults from admin of the plugin
	
	/**
	 * Defines the caching directories based on the file structure of the current system
	 */
	public function __construct($alpcal_options)
	{
		$this->alpcal_options = $alpcal_options;
		$this->setDefaults_alpcal_options();
	}

	public function __destruct()
	{
	}

	private function setDefaults_alpcal_options()
	{
		if (!$this->alpcal_options['which_cal']) { $this->alpcal_options['which_cal']='BCA'; }
		if (!$this->alpcal_options['show_eventTypes']) { $this->alpcal_options['show_eventTypes']='Y'; }
		if (!$this->alpcal_options['cache_length_months']) { $this->alpcal_options['cache_length_months']=300; }
		if (!$this->alpcal_options['cache_length_events']) { $this->alpcal_options['cache_length_events']=300; }
		if (!$this->alpcal_options['first_day']) { $this->alpcal_options['first_day']='MON'; }
		if ($this->alpcal_options['calendars_additional']) 
			{
				$calendars_additional = $this->alpcal_options['calendars_additional'];
				$this->alpcal_options['calendars_additional'] = array();
				$ca = explode(",",$calendars_additional);
				foreach ($ca as $v)
				{
					$this->alpcal_options['calendars_additional'][] = $v;
				}
			}
		else{
			$this->alpcal_options['calendars_additional'] = array();
			}
		array_unshift($this->alpcal_options['calendars_additional'],'AlpineCalendar_ca');
	}


}
