/** * Factory method that allows the creation of new objects * @version $Id: factory.php,v 1.5 2003/06/24 21:30:30 roger Exp $ * @param string $class the name of the object to create * @return object the created object */ function &calendar_userapi_factory($class) { static $calobject; static $icalobject; static $eventobject; static $importobject; static $exportobject; static $alarmobject; static $modinfo; if (!isset($modinfo)) { $modInfo =& xarMod::getInfo(xarMod::getRegID('calendar')); } switch (strtolower($class)) { case 'calendar': if (!isset($calobject)) { sys::import("modules.{$modInfo['osdirectory']}.class.calendar"); $calobject =& new Calendar(); } return $calobject; break; case 'ical_parser': if (!isset($icalobject)) { sys::import("modules.{$modInfo['osdirectory']}.class.ical_parser"); $icalobject =& new iCal_Parser(); } return $icalobject; break; case 'event': if (!isset($eventobject)) { sys::import("modules.{$modInfo['osdirectory']}.class.event"); $eventobject =& new Event(); } return $eventobject; break; /* case 'import': break; case 'export': break; case 'alarm': break; */ /* case 'import': break; case 'export': break; case 'alarm': break; */ default: return; break; } }
define('CALENDAR_FIRST_DAY_OF_WEEK', $cal_sdow); } else { // set the first day of the week to the admin/user default define('CALENDAR_FIRST_DAY_OF_WEEK', 0); } //echo 'cal_sdow = '.CALENDAR_FIRST_DAY_OF_WEEK; //====================================================================== // Define the location of the PEAR::Calendar files //====================================================================== if (!defined('CALENDAR_ROOT')) { define('CALENDAR_ROOT', xarModVars::get('calendar', 'pearcalendar_root')); } //====================================================================== // Define directory locations for this module //====================================================================== $modinfo = xarMod::getInfo(xarMod::getRegID('calendar')); if (!defined('CALENDAR_MODULE_ROOT')) { define('CALENDAR_MODULE_ROOT', "code/modules/{$modinfo['directory']}/"); } if (!defined('CALENDAR_MODULE_INCLUDES')) { define('CALENDAR_MODULE_INCLUDES', CALENDAR_MODULE_ROOT . 'xarincludes/'); } /** * Used to get the current view the calendar is in (Day, Week, Month, Year) */ function calendar_userapi_currentView() { xarVarFetch('func', 'str::', $func, 'main', XARVAR_NOT_REQUIRED); $valid = array('day', 'week', 'month', 'year'); $func = strtolower($func); if (!in_array($func, $valid)) {