diff --git a/airtime_mvc/application/controllers/LibraryController.php b/airtime_mvc/application/controllers/LibraryController.php index 70bfd2d7b..182979c03 100644 --- a/airtime_mvc/application/controllers/LibraryController.php +++ b/airtime_mvc/application/controllers/LibraryController.php @@ -11,7 +11,6 @@ class LibraryController extends Zend_Controller_Action { $ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext->addActionContext('contents-feed', 'json') - ->addActionContext('contents-feed-test', 'json') ->addActionContext('delete', 'json') ->addActionContext('duplicate', 'json') ->addActionContext('delete-group', 'json') @@ -424,19 +423,6 @@ class LibraryController extends Zend_Controller_Action $this->view->files = SecurityHelper::htmlescape_recursive($r["aaData"]); } - public function contentsFeedTestAction() - { - $params = $this->getRequest()->getParams(); - - # terrible name for the method below. it does not only search files. - $r = Application_Model_StoredFile::searchLibraryFiles($params); - - $this->view->sEcho = $r["sEcho"]; - $this->view->iTotalDisplayRecords = $r["iTotalDisplayRecords"]; - $this->view->iTotalRecords = $r["iTotalRecords"]; - $this->view->files = SecurityHelper::htmlescape_recursive($r["aaData"]); - } - public function editFileMdAction() { $user = Application_Model_User::getCurrentUser(); diff --git a/airtime_mvc/application/controllers/ShowBuilderController.php b/airtime_mvc/application/controllers/ShowBuilderController.php index c5cd87818..67c58c512 100644 --- a/airtime_mvc/application/controllers/ShowBuilderController.php +++ b/airtime_mvc/application/controllers/ShowBuilderController.php @@ -30,7 +30,7 @@ class ShowBuilderController extends Zend_Controller_Action { $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->headScript()->appendFile($baseUrl.'js/airtime/library/library-test.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->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_showbuilder_test.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); // PLUPLOAD $this->view->headScript()->appendFile($baseUrl.'js/libs/dropzone.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); @@ -40,8 +40,14 @@ class ShowBuilderController extends Zend_Controller_Action { $this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/builder_test.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/main_builder_test.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); + // MEDIA BUILDER + $this->view->headScript()->appendFile($baseUrl.'js/airtime/library/spl-test.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']); + $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-test.css?'.$CC_CONFIG['airtime_version']); $csrf_namespace = new Zend_Session_Namespace('csrf_namespace'); $csrf_element = new Zend_Form_Element_Hidden('csrf'); diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 5d92dd54d..7c3a242a3 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -907,113 +907,7 @@ SQL; return $results; } - public static function searchLibraryFilesTest($datatables) - { - $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME); - $displayColumns = self::getLibraryColumns(); - - $fileSelect = array(); - foreach ($displayColumns as $key) { - if ($key === "id") { - $fileSelect[] = "FILES.id AS $key"; - } elseif ($key === "owner_id") { - $fileSelect[] = "sub.login AS $key"; - } //file length is displayed based on cueout - cuein. - else if ($key === "length") { - $fileSelect[] = "(cueout - cuein)::INTERVAL AS length"; - } elseif ($key === "year") { - $fileSelect[] = "year AS ".$key; - } else { - $fileSelect[] = $key; - } - } - - $fileSelect = "SELECT ". join(",", $fileSelect); - $fileTable = "({$fileSelect} FROM cc_files AS FILES LEFT JOIN cc_subjs AS sub ON (sub.id = FILES.owner_id) WHERE file_exists = 'TRUE' AND hidden='FALSE')"; - $fromTable = $fileTable." AS File"; //need an alias for the table if it's standalone. - - // update is_scheduled to false for tracks that - // have already played out - self::updatePastFilesIsScheduled(); - $results = Application_Model_Datatables::findEntries($con, $displayColumns, $fromTable, $datatables); - - $displayTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone()); - $utcTimezone = new DateTimeZone("UTC"); - - foreach ($results['aaData'] as &$row) { - $row['id'] = intval($row['id']); - - //taken from Datatables.php, needs to be cleaned up there. - if (isset($r['ftype'])) { - if ($r['ftype'] == 'playlist') { - $pl = new Application_Model_Playlist($r['id']); - $r['length'] = $pl->getLength(); - } elseif ($r['ftype'] == "block") { - $bl = new Application_Model_Block($r['id']); - $r['bl_type'] = $bl->isStatic() ? 'static' : 'dynamic'; - $r['length'] = $bl->getLength(); - } - } - - if ($row['ftype'] === "audioclip") { - - $cuein_formatter = new LengthFormatter($row["cuein"]); - $row["cuein"] = $cuein_formatter->format(); - - $cueout_formatter = new LengthFormatter($row["cueout"]); - $row["cueout"] = $cueout_formatter->format(); - - $cuein = Application_Common_DateHelper::playlistTimeToSeconds($row["cuein"]); - $cueout = Application_Common_DateHelper::playlistTimeToSeconds($row["cueout"]); - $row_length = Application_Common_DateHelper::secondsToPlaylistTime($cueout - $cuein); - - $formatter = new SamplerateFormatter($row['sample_rate']); - $row['sample_rate'] = $formatter->format(); - - $formatter = new BitrateFormatter($row['bit_rate']); - $row['bit_rate'] = $formatter->format(); - - // for audio preview - $row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION); - - } - else { - - $row['audioFile'] = $row['id']; - $row_length = $row['length']; - } - - $len_formatter = new LengthFormatter($row_length); - $row['length'] = $len_formatter->format(); - - //convert mtime and utime to localtime - $row['mtime'] = new DateTime($row['mtime'], $utcTimezone); - $row['mtime']->setTimeZone($displayTimezone); - $row['mtime'] = $row['mtime']->format(DEFAULT_TIMESTAMP_FORMAT); - $row['utime'] = new DateTime($row['utime'], $utcTimezone); - $row['utime']->setTimeZone($displayTimezone); - $row['utime'] = $row['utime']->format(DEFAULT_TIMESTAMP_FORMAT); - - //need to convert last played to localtime if it exists. - if (isset($row['lptime'])) { - $row['lptime'] = new DateTime($row['lptime'], $utcTimezone); - $row['lptime']->setTimeZone($displayTimezone); - $row['lptime'] = $row['lptime']->format(DEFAULT_TIMESTAMP_FORMAT); - } - - // we need to initalize the checkbox and image row because we do not retrieve - // any data from the db for these and datatables will complain - $row['checkbox'] = ""; - $row['image'] = ""; - - $type = substr($row['ftype'], 0, 2); - $row['tr_id'] = "{$type}_{$row['id']}"; - } - - return $results; - } - - /** + /** * Copy a newly uploaded audio file from its temporary upload directory * on the local disk (like /tmp) over to Airtime's "stor" directory, * which is where all ingested music/media live. diff --git a/airtime_mvc/application/views/scripts/show-builder/index.phtml b/airtime_mvc/application/views/scripts/show-builder/index.phtml index 5d4b7abd1..3b69bf1af 100644 --- a/airtime_mvc/application/views/scripts/show-builder/index.phtml +++ b/airtime_mvc/application/views/scripts/show-builder/index.phtml @@ -1,8 +1,12 @@