2010-12-07 20:19:27 +01:00
|
|
|
<?php
|
2012-01-09 23:47:58 +01:00
|
|
|
require_once __DIR__."/configs/conf.php";
|
|
|
|
require_once __DIR__."/configs/ACL.php";
|
2010-12-07 20:19:27 +01:00
|
|
|
require_once 'propel/runtime/lib/Propel.php';
|
2012-08-24 03:58:21 +02:00
|
|
|
|
2011-11-29 22:07:38 +01:00
|
|
|
Propel::init(__DIR__."/configs/airtime-conf-production.php");
|
2012-08-24 03:58:21 +02:00
|
|
|
|
2011-03-24 04:24:06 +01:00
|
|
|
require_once __DIR__."/configs/constants.php";
|
2011-09-26 21:32:56 +02:00
|
|
|
require_once 'Preference.php';
|
2012-04-16 16:19:34 +02:00
|
|
|
require_once "DateHelper.php";
|
|
|
|
require_once "OsPath.php";
|
2012-09-05 22:14:08 +02:00
|
|
|
require_once "Database.php";
|
2011-03-24 04:24:06 +01:00
|
|
|
require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php';
|
2011-03-22 14:55:33 +01:00
|
|
|
|
2012-08-24 03:58:21 +02:00
|
|
|
|
2012-05-06 04:29:31 +02:00
|
|
|
date_default_timezone_set(Application_Model_Preference::GetTimezone());
|
|
|
|
|
2012-08-24 03:58:21 +02:00
|
|
|
|
2012-04-02 06:31:26 +02:00
|
|
|
global $CC_CONFIG;
|
2012-06-23 00:01:00 +02:00
|
|
|
$airtime_version = Application_Model_Preference::GetAirtimeVersion();
|
|
|
|
$uniqueid = Application_Model_Preference::GetUniqueId();
|
2012-06-27 16:27:53 +02:00
|
|
|
$CC_CONFIG['airtime_version'] = md5($airtime_version.$uniqueid);
|
2011-11-15 22:10:40 +01:00
|
|
|
require_once __DIR__."/configs/navigation.php";
|
|
|
|
|
2011-08-12 21:36:00 +02:00
|
|
|
Zend_Validate::setDefaultNamespaces("Zend");
|
|
|
|
|
|
|
|
$front = Zend_Controller_Front::getInstance();
|
2012-01-16 09:56:57 +01:00
|
|
|
$front->registerPlugin(new RabbitMqPlugin());
|
2011-08-12 21:36:00 +02:00
|
|
|
|
2012-09-06 20:01:54 +02:00
|
|
|
|
2012-01-16 09:56:57 +01:00
|
|
|
/* The bootstrap class should only be used to initialize actions that return a view.
|
2011-08-12 21:36:00 +02:00
|
|
|
Actions that return JSON will not use the bootstrap class! */
|
2010-12-07 20:19:27 +01:00
|
|
|
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|
|
|
{
|
2011-08-23 18:45:03 +02:00
|
|
|
protected function _initDoctype()
|
2010-12-07 20:19:27 +01:00
|
|
|
{
|
|
|
|
$this->bootstrap('view');
|
|
|
|
$view = $this->getResource('view');
|
|
|
|
$view->doctype('XHTML1_STRICT');
|
|
|
|
}
|
|
|
|
|
2011-08-23 18:45:03 +02:00
|
|
|
protected function _initHeadLink()
|
|
|
|
{
|
2012-02-08 22:21:57 +01:00
|
|
|
global $CC_CONFIG;
|
2012-02-09 18:07:32 +01:00
|
|
|
|
2011-08-23 18:45:03 +02:00
|
|
|
$view = $this->getResource('view');
|
2011-04-18 17:02:09 +02:00
|
|
|
$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
|
2012-01-27 21:30:44 +01:00
|
|
|
$baseDir = dirname($_SERVER['SCRIPT_FILENAME']);
|
2011-04-18 17:02:09 +02:00
|
|
|
|
2012-02-08 22:21:57 +01:00
|
|
|
$view->headLink()->appendStylesheet($baseUrl.'/css/redmond/jquery-ui-1.8.8.custom.css?'.$CC_CONFIG['airtime_version']);
|
|
|
|
$view->headLink()->appendStylesheet($baseUrl.'/css/pro_dropdown_3.css?'.$CC_CONFIG['airtime_version']);
|
|
|
|
$view->headLink()->appendStylesheet($baseUrl.'/css/qtip/jquery.qtip.min.css?'.$CC_CONFIG['airtime_version']);
|
|
|
|
$view->headLink()->appendStylesheet($baseUrl.'/css/styles.css?'.$CC_CONFIG['airtime_version']);
|
2012-04-03 19:53:08 +02:00
|
|
|
$view->headLink()->appendStylesheet($baseUrl.'/css/masterpanel.css?'.$CC_CONFIG['airtime_version']);
|
2011-08-23 18:45:03 +02:00
|
|
|
}
|
2010-12-07 20:19:27 +01:00
|
|
|
|
2011-08-23 18:45:03 +02:00
|
|
|
protected function _initHeadScript()
|
|
|
|
{
|
2012-02-01 16:57:38 +01:00
|
|
|
global $CC_CONFIG;
|
2012-02-06 11:07:10 +01:00
|
|
|
|
2011-08-23 18:45:03 +02:00
|
|
|
$view = $this->getResource('view');
|
2011-04-18 17:02:09 +02:00
|
|
|
$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
|
2012-01-27 21:30:44 +01:00
|
|
|
$baseDir = dirname($_SERVER['SCRIPT_FILENAME']);
|
2011-04-18 17:02:09 +02:00
|
|
|
|
2012-08-21 22:54:14 +02:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery-1.7.2.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery-ui-1.8.18.custom.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/libs/jquery.stickyPanel.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/qtip/jquery.qtip.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
2012-04-25 22:39:58 +02:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/jplayer/jquery.jplayer.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/sprintf/sprintf-0.7-beta1.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
2011-09-30 20:46:09 +02:00
|
|
|
$view->headScript()->appendScript("var baseUrl='$baseUrl/'");
|
2011-01-31 05:05:49 +01:00
|
|
|
|
2011-02-01 17:43:52 +01:00
|
|
|
//scripts for now playing bar
|
2012-02-08 22:21:57 +01:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/helperfunctions.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
2012-05-09 02:41:09 +02:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/dashboard.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
2012-02-08 22:21:57 +01:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/versiontooltip.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
2012-01-16 09:56:57 +01:00
|
|
|
|
2012-02-14 21:43:27 +01:00
|
|
|
|
2012-02-08 22:21:57 +01:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/common.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
2012-02-09 18:07:32 +01:00
|
|
|
|
2012-07-11 00:51:32 +02:00
|
|
|
$user = Application_Model_User::getCurrentUser();
|
2012-04-20 17:31:24 +02:00
|
|
|
if (!is_null($user)){
|
|
|
|
$userType = $user->getType();
|
|
|
|
} else {
|
|
|
|
$userType = "";
|
|
|
|
}
|
|
|
|
$view->headScript()->appendScript("var userType = '$userType';");
|
2012-07-10 21:09:28 +02:00
|
|
|
|
2012-08-24 03:58:21 +02:00
|
|
|
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) {
|
2012-02-08 22:21:57 +01:00
|
|
|
$view->headScript()->appendFile($baseUrl.'/js/libs/google-analytics.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
2012-02-01 16:57:38 +01:00
|
|
|
}
|
2011-02-03 23:51:35 +01:00
|
|
|
}
|
2011-03-22 14:55:33 +01:00
|
|
|
|
2011-03-24 04:24:06 +01:00
|
|
|
protected function _initViewHelpers()
|
|
|
|
{
|
2011-02-03 23:51:35 +01:00
|
|
|
$view = $this->getResource('view');
|
2011-01-31 00:20:47 +01:00
|
|
|
$view->addHelperPath('../application/views/helpers', 'Airtime_View_Helper');
|
2011-01-30 22:47:11 +01:00
|
|
|
}
|
2011-03-22 14:55:33 +01:00
|
|
|
|
2011-03-24 04:24:06 +01:00
|
|
|
protected function _initTitle()
|
|
|
|
{
|
2011-02-03 23:51:35 +01:00
|
|
|
$view = $this->getResource('view');
|
2011-02-04 01:17:52 +01:00
|
|
|
$view->headTitle(Application_Model_Preference::GetHeadTitle());
|
2011-02-03 23:51:35 +01:00
|
|
|
}
|
2011-08-22 16:12:53 +02:00
|
|
|
|
|
|
|
protected function _initZFDebug()
|
|
|
|
{
|
2012-08-24 03:58:21 +02:00
|
|
|
if (APPLICATION_ENV == "development") {
|
2011-08-22 16:12:53 +02:00
|
|
|
$autoloader = Zend_Loader_Autoloader::getInstance();
|
|
|
|
$autoloader->registerNamespace('ZFDebug');
|
|
|
|
|
|
|
|
$options = array(
|
2012-01-16 09:56:57 +01:00
|
|
|
'plugins' => array('Variables',
|
2011-08-22 16:12:53 +02:00
|
|
|
'Exception',
|
|
|
|
'Memory',
|
|
|
|
'Time')
|
|
|
|
);
|
|
|
|
$debug = new ZFDebug_Controller_Plugin_Debug($options);
|
|
|
|
|
|
|
|
$this->bootstrap('frontController');
|
|
|
|
$frontController = $this->getResource('frontController');
|
|
|
|
$frontController->registerPlugin($debug);
|
|
|
|
}
|
|
|
|
}
|
2012-01-16 09:56:57 +01:00
|
|
|
|
2011-12-22 01:01:29 +01:00
|
|
|
protected function _initRouter()
|
|
|
|
{
|
2012-08-24 03:58:21 +02:00
|
|
|
$front = Zend_Controller_Front::getInstance();
|
2011-12-22 01:01:29 +01:00
|
|
|
$router = $front->getRouter();
|
2012-01-16 09:56:57 +01:00
|
|
|
|
2011-12-22 01:01:29 +01:00
|
|
|
$router->addRoute(
|
|
|
|
'password-change',
|
|
|
|
new Zend_Controller_Router_Route('password-change/:user_id/:token', array(
|
|
|
|
'module' => 'default',
|
2012-04-17 18:16:10 +02:00
|
|
|
'controller' => 'login',
|
2011-12-22 01:01:29 +01:00
|
|
|
'action' => 'password-change',
|
|
|
|
)));
|
|
|
|
}
|
2010-12-07 20:19:27 +01:00
|
|
|
}
|
|
|
|
|