--- /dev/null
+<?php
+if (defined('COMMON_EVENTS') && COMMON_EVENTS) {
+ $calendarDateArray = filter_var_array(
+ $_REQUEST,
+ array(
+ 'day' => array('filter' => FILTER_VALIDATE_INT, 'options' => array('min_range' => 1, 'max_range' => 31)),
+ 'month' => array('filter' => FILTER_VALIDATE_INT, 'options' => array('min_range' => 1, 'max_range' => 12)),
+ 'year' => array('filter' => FILTER_VALIDATE_INT, 'options' => array('min_range' => date('Y'), 'max_range' => date('Y') + 2)),
+ )
+ );
+ if ($calendarDateArray['day'] && $calendarDateArray['month'] && $calendarDateArray['year']) {
+ $time = mktime(
+ 0,
+ 0,
+ 0,
+ $calendarDateArray['month'],
+ $calendarDateArray['day'],
+ $calendarDateArray['year']
+ );
+ $_REQUEST['search'] = 1;
+ $_REQUEST['startMonth'] = $_REQUEST['endMonth'] = date('m/d/Y', $time);
+ }
+ $search = filter_var($_REQUEST['search'], FILTER_VALIDATE_BOOLEAN);
+ if ($search && isset($_REQUEST['eventName']) && !$eventName = filter_var($_REQUEST['eventName'])) {
+ $search = false;
+ }
+ $t = filter_var($_REQUEST['t']);
+ $eventId = filter_var($_REQUEST['eventid'], FILTER_VALIDATE_INT);
+ if (!$t && !$search && !$eventId) {
+ $_REQUEST['t'] = '30';
+ }
+ // set CommonApp define if not set
+ if (!defined('COMMON_APP_BASE')) {
+ define('COMMON_APP_BASE', '/var/www/server/CommonApps/');
+ }
+ // load the event application config files form CommonApps
+ define('COMMON_APP_NAME', 'EventCalendar');
+ define('COMMON_APP_VERSION', 'V1');
+ define('COMMON_APP_INI', 'application.ini');
+ define('COMMON_APP_SITE_INI', 'eventCalendar.ini');
+
+ define('COMMON_APP_CONTROLLER', 'IndexController');
+ $appPath = COMMON_APP_BASE . COMMON_APP_NAME . '/' . COMMON_APP_VERSION . '/';
+ define('COMMON_APP_PATH', $appPath);
+ // now only need to pull in the main file to run the app
+ // pull in admin.php file
+ unset($GLOBALS['bottomScripts']['external']);
+ require COMMON_APP_PATH . 'Bootstrap.php';
+} else {
+ $events = new Toolkit_Events_Display(
+ Toolkit_Database::getInstance()
+ );
+ echo $events->toHTML($this->keywordReplacement);
+}
+