CC-6079 - merge and remove underscore files

This commit is contained in:
Duncan Sommerville 2015-08-18 15:23:42 -04:00
parent 5ab0850d9a
commit 3f25ab2647
38 changed files with 2131 additions and 9600 deletions

View file

@ -20,32 +20,25 @@ class ShowbuilderController extends Zend_Controller_Action
public function indexAction()
{
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$response = $this->getResponse();
//Enable AJAX requests from www.airtime.pro because the autologin during the seamless sign-up follows
//a redirect here.
CORSHelper::enableATProCrossOriginRequests($request, $response);
$baseUrl = Application_Common_OsPath::getBaseDir();
$userType = Application_Model_User::GetCurrentUser()->getType();
//$this->_helper->layout->setLayout("showbuilder");
$user = Application_Model_User::GetCurrentUser();
$userType = $user->getType();
$this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '$userType' );");
$this->view->headScript()->appendScript(Application_Common_GoogleAnalytics::generateGoogleTagManagerDataLayerJavaScript());
$this->view->headLink()->appendStylesheet($baseUrl . 'css/redmond/jquery-ui-1.8.8.custom.css?' . $CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.fnSetFilteringDelay.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
//$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.ColReorder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.colReorder.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.FixedColumns.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.columnFilter.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/js-timezone-detect/jstz-1.0.4.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
@ -54,50 +47,32 @@ class ShowbuilderController extends Zend_Controller_Action
$this->view->headLink()->appendStylesheet($baseUrl.'css/media_library.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColReorder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/dataTables.colReorder.min.css?'.$CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
//Show the timezone and language setup popup, if needed.
$this->checkAndShowSetupPopup($request);
// PLUPLOAD
$this->view->headScript()->appendFile($baseUrl.'js/libs/dropzone.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
//determine whether to remove/hide/display the library.
$showLib = false;
if (!$user->isGuest()) {
$disableLib = false;
$this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/main_builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$data = Application_Model_Preference::getNowPlayingScreenSettings();
if (!is_null($data)) {
if ($data["library"] == "true") {
$showLib = true;
}
}
} else {
$disableLib = true;
}
$this->view->disableLib = $disableLib;
$this->view->showLib = $showLib;
// MEDIA BUILDER
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/spl.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playlist/smart_blockbuilder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
//only include library things on the page if the user can see it.
if (!$disableLib) {
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/_showbuilder.css?'.$CC_CONFIG['airtime_version']); // TODO
$data = Application_Model_Preference::getCurrentLibraryTableSetting();
if (!is_null($data)) {
$libraryTable = json_encode($data);
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-library', JSON.stringify($libraryTable) );");
} else {
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-library', '' );");
}
}
$data = Application_Model_Preference::getTimelineDatatableSetting();
if (!is_null($data)) {
$timelineTable = json_encode($data);
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-timeline', JSON.stringify($timelineTable) );");
} else {
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-timeline', '' );");
}
$csrf_namespace = new Zend_Session_Namespace('csrf_namespace');
$csrf_element = new Zend_Form_Element_Hidden('csrf');
$csrf_element->setValue($csrf_namespace->authtoken)->setRequired('true')->removeDecorator('HtmlTag')->removeDecorator('Label');
$this->view->csrf = $csrf_element;
$request = $this->getRequest();
//populate date range form for show builder.
$now = time();
$from = $request->getParam("from", $now);
@ -113,20 +88,13 @@ class ShowbuilderController extends Zend_Controller_Action
$form = new Application_Form_ShowBuilder();
$form->populate(array(
'sb_date_start' => $start->format("Y-m-d"),
'sb_time_start' => $start->format("H:i"),
'sb_date_end' => $end->format("Y-m-d"),
'sb_time_end' => $end->format("H:i")
));
'sb_date_start' => $start->format("Y-m-d"),
'sb_time_start' => $start->format("H:i"),
'sb_date_end' => $end->format("Y-m-d"),
'sb_time_end' => $end->format("H:i")
));
$this->view->sb_form = $form;
$this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/main_builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']);
}
/** Check if we need to show the timezone/language setup popup and display it. (eg. on first run) */
@ -192,7 +160,7 @@ class ShowbuilderController extends Zend_Controller_Action
}
$displayTimeZone = new DateTimeZone(Application_Model_Preference::GetTimezone());
$start = $instance->getDbStarts(null);
$start->setTimezone($displayTimeZone);
$end = $instance->getDbEnds(null);
@ -208,7 +176,7 @@ class ShowbuilderController extends Zend_Controller_Action
$this->view->dialog = $this->view->render('showbuilder/builderDialog.phtml');
}
public function checkBuilderFeedAction()
{
$request = $this->getRequest();
@ -231,7 +199,7 @@ class ShowbuilderController extends Zend_Controller_Action
public function builderFeedAction()
{
$current_time = time();
$request = $this->getRequest();
$show_filter = intval($request->getParam("showFilter", 0));
$show_instance_filter = intval($request->getParam("showInstanceFilter", 0));
@ -253,10 +221,10 @@ class ShowbuilderController extends Zend_Controller_Action
public function scheduleAddAction()
{
$request = $this->getRequest();
$mediaItems = $request->getParam("mediaIds", array());
$scheduledItems = $request->getParam("schedIds", array());
$log_vars = array();
$log_vars["url"] = $_SERVER['HTTP_HOST'];
$log_vars["action"] = "showbuilder/schedule-add";
@ -264,7 +232,7 @@ class ShowbuilderController extends Zend_Controller_Action
$log_vars["params"]["media_items"] = $mediaItems;
$log_vars["params"]["scheduled_items"] = $scheduledItems;
Logging::info($log_vars);
try {
$scheduler = new Application_Model_Scheduler();
$scheduler->scheduleAfter($scheduledItems, $mediaItems);
@ -281,7 +249,7 @@ class ShowbuilderController extends Zend_Controller_Action
{
$request = $this->getRequest();
$items = $request->getParam("items", array());
$log_vars = array();
$log_vars["url"] = $_SERVER['HTTP_HOST'];
$log_vars["action"] = "showbuilder/schedule-remove";
@ -331,8 +299,7 @@ class ShowbuilderController extends Zend_Controller_Action
public function scheduleReorderAction()
{
throw new Exception("this controller is/was a no-op please fix your
code");
throw new Exception("this controller is/was a no-op please fix your code");
}
}