style(legacy): fix code format with php-cs-fixer (#1674)

This commit is contained in:
Jonas L 2022-03-14 11:15:04 +01:00 committed by GitHub
parent e1dc69af9e
commit 69d8eae845
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
111 changed files with 1163 additions and 1163 deletions

View file

@ -13,7 +13,7 @@ class ApiController extends Zend_Controller_Action
$this->_helper->viewRenderer->setNoRender(true);
}
//Ignore API key and session authentication for these APIs:
// Ignore API key and session authentication for these APIs:
$ignoreAuth = ['live-info',
'live-info-v2',
'week-info',
@ -75,7 +75,7 @@ class ApiController extends Zend_Controller_Action
->addActionContext('update-cue-values-by-silan', 'json')
->addActionContext('get-usability-hint', 'json')
->addActionContext('poll-celery', 'json')
->addActionContext('recalculate-schedule', 'json') //RKTN-260
->addActionContext('recalculate-schedule', 'json') // RKTN-260
->initContext();
}
@ -98,8 +98,8 @@ class ApiController extends Zend_Controller_Action
return true;
}
//Start the session so the authentication is
//enforced by the ACL plugin.
// Start the session so the authentication is
// enforced by the ACL plugin.
Zend_Session::start();
$authAdapter = Zend_Auth::getInstance();
Application_Model_Auth::pinSessionToClient($authAdapter);
@ -186,7 +186,7 @@ class ApiController extends Zend_Controller_Action
}
}
//Used by the SaaS monitoring
// Used by the SaaS monitoring
public function onAirLightAction()
{
$request = $this->getRequest();
@ -354,7 +354,7 @@ class ApiController extends Zend_Controller_Action
$timezone
);
//Convert the UTC scheduler time ("now") to the user-defined timezone.
// Convert the UTC scheduler time ("now") to the user-defined timezone.
$result['schedulerTime'] = Application_Common_DateHelper::UTCStringToTimezoneString($result['schedulerTime'], $timezone);
$result['timezone'] = $upcase ? strtoupper($timezone) : $timezone;
$result['timezoneOffset'] = Application_Common_DateHelper::getTimezoneOffset($timezone);
@ -495,7 +495,7 @@ class ApiController extends Zend_Controller_Action
$timezone
);
//Convert the UTC scheduler time ("now") to the user-defined timezone.
// Convert the UTC scheduler time ("now") to the user-defined timezone.
$result['station']['schedulerTime'] = Application_Common_DateHelper::UTCStringToTimezoneString($result['station']['schedulerTime'], $timezone);
$result['station']['timezone'] = $upcase ? strtoupper($timezone) : $timezone;
}
@ -510,7 +510,7 @@ class ApiController extends Zend_Controller_Action
$request = $this->getRequest();
$result = WidgetHelper::getWeekInfo($this->getRequest()->getParam('timezone'));
//used by caller to determine if the airtime they are running or widgets in use is out of date.
// used by caller to determine if the airtime they are running or widgets in use is out of date.
$result['AIRTIME_API_VERSION'] = AIRTIME_API_VERSION;
$this->returnJsonOrJsonp($request, $result);
@ -551,7 +551,7 @@ class ApiController extends Zend_Controller_Action
throw new ZendActionHttpException($this, 400, 'ERROR: Show does not have an associated image.');
}
} catch (Exception $e) {
//To avoid broken images on your site, we return the station logo if we can't find the show logo.
// To avoid broken images on your site, we return the station logo if we can't find the show logo.
$this->_redirect('api/station-logo');
return;
@ -562,7 +562,7 @@ class ApiController extends Zend_Controller_Action
// but has been cached in a client's browser this will throw an exception
Application_Common_FileIO::smartReadFile($path, filesize($path), $mime_type);
} catch (LibreTimeFileNotFoundException $e) {
//throw new ZendActionHttpException($this, 404, "ERROR: No image found at $path");
// throw new ZendActionHttpException($this, 404, "ERROR: No image found at $path");
$this->_redirect('api/station-logo');
return;
@ -607,7 +607,7 @@ class ApiController extends Zend_Controller_Action
$storDir = Application_Model_MusicDir::getStorDir();
$fp = $storDir->getDirectory();
//$this->view->type = $type;
// $this->view->type = $type;
$file = Application_Model_StoredFile::RecallById($trackid);
$md = $file->getMetadata();
@ -624,7 +624,7 @@ class ApiController extends Zend_Controller_Action
}
}
} elseif ($return === 'artwork') {
//default
// default
foreach ($md as $key => $value) {
if ($key == 'MDATA_KEY_ARTWORK' && !is_null($value)) {
FileDataHelper::renderImage($fp . $md['MDATA_KEY_ARTWORK'] . '-512.jpg');
@ -779,13 +779,13 @@ class ApiController extends Zend_Controller_Action
$historyService = new Application_Service_HistoryService();
$historyService->insertPlayedItem($media_id);
//set a 'last played' timestamp for media item
//needed for smart blocks
// set a 'last played' timestamp for media item
// needed for smart blocks
$mediaType = Application_Model_Schedule::GetType($media_id);
if ($mediaType == 'file') {
$file_id = Application_Model_Schedule::GetFileId($media_id);
if (!is_null($file_id)) {
//we are dealing with a file not a stream
// we are dealing with a file not a stream
$file = Application_Model_StoredFile::RecallById($file_id);
$now = new DateTime('now', new DateTimeZone('UTC'));
$file->setLastPlayedTime($now);
@ -854,17 +854,17 @@ class ApiController extends Zend_Controller_Action
{
$showCanceled = false;
$file = Application_Model_StoredFile::RecallById($file_id);
//$show_instance = $this->_getParam('show_instance');
// $show_instance = $this->_getParam('show_instance');
try {
$show_inst = new Application_Model_ShowInstance($show_instance_id);
$show_inst->setRecordedFile($file_id);
} catch (Exception $e) {
//we've reached here probably because the show was
//cancelled, and therefore the show instance does not exist
//anymore (ShowInstance constructor threw this error). We've
//done all we can do (upload the file and put it in the
//library), now lets just return.
// we've reached here probably because the show was
// cancelled, and therefore the show instance does not exist
// anymore (ShowInstance constructor threw this error). We've
// done all we can do (upload the file and put it in the
// library), now lets just return.
$showCanceled = true;
}
@ -916,18 +916,18 @@ class ApiController extends Zend_Controller_Action
$filepath = $md['MDATA_KEY_FILEPATH'];
$file = Application_Model_StoredFile::RecallByFilepath($filepath, $con);
//File is not in database anymore.
// File is not in database anymore.
if (is_null($file)) {
$return_hash['error'] = sprintf(_('File does not exist in %s'), PRODUCT_NAME);
}
//Updating a metadata change.
// Updating a metadata change.
else {
//CC-5207 - restart media-monitor causes it to reevaluate all
//files in watched directories, and reset their cue-in/cue-out
//values. Since media-monitor has nothing to do with cue points
//let's unset it here. Note that on mode == "create", we still
//want media-monitor sending info about cue_out which by default
//will be equal to length of track until silan can take over.
// CC-5207 - restart media-monitor causes it to reevaluate all
// files in watched directories, and reset their cue-in/cue-out
// values. Since media-monitor has nothing to do with cue points
// let's unset it here. Note that on mode == "create", we still
// want media-monitor sending info about cue_out which by default
// will be equal to length of track until silan can take over.
unset($md['MDATA_KEY_CUE_IN'], $md['MDATA_KEY_CUE_OUT']);
$file->setMetadata($md);
@ -942,7 +942,7 @@ class ApiController extends Zend_Controller_Action
$return_hash['error'] = sprintf(_('File does not exist in %s'), PRODUCT_NAME);
} else {
$filepath = $md['MDATA_KEY_FILEPATH'];
//$filepath = str_replace("\\", "", $filepath);
// $filepath = str_replace("\\", "", $filepath);
$file->setFilePath($filepath);
}
} elseif ($mode == 'delete') {
@ -959,7 +959,7 @@ class ApiController extends Zend_Controller_Action
}
} elseif ($mode == 'delete_dir') {
$filepath = $md['MDATA_KEY_FILEPATH'];
//$filepath = str_replace("\\", "", $filepath);
// $filepath = str_replace("\\", "", $filepath);
$files = Application_Model_StoredFile::RecallByPartialFilepath($filepath, $con);
foreach ($files as $file) {
@ -1283,7 +1283,7 @@ class ApiController extends Zend_Controller_Action
$djtype = $request->getParam('djtype');
if ($djtype == 'master') {
//check against master
// check against master
if ($username == Application_Model_Preference::GetLiveStreamMasterUsername()
&& $password == Application_Model_Preference::GetLiveStreamMasterPassword()) {
$this->view->msg = true;
@ -1291,7 +1291,7 @@ class ApiController extends Zend_Controller_Action
$this->view->msg = false;
}
} elseif ($djtype == 'dj') {
//check against show dj auth
// check against show dj auth
$showInfo = Application_Model_Show::getCurrentShow();
// there is current playing show
@ -1342,7 +1342,7 @@ class ApiController extends Zend_Controller_Action
{
$dir_id = $this->_getParam('dir_id');
//connect to db and get get sql
// connect to db and get get sql
$rows = Application_Model_StoredFile::listAllFiles2($dir_id, 100);
$this->_helper->json->sendJson($rows);
@ -1350,7 +1350,7 @@ class ApiController extends Zend_Controller_Action
public function getFilesWithoutSilanValueAction()
{
//connect to db and get get sql
// connect to db and get get sql
$rows = Application_Model_StoredFile::getAllFilesWithoutSilan();
$this->_helper->json->sendJson($rows);
@ -1382,16 +1382,16 @@ class ApiController extends Zend_Controller_Action
// TODO : move this code into model -- RG
$file = Application_Model_StoredFile::RecallById($p_id = $id)->getPropelOrm();
//What we are doing here is setting a more accurate length that was
//calculated with silan by actually scanning the entire file. This
//process takes a really long time, and so we only do it in the background
//after the file has already been imported -MK
// What we are doing here is setting a more accurate length that was
// calculated with silan by actually scanning the entire file. This
// process takes a really long time, and so we only do it in the background
// after the file has already been imported -MK
try {
$length = $file->getDbLength();
if (isset($info['length'])) {
$length = $info['length'];
//length decimal number in seconds. Need to convert it to format
//HH:mm:ss to get around silly PHP limitations.
// length decimal number in seconds. Need to convert it to format
// HH:mm:ss to get around silly PHP limitations.
$length = Application_Common_DateHelper::secondsToPlaylistTime($length);
$file->setDbLength($length);
}
@ -1406,7 +1406,7 @@ class ApiController extends Zend_Controller_Action
} catch (Exception $e) {
Logging::info('Failed to update silan values for ' . $file->getDbTrackTitle());
Logging::info('File length analyzed by Silan is: ' . $length);
//set silan_check to true so we don't attempt to re-anaylze again
// set silan_check to true so we don't attempt to re-anaylze again
$file->setDbSilanCheck(true);
$file->save();
}
@ -1422,7 +1422,7 @@ class ApiController extends Zend_Controller_Action
$media_id = intval($request->getParam('media_id'));
$data_arr = json_decode($data);
//$media_id is -1 sometimes when a stream has stopped playing
// $media_id is -1 sometimes when a stream has stopped playing
if (!is_null($media_id) && $media_id > 0) {
if (isset($data_arr->title)) {
$data_title = substr($data_arr->title, 0, 1024);
@ -1602,7 +1602,7 @@ class ApiController extends Zend_Controller_Action
[$startsDT, $endsDT] = Application_Common_HTTPHelper::getStartEndFromRequest($request);
if ((!isset($showId)) || (!is_numeric($showId))) {
//if (!isset($showId)) {
// if (!isset($showId)) {
$this->_helper->json->sendJson(
['jsonrpc' => '2.0', 'error' => ['code' => 400, 'message' => 'missing invalid type for required show_id parameter. use type int.' . $showId]]
);
@ -1712,7 +1712,7 @@ class ApiController extends Zend_Controller_Action
header('Content-Type: application/x-mpegurl');
header('Content-Disposition: attachment; filename=stream.m3u');
$m3uFile = "#EXTM3U\r\n\r\n"; //Windows linebreaks eh
$m3uFile = "#EXTM3U\r\n\r\n"; // Windows linebreaks eh
$stationName = Application_Model_Preference::GetStationName();
$streamData = Application_Model_StreamSetting::getEnabledStreamData();
@ -1738,17 +1738,17 @@ class ApiController extends Zend_Controller_Action
$showInstances = CcShowInstancesQuery::create()
->filterByDbStarts($now, Criteria::GREATER_THAN)
//->filterByDbModifiedInstance(false)
// ->filterByDbModifiedInstance(false)
->orderByDbStarts()
->find();
//->find($this->con);
// ->find($this->con);
$total = $showInstances->count();
$progress = 0;
foreach ($showInstances as $instance) {
echo round(floatval($progress / $total) * 100) . '% - ' . $instance->getDbId() . "\n<br>";
flush();
ob_flush();
//while(@ob_end_clean());
// while(@ob_end_clean());
$scheduler->removeGaps2($instance->getDbId());
++$progress;
}

View file

@ -63,7 +63,7 @@ class DashboardController extends Zend_Controller_Action
Application_Model_Preference::SetSourceSwitchStatus($sourcename, 'off');
$this->view->status = 'OFF';
//Log table updates
// Log table updates
Application_Model_LiveLog::SetEndTime(
$sourcename == 'scheduled_play' ? 'S' : 'L',
new DateTime('now', new DateTimeZone('UTC'))
@ -72,7 +72,7 @@ class DashboardController extends Zend_Controller_Action
Application_Model_Preference::SetSourceSwitchStatus($sourcename, 'on');
$this->view->status = 'ON';
//Log table updates
// Log table updates
Application_Model_LiveLog::SetNewLogTime(
$sourcename == 'scheduled_play' ? 'S' : 'L',
new DateTime('now', new DateTimeZone('UTC'))

View file

@ -95,7 +95,7 @@ class EmbedController extends Zend_Controller_Action
$this->view->schedule_data = json_encode($weeklyScheduleData);
$currentDay = new DateTime('now', new DateTimeZone(Application_Model_Preference::GetTimezone()));
//day of the month without leading zeros (1 to 31)
// day of the month without leading zeros (1 to 31)
$this->view->currentDayOfMonth = $currentDay->format('j');
}
}

View file

@ -68,7 +68,7 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
//TODO: Get list of page IDs (deserialize)
// TODO: Get list of page IDs (deserialize)
$request = $this->getRequest();
if (!$request->isPost()) {
@ -82,8 +82,8 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
$facebookMicroserviceUrl = $CC_CONFIG['facebook-app-url'];
$facebookMicroserviceApiKey = $CC_CONFIG['facebook-app-api-key'];
//Post the page tab ID and station subdomain to the social microservice so that mapping can be saved
//in a database.
// Post the page tab ID and station subdomain to the social microservice so that mapping can be saved
// in a database.
foreach ($facebookPageIds as $facebookPageId) {
$postfields = [];
$postfields['facebookPageId'] = $facebookPageId;
@ -113,6 +113,6 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
curl_close($ch);
}
//$arr = json_decode($jsondata, true); # Decode JSON String
// $arr = json_decode($jsondata, true); # Decode JSON String
}
}

View file

@ -4,8 +4,8 @@ class ErrorController extends Zend_Controller_Action
{
public function init()
{
//The default layout includes the Dashboard header, which may contain private information.
//We cannot show that.
// The default layout includes the Dashboard header, which may contain private information.
// We cannot show that.
$this->view->layout()->disableLayout();
$this->setupCSS();
@ -46,8 +46,8 @@ class ErrorController extends Zend_Controller_Action
break;
}
} else {
//$exceptions = $this->_getAllParams();
//Logging::error($exceptions);
// $exceptions = $this->_getAllParams();
// Logging::error($exceptions);
$this->error404Action();
return;
@ -58,7 +58,7 @@ class ErrorController extends Zend_Controller_Action
if (($log = $this->getLog())) {
$log->crit($this->view->message, $errors->exception);
}*/
//Logging that actually works: -- Albert
// Logging that actually works: -- Albert
Logging::error($this->view->message . ': ' . $errors->exception);
// conditionally display exceptions

View file

@ -40,7 +40,7 @@ class FeedsController extends Zend_Controller_Action
$begin = 0;
$end = $size - 1;
//ob_start(); //Must start a buffer here for these header() functions
// ob_start(); //Must start a buffer here for these header() functions
if (isset($_SERVER['HTTP_RANGE'])) {
if (preg_match('/bytes=\h*(\d+)-(\d*)[\D.*]?/i', $_SERVER['HTTP_RANGE'], $matches)) {

View file

@ -18,7 +18,7 @@ class IndexController extends Zend_Controller_Action
$this->view->headScript()->appendScript('$.i18n.setDictionary(general_dict)');
$this->view->headScript()->appendScript("var baseUrl='{$baseUrl}'");
//jplayer
// jplayer
$this->view->headScript()->appendFile($baseUrl . 'js/jplayer/jquery.jplayer.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl . 'js/jplayer/jplayer.playlist.min.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
@ -27,7 +27,7 @@ class IndexController extends Zend_Controller_Action
$this->view->headLink()->appendStylesheet($baseUrl . 'css/radio-page/station-podcast.css?' . $CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl . 'css/bootstrap.css?' . $CC_CONFIG['airtime_version']);
//jplayer control buttons
// jplayer control buttons
$this->view->headLink()->appendStylesheet($baseUrl . 'css/redmond/jquery-ui-1.8.8.custom.css?' . $CC_CONFIG['airtime_version']);
$this->_helper->layout->setLayout('radio-page');
@ -54,7 +54,7 @@ class IndexController extends Zend_Controller_Action
}
$this->view->displayLoginButton = $displayRadioPageLoginButtonValue;
//station feed episodes
// station feed episodes
$stationPodcastId = Application_Model_Preference::getStationPodcastId();
$podcastEpisodesService = new Application_Service_PodcastEpisodeService();
$episodes = $podcastEpisodesService->getPodcastEpisodes($stationPodcastId, 0, 0, PodcastEpisodesPeer::PUBLICATION_DATE, 'DESC');

View file

@ -79,7 +79,7 @@ class LibraryController extends Zend_Controller_Action
$baseUrl = Application_Common_OsPath::getBaseDir();
$id = $this->_getParam('id');
$type = $this->_getParam('type');
//playlist||timeline
// playlist||timeline
$screen = $this->_getParam('screen');
$menu = [];
@ -87,7 +87,7 @@ class LibraryController extends Zend_Controller_Action
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id);
//Open a jPlayer window and play the audio clip.
// Open a jPlayer window and play the audio clip.
$menu['play'] = ['name' => _('Preview'), 'icon' => 'play', 'disabled' => false];
$isAdminOrPM = $user->isUserType([UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER]);
@ -184,11 +184,11 @@ class LibraryController extends Zend_Controller_Action
public function deleteAction()
{
//array containing id and type of media to delete.
// array containing id and type of media to delete.
$mediaItems = $this->_getParam('media', null);
$user = Application_Model_User::getCurrentUser();
//$isAdminOrPM = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
// $isAdminOrPM = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
$files = [];
$playlists = [];
@ -221,7 +221,7 @@ class LibraryController extends Zend_Controller_Action
} catch (BlockNoPermissionException $e) {
$message = $noPermissionMsg;
} catch (Exception $e) {
//TODO: warn user that not all blocks could be deleted.
// TODO: warn user that not all blocks could be deleted.
}
try {
@ -229,7 +229,7 @@ class LibraryController extends Zend_Controller_Action
} catch (WebstreamNoPermissionException $e) {
$message = $noPermissionMsg;
} catch (Exception $e) {
//TODO: warn user that not all streams could be deleted.
// TODO: warn user that not all streams could be deleted.
Logging::info($e);
}
@ -243,7 +243,7 @@ class LibraryController extends Zend_Controller_Action
} catch (DeleteScheduledFileException $e) {
$message = _('Could not delete file because it is scheduled in the future.');
} catch (Exception $e) {
//could throw a scheduled in future exception.
// could throw a scheduled in future exception.
$message = _('Could not delete file(s).');
Logging::info($message . ': ' . $e->getMessage());
}
@ -309,8 +309,8 @@ class LibraryController extends Zend_Controller_Action
// the issue here is that the format that getCriteria provides is different from the format the saveCriteria
// expects due to the useage of startForm. So we either need to write new code that simply copies the database
// or figure out a way to instantiate a form inside of here and save it without modifying it.
//$newBlForm = new Application_Form_SmartBlockCriteria;
//$newBlForm->startForm($id);
// $newBlForm = new Application_Form_SmartBlockCriteria;
// $newBlForm->startForm($id);
$criteria = CcBlockcriteriaQuery::create()->orderByDbCriteria()->findByDbBlockId($id);
foreach ($criteria as &$c) {
$row = new CcBlockcriteria();
@ -366,9 +366,9 @@ class LibraryController extends Zend_Controller_Action
if ($request->isPost()) {
$js = $this->_getParam('data');
$serialized = [];
//need to convert from serialized jQuery array.
// need to convert from serialized jQuery array.
foreach ($js as $j) {
//on edit, if no artwork is set and audiofile has image, automatically add it
// on edit, if no artwork is set and audiofile has image, automatically add it
if ($j['name'] == 'artwork') {
if ($j['value'] == null || $j['value'] == '') {
$serialized['artwork'] = FileDataHelper::resetArtwork($file_id);
@ -479,6 +479,6 @@ class LibraryController extends Zend_Controller_Action
public function publishDialogAction()
{
$this->_helper->layout->disableLayout();
//This just spits out publish-dialog.phtml!
// This just spits out publish-dialog.phtml!
}
}

View file

@ -12,7 +12,7 @@ final class LocaleController extends Zend_Controller_Action
echo 'var datatables_dict =' .
file_get_contents(
Application_Common_OsPath::join(
//$_SERVER["DOCUMENT_ROOT"],
// $_SERVER["DOCUMENT_ROOT"],
dirname(__FILE__) . '/../../public/', // Fixing this... -- Albert
'js/datatables/i18n/',
$locale . '.txt'
@ -23,17 +23,17 @@ final class LocaleController extends Zend_Controller_Action
public function generalTranslationTableAction()
{
$translations = [
//common/common.js
// common/common.js
'Audio Player' => _('Audio Player'),
'Something went wrong!' => _('Something went wrong!'),
//dashboard/dashboard.js
// dashboard/dashboard.js
'Recording:' => _('Recording:'),
'Master Stream' => _('Master Stream'),
'Live Stream' => _('Live Stream'),
'Nothing Scheduled' => _('Nothing Scheduled'),
'Current Show:' => _('Current Show:'),
'Current' => _('Current'),
//dashboard/versiontooltip.js
// dashboard/versiontooltip.js
'You are running the latest version' => _('You are running the latest version'),
'New version available: ' => _('New version available: '),
'You have a pre-release version of LibreTime intalled.' => _('You have a pre-release version of LibreTime intalled.'),
@ -41,15 +41,15 @@ final class LocaleController extends Zend_Controller_Action
'A feature update for your LibreTime installation is available.' => _('A feature update for your LibreTime installation is available.'),
'A major update for your LibreTime installation is available.' => _('A major update for your LibreTime installation is available.'),
'Multiple major updates for LibreTime installation are available. Please upgrade as soon as possible.' => _('Multiple major updates for LibreTime installation are available. Please upgrade as soon as possible.'),
//library/events/library_playlistbuilder.js
// library/events/library_playlistbuilder.js
'Add to current playlist' => _('Add to current playlist'),
'Add to current smart block' => _('Add to current smart block'),
'Adding 1 Item' => _('Adding 1 Item'),
'Adding %s Items' => _('Adding %s Items'),
'You can only add tracks to smart blocks.' => _('You can only add tracks to smart blocks.'),
'You can only add tracks, smart blocks, and webstreams to playlists.' => _('You can only add tracks, smart blocks, and webstreams to playlists.'),
//library/events/library_showbuilder.js
//already in library/events/library_playlistbuilder.js
// library/events/library_showbuilder.js
// already in library/events/library_playlistbuilder.js
'Please select a cursor position on timeline.' => _('Please select a cursor position on timeline.'),
"You haven't added any tracks" => _("You haven't added any tracks"),
"You haven't added any playlists" => _("You haven't added any playlists"),
@ -62,9 +62,9 @@ final class LocaleController extends Zend_Controller_Action
'Learn about smart blocks' => _('Learn about smart blocks'),
'Learn about webstreams' => _('Learn about webstreams'),
"Click 'New' to create one." => _("Click 'New' to create one."),
//"Adding 1 Item" => _("Adding 1 Item"),
//"Adding %s Items" => _("Adding %s Items"),
//library/library.js
// "Adding 1 Item" => _("Adding 1 Item"),
// "Adding %s Items" => _("Adding %s Items"),
// library/library.js
'Add' => _('Add'),
'New' => _('New'),
'Edit' => _('Edit'),
@ -120,7 +120,7 @@ final class LocaleController extends Zend_Controller_Action
'Are you sure you want to delete the selected item?' => _('Are you sure you want to delete the selected item?'),
'Uploading in progress...' => _('Uploading in progress...'),
'Retrieving data from the server...' => _('Retrieving data from the server...'),
//library/podcast.js
// library/podcast.js
'Import' => _('Import'),
'Imported?' => _('Imported?'),
'View' => _('View'),
@ -131,9 +131,9 @@ final class LocaleController extends Zend_Controller_Action
'Input must be in the format: yyyy-mm-dd' => _('Input must be in the format: yyyy-mm-dd'),
'Input must be in the format: hh:mm:ss.t' => _('Input must be in the format: hh:mm:ss.t'),
'My Podcast' => _('My Podcast'),
//library/plupload.js
// library/plupload.js
'You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?' => _('You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?'),
//library/spl.js
// library/spl.js
'Open Media Builder' => _('Open Media Builder'),
"please put in a time '00:00:00 (.0)'" => _("please put in a time '00:00:00 (.0)'"),
"Please enter a valid time in seconds. Eg. 0.5'" => _('Please enter a valid time in seconds. Eg. 0.5'),
@ -143,14 +143,14 @@ final class LocaleController extends Zend_Controller_Action
'Playlist saved' => _('Playlist saved'),
'Playlist shuffled' => _('Playlist shuffled'),
"Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore." => _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."),
//listenerstat/listenerstat.js
// listenerstat/listenerstat.js
'Listener Count on %s: %s' => _('Listener Count on %s: %s'),
//nowplaying/register.js
// nowplaying/register.js
'Remind me in 1 week' => _('Remind me in 1 week'),
'Remind me never' => _('Remind me never'),
'Yes, help Airtime' => _('Yes, help Airtime'),
'Image must be one of jpg, jpeg, png, or gif' => _('Image must be one of jpg, jpeg, png, or gif'),
//playlist/smart_blockbuilder.js
// playlist/smart_blockbuilder.js
'A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show.' => _('A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show.'),
'A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library.' => _('A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library.'),
'The desired block length will not be reached if %s cannot find enough unique tracks to match your criteria. Enable this option if you wish to allow tracks to be added multiple times to the smart block.' => _('The desired block length will not be reached if %s cannot find enough unique tracks to match your criteria. Enable this option if you wish to allow tracks to be added multiple times to the smart block.'),
@ -170,14 +170,14 @@ final class LocaleController extends Zend_Controller_Action
'is in the range' => _('is in the range'),
'Preview' => _('Preview'),
'Generate' => _('Generate'),
//preferences/musicdirs.js
// preferences/musicdirs.js
'Choose Storage Folder' => _('Choose Storage Folder'),
'Choose Folder to Watch' => _('Choose Folder to Watch'),
"Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!" => _("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"),
'Manage Media Folders' => _('Manage Media Folders'),
'Are you sure you want to remove the watched folder?' => _('Are you sure you want to remove the watched folder?'),
'This path is currently not accessible.' => _('This path is currently not accessible.'),
//preferences/streamsetting.js
// preferences/streamsetting.js
'Some stream types require extra configuration. Details about enabling %sAAC+ Support%s or %sOpus Support%s are provided.' => _('Some stream types require extra configuration. Details about enabling %sAAC+ Support%s or %sOpus Support%s are provided.'),
'Connected to the streaming server' => _('Connected to the streaming server'),
'The stream is disabled' => _('The stream is disabled'),
@ -192,9 +192,9 @@ final class LocaleController extends Zend_Controller_Action
"If your live streaming client does not ask for a username, this field should be 'source'." => _("If your live streaming client does not ask for a username, this field should be 'source'."),
'WARNING: This will restart your stream and may cause a short dropout for your listeners!' => _('WARNING: This will restart your stream and may cause a short dropout for your listeners!'),
'This is the admin username and password for Icecast/SHOUTcast to get listener statistics.' => _('This is the admin username and password for Icecast/SHOUTcast to get listener statistics.'),
//preferences/support-setting.js
// preferences/support-setting.js
'Image must be one of jpg, jpeg, png, or gif' => _('Image must be one of jpg, jpeg, png, or gif'),
//schedule/add-show.js
// schedule/add-show.js
'Warning: You cannot change this field while the show is currently playing' => _('Warning: You cannot change this field while the show is currently playing'),
'No result found' => _('No result found'),
'This follows the same security pattern for the shows: only users assigned to the show can connect.' => _('This follows the same security pattern for the shows: only users assigned to the show can connect.'),
@ -204,9 +204,9 @@ final class LocaleController extends Zend_Controller_Action
'Warning: Shows cannot be re-linked' => _('Warning: Shows cannot be re-linked'),
'By linking your repeating shows any media items scheduled in any repeat show will also get scheduled in the other repeat shows' => _('By linking your repeating shows any media items scheduled in any repeat show will also get scheduled in the other repeat shows'),
'Timezone is set to the station timezone by default. Shows in the calendar will be displayed in your local time defined by the Interface Timezone in your user settings.' => _('Timezone is set to the station timezone by default. Shows in the calendar will be displayed in your local time defined by the Interface Timezone in your user settings.'),
//schedule/full-calendar-functions
//already in schedule/add-show.js
//"The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
// schedule/full-calendar-functions
// already in schedule/add-show.js
// "The show instance doesn't exist anymore!" => _("The show instance doesn't exist anymore!"),
'Show' => _('Show'),
'Show is empty' => _('Show is empty'),
'1m' => _('1m'),
@ -219,9 +219,9 @@ final class LocaleController extends Zend_Controller_Action
'Retreiving data from the server...' => _('Retreiving data from the server...'),
'This show has no scheduled content.' => _('This show has no scheduled content.'),
'This show is not completely filled with content.' => _('This show is not completely filled with content.'),
//already in schedule/add-show.js
//"The show instance doesn"t exist anymore!" => _("The show instance doesn"t exist anymore!"),
//schedule/schedule.js
// already in schedule/add-show.js
// "The show instance doesn"t exist anymore!" => _("The show instance doesn"t exist anymore!"),
// schedule/schedule.js
'January' => _('January'),
'February' => _('February'),
'March' => _('March'),
@ -269,10 +269,10 @@ final class LocaleController extends Zend_Controller_Action
'Stop recording current show?' => _('Stop recording current show?'),
'Ok' => _('Ok'),
'Contents of Show' => _('Contents of Show'),
//already in schedule/add-show.js
//"The show instance doesn"t exist anymore!" => _("The show instance doesn"t exist anymore!"),
// already in schedule/add-show.js
// "The show instance doesn"t exist anymore!" => _("The show instance doesn"t exist anymore!"),
'Remove all content?' => _('Remove all content?'),
//showbuilder/builder.js
// showbuilder/builder.js
'Delete selected item(s)?' => _('Delete selected item(s)?'),
'Start' => _('Start'),
'End' => _('End'),
@ -281,11 +281,11 @@ final class LocaleController extends Zend_Controller_Action
' of ' => _(' of '),
' records' => _(' records'),
'There are no shows scheduled during the specified time period.' => _('There are no shows scheduled during the specified time period.'),
//already in library/library.js
//"Title" => _("Title"),
//"Creator" => _("Creator"),
//"Album" => _("Album"),
//"Mime" => _("Mime"),
// already in library/library.js
// "Title" => _("Title"),
// "Creator" => _("Creator"),
// "Album" => _("Album"),
// "Mime" => _("Mime"),
'Cue In' => _('Cue In'),
'Cue Out' => _('Cue Out'),
'Fade In' => _('Fade In'),
@ -293,9 +293,9 @@ final class LocaleController extends Zend_Controller_Action
'Show Empty' => _('Show Empty'),
'Recording From Line In' => _('Recording From Line In'),
'Track preview' => _('Track preview'),
//already in library/spl.js
//"Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn"t "watched" anymore."
//=> _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn"t "watched" anymore."),
// already in library/spl.js
// "Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn"t "watched" anymore."
// => _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn"t "watched" anymore."),
'Cannot schedule outside a show.' => _('Cannot schedule outside a show.'),
'Moving 1 Item' => _('Moving 1 Item'),
'Moving %s Items' => _('Moving %s Items'),
@ -304,8 +304,8 @@ final class LocaleController extends Zend_Controller_Action
'Fade Editor' => _('Fade Editor'),
'Cue Editor' => _('Cue Editor'),
'Waveform features are available in a browser supporting the Web Audio API' => _('Waveform features are available in a browser supporting the Web Audio API'),
//already in library/library.js
//"Select" => _("Select"),
// already in library/library.js
// "Select" => _("Select"),
'Select all' => _('Select all'),
'Select none' => _('Select none'),
'Trim overbooked shows' => _('Trim overbooked shows'),
@ -313,20 +313,20 @@ final class LocaleController extends Zend_Controller_Action
'Jump to the current playing track' => _('Jump to the current playing track'),
'Jump to Current' => _('Jump to Current'),
'Cancel current show' => _('Cancel current show'),
//already in schedule/schedule.js
//"Cancel Current Show?" => _("Cancel Current Show?"),
// already in schedule/schedule.js
// "Cancel Current Show?" => _("Cancel Current Show?"),
'Stop recording current show?' => _('Stop recording current show?'),
//showbuilder/main_builder.js
// showbuilder/main_builder.js
'Open library to add or remove content' => _('Open library to add or remove content'),
'Add / Remove Content' => _('Add / Remove Content'),
//status/status.js
// status/status.js
'in use' => _('in use'),
'Disk' => _('Disk'),
//serverbrowse/serverbrowse.js
// serverbrowse/serverbrowse.js
'Look in' => _('Look in'),
'Cancel' => _('Cancel'),
'Open' => _('Open'),
//user/user.js
// user/user.js
'Admin' => _('Admin'),
'DJ' => _('DJ'),
'Program Manager' => _('Program Manager'),
@ -351,17 +351,17 @@ final class LocaleController extends Zend_Controller_Action
'View system status' => _('View system status'),
'Access playout history' => _('Access playout history'),
'View listener stats' => _('View listener stats'),
//dataTables/ColVis.js
// dataTables/ColVis.js
'Show / hide columns' => _('Show / hide columns'),
'Columns' => _('Columns'),
//datatables.columnFilter.js
// datatables.columnFilter.js
'From {from} to {to}' => _('From {from} to {to}'),
'kbps' => _('kbps'),
'yyyy-mm-dd' => _('yyyy-mm-dd'),
'hh:mm:ss.t' => _('hh:mm:ss.t'),
'kHz' => _('kHz'),
//datepicker
//months are already in schedule/schedule.js
// datepicker
// months are already in schedule/schedule.js
'Su' => _('Su'),
'Mo' => _('Mo'),
'Tu' => _('Tu'),
@ -370,12 +370,12 @@ final class LocaleController extends Zend_Controller_Action
'Fr' => _('Fr'),
'Sa' => _('Sa'),
'Close' => _('Close'),
//timepicker
// timepicker
'Hour' => _('Hour'),
'Minute' => _('Minute'),
'Done' => _('Done'),
//plupload ships with translation files but a lot are incomplete
//so we will keep them here to prevent incomplete translations
// plupload ships with translation files but a lot are incomplete
// so we will keep them here to prevent incomplete translations
'Select files' => _('Select files'),
'Add files to the upload queue and click the start button.' => _('Add files to the upload queue and click the start button.'),
'Filename' => _('Add files to the upload queue and click the start button.'),
@ -403,7 +403,7 @@ final class LocaleController extends Zend_Controller_Action
"Upload URL might be wrong or doesn't exist" => _("Upload URL might be wrong or doesn't exist"),
'Error: File too large: ' => _('Error: File too large: '),
'Error: Invalid file extension: ' => _('Error: Invalid file extension: '),
//history translations
// history translations
'Set Default' => _('Set Default'),
'Create Entry' => _('Create Entry'),
'Edit History Record' => _('Edit History Record'),
@ -413,14 +413,14 @@ final class LocaleController extends Zend_Controller_Action
"%sPrint view%sPlease use your browser's print function to print this table. Press escape when finished." => _("%sPrint view%sPlease use your browser's print function to print this table. Press escape when finished."),
'New Show' => _('New Show'),
'New Log Entry' => _('New Log Entry'),
//Datatables:
// Datatables:
'No data available in table' => _('No data available in table'),
'(filtered from _MAX_ total entries)' => _('(filtered from _MAX_ total entries)'),
': activate to sort column ascending',
': activate to sort column descending',
//End of datatables
// End of datatables
//New entries from .js "" => _(""),
// New entries from .js "" => _(""),
'First' => _('First'),
'Last' => _('Last'),
'Next' => _('Next'),
@ -450,7 +450,7 @@ final class LocaleController extends Zend_Controller_Action
'Showing 0 to 0 of 0 tracks' => _('Showing 0 to 0 of 0 tracks'),
'Showing 0 to 0 of 0 track types' => _('Showing 0 to 0 of 0 track types'),
'(filtered from _MAX_ total track types)' => _('(filtered from _MAX_ total track types)'),
//"This is used for tracks containing music." => _("This is used for tracks containing music."),
// "This is used for tracks containing music." => _("This is used for tracks containing music."),
'Are you sure you want to delete this tracktype?' => _('Are you sure you want to delete this tracktype?'),
'No track types were found.' => _('No track types were found.'),
'No track types found' => _('No track types found'),
@ -479,11 +479,11 @@ final class LocaleController extends Zend_Controller_Action
'Add New Podcast' => _('Add New Podcast'),
"Cannot schedule outside a show.\nTry creating a show first." => _("Cannot schedule outside a show.\nTry creating a show first."),
'No files have been uploaded yet.' => _('No files have been uploaded yet.'),
//"Value is required and can't be empty" => _("Value is required and can't be empty"),
//"mute" => _("mute"),
//"max volume" => _("max volume"),
// "Value is required and can't be empty" => _("Value is required and can't be empty"),
// "mute" => _("mute"),
// "max volume" => _("max volume"),
//embed player
// embed player
'On Air' => _('On Air'),
'Off Air' => _('Off Air'),
'Offline' => _('Offline'),

View file

@ -21,13 +21,13 @@ class LoginController extends Zend_Controller_Action
$response = $this->getResponse();
$stationLocale = Application_Model_Preference::GetDefaultLocale();
//Enable AJAX requests from www.airtime.pro for the sign-in process.
// Enable AJAX requests from www.airtime.pro for the sign-in process.
CORSHelper::enableCrossOriginRequests($request, $response);
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', $stationLocale));
if (Zend_Session::isStarted()) {
//Open the session for writing, because we close it for writing by default in Bootstrap.php as an optimization.
// Open the session for writing, because we close it for writing by default in Bootstrap.php as an optimization.
SessionHelper::reopenSessionForWriting();
$auth = Zend_Auth::getInstance();
@ -38,7 +38,7 @@ class LoginController extends Zend_Controller_Action
}
}
//uses separate layout without a navigation.
// uses separate layout without a navigation.
$this->_helper->layout->setLayout('login');
$this->view->error = false;
@ -50,35 +50,35 @@ class LoginController extends Zend_Controller_Action
$message = _('Please enter your username and password.');
if ($request->isPost()) {
//Open the session for writing, because we close it for writing by default in Bootstrap.php as an optimization.
//session_start();
// Open the session for writing, because we close it for writing by default in Bootstrap.php as an optimization.
// session_start();
if ($form->isValid($request->getPost())) {
//get the username and password from the form
// get the username and password from the form
$username = $form->getValue('username');
$password = $form->getValue('password');
$locale = $form->getValue('locale');
$authAdapter = Application_Model_Auth::getAuthAdapter();
//pass to the adapter the submitted username and password
// pass to the adapter the submitted username and password
$authAdapter->setIdentity($username)
->setCredential($password);
$result = $auth->authenticate($authAdapter);
if ($result->isValid()) {
Zend_Session::regenerateId();
//all info about this user from the login table omit only the password
// all info about this user from the login table omit only the password
$userInfo = $authAdapter->getResultRowObject(null, 'password');
//the default storage is a session with namespace Zend_Auth
// the default storage is a session with namespace Zend_Auth
$authStorage = $auth->getStorage();
$authStorage->write($userInfo);
Application_Model_LoginAttempts::resetAttempts($_SERVER['REMOTE_ADDR']);
Application_Model_Subjects::resetLoginAttempts($username);
//set the user locale in case user changed it in when logging in
// set the user locale in case user changed it in when logging in
Application_Model_Preference::SetUserLocale($locale);
$this->_redirect('showbuilder');
@ -98,7 +98,7 @@ class LoginController extends Zend_Controller_Action
public function logoutAction()
{
//Open the session for writing, because we close it for writing by default in Bootstrap.php as an optimization.
// Open the session for writing, because we close it for writing by default in Bootstrap.php as an optimization.
SessionHelper::reopenSessionForWriting();
$auth = Zend_Auth::getInstance();
@ -122,7 +122,7 @@ class LoginController extends Zend_Controller_Action
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', $stationLocale));
//uses separate layout without a navigation.
// uses separate layout without a navigation.
$this->_helper->layout->setLayout('login');
$form = new Application_Form_PasswordRestore();
@ -156,7 +156,7 @@ class LoginController extends Zend_Controller_Action
} else {
$form->email->addError($this->view->translate(_('That username or email address could not be found.')));
}
} else { //Form is not valid
} else { // Form is not valid
$form->email->addError($this->view->translate(_('There was a problem with the username or email address you entered.')));
}
}
@ -171,13 +171,13 @@ class LoginController extends Zend_Controller_Action
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', $stationLocale));
//uses separate layout without a navigation.
// uses separate layout without a navigation.
$this->_helper->layout->setLayout('login');
}
public function passwordChangeAction()
{
//uses separate layout without a navigation.
// uses separate layout without a navigation.
$this->_helper->layout->setLayout('login');
$request = $this->getRequest();
@ -192,7 +192,7 @@ class LoginController extends Zend_Controller_Action
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', $stationLocale));
//check validity of token
// check validity of token
if (!$auth->checkToken($user_id, $token, 'password.restore')) {
Logging::debug('token not valid');
$this->_helper->redirector('index', 'login');
@ -213,10 +213,10 @@ class LoginController extends Zend_Controller_Action
$zend_auth->authenticate($authAdapter);
//all info about this user from the login table omit only the password
// all info about this user from the login table omit only the password
$userInfo = $authAdapter->getResultRowObject(null, 'password');
//the default storage is a session with namespace Zend_Auth
// the default storage is a session with namespace Zend_Auth
$authStorage = $zend_auth->getStorage();
$authStorage->write($userInfo);

View file

@ -31,7 +31,7 @@ class PlaylistController extends Zend_Controller_Action
->addActionContext('change-playlist', 'json')
->initContext();
//This controller writes to the session all over the place, so we're going to reopen it for writing here.
// This controller writes to the session all over the place, so we're going to reopen it for writing here.
SessionHelper::reopenSessionForWriting();
}
@ -106,7 +106,7 @@ class PlaylistController extends Zend_Controller_Action
$form->startForm($obj->getId(), $formIsValid);
$this->view->form = $form;
$this->view->obj = $obj;
//$this->view->type = "sb";
// $this->view->type = "sb";
$this->view->id = $obj->getId();
if ($isJson) {
@ -115,7 +115,7 @@ class PlaylistController extends Zend_Controller_Action
$this->view->html = $this->view->render($viewPath);
} else {
$this->view->obj = $obj;
//$this->view->type = "pl";
// $this->view->type = "pl";
$this->view->id = $obj->getId();
if ($isJson) {
return $this->view->html = $this->view->render($viewPath);
@ -185,7 +185,7 @@ class PlaylistController extends Zend_Controller_Action
public function newAction()
{
//$pl_sess = $this->pl_sess;
// $pl_sess = $this->pl_sess;
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$type = $this->_getParam('type');
@ -306,7 +306,7 @@ class PlaylistController extends Zend_Controller_Action
$obj->addAudioClips($ids, $afterItem, $addType);
} elseif ($obj->isStatic()) {
// if the dest is a block object
//check if any items are playlists
// check if any items are playlists
foreach ($ids as $id) {
if (is_array($id) && isset($id[1])) {
if ($id[1] != 'audioclip') {
@ -574,7 +574,7 @@ class PlaylistController extends Zend_Controller_Action
$this->view->result = 1;
}
$this->view->name = $bl->getName();
//$this->view->type = "sb";
// $this->view->type = "sb";
$this->view->id = $bl->getId();
$this->view->modified = $bl->getLastModified('U');
} elseif ($params['type'] == 'playlist') {
@ -583,7 +583,7 @@ class PlaylistController extends Zend_Controller_Action
$this->view->name = $params['name'];
}
//$this->_helper->json->sendJson($result);
// $this->_helper->json->sendJson($result);
}
public function smartBlockGenerateAction()
@ -591,7 +591,7 @@ class PlaylistController extends Zend_Controller_Action
$request = $this->getRequest();
$params = $request->getPost();
//make sure block exists
// make sure block exists
try {
$bl = new Application_Model_Block($params['obj_id']);
@ -601,7 +601,7 @@ class PlaylistController extends Zend_Controller_Action
$result = $bl->generateSmartBlock($params['data']);
$this->view->result = $result['result'];
$this->createUpdateResponse($bl, true);
//$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true, true)));
// $this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true, true)));
} else {
$this->view->obj = $bl;
$this->view->id = $bl->getId();

View file

@ -62,7 +62,7 @@ class PlayouthistoryController extends Zend_Controller_Action
$this->view->headLink()->appendStylesheet($baseUrl . 'css/history_styles.css?' . $CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl . 'css/jquery.contextMenu.css?' . $CC_CONFIG['airtime_version']);
//set datatables columns for display of data.
// set datatables columns for display of data.
$historyService = new Application_Service_HistoryService();
$columns = json_encode($historyService->getDatatablesLogSheetColumns());
$script = "localStorage.setItem( 'datatables-historyitem-aoColumns', JSON.stringify({$columns}) ); ";

View file

@ -33,10 +33,10 @@ class PluploadController extends Zend_Controller_Action
$this->view->quotaLimitReached = true;
}
//Because uploads are done via AJAX (and we're not using Zend form for those), we manually add the CSRF
//token in here.
// Because uploads are done via AJAX (and we're not using Zend form for those), we manually add the CSRF
// token in here.
$csrf_namespace = new Zend_Session_Namespace('csrf_namespace');
//The CSRF token is generated in Bootstrap.php
// The CSRF token is generated in Bootstrap.php
$csrf_element = new Zend_Form_Element_Hidden('csrf');
$csrf_element->setValue($csrf_namespace->authtoken)->setRequired('true')->removeDecorator('HtmlTag')->removeDecorator('Label');
@ -80,10 +80,10 @@ class PluploadController extends Zend_Controller_Action
$rowStart = intval($request->getParam('iDisplayStart', 0));
$recentUploadsQuery = CcFilesQuery::create();
//old propel 1.5 to reuse this query item (for counts/finds)
// old propel 1.5 to reuse this query item (for counts/finds)
$recentUploadsQuery->keepQuery(true);
//Hide deleted files
// Hide deleted files
$recentUploadsQuery->filterByDbFileExists(true);
$numTotalRecentUploads = $recentUploadsQuery->count();
@ -95,7 +95,7 @@ class PluploadController extends Zend_Controller_Action
} elseif ($filter == 'failed') {
$recentUploadsQuery->filterByDbImportStatus(2);
$numTotalDisplayUploads = $recentUploadsQuery->count();
//TODO: Consider using array('min' => 200)) or something if we have multiple errors codes for failure.
// TODO: Consider using array('min' => 200)) or something if we have multiple errors codes for failure.
}
$recentUploads = $recentUploadsQuery
@ -110,12 +110,12 @@ class PluploadController extends Zend_Controller_Action
foreach ($recentUploads as $upload) {
$upload = $upload->toArray(BasePeer::TYPE_FIELDNAME);
//TODO: $this->sanitizeResponse($upload));
// TODO: $this->sanitizeResponse($upload));
$upload['utime'] = new DateTime($upload['utime'], $utcTimezone);
$upload['utime']->setTimeZone($displayTimezone);
$upload['utime'] = $upload['utime']->format(DEFAULT_TIMESTAMP_FORMAT);
//TODO: Invoke sanitization here (MediaController's removeBlacklist stuff)
// TODO: Invoke sanitization here (MediaController's removeBlacklist stuff)
array_push($uploadsArray, $upload);
}

View file

@ -73,10 +73,10 @@ class PreferenceController extends Zend_Controller_Action
$this->view->statusMsg = "<div class='success'>" . _('Preferences updated.') . '</div>';
$form = new Application_Form_Preferences();
$this->view->form = $form;
//$this->_helper->json->sendJson(array("valid"=>"true", "html"=>$this->view->render('preference/index.phtml')));
// $this->_helper->json->sendJson(array("valid"=>"true", "html"=>$this->view->render('preference/index.phtml')));
} else {
$this->view->form = $form;
//$this->_helper->json->sendJson(array("valid"=>"false", "html"=>$this->view->render('preference/index.phtml')));
// $this->_helper->json->sendJson(array("valid"=>"false", "html"=>$this->view->render('preference/index.phtml')));
}
}
$this->view->logoImg = Application_Model_Preference::GetStationLogo();
@ -261,7 +261,7 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::setReplayGainModifier($values['replayGainModifier']);
$md = ['schedule' => Application_Model_Schedule::getSchedule()];
Application_Model_RabbitMq::SendMessageToPypo('update_schedule', $md);
//Application_Model_RabbitMq::PushSchedule();
// Application_Model_RabbitMq::PushSchedule();
}
// pulling this from the 2.5.x branch
@ -363,7 +363,7 @@ class PreferenceController extends Zend_Controller_Action
if ($handle !== false) {
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..') {
//only show directories that aren't private.
// only show directories that aren't private.
if (is_dir($path . $file) && substr($file, 0, 1) != '.') {
$element = [];
$element['name'] = $file;
@ -376,7 +376,7 @@ class PreferenceController extends Zend_Controller_Action
}
}
ksort($result);
//returns format serverBrowse is looking for.
// returns format serverBrowse is looking for.
$this->_helper->json->sendJson($result);
}

View file

@ -46,7 +46,7 @@ class ScheduleController extends Zend_Controller_Action
$baseUrl = Application_Common_OsPath::getBaseDir();
//Embed the schedule in our page response so we don't have to make an AJAX request to get this data after the page load.
// Embed the schedule in our page response so we don't have to make an AJAX request to get this data after the page load.
$scheduleController = new ScheduleController($this->getRequest(), $this->getResponse());
$scheduleController->eventFeedPreloadAction();
$events = json_encode($scheduleController->view->events);
@ -64,10 +64,10 @@ class ScheduleController extends Zend_Controller_Action
$this->view->headScript()->appendFile($baseUrl . 'js/contextmenu/jquery.contextMenu.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
//full-calendar-functions.js requires this variable, so that datePicker widget can be offset to server time instead of client time
//this should be as a default, however with our new drop down timezone changing for shows, we should reset this offset then??
// full-calendar-functions.js requires this variable, so that datePicker widget can be offset to server time instead of client time
// this should be as a default, however with our new drop down timezone changing for shows, we should reset this offset then??
$this->view->headScript()->appendScript('var timezoneOffset = ' . Application_Common_DateHelper::getStationTimezoneOffset() . '; //in seconds');
//set offset to ensure it loads last
// set offset to ensure it loads last
$this->view->headScript()->offsetSetFile(90, $baseUrl . 'js/airtime/schedule/full-calendar-functions.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl . 'js/fullcalendar/fullcalendar.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
@ -89,7 +89,7 @@ class ScheduleController extends Zend_Controller_Action
$this->view->headLink()->appendStylesheet($baseUrl . 'css/add-show.css?' . $CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl . 'css/jquery.contextMenu.css?' . $CC_CONFIG['airtime_version']);
//Start Show builder JS/CSS requirements
// Start Show builder JS/CSS requirements
$headScript = $this->view->headScript();
AirtimeTableView::injectTableJavaScriptDependencies($headScript, $baseUrl, $CC_CONFIG['airtime_version']);
@ -106,7 +106,7 @@ class ScheduleController extends Zend_Controller_Action
$this->view->headLink()->appendStylesheet($baseUrl . 'css/datatables/css/dataTables.colReorder.min.css?' . $CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl . 'css/showbuilder.css?' . $CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl . 'css/dashboard.css?' . $CC_CONFIG['airtime_version']);
//End Show builder JS/CSS requirements
// End Show builder JS/CSS requirements
$this->createShowFormAction(true);
@ -333,7 +333,7 @@ class ScheduleController extends Zend_Controller_Action
'user'
);
//TODO: Add timezone and timezoneOffset back into the ApiController's results.
// TODO: Add timezone and timezoneOffset back into the ApiController's results.
$range['timezone'] = Application_Common_DateHelper::getUserTimezoneAbbreviation();
$range['timezoneOffset'] = Application_Common_DateHelper::getUserTimezoneOffset();
@ -346,7 +346,7 @@ class ScheduleController extends Zend_Controller_Action
$live_dj_switch = Application_Model_Preference::GetSourceSwitchStatus('live_dj');
$master_dj_switch = Application_Model_Preference::GetSourceSwitchStatus('master_dj');
//might not be the correct place to implement this but for now let's just do it here
// might not be the correct place to implement this but for now let's just do it here
$source_status['live_dj_source'] = $live_dj;
$source_status['master_dj_source'] = $master_dj;
$this->view->source_status = $source_status;
@ -384,7 +384,7 @@ class ScheduleController extends Zend_Controller_Action
$originalShowName = $originalShow->getName();
$originalShowStart = $originalShow->getShowInstanceStart();
//convert from UTC to user's timezone for display.
// convert from UTC to user's timezone for display.
$displayTimeZone = new DateTimeZone(Application_Model_Preference::GetTimezone());
$originalDateTime = new DateTime($originalShowStart, new DateTimeZone('UTC'));
$originalDateTime->setTimezone($displayTimeZone);
@ -464,7 +464,7 @@ class ScheduleController extends Zend_Controller_Action
$js = $this->_getParam('data');
$data = [];
//need to convert from serialized jQuery array.
// need to convert from serialized jQuery array.
foreach ($js as $j) {
$data[$j['name']] = $j['value'];
}
@ -520,7 +520,7 @@ class ScheduleController extends Zend_Controller_Action
$js = $this->_getParam('data');
$data = [];
//need to convert from serialized jQuery array.
// need to convert from serialized jQuery array.
foreach ($js as $j) {
$data[$j['name']] = $j['value'];
}
@ -530,7 +530,7 @@ class ScheduleController extends Zend_Controller_Action
);
$service_show = new Application_Service_ShowService(null, $data, true);
//TODO: move this to js
// TODO: move this to js
$data['add_show_hosts'] = $this->_getParam('hosts');
$data['add_show_day_check'] = $this->_getParam('days');
@ -570,7 +570,7 @@ class ScheduleController extends Zend_Controller_Action
if (!$validateStartTime) {
$this->view->when->getElement('add_show_start_time')->setOptions(['disabled' => true]);
}
//$this->view->rr->getElement('add_show_record')->setOptions(array('disabled' => true));
// $this->view->rr->getElement('add_show_record')->setOptions(array('disabled' => true));
$this->view->addNewShow = false;
$this->view->action = 'edit-show';
@ -585,7 +585,7 @@ class ScheduleController extends Zend_Controller_Action
$js = $this->_getParam('data');
$data = [];
//need to convert from serialized jQuery array.
// need to convert from serialized jQuery array.
foreach ($js as $j) {
$data[$j['name']] = $j['value'];
}
@ -612,11 +612,11 @@ class ScheduleController extends Zend_Controller_Action
$this->view->addNewShow = true;
if ($data['add_show_start_now'] == 'now') {
//have to use the timezone the user has entered in the form to check past/present
// have to use the timezone the user has entered in the form to check past/present
$showTimezone = new DateTimeZone($data['add_show_timezone']);
$nowDateTime = new DateTime('now', $showTimezone);
//$showStartDateTime = new DateTime($start_time, $showTimezone);
//$showEndDateTime = new DateTime($end_time, $showTimezone);
// $showStartDateTime = new DateTime($start_time, $showTimezone);
// $showEndDateTime = new DateTime($end_time, $showTimezone);
$data['add_show_start_time'] = $nowDateTime->format('H:i');
$data['add_show_start_date'] = $nowDateTime->format('Y-m-d');
@ -626,7 +626,7 @@ class ScheduleController extends Zend_Controller_Action
// Get the show ID from the show service to pass as a parameter to the RESTful ShowImageController
$this->view->showId = $service_show->addUpdateShow($data);
//send new show forms to the user
// send new show forms to the user
$this->createShowFormAction(true);
$this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
@ -734,7 +734,7 @@ class ScheduleController extends Zend_Controller_Action
$menu[] = ['action' => ['type' => 'gourl', 'url' => $url],
'title' => _('Download'), ];
//returns format jjmenu is looking for.
// returns format jjmenu is looking for.
$this->_helper->json->sendJson($menu);
}

View file

@ -21,7 +21,7 @@ class ShowbuilderController extends Zend_Controller_Action
$baseUrl = Application_Common_OsPath::getBaseDir();
$userType = Application_Model_User::GetCurrentUser()->getType();
//$this->_helper->layout->setLayout("showbuilder");
// $this->_helper->layout->setLayout("showbuilder");
$this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '{$userType}' );");
@ -70,7 +70,7 @@ class ShowbuilderController extends Zend_Controller_Action
$this->view->csrf = $csrf_element;
$request = $this->getRequest();
//populate date range form for show builder.
// populate date range form for show builder.
$now = time();
$from = $request->getParam('from', $now);
$to = $request->getParam('to', $now + (3 * 60 * 60));
@ -133,12 +133,12 @@ class ShowbuilderController extends Zend_Controller_Action
$instance = $item->getCcShowInstances();
$menu['preview'] = ['name' => _('Preview'), 'icon' => 'play'];
//select the cursor
// select the cursor
$menu['selCurs'] = ['name' => _('Select cursor'), 'icon' => 'select-cursor'];
$menu['delCurs'] = ['name' => _('Remove cursor'), 'icon' => 'select-cursor'];
if ($now < floatval($item->getDbEnds('U.u')) && $user->canSchedule($instance->getDbShowId())) {
//remove/truncate the item from the schedule
// remove/truncate the item from the schedule
$menu['del'] = ['name' => _('Delete'), 'icon' => 'delete', 'url' => $baseUrl . 'showbuilder/schedule-remove'];
}
@ -199,7 +199,7 @@ class ShowbuilderController extends Zend_Controller_Action
$opts = ['myShows' => $my_shows, 'showFilter' => $show_filter];
$showBuilder = new Application_Model_ShowBuilder($startsDT, $endsDT, $opts);
//only send the schedule back if updates have been made.
// only send the schedule back if updates have been made.
// -1 default will always call the schedule to be sent back if no timestamp is defined.
$this->view->update = $showBuilder->hasBeenUpdatedSince(
$timestamp,

View file

@ -69,7 +69,7 @@ class UserController extends Zend_Controller_Action
$user->setPassword($formData['password']);
}
if (array_key_exists('type', $formData)) {
if ($formData['type'] != UTYPE_SUPERADMIN) { //Don't allow any other user to be promoted to Super Admin
if ($formData['type'] != UTYPE_SUPERADMIN) { // Don't allow any other user to be promoted to Super Admin
$user->setType($formData['type']);
}
}
@ -136,12 +136,12 @@ class UserController extends Zend_Controller_Action
if ($form->isValid($formData)
&& $form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) {
$user = new Application_Model_User($formData['cu_user_id']);
//Stupid hack because our schema enforces non-null first_name
//even though by default the admin user has no first name... (....)
// Stupid hack because our schema enforces non-null first_name
// even though by default the admin user has no first name... (....)
if (Application_Model_User::getCurrentUser()->isSuperAdmin()) {
if (empty($formData['cu_first_name'])) {
$formData['cu_first_name'] = 'admin';
$formData['cu_last_name'] = 'admin'; //ditto, avoid non-null DB constraint
$formData['cu_last_name'] = 'admin'; // ditto, avoid non-null DB constraint
}
}
if (isset($formData['cu_first_name'])) {
@ -180,9 +180,9 @@ class UserController extends Zend_Controller_Action
Application_Model_Preference::SetUserLocale($formData['cu_locale']);
Application_Model_Preference::SetUserTimezone($formData['cu_timezone']);
//configure localization with new locale setting
// configure localization with new locale setting
Application_Model_Locale::configureLocalization($formData['cu_locale']);
//reinitialize form so language gets translated
// reinitialize form so language gets translated
$form = new Application_Form_EditUser();
$this->view->successMessage = "<div class='success'>" . _('Settings updated successfully!') . '</div>';
@ -234,8 +234,8 @@ class UserController extends Zend_Controller_Action
} elseif ($files_action == 'reassign_to') {
// TODO : fix code to actually use the line below and pick a
// real owner instead of defaulting to the first found admin
//$new_owner_id = $this->_getParam("new_owner");
//$new_owner = new Application_Model_User($new_owner_id);
// $new_owner_id = $this->_getParam("new_owner");
// $new_owner = new Application_Model_User($new_owner_id);
$user->donateFilesTo($new_owner);
Logging::info("Reassign to user {$new_owner->getDbId()}");
}

View file

@ -81,7 +81,7 @@ class UsersettingsController extends Zend_Controller_Action
{
SessionHelper::reopenSessionForWriting();
Zend_Session::namespaceUnset('referrer');
//pass in true to indicate 'Remind me never' was clicked
// pass in true to indicate 'Remind me never' was clicked
Application_Model_Preference::SetRemindMeDate(true);
}

View file

@ -24,7 +24,7 @@ class WebstreamController extends Zend_Controller_Action
$webstream = new CcWebstream();
//we're not saving this primary key in the DB so it's OK to be -1
// we're not saving this primary key in the DB so it's OK to be -1
$webstream->setDbId(-1);
$webstream->setDbName(_('Untitled Webstream'));
$webstream->setDbDescription('');
@ -35,7 +35,7 @@ class WebstreamController extends Zend_Controller_Action
$webstream->setDbUtime(new DateTime('now', new DateTimeZone('UTC')));
$webstream->setDbMtime(new DateTime('now', new DateTimeZone('UTC')));
//clear the session in case an old playlist was open: CC-4196
// clear the session in case an old playlist was open: CC-4196
Application_Model_Library::changePlaylist(null, null);
$this->view->obj = new Application_Model_Webstream($webstream);
@ -116,7 +116,7 @@ class WebstreamController extends Zend_Controller_Action
/*we are updating a playlist. Ensure that if the user is a
host/dj, that he has the correct permission.*/
$user = Application_Model_User::getCurrentUser();
//only allow when webstream belongs to the DJ
// only allow when webstream belongs to the DJ
return $webstream->getDbCreatorId() == $user->getId();
}
/*we are creating a new stream. Don't need to check whether the

View file

@ -119,20 +119,20 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
])) {
$this->setRoleName('G');
} elseif (Zend_Session::isStarted() && !Zend_Auth::getInstance()->hasIdentity()) {
//The controller uses sessions but we don't have an identity yet.
// The controller uses sessions but we don't have an identity yet.
// If we don't have an identity and we're making a RESTful request,
// we need to do API key verification
if ($request->getModuleName() == 'rest') {
if (!$this->verifyAuth()) {
//$this->denyAccess();
//$this->getResponse()->sendResponse();
//$r->gotoSimpleAndExit('index', 'login', $request->getModuleName());
// $this->denyAccess();
// $this->getResponse()->sendResponse();
// $r->gotoSimpleAndExit('index', 'login', $request->getModuleName());
//die();
// die();
throw new Zend_Controller_Exception('Incorrect API key', 401);
}
} else { //Non-REST, regular Airtime web app requests
} else { // Non-REST, regular Airtime web app requests
// Redirect user to the landing page if they are trying to
// access a resource that requires a valid session.
// Skip the redirection if they are already on the landing page
@ -148,7 +148,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
->setBody($json)
->sendResponse();
//redirectAndExit() cleans up, sends the headers and stops the script
// redirectAndExit() cleans up, sends the headers and stops the script
Zend_Controller_Action_HelperBroker::getStaticHelper('redirector')->redirectAndExit();
} else {
$r = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
@ -156,7 +156,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
}
}
}
} else { //We have a session/identity.
} else { // We have a session/identity.
// If we have an identity and we're making a RESTful request,
// we need to check the CSRF token
if ($_SERVER['REQUEST_METHOD'] != 'GET' && $request->getModuleName() == 'rest') {

View file

@ -26,10 +26,10 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
$controller = strtolower($request->getControllerName());
$action = strtolower($request->getActionName());
//List of controllers where we don't need a session, and we don't need
//all the standard HTML / JS boilerplate.
// List of controllers where we don't need a session, and we don't need
// all the standard HTML / JS boilerplate.
if (!in_array($controller, [
'index', //Radio Page
'index', // Radio Page
'api',
'auth',
'error',
@ -38,11 +38,11 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
'feeds',
])
) {
//Start the session
// Start the session
Zend_Session::start();
Application_Model_Auth::pinSessionToClient(Zend_Auth::getInstance());
//localization configuration
// localization configuration
Application_Model_Locale::configureLocalization();
$this->_initGlobals();
@ -122,11 +122,11 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
$csrf_namespace->setExpirationSeconds(168 * 60 * 60);
}
//Here we are closing the session for writing because otherwise no requests
//in this session will be handled in parallel. This gives a major boost to the perceived performance
//of the application (page load times are more consistent, no lock contention).
// Here we are closing the session for writing because otherwise no requests
// in this session will be handled in parallel. This gives a major boost to the perceived performance
// of the application (page load times are more consistent, no lock contention).
session_write_close();
//Zend_Session::writeClose(true);
// Zend_Session::writeClose(true);
}
/**
@ -140,7 +140,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
$view->headScript()->appendScript("var PRODUCT_NAME = '" . PRODUCT_NAME . "';");
$view->headScript()->appendScript("var USER_MANUAL_URL = '" . USER_MANUAL_URL . "';");
$view->headScript()->appendScript("var COMPANY_NAME = '" . COMPANY_NAME . "';");
//Each page refresh or tab open has uniqID, not to be used for security
// Each page refresh or tab open has uniqID, not to be used for security
$view->headScript()->appendScript("var UNIQID = '" . uniqid() . "';");
$track_type_options = [];
@ -204,8 +204,8 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
->appendScript('$.i18n.setDictionary(general_dict)')
->appendScript("var baseUrl='{$baseUrl}'");
//These timezones are needed to adjust javascript Date objects on the client to make sense to the user's set timezone
//or the server's set timezone.
// These timezones are needed to adjust javascript Date objects on the client to make sense to the user's set timezone
// or the server's set timezone.
$serverTimeZone = new DateTimeZone(Application_Model_Preference::GetDefaultTimezone());
$now = new DateTime('now', $serverTimeZone);
$offset = $now->format('Z') * -1;
@ -218,7 +218,7 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract
$view->headScript()->appendScript("var userTimezoneOffset = {$offset}; //in seconds");
}
//scripts for now playing bar
// scripts for now playing bar
$view->headScript()->appendFile($baseUrl . 'js/airtime/airtime_bootstrap.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
->appendFile($baseUrl . 'js/airtime/dashboard/helperfunctions.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')
->appendFile($baseUrl . 'js/airtime/dashboard/dashboard.js?' . $CC_CONFIG['airtime_version'], 'text/javascript')