Merge branch 'saas-dev' into soundcloud
This commit is contained in:
commit
f243014d9f
271 changed files with 123614 additions and 117677 deletions
|
@ -30,6 +30,8 @@ require_once "Timezone.php";
|
|||
require_once "Auth.php";
|
||||
require_once "interface/OAuth2.php";
|
||||
require_once "TaskManager.php";
|
||||
require_once "UsabilityHints.php";
|
||||
require_once __DIR__.'/models/formatters/LengthFormatter.php';
|
||||
require_once __DIR__.'/services/CeleryService.php';
|
||||
require_once __DIR__.'/services/SoundcloudService.php';
|
||||
require_once __DIR__.'/forms/helpers/ValidationTypes.php';
|
||||
|
@ -92,6 +94,15 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||
$userType = "";
|
||||
}
|
||||
$view->headScript()->appendScript("var userType = '$userType';");
|
||||
|
||||
// Dropzone also accept file extensions and doesn't correctly extract certain mimetypes (eg. FLAC - try it),
|
||||
// so we append the file extensions to the list of mimetypes and that makes it work.
|
||||
$mimeTypes = FileDataHelper::getAudioMimeTypeArray();
|
||||
$fileExtensions = array_values($mimeTypes);
|
||||
foreach($fileExtensions as &$extension) {
|
||||
$extension = '.' . $extension;
|
||||
}
|
||||
$view->headScript()->appendScript("var acceptedMimeTypes = " . json_encode(array_merge(array_keys($mimeTypes), $fileExtensions)) . ";");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -130,9 +141,9 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||
protected function _initTasks() {
|
||||
/* We need to wrap this here so that we aren't checking when we're running the unit test suite
|
||||
*/
|
||||
$taskManager = TaskManager::getInstance();
|
||||
$taskManager->runTask(AirtimeTask::UPGRADE); // Run the upgrade on each request (if it needs to be run)
|
||||
if (getenv("AIRTIME_UNIT_TEST") != 1) {
|
||||
$taskManager = TaskManager::getInstance();
|
||||
$taskManager->runTask(AirtimeTask::UPGRADE); // Run the upgrade on each request (if it needs to be run)
|
||||
//This will do the upgrade too if it's needed...
|
||||
$taskManager->runTasks();
|
||||
}
|
||||
|
|
|
@ -42,12 +42,12 @@ class Amazon_S3StorageBackend extends StorageBackend
|
|||
}
|
||||
|
||||
/** Returns a signed download URL from Amazon S3, expiring in 60 minutes */
|
||||
public function getDownloadURLs($resourceId)
|
||||
public function getDownloadURLs($resourceId, $contentDispositionFilename)
|
||||
{
|
||||
$urls = array();
|
||||
|
||||
$signedS3Url = $this->s3Client->getObjectUrl($this->getBucket(), $resourceId, '+60 minutes');
|
||||
|
||||
$s3args = array('ResponseContentDisposition' => 'attachment; filename="' . urlencode($contentDispositionFilename) . '"');
|
||||
$signedS3Url = $this->s3Client->getObjectUrl($this->getBucket(), $resourceId, '+60 minutes', $s3args);
|
||||
|
||||
//If we're using the proxy cache, we need to modify the request URL after it has
|
||||
//been generated by the above. (The request signature must be for the amazonaws.com,
|
||||
|
@ -65,7 +65,7 @@ class Amazon_S3StorageBackend extends StorageBackend
|
|||
$p["path"] = substr($p["path"], 1 + strlen($this->getBucket()));
|
||||
}
|
||||
$proxyUrl = $p["scheme"] . "://" . $p["host"] . $p["path"] . "?" . $p["query"];
|
||||
//Add this proxy cache URL to the list of download URLs.
|
||||
//Add this proxy cache URL to the list of download URLs.s
|
||||
array_push($urls, $proxyUrl);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class FileStorageBackend extends StorageBackend
|
|||
return $resourceId;
|
||||
}
|
||||
|
||||
public function getDownloadURLs($resourceId)
|
||||
public function getDownloadURLs($resourceId, $contentDispositionFilename)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -38,9 +38,9 @@ class ProxyStorageBackend extends StorageBackend
|
|||
return $this->storageBackend->getAbsoluteFilePath($resourceId);
|
||||
}
|
||||
|
||||
public function getDownloadURLs($resourceId)
|
||||
public function getDownloadURLs($resourceId, $contentDispositionFilename)
|
||||
{
|
||||
return $this->storageBackend->getDownloadURLs($resourceId);
|
||||
return $this->storageBackend->getDownloadURLs($resourceId, $contentDispositionFilename);
|
||||
}
|
||||
|
||||
public function deletePhysicalFile($resourceId)
|
||||
|
|
|
@ -15,7 +15,7 @@ abstract class StorageBackend
|
|||
|
||||
/** Returns the file object's signed URL. The URL must be signed since they
|
||||
* privately stored on the storage backend. */
|
||||
abstract public function getDownloadURLs($resourceId);
|
||||
abstract public function getDownloadURLs($resourceId, $contentDispositionFilename);
|
||||
|
||||
/** Deletes the file from the storage backend. */
|
||||
abstract public function deletePhysicalFile($resourceId);
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
|
||||
define("AIRTIME_PRO_FREE_TRIAL_PLAN_ID", 34);
|
||||
define("WHMCS_AIRTIME_GROUP_ID", 15);
|
||||
|
||||
class Billing
|
||||
{
|
||||
public static function getAPICredentials()
|
||||
|
@ -30,10 +33,10 @@ class Billing
|
|||
{
|
||||
//Making this static to cache the products during a single HTTP request.
|
||||
//This saves us roundtrips to WHMCS if getProducts() is called multiple times.
|
||||
static $result = array();
|
||||
if (!empty($result))
|
||||
static $products = array();
|
||||
if (!empty($products))
|
||||
{
|
||||
return $result["products"]["product"];
|
||||
return $products;
|
||||
}
|
||||
|
||||
$credentials = self::getAPICredentials();
|
||||
|
@ -44,7 +47,7 @@ class Billing
|
|||
$postfields["action"] = "getproducts";
|
||||
$postfields["responsetype"] = "json";
|
||||
//gid is the Airtime product group id on whmcs
|
||||
$postfields["gid"] = "15";
|
||||
$postfields["gid"] = WHMCS_AIRTIME_GROUP_ID;
|
||||
|
||||
$query_string = "";
|
||||
foreach ($postfields AS $k=>$v) $query_string .= "$k=".urlencode($v)."&";
|
||||
|
@ -54,9 +57,9 @@ class Billing
|
|||
$products = $result["products"]["product"];
|
||||
|
||||
//Blacklist all free plans
|
||||
//Hide the promo plans - we will tell the user if they are eligible for a promo plan
|
||||
foreach ($products as $k => $p) {
|
||||
Logging::info($p);
|
||||
if ($p["paytype"] === "free")
|
||||
if ($p["paytype"] === "free" || strpos($p["name"], "Awesome August 2015") !== false)
|
||||
{
|
||||
unset($products[$k]);
|
||||
}
|
||||
|
@ -106,7 +109,7 @@ class Billing
|
|||
$result = self::makeRequest($credentials["url"], $query_string);
|
||||
|
||||
//XXX: Debugging / local testing
|
||||
if ($_SERVER['SERVER_NAME'] == "airtime.localhost") {
|
||||
if ($_SERVER['SERVER_NAME'] == "localhost") {
|
||||
$_SERVER['SERVER_NAME'] = "bananas.airtime.pro";
|
||||
}
|
||||
|
||||
|
|
|
@ -4,22 +4,23 @@ class FileDataHelper {
|
|||
|
||||
public static function getAudioMimeTypeArray() {
|
||||
return array(
|
||||
"audio/ogg" => "ogg",
|
||||
"application/ogg" => "ogg",
|
||||
"audio/vorbis" => "ogg",
|
||||
"audio/mp3" => "mp3",
|
||||
"audio/mpeg" => "mp3",
|
||||
"audio/mpeg3" => "mp3",
|
||||
"audio/aac" => "aac",
|
||||
"audio/aacp" => "aac",
|
||||
"audio/mp4" => "mp4",
|
||||
"audio/x-flac" => "flac",
|
||||
"audio/wav" => "wav",
|
||||
"audio/x-wav" => "wav",
|
||||
"audio/mp2" => "mp2",
|
||||
"audio/mp1" => "mp1",
|
||||
"audio/x-ms-wma" => "wma",
|
||||
"audio/basic" => "au",
|
||||
"audio/ogg" => "ogg",
|
||||
"application/ogg" => "ogg",
|
||||
"audio/vorbis" => "ogg",
|
||||
"audio/mp3" => "mp3",
|
||||
"audio/mpeg" => "mp3",
|
||||
"audio/mpeg3" => "mp3",
|
||||
"audio/x-aac" => "aac",
|
||||
"audio/aac" => "aac",
|
||||
"audio/aacp" => "aac",
|
||||
"audio/mp4" => "m4a",
|
||||
"audio/x-flac" => "flac",
|
||||
"audio/wav" => "wav",
|
||||
"audio/x-wav" => "wav",
|
||||
"audio/mp2" => "mp2",
|
||||
"audio/mp1" => "mp1",
|
||||
"audio/x-ms-wma" => "wma",
|
||||
"audio/basic" => "au",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ class ProvisioningHelper
|
|||
private $dbuser, $dbpass, $dbname, $dbhost, $dbowner, $apikey;
|
||||
private $instanceId;
|
||||
private $stationName, $description;
|
||||
private $defaultIcecastPassword;
|
||||
|
||||
public function __construct($apikey)
|
||||
{
|
||||
|
@ -24,8 +25,12 @@ class ProvisioningHelper
|
|||
*/
|
||||
public function createAction()
|
||||
{
|
||||
$apikey = $_SERVER['PHP_AUTH_USER'];
|
||||
if (!isset($apikey) || $apikey != $this->apikey) {
|
||||
$apikey = "";
|
||||
if (isset($_SERVER['PHP_AUTH_USER']))
|
||||
{
|
||||
$apikey = $_SERVER['PHP_AUTH_USER'];
|
||||
}
|
||||
if ($apikey != $this->apikey) {
|
||||
Logging::info("Invalid API Key: $apikey");
|
||||
http_response_code(403);
|
||||
echo "ERROR: Incorrect API key";
|
||||
|
@ -118,6 +123,9 @@ class ProvisioningHelper
|
|||
if (isset($_POST['description'])) {
|
||||
$this->description = $_POST['description'];
|
||||
}
|
||||
if (isset($_POST['icecast_pass'])) {
|
||||
$this->defaultIcecastPassword = $_POST['icecast_pass'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -208,6 +216,9 @@ class ProvisioningHelper
|
|||
if ($this->description) {
|
||||
Application_Model_Preference::SetStationDescription($this->description);
|
||||
}
|
||||
if (isset($this->defaultIcecastPassword)) {
|
||||
Application_Model_Preference::setDefaultIcecastPassword($this->defaultIcecastPassword);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ class Application_Common_Timezone
|
|||
'UTC' => DateTimeZone::UTC
|
||||
);
|
||||
|
||||
$tzlist = array();
|
||||
$tzlist = array(NULL => "Use station default");
|
||||
|
||||
foreach ($regions as $name => $mask) {
|
||||
$ids = DateTimeZone::listIdentifiers($mask);
|
||||
|
|
211
airtime_mvc/application/common/UsabilityHints.php
Normal file
211
airtime_mvc/application/common/UsabilityHints.php
Normal file
|
@ -0,0 +1,211 @@
|
|||
<?php
|
||||
|
||||
class Application_Common_UsabilityHints
|
||||
{
|
||||
|
||||
/**
|
||||
* @param $userPath User's current location in Airtime (i.e. /Plupload)
|
||||
* @return string
|
||||
*/
|
||||
public static function getUsabilityHint($userPath=null)
|
||||
{
|
||||
// We want to display hints in this order:
|
||||
// 1. Check if files are uploaded
|
||||
// 2. Check if a show is scheduled
|
||||
// 3. Check if current or next show needs content
|
||||
|
||||
// Once the user is on the page linked to from the hint we want to
|
||||
// display a new message further describing what to do. Once this
|
||||
// action has been done we can hide the message and get the next
|
||||
// usability hint, if there is one.
|
||||
|
||||
$userIsOnCalendarPage = false;
|
||||
$userIsOnAddMediaPage = false;
|
||||
|
||||
// If $userPath is set the request came from AJAX so the user's
|
||||
// current location inside Airtime gets passed in to this function.
|
||||
if (!is_null($userPath)) {
|
||||
// We check if the controller names are in the user's current location
|
||||
// so we can ignore leading or trailing slashes, special characters like '#',
|
||||
// and additional controller action names like '/user/add-user'
|
||||
|
||||
if (strpos(strtolower($userPath), 'plupload') !== false) {
|
||||
$userIsOnAddMediaPage = true;
|
||||
}
|
||||
|
||||
if (strpos(strtolower($userPath), 'schedule') !== false) {
|
||||
$userIsOnCalendarPage = true;
|
||||
}
|
||||
} else {
|
||||
// If $userPath is not set the request came from inside Airtime so
|
||||
// we can use Zend's Front Controller to get the user's current location.
|
||||
$currentController = strtolower(Zend_Controller_Front::getInstance()->getRequest()->getControllerName());
|
||||
|
||||
if ($currentController == "schedule") {
|
||||
$userIsOnCalendarPage = true;
|
||||
}
|
||||
|
||||
if ($currentController == "plupload") {
|
||||
$userIsOnAddMediaPage = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (self::zeroFilesUploaded()) {
|
||||
if ($userIsOnAddMediaPage) {
|
||||
return _("Upload some tracks below to add them to your library!");
|
||||
} else {
|
||||
return sprintf(_("It looks like you haven't uploaded any audio files yet. %sUpload a file now%s."),
|
||||
"<a href=\"/plupload\">",
|
||||
"</a>");
|
||||
}
|
||||
} else if (!self::isFutureOrCurrentShowScheduled()) {
|
||||
if ($userIsOnCalendarPage) {
|
||||
return _("Click the 'New Show' button and fill out the required fields.");
|
||||
} else {
|
||||
return sprintf(_("It looks like you don't have any shows scheduled. %sCreate a show now%s."),
|
||||
"<a href=\"/schedule\">",
|
||||
"</a>");
|
||||
}
|
||||
} else if (self::isCurrentShowEmpty()) {
|
||||
// If the current show is linked users cannot add content to it so we have to provide a different message.
|
||||
if (self::isCurrentShowLinked()) {
|
||||
if ($userIsOnCalendarPage) {
|
||||
return _("To start broadcasting, cancel the current linked show by clicking on it and selecting 'Cancel Show'.");
|
||||
} else {
|
||||
return sprintf(_("Linked shows need to be filled with tracks before it starts. To start broadcasting cancel the current linked show and schedule an unlinked show.
|
||||
%sCreate an unlinked show now%s."), "<a href=\"/schedule\">", "</a>");
|
||||
}
|
||||
} else {
|
||||
if ($userIsOnCalendarPage) {
|
||||
return _("To start broadcasting, click on the current show and select 'Schedule Tracks'");
|
||||
} else {
|
||||
return sprintf(_("It looks like the current show needs more tracks. %sAdd tracks to your show now%s."),
|
||||
"<a href=\"/schedule\">",
|
||||
"</a>");
|
||||
}
|
||||
}
|
||||
} else if (!self::getCurrentShow() && self::isNextShowEmpty()) {
|
||||
if ($userIsOnCalendarPage) {
|
||||
return _("Click on the show starting next and select 'Schedule Tracks'");
|
||||
} else {
|
||||
return sprintf(_("It looks like the next show is empty. %sAdd tracks to your show now%s."),
|
||||
"<a href=\"/schedule\">",
|
||||
"</a>");
|
||||
}
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if no files have been uploaded.
|
||||
*/
|
||||
private static function zeroFilesUploaded()
|
||||
{
|
||||
$fileCount = CcFilesQuery::create()
|
||||
->filterByDbFileExists(true)
|
||||
->filterByDbHidden(false)
|
||||
->count();
|
||||
|
||||
if ($fileCount == 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if there is at least one show currently scheduled
|
||||
* or in the future.
|
||||
*/
|
||||
private static function isFutureOrCurrentShowScheduled()
|
||||
{
|
||||
$futureShow = self::getNextFutureShow();
|
||||
$currentShow = self::getCurrentShow();
|
||||
|
||||
if (is_null($futureShow) && is_null($currentShow)) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private static function isCurrentShowEmpty()
|
||||
{
|
||||
$currentShow = self::getCurrentShow();
|
||||
|
||||
if (is_null($currentShow)) {
|
||||
return false;
|
||||
} else {
|
||||
$now = new DateTime("now", new DateTimeZone("UTC"));
|
||||
$scheduledTracks = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($currentShow->getDbId())
|
||||
->filterByDbEnds($now, Criteria::GREATER_EQUAL)
|
||||
->find();
|
||||
if ($scheduledTracks->count() == 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function isNextShowEmpty()
|
||||
{
|
||||
$futureShow = self::getNextFutureShow();
|
||||
|
||||
if (is_null($futureShow)) {
|
||||
return false;
|
||||
} else {
|
||||
$now = new DateTime("now", new DateTimeZone("UTC"));
|
||||
$scheduledTracks = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($futureShow->getDbId())
|
||||
->filterByDbStarts($now, Criteria::GREATER_EQUAL)
|
||||
->find();
|
||||
if ($scheduledTracks->count() == 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static function getCurrentShow()
|
||||
{
|
||||
$now = new DateTime("now", new DateTimeZone("UTC"));
|
||||
|
||||
return CcShowInstancesQuery::create()
|
||||
->filterByDbStarts($now, Criteria::LESS_THAN)
|
||||
->filterByDbEnds($now, Criteria::GREATER_THAN)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->findOne();
|
||||
}
|
||||
|
||||
private static function getNextFutureShow()
|
||||
{
|
||||
$now = new DateTime("now", new DateTimeZone("UTC"));
|
||||
|
||||
return CcShowInstancesQuery::create()
|
||||
->filterByDbStarts($now, Criteria::GREATER_THAN)
|
||||
->filterByDbModifiedInstance(false)
|
||||
->orderByDbStarts()
|
||||
->findOne();
|
||||
}
|
||||
|
||||
private static function isCurrentShowLinked()
|
||||
{
|
||||
$currentShow = self::getCurrentShow();
|
||||
if (!is_null($currentShow)) {
|
||||
$show = CcShowQuery::create()
|
||||
->filterByDbId($currentShow->getDbShowId())
|
||||
->findOne();
|
||||
if ($show->isLinked()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -40,7 +40,8 @@ $ccAcl->add(new Zend_Acl_Resource('library'))
|
|||
->add(new Zend_Acl_Resource('provisioning'))
|
||||
->add(new Zend_Acl_Resource('player'))
|
||||
->add(new Zend_Acl_Resource('soundcloud'))
|
||||
->add(new Zend_Acl_Resource('embeddablewidgets'));
|
||||
->add(new Zend_Acl_Resource('embeddablewidgets'))
|
||||
->add(new Zend_Acl_Resource('setup'));
|
||||
|
||||
/** Creating permissions */
|
||||
$ccAcl->allow('G', 'index')
|
||||
|
@ -60,6 +61,8 @@ $ccAcl->allow('G', 'index')
|
|||
->allow('G', 'downgrade')
|
||||
->allow('G', 'rest:show-image', 'get')
|
||||
->allow('G', 'rest:media', 'get')
|
||||
->allow('G', 'setup')
|
||||
->allow('G', 'embeddablewidgets')
|
||||
->allow('H', 'soundcloud')
|
||||
->allow('H', 'rest:show-image')
|
||||
->allow('H', 'rest:media')
|
||||
|
@ -74,8 +77,6 @@ $ccAcl->allow('G', 'index')
|
|||
->allow('A', 'user')
|
||||
->allow('A', 'systemstatus')
|
||||
->allow('A', 'preference')
|
||||
->allow('A', 'player')
|
||||
->allow('A', 'embeddablewidgets')
|
||||
->allow('S', 'thank-you')
|
||||
->allow('S', 'billing');
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ define('COMPANY_NAME' , 'Sourcefabric');
|
|||
define('COMPANY_SUFFIX' , 'z.ú.');
|
||||
define('COMPANY_SITE' , 'Sourcefabric.org');
|
||||
define('COMPANY_SITE_URL' , 'http://sourcefabric.org/');
|
||||
define('SUPPORT_EMAIL_ADDRESS', "help@sourcefabric.org");
|
||||
|
||||
define('HELP_URL' , 'http://help.sourcefabric.org/');
|
||||
define('FAQ_URL' , 'https://sourcefabricberlin.zendesk.com/hc/en-us/sections/200994309-Airtime-FAQ');
|
||||
|
@ -16,7 +17,10 @@ define('WHOS_USING_URL' , 'http://sourcefabric.org/en/airtime/whosus
|
|||
define('TERMS_AND_CONDITIONS_URL' , 'http://www.sourcefabric.org/en/about/policy/');
|
||||
define('PRIVACY_POLICY_URL' , 'http://www.sourcefabric.org/en/about/policy/');
|
||||
define('USER_MANUAL_URL' , 'http://sourcefabric.booktype.pro/airtime-pro-for-broadcasters');
|
||||
define('ABOUT_AIRTIME_URL' , 'https://www.airtime.pro/support/');
|
||||
define('AIRTIME_TRANSIFEX_URL' , 'https://www.transifex.com/projects/p/airtime/');
|
||||
define('WHMCS_PASSWORD_RESET_URL' , 'https://account.sourcefabric.com/pwreset.php');
|
||||
define('SUPPORT_TICKET_URL' , 'https://sourcefabricberlin.zendesk.com/hc/en-us/requests/new');
|
||||
|
||||
define('LICENSE_VERSION' , 'GNU AGPL v.3');
|
||||
define('LICENSE_URL' , 'http://www.gnu.org/licenses/agpl-3.0-standalone.html');
|
||||
|
@ -32,6 +36,9 @@ define('DEFAULT_LOGO_PLACEHOLDER', 1);
|
|||
define('DEFAULT_LOGO_FILE', 'images/airtime_logo.png');
|
||||
define('DEFAULT_TIMESTAMP_FORMAT', 'Y-m-d H:i:s');
|
||||
define('DEFAULT_MICROTIME_FORMAT', 'Y-m-d H:i:s.u');
|
||||
define('DEFAULT_ICECAST_PORT', 8000);
|
||||
define('DEFAULT_ICECAST_PASS', 'hackme');
|
||||
define('DEFAULT_SHOW_COLOR', '76aca5');
|
||||
|
||||
// Metadata Keys for files
|
||||
define('MDATA_KEY_FILEPATH' , 'filepath');
|
||||
|
@ -103,6 +110,7 @@ define('PROVISIONING_STATUS_ACTIVE' , 'Active');
|
|||
define("TUNEIN_API_URL", "http://air.radiotime.com/Playing.ashx");
|
||||
|
||||
// SoundCloud
|
||||
define('SOUNDCLOUD', 'SoundCloud');
|
||||
define('DEFAULT_SOUNDCLOUD_LICENSE_TYPE', 'all-rights-reserved');
|
||||
define('DEFAULT_SOUNDCLOUD_SHARING_TYPE', 'public');
|
||||
|
||||
|
|
|
@ -9,49 +9,59 @@
|
|||
*/
|
||||
$pages = array(
|
||||
array(
|
||||
'label' => _('Now Playing'),
|
||||
'module' => 'default',
|
||||
'controller' => 'Showbuilder',
|
||||
'action' => 'index',
|
||||
'resource' => 'showbuilder'
|
||||
),
|
||||
array(
|
||||
'label' => _('Add Media'),
|
||||
'module' => 'default',
|
||||
'controller' => 'Plupload',
|
||||
'action' => 'index',
|
||||
'resource' => 'plupload'
|
||||
),
|
||||
array(
|
||||
'label' => _('Library'),
|
||||
'module' => 'default',
|
||||
'controller' => 'Library',
|
||||
'action' => 'index',
|
||||
'resource' => 'playlist'
|
||||
),
|
||||
array(
|
||||
'label' => _('Calendar'),
|
||||
'module' => 'default',
|
||||
'controller' => 'Schedule',
|
||||
'action' => 'index',
|
||||
'resource' => 'schedule'
|
||||
),
|
||||
array(
|
||||
'label' => _('Radio Page'),
|
||||
'label' => "<i class='icon-globe icon-white'></i>"._('Radio Page'),
|
||||
'uri' => '/',
|
||||
'resource' => '',
|
||||
'pages' => array(
|
||||
)
|
||||
),
|
||||
array(
|
||||
'label' => _('System'),
|
||||
'uri' => '#',
|
||||
'resource' => 'preference',
|
||||
'pages' => array(
|
||||
'label' => "<i class='icon-calendar icon-white'></i>"._('Calendar'),
|
||||
'module' => 'default',
|
||||
'controller' => 'schedule',
|
||||
'action' => 'index',
|
||||
'resource' => 'schedule'
|
||||
),
|
||||
array(
|
||||
'label' => "<i class='icon-wrench icon-white'></i>"._('Widgets'),
|
||||
'module' => 'default',
|
||||
'controller' => 'embeddablewidgets',
|
||||
'action' => 'player',
|
||||
'resource' => 'embeddablewidgets',
|
||||
'title' => 'Widgets',
|
||||
'pages' => array(
|
||||
array(
|
||||
'label' => _('Preferences'),
|
||||
'label' => _('Player'),
|
||||
'module' => 'default',
|
||||
'controller' => 'Preference'
|
||||
'controller' => 'embeddablewidgets',
|
||||
'action' => 'player',
|
||||
),
|
||||
array(
|
||||
'label' => _('Weekly Schedule'),
|
||||
'module' => 'default',
|
||||
'controller' => 'embeddablewidgets',
|
||||
'action' => 'schedule',
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'label' => "<i class='icon-cog icon-white'></i>"._("Settings"),
|
||||
'resource' => 'preference',
|
||||
'action' => 'index',
|
||||
'module' => 'default',
|
||||
'controller' => 'preference',
|
||||
'title' => 'Settings',
|
||||
'pages' => array(
|
||||
array(
|
||||
'label' => _('General'),
|
||||
'module' => 'default',
|
||||
'controller' => 'preference'
|
||||
),
|
||||
array(
|
||||
'label' => _('My Profile'),
|
||||
'controller' => 'user',
|
||||
'action' => 'edit-user',
|
||||
'resource' => 'user'
|
||||
),
|
||||
array(
|
||||
'label' => _('Users'),
|
||||
|
@ -60,26 +70,22 @@ $pages = array(
|
|||
'action' => 'add-user',
|
||||
'resource' => 'user'
|
||||
),
|
||||
array(
|
||||
'label' => _('Media Folders'),
|
||||
'module' => 'default',
|
||||
'controller' => 'Preference',
|
||||
'action' => 'directory-config',
|
||||
'id' => 'manage_folder'
|
||||
),
|
||||
array(
|
||||
'label' => _('Streams'),
|
||||
'module' => 'default',
|
||||
'controller' => 'Preference',
|
||||
'controller' => 'preference',
|
||||
'action' => 'stream-setting'
|
||||
),
|
||||
array(
|
||||
'label' => _('Status'),
|
||||
'module' => 'default',
|
||||
'controller' => 'systemstatus',
|
||||
'action' => 'index',
|
||||
'resource' => 'systemstatus'
|
||||
),
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'label' => "<i class='icon-signal icon-white'></i>"._("Analytics"),
|
||||
'module' => 'default',
|
||||
'controller' => 'listenerstat',
|
||||
'action' => 'index',
|
||||
'resource' => 'listenerstat',
|
||||
'title' => 'Analytics',
|
||||
'pages' => array(
|
||||
array(
|
||||
'label' => _('Listener Stats'),
|
||||
'module' => 'default',
|
||||
|
@ -88,44 +94,58 @@ $pages = array(
|
|||
'resource' => 'listenerstat'
|
||||
),
|
||||
array(
|
||||
'label' => _('Embeddable Widgets'),
|
||||
'label' => _('Playout History'),
|
||||
'module' => 'default',
|
||||
'controller' => 'embeddablewidgets',
|
||||
'action' => 'index'
|
||||
'controller' => 'playouthistory',
|
||||
'action' => 'index',
|
||||
'resource' => 'playouthistory'
|
||||
),
|
||||
array(
|
||||
'label' => _('History Templates'),
|
||||
'module' => 'default',
|
||||
'controller' => 'playouthistorytemplate',
|
||||
'action' => 'index',
|
||||
'resource' => 'playouthistorytemplate'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'label' => _('History'),
|
||||
'uri' => '#',
|
||||
'resource' => 'playouthistory',
|
||||
'pages' => array(
|
||||
array(
|
||||
'label' => _('Playout History'),
|
||||
'module' => 'default',
|
||||
'controller' => 'playouthistory',
|
||||
'action' => 'index',
|
||||
'resource' => 'playouthistory'
|
||||
),
|
||||
array(
|
||||
'label' => _('History Templates'),
|
||||
'module' => 'default',
|
||||
'controller' => 'playouthistorytemplate',
|
||||
'action' => 'index',
|
||||
'resource' => 'playouthistorytemplate'
|
||||
),
|
||||
)
|
||||
),
|
||||
array(
|
||||
'label' => _('Help'),
|
||||
'uri' => '#',
|
||||
'resource' => 'dashboard',
|
||||
'pages' => array(
|
||||
'label' => "<i class='icon-briefcase icon-white'></i>"._('Billing'),
|
||||
'controller' => 'billing',
|
||||
'action' => 'upgrade',
|
||||
'resource' => 'billing',
|
||||
'title' => 'Billing',
|
||||
'pages' => array(
|
||||
array(
|
||||
'label' => _('Help Center'),
|
||||
'uri' => HELP_URL,
|
||||
'target' => "_blank"
|
||||
'label' => _('Account Plans'),
|
||||
'module' => 'default',
|
||||
'controller' => 'billing',
|
||||
'action' => 'upgrade',
|
||||
'resource' => 'billing'
|
||||
),
|
||||
array(
|
||||
'label' => _('Account Details'),
|
||||
'module' => 'default',
|
||||
'controller' => 'billing',
|
||||
'action' => 'client',
|
||||
'resource' => 'billing'
|
||||
),
|
||||
array(
|
||||
'label' => _('View Invoices'),
|
||||
'module' => 'default',
|
||||
'controller' => 'billing',
|
||||
'action' => 'invoices',
|
||||
'resource' => 'billing'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'label' => "<i class='icon-question-sign icon-white'></i>"._('Help'),
|
||||
'controller' => 'dashboard',
|
||||
'action' => 'help',
|
||||
'resource' => 'dashboard',
|
||||
'title' => 'Help',
|
||||
'pages' => array(
|
||||
array(
|
||||
'label' => _('Getting Started'),
|
||||
'module' => 'default',
|
||||
|
@ -144,11 +164,9 @@ $pages = array(
|
|||
'target' => "_blank"
|
||||
),
|
||||
array(
|
||||
'label' => _('About'),
|
||||
'module' => 'default',
|
||||
'controller' => 'dashboard',
|
||||
'action' => 'about',
|
||||
'resource' => 'dashboard'
|
||||
'label' => _('File a Support Ticket'),
|
||||
'uri' => SUPPORT_TICKET_URL,
|
||||
'target' => "_blank"
|
||||
),
|
||||
array(
|
||||
'label' => _(sprintf("Help Translate %s", PRODUCT_NAME)),
|
||||
|
@ -157,34 +175,6 @@ $pages = array(
|
|||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'label' => _('Billing'),
|
||||
'uri' => '#',
|
||||
'resource' => 'billing',
|
||||
'pages' => array(
|
||||
array(
|
||||
'label' => _('Account Details'),
|
||||
'module' => 'default',
|
||||
'controller' => 'billing',
|
||||
'action' => 'client',
|
||||
'resource' => 'billing'
|
||||
),
|
||||
array(
|
||||
'label' => _('Account Plans'),
|
||||
'module' => 'default',
|
||||
'controller' => 'billing',
|
||||
'action' => 'upgrade',
|
||||
'resource' => 'billing'
|
||||
),
|
||||
array(
|
||||
'label' => _('View Invoices'),
|
||||
'module' => 'default',
|
||||
'controller' => 'billing',
|
||||
'action' => 'invoices',
|
||||
'resource' => 'billing'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@ class ApiController extends Zend_Controller_Action
|
|||
->addActionContext('update-stream-setting-table' , 'json')
|
||||
->addActionContext('update-replay-gain-value' , 'json')
|
||||
->addActionContext('update-cue-values-by-silan' , 'json')
|
||||
->addActionContext('get-usability-hint' , 'json')
|
||||
->initContext();
|
||||
}
|
||||
|
||||
|
@ -1467,4 +1468,12 @@ class ApiController extends Zend_Controller_Action
|
|||
$this->_helper->json->sendJson(array(1));
|
||||
}
|
||||
|
||||
public function getUsabilityHintAction()
|
||||
{
|
||||
$userPath = $this->_getParam("userPath");
|
||||
|
||||
$hint = Application_Common_UsabilityHints::getUsabilityHint($userPath);
|
||||
$this->_helper->json->sendJson($hint);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,6 +21,9 @@ class BillingController extends Zend_Controller_Action {
|
|||
|
||||
public function upgradeAction()
|
||||
{
|
||||
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Billing');
|
||||
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/billing.css?'.$CC_CONFIG['airtime_version']);
|
||||
|
@ -28,10 +31,13 @@ class BillingController extends Zend_Controller_Action {
|
|||
|
||||
$request = $this->getRequest();
|
||||
$form = new Application_Form_BillingUpgradeDowngrade();
|
||||
|
||||
if ($request->isPost()) {
|
||||
|
||||
$formData = $request->getPost();
|
||||
|
||||
if ($form->isValid($formData)) {
|
||||
|
||||
$credentials = Billing::getAPICredentials();
|
||||
|
||||
//Check if VAT should be applied or not to this invoice.
|
||||
|
@ -51,8 +57,8 @@ class BillingController extends Zend_Controller_Action {
|
|||
//and it freaks out and does the wrong thing if we do it via the API
|
||||
//so we have to do avoid that.
|
||||
if (($currentPlanProductId == $formData["newproductid"]) &&
|
||||
($currentPlanProductBillingCycle == $formData["newproductbillingcycle"]))
|
||||
{
|
||||
($currentPlanProductBillingCycle == $formData["newproductbillingcycle"])
|
||||
) {
|
||||
$placeAnUpgradeOrder = false;
|
||||
}
|
||||
|
||||
|
@ -70,7 +76,7 @@ class BillingController extends Zend_Controller_Action {
|
|||
$postfields["responsetype"] = "json";
|
||||
|
||||
$upgrade_query_string = "";
|
||||
foreach ($postfields AS $k=>$v) $upgrade_query_string .= "$k=".urlencode($v)."&";
|
||||
foreach ($postfields AS $k => $v) $upgrade_query_string .= "$k=" . urlencode($v) . "&";
|
||||
|
||||
//update client info
|
||||
|
||||
|
@ -90,7 +96,7 @@ class BillingController extends Zend_Controller_Action {
|
|||
unset($clientfields["password2verify"]);
|
||||
unset($clientfields["submit"]);
|
||||
$client_query_string = "";
|
||||
foreach ($clientfields AS $k=>$v) $client_query_string .= "$k=".urlencode($v)."&";
|
||||
foreach ($clientfields AS $k => $v) $client_query_string .= "$k=" . urlencode($v) . "&";
|
||||
|
||||
//Update the client details in WHMCS first
|
||||
$result = Billing::makeRequest($credentials["url"], $client_query_string);
|
||||
|
@ -103,8 +109,7 @@ class BillingController extends Zend_Controller_Action {
|
|||
|
||||
//If there were no changes to the plan or billing cycle, we just redirect you to the
|
||||
//invoices screen and show a message.
|
||||
if (!$placeAnUpgradeOrder)
|
||||
{
|
||||
if (!$placeAnUpgradeOrder) {
|
||||
$this->_redirect('billing/invoices?planupdated');
|
||||
return;
|
||||
}
|
||||
|
@ -112,11 +117,11 @@ class BillingController extends Zend_Controller_Action {
|
|||
//Then place an upgrade order in WHMCS
|
||||
$result = Billing::makeRequest($credentials["url"], $upgrade_query_string);
|
||||
if ($result["result"] == "error") {
|
||||
Logging::info($_SERVER['HTTP_HOST']." - Account upgrade failed. - ".$result["message"]);
|
||||
Logging::info($_SERVER['HTTP_HOST'] . " - Account upgrade failed. - " . $result["message"]);
|
||||
$this->setErrorMessage();
|
||||
$this->view->form = $form;
|
||||
} else {
|
||||
Logging::info($_SERVER['HTTP_HOST']. "Account plan upgrade request:");
|
||||
Logging::info($_SERVER['HTTP_HOST'] . "Account plan upgrade request:");
|
||||
Logging::info($result);
|
||||
|
||||
// Disable the view and the layout here, squashes an error.
|
||||
|
@ -126,7 +131,14 @@ class BillingController extends Zend_Controller_Action {
|
|||
if ($apply_vat) {
|
||||
Billing::addVatToInvoice($result["invoiceid"]);
|
||||
}
|
||||
self::viewInvoice($result["invoiceid"]);
|
||||
|
||||
// there may not be an invoice created if the client is downgrading
|
||||
if (!empty($result["invoiceid"])) {
|
||||
self::viewInvoice($result["invoiceid"]);
|
||||
} else {
|
||||
$this->_redirect('billing/invoices?planupdated');
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->view->form = $form;
|
||||
|
@ -207,6 +219,8 @@ class BillingController extends Zend_Controller_Action {
|
|||
|
||||
public function clientAction()
|
||||
{
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Billing');
|
||||
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/billing.css?'.$CC_CONFIG['airtime_version']);
|
||||
|
@ -257,6 +271,8 @@ class BillingController extends Zend_Controller_Action {
|
|||
|
||||
public function invoicesAction()
|
||||
{
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Billing');
|
||||
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/billing.css?'.$CC_CONFIG['airtime_version']);
|
||||
|
|
|
@ -108,11 +108,12 @@ class DashboardController extends Zend_Controller_Action
|
|||
|
||||
public function helpAction()
|
||||
{
|
||||
// action body
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Help');
|
||||
}
|
||||
|
||||
public function aboutAction()
|
||||
{
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Help');
|
||||
$this->view->airtime_version = Application_Model_Preference::GetAirtimeVersion();
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,10 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
|
|||
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
public function playerAction()
|
||||
{
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Widgets');
|
||||
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/player-form.css?'.$CC_CONFIG['airtime_version']);
|
||||
|
@ -27,6 +29,13 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
|
|||
1. Enable at least one MP3, AAC, or OGG stream under System -> Streams<br>
|
||||
2. Enable the Public Airtime API under System -> Preferences");
|
||||
}
|
||||
}
|
||||
|
||||
public function scheduleAction()
|
||||
{
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Widgets');
|
||||
|
||||
$apiEnabled = Application_Model_Preference::GetAllow3rdPartyApi();
|
||||
|
||||
if (!$apiEnabled) {
|
||||
$this->view->weekly_schedule_error_msg = _("To use the embeddable weekly schedule widget you must:<br><br>
|
||||
|
|
|
@ -16,8 +16,6 @@ class LibraryController extends Zend_Controller_Action
|
|||
->addActionContext('delete-group', 'json')
|
||||
->addActionContext('context-menu', 'json')
|
||||
->addActionContext('get-file-metadata', 'html')
|
||||
->addActionContext('upload-file-soundcloud', 'json')
|
||||
->addActionContext('get-upload-to-soundcloud-status', 'json')
|
||||
->addActionContext('set-num-entries', 'json')
|
||||
->addActionContext('edit-file-md', 'json')
|
||||
->initContext();
|
||||
|
@ -25,95 +23,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
|
||||
public function indexAction()
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$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.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/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$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_playlistbuilder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$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/waveform.css?'.$CC_CONFIG['airtime_version']);
|
||||
|
||||
$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->headScript()->appendFile($baseUrl.'js/waveformplaylist/observer/observer.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/config.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/curves.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/fades.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/local_storage.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/controls.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/playout.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/track_render.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/track.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/time_scale.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/playlist.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
//arbitrary attributes need to be allowed to set an id for the templates.
|
||||
$this->view->headScript()->setAllowArbitraryAttributes(true);
|
||||
//$this->view->headScript()->appendScript(file_get_contents(APPLICATION_PATH.'/../public/js/waveformplaylist/templates/bottombar.tpl'),
|
||||
// 'text/template', array('id' => 'tpl_playlist_cues', 'noescape' => true));
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
|
||||
|
||||
try {
|
||||
|
||||
$obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME);
|
||||
if (isset($obj_sess->id)) {
|
||||
$objInfo = Application_Model_Library::getObjInfo($obj_sess->type);
|
||||
$obj = new $objInfo['className']($obj_sess->id);
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new Application_Model_User($userInfo->id);
|
||||
$isAdminOrPM = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
|
||||
if ($isAdminOrPM || $obj->getCreatorId() == $userInfo->id) {
|
||||
$this->view->obj = $obj;
|
||||
if ($obj_sess->type == "block") {
|
||||
$form = new Application_Form_SmartBlockCriteria();
|
||||
$form->startForm($obj_sess->id);
|
||||
$this->view->form = $form;
|
||||
}
|
||||
}
|
||||
|
||||
$formatter = new LengthFormatter($obj->getLength());
|
||||
$this->view->length = $formatter->format();
|
||||
$this->view->type = $obj_sess->type;
|
||||
}
|
||||
|
||||
//get user settings and determine if we need to hide
|
||||
// or show the playlist editor
|
||||
$showPlaylist = false;
|
||||
$data = Application_Model_Preference::getLibraryScreenSettings();
|
||||
if (!is_null($data)) {
|
||||
if ($data["playlist"] == "true") {
|
||||
$showPlaylist = true;
|
||||
}
|
||||
}
|
||||
$this->view->showPlaylist = $showPlaylist;
|
||||
} catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound($obj_sess->type);
|
||||
} catch (Exception $e) {
|
||||
$this->playlistNotFound($obj_sess->type);
|
||||
Logging::info($e->getMessage());
|
||||
//$this->playlistUnknownError($e);
|
||||
}
|
||||
$this->_redirect("showbuilder");
|
||||
}
|
||||
|
||||
protected function playlistNotFound($p_type)
|
||||
|
@ -219,6 +129,40 @@ class LibraryController extends Zend_Controller_Action
|
|||
// is a cloud_file and handle it appropriately.
|
||||
$url = $baseUrl."api/get-media/file/$id/download/true";
|
||||
$menu["download"] = array("name" => _("Download"), "icon" => "download", "url" => $url);
|
||||
|
||||
// SOUNDCLOUD MENU OPTION
|
||||
$ownerId = empty($obj) ? $file->getFileOwnerId() : $obj->getCreatorId();
|
||||
if ($isAdminOrPM || $ownerId == $user->getId()) {
|
||||
$soundcloudService = new SoundcloudService();
|
||||
if ($type === "audioclip" && $soundcloudService->hasAccessToken()) {
|
||||
|
||||
//create a menu separator
|
||||
$menu["sep1"] = "-----------";
|
||||
|
||||
//create a sub menu for Soundcloud actions.
|
||||
$menu["soundcloud"] = array("name" => _(SOUNDCLOUD), "icon" => "soundcloud", "items" => array());
|
||||
|
||||
$serviceId = $soundcloudService->getServiceId($id);
|
||||
if (!is_null($file) && $serviceId != 0) {
|
||||
$menu["soundcloud"]["items"]["view"] = array("name" => _("View track"), "icon" => "soundcloud", "url" => $baseUrl . "soundcloud/view-on-sound-cloud/id/{$id}");
|
||||
$menu["soundcloud"]["items"]["remove"] = array("name" => _("Remove track"), "icon" => "soundcloud", "url" => $baseUrl . "soundcloud/delete/id/{$id}");
|
||||
} else {
|
||||
// If a reference exists for this file ID, that means the user has uploaded the track
|
||||
// but we haven't yet gotten a response from Celery, so disable the menu item
|
||||
if ($soundcloudService->referenceExists($id)) {
|
||||
$menu["soundcloud"]["items"]["upload"] = array(
|
||||
"name" => _("Upload track"), "icon" => "soundcloud",
|
||||
"url" => $baseUrl . "soundcloud/upload/id/{$id}", "disabled" => true
|
||||
);
|
||||
} else {
|
||||
$menu["soundcloud"]["items"]["upload"] = array(
|
||||
"name" => _("Upload track"), "icon" => "soundcloud",
|
||||
"url" => $baseUrl . "soundcloud/upload/id/{$id}"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($type === "playlist" || $type === "block") {
|
||||
if ($type === 'playlist') {
|
||||
$obj = new Application_Model_Playlist($id);
|
||||
|
@ -265,40 +209,6 @@ class LibraryController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
|
||||
// SOUNDCLOUD MENU OPTION
|
||||
$ownerId = empty($obj) ? $file->getFileOwnerId() : $obj->getCreatorId();
|
||||
if ($isAdminOrPM || $ownerId == $user->getId()) {
|
||||
$soundcloudService = new SoundcloudService();
|
||||
if ($type === "audioclip" && $soundcloudService->hasAccessToken()) {
|
||||
|
||||
//create a menu separator
|
||||
$menu["sep1"] = "-----------";
|
||||
|
||||
//create a sub menu for Soundcloud actions.
|
||||
$menu["soundcloud"] = array("name" => _("Soundcloud"), "icon" => "soundcloud", "items" => array());
|
||||
|
||||
$serviceId = $soundcloudService->getServiceId($id);
|
||||
if (!is_null($file) && $serviceId != 0) {
|
||||
$menu["soundcloud"]["items"]["view"] = array("name" => _("View track"), "icon" => "soundcloud", "url" => $baseUrl . "soundcloud/view-on-sound-cloud/id/{$id}");
|
||||
$menu["soundcloud"]["items"]["remove"] = array("name" => _("Remove track"), "icon" => "soundcloud", "url" => $baseUrl . "soundcloud/delete/id/{$id}");
|
||||
} else {
|
||||
// If a reference exists for this file ID, that means the user has uploaded the track
|
||||
// but we haven't yet gotten a response from Celery, so disable the menu item
|
||||
if ($soundcloudService->referenceExists($id)) {
|
||||
$menu["soundcloud"]["items"]["upload"] = array(
|
||||
"name" => _("Upload track"), "icon" => "soundcloud",
|
||||
"url" => $baseUrl . "soundcloud/upload/id/{$id}", "disabled" => true
|
||||
);
|
||||
} else {
|
||||
$menu["soundcloud"]["items"]["upload"] = array(
|
||||
"name" => _("Upload track"), "icon" => "soundcloud",
|
||||
"url" => $baseUrl . "soundcloud/upload/id/{$id}"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($menu)) {
|
||||
$menu["noaction"] = array("name"=>_("No action available"));
|
||||
}
|
||||
|
@ -435,14 +345,17 @@ class LibraryController extends Zend_Controller_Action
|
|||
$file_id = $this->_getParam('id', null);
|
||||
$file = Application_Model_StoredFile::RecallById($file_id);
|
||||
|
||||
if (!$isAdminOrPM && $file->getFileOwnerId() != $user->getId()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$form = new Application_Form_EditAudioMD();
|
||||
$form->startForm($file_id);
|
||||
$form->populate($file->getDbColMetadata());
|
||||
|
||||
$this->view->permissionDenied = false;
|
||||
if (!$isAdminOrPM && $file->getFileOwnerId() != $user->getId()) {
|
||||
$form->makeReadOnly();
|
||||
$form->removeActionButtons();
|
||||
$this->view->permissionDenied = true;
|
||||
}
|
||||
|
||||
if ($request->isPost()) {
|
||||
|
||||
$js = $this->_getParam('data');
|
||||
|
@ -461,7 +374,10 @@ class LibraryController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
$this->view->form = $form;
|
||||
$this->view->dialog = $this->view->render('library/edit-file-md.phtml');
|
||||
$this->view->id = $file_id;
|
||||
$this->view->title = $file->getPropelOrm()->getDbTrackTitle();
|
||||
$this->view->type = "md";
|
||||
$this->view->html = $this->view->render('library/edit-file-md.phtml');
|
||||
}
|
||||
|
||||
public function getFileMetadataAction()
|
||||
|
|
|
@ -17,8 +17,11 @@ class ListenerstatController extends Zend_Controller_Action
|
|||
$request = $this->getRequest();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/flot/jquery.flot.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/flot/jquery.flot.crosshair.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/flot/jquery.flot.resize.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/listenerstat/listenerstat.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
|
|
@ -51,6 +51,15 @@ class LocaleController extends Zend_Controller_Action
|
|||
//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"),
|
||||
"You haven't added any smart blocks" => _("You haven't added any smart blocks"),
|
||||
"You haven't added any webstreams" => _("You haven't added any webstreams"),
|
||||
"Learn about tracks" => _("Learn about tracks"),
|
||||
"Learn about playlists" => _("Learn about playlists"),
|
||||
"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
|
||||
|
@ -62,7 +71,8 @@ class LocaleController extends Zend_Controller_Action
|
|||
"Deselect all" => _("Deselect all"),
|
||||
"Are you sure you want to delete the selected item(s)?" => _("Are you sure you want to delete the selected item(s)?"),
|
||||
"Scheduled" => _("Scheduled"),
|
||||
"Playlist" => _("Playlist / Block"),
|
||||
"Tracks" => _("Tracks"),
|
||||
"Playlist" => _("Playlist"),
|
||||
"Title" => _("Title"),
|
||||
"Creator" => _("Creator"),
|
||||
"Album" => _("Album"),
|
||||
|
@ -112,7 +122,7 @@ class LocaleController extends Zend_Controller_Action
|
|||
//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 put in a time in seconds '00 (.0)'" => _("please put in a time in seconds '00 (.0)'"),
|
||||
"Please enter a valid time in seconds. Eg. 0.5'" => _("Please enter a valid time in seconds. Eg. 0.5"),
|
||||
"Your browser does not support playing this file type: " => _("Your browser does not support playing this file type: "),
|
||||
"Dynamic block is not previewable" => _("Dynamic block is not previewable"),
|
||||
"Limit to: " => _("Limit to: "),
|
||||
|
@ -171,8 +181,7 @@ class LocaleController extends Zend_Controller_Action
|
|||
"Check this box to automatically switch on Master/Show source upon source connection." => _("Check this box to automatically switch on Master/Show source upon source connection."),
|
||||
"If your Icecast server expects a username of 'source', this field can be left blank." => _("If your Icecast server expects a username of 'source', this field can be left blank."),
|
||||
"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'."),
|
||||
"If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."
|
||||
=> _("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."),
|
||||
"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
|
||||
"Image must be one of jpg, jpeg, png, or gif" => _("Image must be one of jpg, jpeg, png, or gif"),
|
||||
|
@ -233,10 +242,10 @@ class LocaleController extends Zend_Controller_Action
|
|||
"Oct" => _("Oct"),
|
||||
"Nov" => _("Nov"),
|
||||
"Dec" => _("Dec"),
|
||||
"today" => _("today"),
|
||||
"day" => _("day"),
|
||||
"week" => _("week"),
|
||||
"month" => _("month"),
|
||||
"Today" => _("Today"),
|
||||
"Day" => _("Day"),
|
||||
"Week" => _("Week"),
|
||||
"Month" => _("Month"),
|
||||
"Sunday" => _("Sunday"),
|
||||
"Monday" => _("Monday"),
|
||||
"Tuesday" => _("Tuesday"),
|
||||
|
@ -264,6 +273,9 @@ class LocaleController extends Zend_Controller_Action
|
|||
"Start" => _("Start"),
|
||||
"End" => _("End"),
|
||||
"Duration" => _("Duration"),
|
||||
"Filtering out " => _("Filtering out "),
|
||||
" of " => _(" of "),
|
||||
" records" => _(" records"),
|
||||
//already in library/library.js
|
||||
//"Title" => _("Title"),
|
||||
//"Creator" => _("Creator"),
|
||||
|
@ -291,7 +303,7 @@ class LocaleController extends Zend_Controller_Action
|
|||
//"Select" => _("Select"),
|
||||
"Select all" => _("Select all"),
|
||||
"Select none" => _("Select none"),
|
||||
"Remove overbooked tracks" => _("Remove overbooked tracks"),
|
||||
"Trim overbooked shows" => _("Trim overbooked shows"),
|
||||
"Remove selected scheduled items" => _("Remove selected scheduled items"),
|
||||
"Jump to the current playing track" => _("Jump to the current playing track"),
|
||||
"Cancel current show" => _("Cancel current show"),
|
||||
|
@ -391,7 +403,27 @@ class LocaleController extends Zend_Controller_Action
|
|||
"No Show" => _("No Show"),
|
||||
"All" => _("All"),
|
||||
"Copied %s row%s to the clipboard" => _("Copied %s row%s to the clipboard"),
|
||||
"%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.")
|
||||
"%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:
|
||||
"No data available in table",
|
||||
"Showing _START_ to _END_ of _TOTAL_ entries",
|
||||
"Showing 0 to 0 of 0 entries",
|
||||
"(filtered from _MAX_ total entries)",
|
||||
"",
|
||||
",",
|
||||
"Show _MENU_",
|
||||
"Loading...",
|
||||
"Processing...",
|
||||
"No matching records found",
|
||||
"First",
|
||||
"Last",
|
||||
"Next",
|
||||
"Previous",
|
||||
": activate to sort column ascending",
|
||||
": activate to sort column descending"
|
||||
//End of datatables
|
||||
);
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
|
|
@ -28,7 +28,7 @@ class LoginController extends Zend_Controller_Action
|
|||
$auth = Zend_Auth::getInstance();
|
||||
|
||||
if ($auth->hasIdentity()) {
|
||||
$this->_redirect('Showbuilder');
|
||||
$this->_redirect('showbuilder');
|
||||
}
|
||||
|
||||
//uses separate layout without a navigation.
|
||||
|
@ -38,11 +38,9 @@ class LoginController extends Zend_Controller_Action
|
|||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/login/login.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
$form = new Application_Form_Login();
|
||||
|
||||
$message = _("Please enter your user name and password");
|
||||
$message = _("Please enter your username and password.");
|
||||
|
||||
if ($request->isPost()) {
|
||||
// if the post contains recaptcha field, which means form had recaptcha field.
|
||||
|
@ -78,7 +76,7 @@ class LoginController extends Zend_Controller_Action
|
|||
//set the user locale in case user changed it in when logging in
|
||||
Application_Model_Preference::SetUserLocale($locale);
|
||||
|
||||
$this->_redirect('Showbuilder');
|
||||
$this->_redirect('showbuilder');
|
||||
} else {
|
||||
$email = $form->getValue('username');
|
||||
$authAdapter = new WHMCS_Auth_Adapter("admin", $email, $password);
|
||||
|
@ -89,7 +87,7 @@ class LoginController extends Zend_Controller_Action
|
|||
//set the user locale in case user changed it in when logging in
|
||||
Application_Model_Preference::SetUserLocale($locale);
|
||||
|
||||
$this->_redirect('Showbuilder');
|
||||
$this->_redirect('showbuilder');
|
||||
}
|
||||
else {
|
||||
$message = _("Wrong username or password provided. Please try again.");
|
||||
|
@ -133,33 +131,31 @@ class LoginController extends Zend_Controller_Action
|
|||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/login/password-restore.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/login/password-restore.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$request = $this->getRequest();
|
||||
$stationLocale = Application_Model_Preference::GetDefaultLocale();
|
||||
|
||||
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', $stationLocale));
|
||||
|
||||
if (!Application_Model_Preference::GetEnableSystemEmail()) {
|
||||
$this->_redirect('login');
|
||||
} else {
|
||||
//uses separate layout without a navigation.
|
||||
$this->_helper->layout->setLayout('login');
|
||||
//uses separate layout without a navigation.
|
||||
$this->_helper->layout->setLayout('login');
|
||||
|
||||
$form = new Application_Form_PasswordRestore();
|
||||
$form = new Application_Form_PasswordRestore();
|
||||
|
||||
$request = $this->getRequest();
|
||||
if ($request->isPost() && $form->isValid($request->getPost())) {
|
||||
if (is_null($form->username->getValue()) || $form->username->getValue() == '') {
|
||||
$user = CcSubjsQuery::create()
|
||||
->filterByDbEmail($form->email->getValue())
|
||||
->findOne();
|
||||
$request = $this->getRequest();
|
||||
if ($request->isPost()) {
|
||||
if ($form->isValid($request->getPost())) {
|
||||
$query = CcSubjsQuery::create();
|
||||
if (empty($form->username->getValue())) {
|
||||
$query->filterByDbEmail($form->email->getValue());
|
||||
} else if (empty($form->email->getValue())) {
|
||||
$query->filterByDbLogin($form->username->getValue());
|
||||
} else {
|
||||
$user = CcSubjsQuery::create()
|
||||
->filterByDbEmail($form->email->getValue())
|
||||
->filterByDbLogin($form->username->getValue())
|
||||
->findOne();
|
||||
$query->filterByDbEmail($form->email->getValue())
|
||||
->filterByDbLogin($form->username->getValue());
|
||||
}
|
||||
$user = $query->findOne();
|
||||
|
||||
if (!empty($user)) {
|
||||
$auth = new Application_Model_Auth();
|
||||
|
@ -171,12 +167,14 @@ class LoginController extends Zend_Controller_Action
|
|||
$form->email->addError($this->view->translate(_("Email could not be sent. Check your mail server settings and ensure it has been configured properly.")));
|
||||
}
|
||||
} else {
|
||||
$form->email->addError($this->view->translate(_("Given email not found.")));
|
||||
$form->email->addError($this->view->translate(sprintf(_pro("That username or email address could not be found. If you are the station owner, you should <a href=\"%s\">reset your here</a>."), WHMCS_PASSWORD_RESET_URL)));
|
||||
}
|
||||
} else { //Form is not valid
|
||||
$form->email->addError($this->view->translate(_("There was a problem with the username or email address you entered.")));
|
||||
}
|
||||
|
||||
$this->view->form = $form;
|
||||
}
|
||||
|
||||
$this->view->form = $form;
|
||||
}
|
||||
|
||||
public function passwordRestoreAfterAction()
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
|
||||
class PlaylistController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
|
@ -29,6 +30,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
->addActionContext('get-block-info', 'json')
|
||||
->addActionContext('shuffle', 'json')
|
||||
->addActionContext('empty-content', 'json')
|
||||
->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.
|
||||
|
@ -41,6 +43,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$objInfo = Application_Model_Library::getObjInfo($p_type);
|
||||
|
||||
$obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME);
|
||||
|
||||
if (isset($obj_sess->id)) {
|
||||
$obj = new $objInfo['className']($obj_sess->id);
|
||||
|
||||
|
@ -72,6 +75,16 @@ class PlaylistController extends Zend_Controller_Action
|
|||
private function createFullResponse($obj = null, $isJson = false,
|
||||
$formIsValid = false)
|
||||
{
|
||||
$user = Application_Model_User::getCurrentUser();
|
||||
$isAdminOrPM = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
|
||||
if (!$isAdminOrPM && $obj->getCreatorId() != $user->getId()) {
|
||||
$this->view->objType = $obj instanceof Application_Model_Block ? "block" : "playlist";
|
||||
$this->view->obj = $obj;
|
||||
$this->view->html = $this->view->render('playlist/permission-denied.phtml');
|
||||
return;
|
||||
}
|
||||
|
||||
$isBlock = false;
|
||||
$viewPath = 'playlist/playlist.phtml';
|
||||
if ($obj instanceof Application_Model_Block) {
|
||||
|
@ -89,6 +102,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
$this->view->form = $form;
|
||||
$this->view->obj = $obj;
|
||||
$this->view->type = "sb";
|
||||
$this->view->id = $obj->getId();
|
||||
|
||||
if ($isJson) {
|
||||
|
@ -98,6 +112,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
}
|
||||
} else {
|
||||
$this->view->obj = $obj;
|
||||
$this->view->type = "pl";
|
||||
$this->view->id = $obj->getId();
|
||||
if ($isJson) {
|
||||
return $this->view->html = $this->view->render($viewPath);
|
||||
|
@ -187,6 +202,16 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$this->createFullResponse($obj);
|
||||
}
|
||||
|
||||
public function changePlaylistAction() {
|
||||
$this->view->layout()->disableLayout(); // Don't inject the standard Now Playing header.
|
||||
$this->_helper->viewRenderer->setNoRender(true); // Don't use (phtml) templates
|
||||
|
||||
$id = $this->_getParam('id', null);
|
||||
$type = $this->_getParam('type');
|
||||
|
||||
Application_Model_Library::changePlaylist($id, $type);
|
||||
}
|
||||
|
||||
public function editAction()
|
||||
{
|
||||
$id = $this->_getParam('id', null);
|
||||
|
@ -194,9 +219,9 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$objInfo = Application_Model_Library::getObjInfo($type);
|
||||
Logging::info("editing {$type} {$id}");
|
||||
|
||||
if (!is_null($id)) {
|
||||
Application_Model_Library::changePlaylist($id, $type);
|
||||
}
|
||||
// if (!is_null($id)) {
|
||||
Application_Model_Library::changePlaylist($id, $type);
|
||||
// }
|
||||
|
||||
try {
|
||||
$obj = new $objInfo['className']($id);
|
||||
|
@ -227,7 +252,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
Logging::info("Currently active {$type} {$obj_sess->id}");
|
||||
if (in_array($obj_sess->id, $ids)) {
|
||||
Logging::info("Deleting currently active {$type}");
|
||||
Application_Model_Library::changePlaylist(null, $type);
|
||||
// Application_Model_Library::changePlaylist(null, $type);
|
||||
} else {
|
||||
Logging::info("Not deleting currently active {$type}");
|
||||
$obj = new $objInfo['className']($obj_sess->id);
|
||||
|
@ -531,24 +556,34 @@ class PlaylistController extends Zend_Controller_Action
|
|||
if ($form->isValid($params)) {
|
||||
$this->setPlaylistNameDescAction();
|
||||
$bl->saveSmartBlockCriteria($params['data']);
|
||||
|
||||
$this->createUpdateResponse($bl);
|
||||
$this->view->result = 0;
|
||||
/*
|
||||
$result['html'] = $this->createFullResponse($bl, true, true);
|
||||
$result['result'] = 0;
|
||||
*/
|
||||
} else {
|
||||
$this->view->obj = $bl;
|
||||
$this->view->id = $bl->getId();
|
||||
$this->view->form = $form;
|
||||
$this->view->unsavedName = $params['name'];
|
||||
$this->view->unsavedDesc = $params['description'];
|
||||
$viewPath = 'playlist/smart-block.phtml';
|
||||
$result['html'] = $this->view->render($viewPath);
|
||||
$result['result'] = 1;
|
||||
$this->view->obj = $bl;
|
||||
$this->view->id = $bl->getId();
|
||||
$this->view->html = $this->view->render($viewPath);
|
||||
$this->view->result = 1;
|
||||
}
|
||||
$this->view->name = $bl->getName();
|
||||
$this->view->type = "sb";
|
||||
$this->view->id = $bl->getId();
|
||||
$this->view->modified = $bl->getLastModified("U");
|
||||
} else if ($params['type'] == 'playlist') {
|
||||
$this->setPlaylistNameDescAction();
|
||||
$this->view->modified = $this->view->modified;
|
||||
$this->view->name = $params['name'];
|
||||
}
|
||||
|
||||
$result["modified"] = $this->view->modified;
|
||||
$this->_helper->json->sendJson($result);
|
||||
|
||||
//$this->_helper->json->sendJson($result);
|
||||
}
|
||||
|
||||
public function smartBlockGenerateAction()
|
||||
|
@ -564,15 +599,14 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$form->startForm($params['obj_id']);
|
||||
if ($form->isValid($params)) {
|
||||
$result = $bl->generateSmartBlock($params['data']);
|
||||
$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true, true)));
|
||||
$this->view->result = $result['result'];
|
||||
$this->createUpdateResponse($bl);
|
||||
#$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true, true)));
|
||||
} else {
|
||||
$this->view->obj = $bl;
|
||||
$this->view->id = $bl->getId();
|
||||
$this->view->form = $form;
|
||||
$viewPath = 'playlist/smart-block.phtml';
|
||||
$result['html'] = $this->view->render($viewPath);
|
||||
$result['result'] = 1;
|
||||
$this->_helper->json->sendJson($result);
|
||||
$this->createFullResponse($bl, false, true);
|
||||
}
|
||||
} catch (BlockNotFoundException $e) {
|
||||
$this->playlistNotFound('block', true);
|
||||
|
@ -590,11 +624,19 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$bl = new Application_Model_Block($params['obj_id']);
|
||||
$result = $bl->shuffleSmartBlock();
|
||||
|
||||
$this->view->result = $result["result"];
|
||||
$this->createUpdateResponse($bl);
|
||||
|
||||
/*
|
||||
if ($result['result'] == 0) {
|
||||
$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true)));
|
||||
$this->_helper->json->sendJson(array(
|
||||
"result"=>0,
|
||||
"contents" => $bl->getContents());
|
||||
///"html"=>$this->viwe));
|
||||
|
||||
} else {
|
||||
$this->_helper->json->sendJson($result);
|
||||
}
|
||||
}*/
|
||||
} catch (BlockNotFoundException $e) {
|
||||
$this->playlistNotFound('block', true);
|
||||
} catch (Exception $e) {
|
||||
|
@ -610,11 +652,17 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$pl = new Application_Model_Playlist($params['obj_id']);
|
||||
$result = $pl->shuffle();
|
||||
|
||||
$this->view->result = $result["result"];
|
||||
$this->createUpdateResponse($pl);
|
||||
/*
|
||||
if ($result['result'] == 0) {
|
||||
$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($pl, true)));
|
||||
$this->_helper->json->sendJson(array(
|
||||
"result"=>0,
|
||||
"contents" => $pl->getContents(),
|
||||
"html"=>$this->createUpdateResponse($pl, true)));
|
||||
} else {
|
||||
$this->_helper->json->sendJson($result);
|
||||
}
|
||||
}*/
|
||||
} catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound('block', true);
|
||||
} catch (Exception $e) {
|
||||
|
|
|
@ -24,6 +24,8 @@ class PlayouthistoryController extends Zend_Controller_Action
|
|||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
|
||||
|
||||
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
|
||||
|
||||
$userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
|
||||
|
|
|
@ -18,6 +18,8 @@ class PlayouthistorytemplateController extends Zend_Controller_Action
|
|||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playouthistory/template.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/history_styles.css?'.$CC_CONFIG['airtime_version']);
|
||||
|
||||
|
@ -32,6 +34,8 @@ class PlayouthistorytemplateController extends Zend_Controller_Action
|
|||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playouthistory/configuretemplate.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/history_styles.css?'.$CC_CONFIG['airtime_version']);
|
||||
|
||||
|
|
|
@ -22,9 +22,11 @@ class PluploadController extends Zend_Controller_Action
|
|||
$this->view->headScript()->appendFile($baseUrl.'js/plupload/jquery.plupload.queue.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/plupload.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/plupload/i18n/'.$locale.'.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/libs/dropzone.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/plupload.queue.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/addmedia.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/dashboard.css?'.$CC_CONFIG['airtime_version']);
|
||||
|
||||
$this->view->quotaLimitReached = false;
|
||||
if (Application_Model_Systemstatus::isDiskOverQuota()) {
|
||||
|
|
|
@ -24,6 +24,8 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$CC_CONFIG = Config::getConfig();
|
||||
$request = $this->getRequest();
|
||||
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Settings');
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/preferences.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
@ -143,15 +145,14 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
$request = $this->getRequest();
|
||||
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Settings');
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/streamsetting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
session_start(); //Open session for writing.
|
||||
|
||||
// get current settings
|
||||
$setting = Application_Model_StreamSetting::getStreamSetting();
|
||||
|
||||
$name_map = array(
|
||||
'ogg' => 'Ogg Vorbis',
|
||||
'fdkaac' => 'AAC+',
|
||||
|
@ -160,55 +161,14 @@ class PreferenceController extends Zend_Controller_Action
|
|||
'mp3' => 'MP3',
|
||||
);
|
||||
|
||||
// get predefined type and bitrate from pref table
|
||||
$temp_types = Application_Model_Preference::GetStreamType();
|
||||
$stream_types = array();
|
||||
foreach ($temp_types as $type) {
|
||||
$type = strtolower(trim($type));
|
||||
if (isset($name_map[$type])) {
|
||||
$name = $name_map[$type];
|
||||
} else {
|
||||
$name = $type;
|
||||
}
|
||||
$stream_types[$type] = $name;
|
||||
}
|
||||
|
||||
$temp_bitrate = Application_Model_Preference::GetStreamBitrate();
|
||||
$max_bitrate = intval(Application_Model_Preference::GetMaxBitrate());
|
||||
$stream_bitrates = array();
|
||||
foreach ($temp_bitrate as $type) {
|
||||
if (intval($type) <= $max_bitrate) {
|
||||
$stream_bitrates[trim($type)] = strtoupper(trim($type))." kbit/s";
|
||||
}
|
||||
}
|
||||
|
||||
$num_of_stream = intval(Application_Model_Preference::GetNumOfStreams());
|
||||
$form = new Application_Form_StreamSetting();
|
||||
|
||||
// $form->addElement('hash', 'csrf', array(
|
||||
// 'salt' => 'unique'
|
||||
// ));
|
||||
|
||||
$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');
|
||||
$form->addElement($csrf_element);
|
||||
|
||||
$form->setSetting($setting);
|
||||
$form->startFrom();
|
||||
|
||||
$live_stream_subform = new Application_Form_LiveStreamingPreferences();
|
||||
$form->addSubForm($live_stream_subform, "live_stream_subform");
|
||||
|
||||
for ($i=1; $i<=$num_of_stream; $i++) {
|
||||
$subform = new Application_Form_StreamSettingSubForm();
|
||||
$subform->setPrefix($i);
|
||||
$subform->setSetting($setting);
|
||||
$subform->setStreamTypes($stream_types);
|
||||
$subform->setStreamBitrates($stream_bitrates);
|
||||
$subform->startForm();
|
||||
$form->addSubForm($subform, "s".$i."_subform");
|
||||
}
|
||||
if ($request->isPost()) {
|
||||
$params = $request->getPost();
|
||||
/* Parse through post data and put in format
|
||||
|
@ -246,7 +206,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$values["s3_data"] = $s3_data;
|
||||
$values["s4_data"] = $s4_data;
|
||||
|
||||
$error = false;
|
||||
if ($form->isValid($values)) {
|
||||
|
||||
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
|
||||
|
@ -263,12 +222,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$s4_set_admin_pass = !empty($values["s4_data"]["admin_pass"]);
|
||||
|
||||
// this goes into cc_pref table
|
||||
Application_Model_Preference::SetStreamLabelFormat($values['streamFormat']);
|
||||
Application_Model_Preference::SetLiveStreamMasterUsername($values["master_username"]);
|
||||
Application_Model_Preference::SetLiveStreamMasterPassword($values["master_password"]);
|
||||
Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]);
|
||||
Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
|
||||
Application_Model_Preference::SetAutoSwitch($values["auto_switch"]);
|
||||
$this->setStreamPreferences($values);
|
||||
|
||||
// compare new values with current value
|
||||
$changeRGenabled = Application_Model_Preference::GetEnableReplayGain() != $values["enableReplayGain"];
|
||||
|
@ -294,34 +248,86 @@ class PreferenceController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data);
|
||||
|
||||
$live_stream_subform->updateVariables();
|
||||
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
|
||||
$this->view->form = $form;
|
||||
$this->view->num_stream = $num_of_stream;
|
||||
$this->view->statusMsg = "<div class='success'>"._("Stream Setting Updated.")."</div>";
|
||||
$this->_helper->json->sendJson(array(
|
||||
"valid"=>"true",
|
||||
"html"=>$this->view->render('preference/stream-setting.phtml'),
|
||||
"s1_set_admin_pass"=>$s1_set_admin_pass,
|
||||
"s2_set_admin_pass"=>$s2_set_admin_pass,
|
||||
"s3_set_admin_pass"=>$s3_set_admin_pass,
|
||||
"s4_set_admin_pass"=>$s4_set_admin_pass,
|
||||
));
|
||||
} else {
|
||||
$live_stream_subform->updateVariables();
|
||||
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
|
||||
$this->view->form = $form;
|
||||
$this->view->num_stream = $num_of_stream;
|
||||
$this->_helper->json->sendJson(array("valid"=>"false", "html"=>$this->view->render('preference/stream-setting.phtml')));
|
||||
}
|
||||
}
|
||||
|
||||
// get predefined type and bitrate from pref table
|
||||
$temp_types = Application_Model_Preference::GetStreamType();
|
||||
$stream_types = array();
|
||||
foreach ($temp_types as $type) {
|
||||
$type = strtolower(trim($type));
|
||||
if (isset($name_map[$type])) {
|
||||
$name = $name_map[$type];
|
||||
} else {
|
||||
$name = $type;
|
||||
}
|
||||
$stream_types[$type] = $name;
|
||||
}
|
||||
|
||||
$temp_bitrate = Application_Model_Preference::GetStreamBitrate();
|
||||
$max_bitrate = intval(Application_Model_Preference::GetMaxBitrate());
|
||||
$stream_bitrates = array();
|
||||
foreach ($temp_bitrate as $type) {
|
||||
if (intval($type) <= $max_bitrate) {
|
||||
$stream_bitrates[trim($type)] = strtoupper(trim($type))." kbit/s";
|
||||
}
|
||||
}
|
||||
|
||||
// get current settings
|
||||
$setting = Application_Model_StreamSetting::getStreamSetting();
|
||||
|
||||
$form->setSetting($setting);
|
||||
$form->startFrom();
|
||||
|
||||
$live_stream_subform = new Application_Form_LiveStreamingPreferences();
|
||||
$form->addSubForm($live_stream_subform, "live_stream_subform");
|
||||
|
||||
for ($i=1; $i<=$num_of_stream; $i++) {
|
||||
$subform = new Application_Form_StreamSettingSubForm();
|
||||
$subform->setPrefix($i);
|
||||
$subform->setSetting($setting);
|
||||
$subform->setStreamTypes($stream_types);
|
||||
$subform->setStreamBitrates($stream_bitrates);
|
||||
$subform->startForm();
|
||||
$subform->toggleState();
|
||||
$form->addSubForm($subform, "s".$i."_subform");
|
||||
}
|
||||
|
||||
$live_stream_subform->updateVariables();
|
||||
|
||||
$this->view->num_stream = $num_of_stream;
|
||||
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
|
||||
$this->view->form = $form;
|
||||
if ($request->isPost()) {
|
||||
if ($form->isValid($values)) {
|
||||
$this->_helper->json->sendJson(array(
|
||||
"valid" => "true",
|
||||
"html" => $this->view->render('preference/stream-setting.phtml'),
|
||||
"s1_set_admin_pass" => $s1_set_admin_pass,
|
||||
"s2_set_admin_pass" => $s2_set_admin_pass,
|
||||
"s3_set_admin_pass" => $s3_set_admin_pass,
|
||||
"s4_set_admin_pass" => $s4_set_admin_pass,
|
||||
));
|
||||
} else {
|
||||
$this->_helper->json->sendJson(array("valid" => "false", "html" => $this->view->render('preference/stream-setting.phtml')));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set stream settings preferences
|
||||
*
|
||||
* @param array $values stream setting preference values
|
||||
*/
|
||||
private function setStreamPreferences($values) {
|
||||
Application_Model_Preference::setUsingCustomStreamSettings($values['customStreamSettings']);
|
||||
Application_Model_Preference::SetStreamLabelFormat($values['streamFormat']);
|
||||
Application_Model_Preference::SetLiveStreamMasterUsername($values["master_username"]);
|
||||
Application_Model_Preference::SetLiveStreamMasterPassword($values["master_password"]);
|
||||
Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]);
|
||||
Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
|
||||
Application_Model_Preference::SetAutoSwitch($values["auto_switch"]);
|
||||
}
|
||||
|
||||
public function serverBrowseAction()
|
||||
|
|
|
@ -41,6 +41,9 @@ class ProvisioningController extends Zend_Controller_Action
|
|||
if (isset($_POST['provisioning_status'])) {
|
||||
Application_Model_Preference::setProvisioningStatus($_POST['provisioning_status']);
|
||||
}
|
||||
if (isset($_POST['icecast_pass'])) {
|
||||
Application_Model_Preference::setDefaultIcecastPassword($_POST['icecast_pass']);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(400)
|
||||
|
|
|
@ -94,10 +94,14 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$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/libs/moment.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/libs/moment-timezone-with-data-2010-2020.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.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/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
@ -106,8 +110,9 @@ class ScheduleController 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->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
|
||||
|
||||
$this->createShowFormAction(true);
|
||||
|
@ -585,6 +590,19 @@ 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
|
||||
$showTimezone = new DateTimeZone($data["add_show_timezone"]);
|
||||
$nowDateTime = new DateTime("now", $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");
|
||||
}
|
||||
|
||||
|
||||
if ($service_showForm->validateShowForms($forms, $data)) {
|
||||
// Get the show ID from the show service to pass as a parameter to the RESTful ShowImageController
|
||||
$this->view->showId = $service_show->addUpdateShow($data);
|
||||
|
|
43
airtime_mvc/application/controllers/SetupController.php
Normal file
43
airtime_mvc/application/controllers/SetupController.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/** This class displays the Language and Timezone setup popup dialog that you see on first run. */
|
||||
|
||||
class SetupController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('setup-language-timezone', 'json');
|
||||
}
|
||||
|
||||
public function setupLanguageTimezoneAction()
|
||||
{
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$form = new Application_Form_SetupLanguageTimezone();
|
||||
|
||||
if ($request->isPost()) {
|
||||
|
||||
$formData = $request->getPost();
|
||||
if ($form->isValid($formData)) {
|
||||
$userService = new Application_Service_UserService();
|
||||
$currentUser = $userService->getCurrentUser();
|
||||
$currentUserId = $currentUser->getDbId();
|
||||
|
||||
Application_Model_Preference::SetUserTimezone($formData["setup_timezone"], $currentUserId);
|
||||
Application_Model_Preference::SetDefaultTimezone($formData["setup_timezone"]);
|
||||
|
||||
Application_Model_Preference::SetUserLocale($formData["setup_language"], $currentUserId);
|
||||
Application_Model_Preference::SetDefaultLocale($formData["setup_language"]);
|
||||
|
||||
Application_Model_Preference::setLangTimezoneSetupComplete(true);
|
||||
|
||||
$this->_redirect('/showbuilder');
|
||||
}
|
||||
}
|
||||
$this->_redirect('/showbuilder');
|
||||
}
|
||||
|
||||
}
|
|
@ -20,30 +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.FixedHeader.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/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
@ -53,108 +48,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');
|
||||
|
||||
$refer_sses = new Zend_Session_Namespace('referrer');
|
||||
// PLUPLOAD
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/libs/dropzone.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
if ($request->isPost()) {
|
||||
$form = new Application_Form_RegisterAirtime();
|
||||
$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');
|
||||
|
||||
$values = $request->getPost();
|
||||
if ($values["Publicise"] != 1 && $form->isValid($values)) {
|
||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||
// 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']);
|
||||
|
||||
if (isset($values["Privacy"])) {
|
||||
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||
}
|
||||
session_start(); //open session for writing again
|
||||
// unset referrer
|
||||
Zend_Session::namespaceUnset('referrer');
|
||||
} elseif ($values["Publicise"] == '1' && $form->isValid($values)) {
|
||||
Application_Model_Preference::SetHeadTitle($values["stnName"], $this->view);
|
||||
Application_Model_Preference::SetPhone($values["Phone"]);
|
||||
Application_Model_Preference::SetEmail($values["Email"]);
|
||||
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
|
||||
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
||||
$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/dashboard.css?'.$CC_CONFIG['airtime_version']); // TODO
|
||||
|
||||
$form->Logo->receive();
|
||||
$imagePath = $form->Logo->getFileName();
|
||||
|
||||
Application_Model_Preference::SetStationCountry($values["Country"]);
|
||||
Application_Model_Preference::SetStationCity($values["City"]);
|
||||
Application_Model_Preference::SetStationDescription($values["Description"]);
|
||||
Application_Model_Preference::SetStationLogo($imagePath);
|
||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||
|
||||
if (isset($values["Privacy"])) {
|
||||
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||
}
|
||||
session_start(); //open session for writing again
|
||||
// unset referrer
|
||||
Zend_Session::namespaceUnset('referrer');
|
||||
} else {
|
||||
$logo = Application_Model_Preference::GetStationLogo();
|
||||
if ($logo) {
|
||||
$this->view->logoImg = $logo;
|
||||
}
|
||||
$this->view->dialog = $form;
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
}
|
||||
}
|
||||
|
||||
//popup if previous page was login
|
||||
if ($refer_sses->referrer == 'login' && Application_Model_Preference::ShouldShowPopUp()
|
||||
&& !Application_Model_Preference::GetSupportFeedback() && $user->isAdmin()){
|
||||
|
||||
$form = new Application_Form_RegisterAirtime();
|
||||
|
||||
$logo = Application_Model_Preference::GetStationLogo();
|
||||
if ($logo) {
|
||||
$this->view->logoImg = $logo;
|
||||
}
|
||||
$this->view->dialog = $form;
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
}
|
||||
|
||||
//determine whether to remove/hide/display the library.
|
||||
$showLib = false;
|
||||
if (!$user->isGuest()) {
|
||||
$disableLib = false;
|
||||
|
||||
$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;
|
||||
|
||||
//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');
|
||||
|
||||
$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);
|
||||
|
@ -170,20 +89,33 @@ 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');
|
||||
/** Check if we need to show the timezone/language setup popup and display it. (eg. on first run) */
|
||||
public function checkAndShowSetupPopup($request)
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
$setupComplete = Application_Model_Preference::getLangTimezoneSetupComplete();
|
||||
$previousPage = $request->getHeader('Referer');
|
||||
$userService = new Application_Service_UserService();
|
||||
$currentUser = $userService->getCurrentUser();
|
||||
$previousPageWasLoginScreen = strpos(strtolower($previousPage), 'login') !== false;
|
||||
|
||||
$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']);
|
||||
// If current user is Super Admin, and they came from the login page,
|
||||
// and they have not seen the setup popup before
|
||||
if ($currentUser->isSuperAdmin() && $previousPageWasLoginScreen && empty($setupComplete)) {
|
||||
$lang_tz_popup_form = new Application_Form_SetupLanguageTimezone();
|
||||
$this->view->lang_tz_popup_form = $lang_tz_popup_form;
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/nowplaying/lang-timezone-setup.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
}
|
||||
}
|
||||
|
||||
public function contextMenuAction()
|
||||
|
@ -243,6 +175,16 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$this->view->start = $start_time;
|
||||
$this->view->end = $end_time;
|
||||
|
||||
$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")
|
||||
));
|
||||
|
||||
$this->view->sb_form = $form;
|
||||
|
||||
$this->view->dialog = $this->view->render('showbuilder/builderDialog.phtml');
|
||||
}
|
||||
|
||||
|
@ -368,8 +310,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");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
<?php
|
||||
|
||||
class SystemstatusController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
/* Disable this on Airtime pro since we're not using Media Monitor/Monit
|
||||
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/status/status.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
*/
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$partitions = Application_Model_Systemstatus::GetDiskInfo();
|
||||
|
||||
$this->view->status = new StdClass;
|
||||
$this->view->status->partitions = $partitions;
|
||||
}
|
||||
}
|
|
@ -22,6 +22,9 @@ class UserController extends Zend_Controller_Action
|
|||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Settings');
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$js_files = array(
|
||||
|
@ -121,6 +124,8 @@ class UserController extends Zend_Controller_Action
|
|||
|
||||
public function editUserAction()
|
||||
{
|
||||
Zend_Layout::getMvcInstance()->assign('parent_page', 'Settings');
|
||||
|
||||
session_start(); //Reopen session for writing.
|
||||
$request = $this->getRequest();
|
||||
$form = new Application_Form_EditUser();
|
||||
|
|
|
@ -14,7 +14,6 @@ class WebstreamController extends Zend_Controller_Action
|
|||
|
||||
public function newAction()
|
||||
{
|
||||
|
||||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
if (!$this->isAuthorized(-1)) {
|
||||
// TODO: this header call does not actually print any error message
|
||||
|
@ -56,7 +55,20 @@ class WebstreamController extends Zend_Controller_Action
|
|||
if ($webstream) {
|
||||
Application_Model_Library::changePlaylist($id, "stream");
|
||||
}
|
||||
$this->view->obj = new Application_Model_Webstream($webstream);
|
||||
|
||||
$obj = new Application_Model_Webstream($webstream);
|
||||
|
||||
$user = Application_Model_User::getCurrentUser();
|
||||
$isAdminOrPM = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
|
||||
if (!$isAdminOrPM && $webstream->getDbCreatorId() != $user->getId()) {
|
||||
$this->view->objType = "webstream";
|
||||
$this->view->obj = $obj;
|
||||
$this->view->html = $this->view->render('playlist/permission-denied.phtml');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->view->obj = $obj;
|
||||
$this->view->action = "edit";
|
||||
$this->view->html = $this->view->render('webstream/webstream.phtml');
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class WhmcsLoginController extends Zend_Controller_Action
|
|||
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', 'en_CA'));
|
||||
if (Zend_Auth::getInstance()->hasIdentity())
|
||||
{
|
||||
$this->_redirect('Showbuilder');
|
||||
$this->_redirect('showbuilder');
|
||||
}
|
||||
|
||||
$authAdapter = new WHMCS_Auth_Adapter($username, $email, $password);
|
||||
|
@ -58,7 +58,7 @@ class WhmcsLoginController extends Zend_Controller_Action
|
|||
//$locale = $form->getValue('locale');
|
||||
//Application_Model_Preference::SetUserLocale($locale);
|
||||
|
||||
$this->_redirect('Showbuilder');
|
||||
$this->_redirect('showbuilder');
|
||||
}
|
||||
else {
|
||||
echo("Sorry, that username or password was incorrect.");
|
||||
|
|
|
@ -82,7 +82,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
* @param string $module
|
||||
* @return void
|
||||
**/
|
||||
public function setErrorPage($action, $controller = 'error', $module = null)
|
||||
public function setErrorPage($action, $controller = 'error', $module = 'default')
|
||||
{
|
||||
$this->_errorPage = array('module' => $module,
|
||||
'controller' => $controller,
|
||||
|
@ -204,7 +204,8 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
$resourceName,
|
||||
$request->getActionName())) {
|
||||
/** Redirect to access denied page */
|
||||
$this->denyAccess();
|
||||
$this->setErrorPage('error403');
|
||||
$this->denyAccess(); /* This results in a 404! */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,11 +15,26 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
"/^[0-2]?[0-9]:[0-5][0-9]$/",
|
||||
_("'%value%' does not fit the time format 'HH:mm'"));
|
||||
|
||||
|
||||
// Add start date element
|
||||
$startNow = new Zend_Form_Element_Radio('add_show_start_now');
|
||||
$startNow->setRequired(false)
|
||||
->setLabel(_('Start Time:'))
|
||||
->addMultiOptions(array(
|
||||
'now' => 'Now',
|
||||
'future' => 'In the Future:'
|
||||
))
|
||||
->setValue('future')
|
||||
->setDecorators(array('ViewHelper'));
|
||||
//$startDate->setAttrib('alt', 'date');
|
||||
$this->addElement($startNow);
|
||||
|
||||
|
||||
// Add start date element
|
||||
$startDate = new Zend_Form_Element_Text('add_show_start_date');
|
||||
$startDate->class = 'input_text';
|
||||
$startDate->setRequired(true)
|
||||
->setLabel(_('Date/Time Start:'))
|
||||
->setLabel(_('In the Future:'))
|
||||
->setValue(date("Y-m-d"))
|
||||
->setFilters(array('StringTrim'))
|
||||
->setValidators(array(
|
||||
|
@ -46,7 +61,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
$endDate = new Zend_Form_Element_Text('add_show_end_date_no_repeat');
|
||||
$endDate->class = 'input_text';
|
||||
$endDate->setRequired(true)
|
||||
->setLabel(_('Date/Time End:'))
|
||||
->setLabel(_('End Time:'))
|
||||
->setValue(date("Y-m-d"))
|
||||
->setFilters(array('StringTrim'))
|
||||
->setValidators(array(
|
||||
|
@ -119,7 +134,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
$showStartDateTime = new DateTime($start_time, $showTimezone);
|
||||
$showEndDateTime = new DateTime($end_time, $showTimezone);
|
||||
|
||||
if ($validateStartDate) {
|
||||
if ($validateStartDate && ($formData['add_show_start_now'] != "now")) {
|
||||
if ($showStartDateTime < $nowDateTime) {
|
||||
$this->getElement('add_show_start_time')->setErrors(array(_('Cannot create show in the past')));
|
||||
$valid = false;
|
||||
|
|
|
@ -105,7 +105,7 @@ class Application_Form_AddUser extends Zend_Form
|
|||
$this->addElement($select);
|
||||
|
||||
$saveBtn = new Zend_Form_Element_Button('save_user');
|
||||
$saveBtn->setAttrib('class', 'btn btn-small right-floated');
|
||||
$saveBtn->setAttrib('class', 'btn right-floated');
|
||||
$saveBtn->setIgnore(true);
|
||||
$saveBtn->setLabel(_('Save'));
|
||||
$this->addElement($saveBtn);
|
||||
|
|
|
@ -14,7 +14,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$emailValidator = Application_Form_Helper_ValidationTypes::overrideEmailAddressValidator();
|
||||
|
||||
$firstname = new Zend_Form_Element_Text('firstname');
|
||||
$firstname->setLabel(_('First Name:'))
|
||||
$firstname->setLabel(_pro('First Name:'))
|
||||
->setValue($client["firstname"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->setRequired(true)
|
||||
|
@ -23,7 +23,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$this->addElement($firstname);
|
||||
|
||||
$lastname = new Zend_Form_Element_Text('lastname');
|
||||
$lastname->setLabel(_('Last Name:'))
|
||||
$lastname->setLabel(_pro('Last Name:'))
|
||||
->setValue($client["lastname"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->setRequired(true)
|
||||
|
@ -32,7 +32,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$this->addElement($lastname);
|
||||
|
||||
$companyname = new Zend_Form_Element_Text('companyname');
|
||||
$companyname->setLabel(_('Company Name:'))
|
||||
$companyname->setLabel(_pro('Company Name:'))
|
||||
->setValue($client["companyname"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->setRequired(false)
|
||||
|
@ -41,7 +41,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$this->addElement($companyname);
|
||||
|
||||
$email = new Zend_Form_Element_Text('email');
|
||||
$email->setLabel(_('Email Address:'))
|
||||
$email->setLabel(_pro('Email Address:'))
|
||||
->setValue($client["email"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->setRequired(true)
|
||||
|
@ -51,7 +51,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$this->addElement($email);
|
||||
|
||||
$address1 = new Zend_Form_Element_Text('address1');
|
||||
$address1->setLabel(_('Address 1:'))
|
||||
$address1->setLabel(_pro('Address 1:'))
|
||||
->setValue($client["address1"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->setRequired(true)
|
||||
|
@ -60,14 +60,14 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$this->addElement($address1);
|
||||
|
||||
$address2 = new Zend_Form_Element_Text('address2');
|
||||
$address2->setLabel(_('Address 2:'))
|
||||
$address2->setLabel(_pro('Address 2:'))
|
||||
->setValue($client["address2"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->addFilter('StringTrim');
|
||||
$this->addElement($address2);
|
||||
|
||||
$city = new Zend_Form_Element_Text('city');
|
||||
$city->setLabel(_('City:'))
|
||||
$city->setLabel(_pro('City:'))
|
||||
->setValue($client["city"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->setRequired(true)
|
||||
|
@ -77,7 +77,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
|
||||
//TODO: get list from whmcs?
|
||||
$state = new Zend_Form_Element_Text('state');
|
||||
$state->setLabel(_('State/Region:'))
|
||||
$state->setLabel(_pro('State/Region:'))
|
||||
->setValue($client["state"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->setRequired(true)
|
||||
|
@ -86,7 +86,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$this->addElement($state);
|
||||
|
||||
$postcode = new Zend_Form_Element_Text('postcode');
|
||||
$postcode->setLabel(_('Zip Code / Postal Code:'))
|
||||
$postcode->setLabel(_pro('Zip Code / Postal Code:'))
|
||||
->setValue($client["postcode"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->setRequired(true)
|
||||
|
@ -99,7 +99,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
asort($countries, SORT_LOCALE_STRING);
|
||||
|
||||
$country = new Zend_Form_Element_Select('country');
|
||||
$country->setLabel(_('Country:'))
|
||||
$country->setLabel(_pro('Country:'))
|
||||
->setValue($client["country"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->setMultiOptions($countries)
|
||||
|
@ -109,7 +109,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$this->addElement($country);
|
||||
|
||||
$phonenumber = new Zend_Form_Element_Text('phonenumber');
|
||||
$phonenumber->setLabel(_('Phone Number:'))
|
||||
$phonenumber->setLabel(_pro('Phone Number:'))
|
||||
->setValue($client["phonenumber"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->setRequired(true)
|
||||
|
@ -118,7 +118,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$this->addElement($phonenumber);
|
||||
|
||||
$securityqid = new Zend_Form_Element_Select('securityqid');
|
||||
$securityqid->setLabel(_('Please choose a security question:'))
|
||||
$securityqid->setLabel(_pro('Please choose a security question:'))
|
||||
->setValue($client["securityqid"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->setRequired(true)
|
||||
|
@ -132,7 +132,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$this->addElement($securityqid);
|
||||
|
||||
$securityqans = new Zend_Form_Element_Text('securityqans');
|
||||
$securityqans->setLabel(_('Please enter an answer:'))
|
||||
$securityqans->setLabel(_pro('Please enter an answer:'))
|
||||
->setValue($client["securityqans"])
|
||||
->setAttrib('class', 'input_text')
|
||||
->setRequired(true)
|
||||
|
@ -149,7 +149,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
}
|
||||
|
||||
$vat = new Zend_Form_Element_Text("7");
|
||||
$vat->setLabel(_('VAT/Tax ID (EU only)'))
|
||||
$vat->setLabel(_pro('VAT/Tax ID (EU only)'))
|
||||
->setBelongsTo('customfields')
|
||||
->setValue($vatvalue)
|
||||
->setAttrib('class', 'input_text')
|
||||
|
@ -159,17 +159,17 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$this->addElement($vat);
|
||||
|
||||
$subscribe = new Zend_Form_Element_Checkbox('71');
|
||||
$subscribe->setLabel(_('Subscribe to Sourcefabric newsletter'))
|
||||
$subscribe->setLabel(_pro('Subscribe to Sourcefabric newsletter'))
|
||||
->setValue($subscribevalue)
|
||||
->setBelongsTo('customfields')
|
||||
->setAttrib('class', 'input_text')
|
||||
->setAttrib('class', 'billing-details-checkbox')
|
||||
->setRequired(true)
|
||||
->addValidator($notEmptyValidator)
|
||||
->addFilter('StringTrim');
|
||||
$this->addElement($subscribe);
|
||||
|
||||
$password = new Zend_Form_Element_Password('password2');
|
||||
$password->setLabel(_('Password:'));
|
||||
$password->setLabel(_pro('Password:'));
|
||||
$password->setAttrib('class', 'input_text');
|
||||
$password->setValue("xxxxxx");
|
||||
$password->setRequired(true);
|
||||
|
@ -178,7 +178,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
$this->addElement($password);
|
||||
|
||||
$passwordVerify = new Zend_Form_Element_Password('password2verify');
|
||||
$passwordVerify->setLabel(_('Verify Password:'));
|
||||
$passwordVerify->setLabel(_pro('Verify Password:'));
|
||||
$passwordVerify->setAttrib('class', 'input_text');
|
||||
$passwordVerify->setValue("xxxxxx");
|
||||
$passwordVerify->setRequired(true);
|
||||
|
@ -190,7 +190,7 @@ class Application_Form_BillingClient extends Zend_Form
|
|||
|
||||
$submit = new Zend_Form_Element_Submit("submit");
|
||||
$submit->setIgnore(true)
|
||||
->setLabel(_("Save"));
|
||||
->setLabel(_pro("Save"));
|
||||
$this->addElement($submit);
|
||||
}
|
||||
}
|
|
@ -3,6 +3,11 @@ class Application_Form_BillingUpgradeDowngrade extends Zend_Form
|
|||
{
|
||||
public function init()
|
||||
{
|
||||
$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->addElement($csrf_element);
|
||||
|
||||
$productPrices = array();
|
||||
$productTypes = array();
|
||||
list($productPrices, $productTypes) = Billing::getProductPricesAndTypes();
|
||||
|
|
|
@ -11,15 +11,14 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
// Set the method for the display form to POST
|
||||
$this->setMethod('post');
|
||||
|
||||
$this->addElement('hidden', 'file_id', array(
|
||||
'value' => $p_id
|
||||
));
|
||||
$file_id = new Zend_Form_Element_Hidden('file_id');
|
||||
$file_id->setValue($p_id);
|
||||
$file_id->addDecorator('HtmlTag', array('tag' => 'div', 'style' => 'display:none'));
|
||||
$file_id->removeDecorator('Label');
|
||||
$file_id->setAttrib('class', 'obj_id');
|
||||
$this->addElement($file_id);
|
||||
|
||||
// Add title field
|
||||
/*$this->addElement('text', 'track_title', array(
|
||||
'label' => _('Title:'),
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim'),
|
||||
));*/
|
||||
$track_title = new Zend_Form_Element_Text('track_title');
|
||||
$track_title->class = 'input_text';
|
||||
$track_title->setLabel(_('Title:'))
|
||||
|
@ -30,11 +29,6 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
$this->addElement($track_title);
|
||||
|
||||
// Add artist field
|
||||
/*$this->addElement('text', 'artist_name', array(
|
||||
'label' => _('Creator:'),
|
||||
'class' => 'input_text',
|
||||
'filters' => array('StringTrim'),
|
||||
));*/
|
||||
$artist_name = new Zend_Form_Element_Text('artist_name');
|
||||
$artist_name->class = 'input_text';
|
||||
$artist_name->setLabel(_('Creator:'))
|
||||
|
@ -51,7 +45,7 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
->setFilters(array('StringTrim'))
|
||||
->setValidators(array(
|
||||
new Zend_Validate_StringLength(array('max' => 512))
|
||||
));;
|
||||
));
|
||||
$this->addElement($album_title);
|
||||
|
||||
// Add track number field
|
||||
|
@ -177,9 +171,9 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
|
||||
// Add the submit button
|
||||
$this->addElement('button', 'editmdsave', array(
|
||||
'ignore' => true,
|
||||
'class' => 'btn',
|
||||
'label' => _('Save'),
|
||||
'ignore' => true,
|
||||
'class' => 'btn md-save right-floated',
|
||||
'label' => _('OK'),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
|
@ -188,19 +182,32 @@ class Application_Form_EditAudioMD extends Zend_Form
|
|||
// Add the submit button
|
||||
$this->addElement('button', 'editmdcancel', array(
|
||||
'ignore' => true,
|
||||
'class' => 'btn md-cancel',
|
||||
'class' => 'btn md-cancel right-floated',
|
||||
'label' => _('Cancel'),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
$this->addDisplayGroup(array('editmdsave', 'editmdcancel'), 'submitButtons', array(
|
||||
'decorators' => array(
|
||||
'FormElements',
|
||||
'DtDdWrapper'
|
||||
)
|
||||
$this->addDisplayGroup(array('editmdcancel', 'editmdsave'), 'submitButtons', array(
|
||||
'decorators' => array(
|
||||
'FormElements',
|
||||
'DtDdWrapper'
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
public function makeReadOnly()
|
||||
{
|
||||
foreach ($this as $element) {
|
||||
$element->setAttrib('readonly', 'readonly');
|
||||
}
|
||||
}
|
||||
|
||||
public function removeActionButtons()
|
||||
{
|
||||
$this->removeElement('editmdsave');
|
||||
$this->removeElement('editmdcancel');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -122,10 +122,13 @@ class Application_Form_EditUser extends Zend_Form
|
|||
$locale->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($locale);
|
||||
|
||||
$stationTz = Application_Model_Preference::GetTimezone($currentUserId);
|
||||
$userTz = Application_Model_Preference::GetUserTimezone($currentUserId);
|
||||
|
||||
$timezone = new Zend_Form_Element_Select("cu_timezone");
|
||||
$timezone->setLabel(_("Interface Timezone:"));
|
||||
$timezone->setMultiOptions(Application_Common_Timezone::getTimezones());
|
||||
$timezone->setValue(Application_Model_Preference::GetUserTimezone($currentUserId));
|
||||
$timezone->setValue($userTz == $stationTz ? null : $userTz);
|
||||
$timezone->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($timezone);
|
||||
|
||||
|
|
|
@ -1,106 +0,0 @@
|
|||
<?php
|
||||
require_once 'customvalidators/ConditionalNotEmpty.php';
|
||||
|
||||
class Application_Form_EmailServerPreferences extends Zend_Form_SubForm
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_email_server.phtml'))
|
||||
));
|
||||
|
||||
// Enable system emails
|
||||
$this->addElement('checkbox', 'enableSystemEmail', array(
|
||||
'label' => _('Enable System Emails (Password Reset)'),
|
||||
'required' => false,
|
||||
'value' => Application_Model_Preference::GetEnableSystemEmail(),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElement('text', 'systemEmail', array(
|
||||
'class' => 'input_text',
|
||||
'label' => _("Reset Password 'From' Email"),
|
||||
'value' => Application_Model_Preference::GetSystemEmail(),
|
||||
'readonly' => true,
|
||||
'decorators' => array('viewHelper')
|
||||
));
|
||||
|
||||
$this->addElement('checkbox', 'configureMailServer', array(
|
||||
'label' => _('Configure Mail Server'),
|
||||
'required' => false,
|
||||
'value' => Application_Model_Preference::GetMailServerConfigured(),
|
||||
'decorators' => array (
|
||||
'viewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElement('checkbox', 'msRequiresAuth', array(
|
||||
'label' => _('Requires Authentication'),
|
||||
'required' => false,
|
||||
'value' => Application_Model_Preference::GetMailServerRequiresAuth(),
|
||||
'decorators' => array(
|
||||
'viewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElement('text', 'mailServer', array(
|
||||
'class' => 'input_text',
|
||||
'label' => _('Mail Server'),
|
||||
'value' => Application_Model_Preference::GetMailServer(),
|
||||
'readonly' => true,
|
||||
'decorators' => array('viewHelper'),
|
||||
'allowEmpty' => false,
|
||||
'validators' => array(
|
||||
new ConditionalNotEmpty(array(
|
||||
'configureMailServer' => '1'
|
||||
))
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElement('text', 'email', array(
|
||||
'class' => 'input_text',
|
||||
'label' => _('Email Address'),
|
||||
'value' => Application_Model_Preference::GetMailServerEmailAddress(),
|
||||
'readonly' => true,
|
||||
'decorators' => array('viewHelper'),
|
||||
'allowEmpty' => false,
|
||||
'validators' => array(
|
||||
new ConditionalNotEmpty(array(
|
||||
'configureMailServer' => '1',
|
||||
'msRequiresAuth' => '1'
|
||||
))
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElement('password', 'ms_password', array(
|
||||
'class' => 'input_text',
|
||||
'label' => _('Password'),
|
||||
'value' => Application_Model_Preference::GetMailServerPassword(),
|
||||
'readonly' => true,
|
||||
'decorators' => array('viewHelper'),
|
||||
'allowEmpty' => false,
|
||||
'validators' => array(
|
||||
new ConditionalNotEmpty(array(
|
||||
'configureMailServer' => '1',
|
||||
'msRequiresAuth' => '1'
|
||||
))
|
||||
),
|
||||
'renderPassword' => true
|
||||
));
|
||||
|
||||
$port = new Zend_Form_Element_Text('port');
|
||||
$port->class = 'input_text';
|
||||
$port->setRequired(false)
|
||||
->setValue(Application_Model_Preference::GetMailServerPort())
|
||||
->setLabel(_('Port'))
|
||||
->setAttrib('readonly', true)
|
||||
->setDecorators(array('viewHelper'));
|
||||
|
||||
$this->addElement($port);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php
|
||||
|
||||
require_once 'customfilters/ImageSize.php';
|
||||
|
||||
|
@ -107,8 +107,7 @@ class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
|||
));
|
||||
$third_party_api->setValue(Application_Model_Preference::GetAllow3rdPartyApi());
|
||||
$third_party_api->setDescription(_('Enabling this feature will allow Airtime to provide schedule data
|
||||
to external widgets that can be embedded in your website. Enable this
|
||||
feature to reveal the embeddable code.'));
|
||||
to external widgets that can be embedded in your website.'));
|
||||
$third_party_api->setSeparator(' '); //No <br> between radio buttons
|
||||
//$third_party_api->addDecorator(new Zend_Form_Decorator_Label(array('tag' => 'dd', 'class' => 'radio-inline-list')));
|
||||
$third_party_api->addDecorator('HtmlTag', array('tag' => 'dd',
|
||||
|
|
|
@ -7,7 +7,6 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1;
|
||||
$isStreamConfigable = Application_Model_Preference::GetEnableStreamConf() == "true";
|
||||
|
||||
$defaultFade = Application_Model_Preference::GetDefaultTransitionFade();
|
||||
|
||||
|
@ -103,7 +102,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
$this->addElement($showSourceMount);
|
||||
|
||||
// demo only code
|
||||
if (!$isStreamConfigable) {
|
||||
if ($isDemo) {
|
||||
$elements = $this->getElements();
|
||||
foreach ($elements as $element) {
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||
|
|
|
@ -37,19 +37,17 @@ class Application_Form_Login extends Zend_Form
|
|||
));
|
||||
|
||||
// Add username element
|
||||
$this->addElement('text', 'username', array(
|
||||
'label' => _('Username:'),
|
||||
'class' => 'input_text',
|
||||
'required' => true,
|
||||
'value' => (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1)?'admin':'',
|
||||
'filters' => array('StringTrim'),
|
||||
'validators' => array(
|
||||
'NotEmpty',
|
||||
),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
$username = new Zend_Form_Element_Text("username");
|
||||
$username->setLabel(_('Username:'))
|
||||
->setAttribs(array(
|
||||
'autofocus' => 'true',
|
||||
'class' => 'input_text',
|
||||
'required' => 'true'))
|
||||
->setValue((isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1)?'admin':'')
|
||||
->addFilter('StringTrim')
|
||||
->setDecorators(array('ViewHelper'))
|
||||
->setValidators(array('NotEmpty'));
|
||||
$this->addElement($username);
|
||||
|
||||
// Add password element
|
||||
$this->addElement('password', 'password', array(
|
||||
|
|
|
@ -40,7 +40,7 @@ class Application_Form_PasswordChange extends Zend_Form
|
|||
));
|
||||
|
||||
$this->addElement('submit', 'submit', array(
|
||||
'label' => _('Get new password'),
|
||||
'label' => _('Save'),
|
||||
'ignore' => true,
|
||||
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
||||
'decorators' => array(
|
||||
|
|
|
@ -11,7 +11,7 @@ class Application_Form_PasswordRestore extends Zend_Form
|
|||
));
|
||||
|
||||
$this->addElement('text', 'email', array(
|
||||
'label' => _('E-mail'),
|
||||
'label' => _('Email'),
|
||||
'required' => true,
|
||||
'filters' => array(
|
||||
'stringTrim',
|
||||
|
@ -33,7 +33,7 @@ class Application_Form_PasswordRestore extends Zend_Form
|
|||
));
|
||||
|
||||
$this->addElement('submit', 'submit', array(
|
||||
'label' => _('Restore password'),
|
||||
'label' => _('Reset password'),
|
||||
'ignore' => true,
|
||||
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
||||
'decorators' => array(
|
||||
|
@ -41,12 +41,14 @@ class Application_Form_PasswordRestore extends Zend_Form
|
|||
)
|
||||
));
|
||||
|
||||
/*
|
||||
$cancel = new Zend_Form_Element_Button("cancel");
|
||||
$cancel->class = 'ui-button ui-widget ui-state-default ui-button-text-only center';
|
||||
$cancel->setLabel(_("Cancel"))
|
||||
$cancel->setLabel(_("Back"))
|
||||
->setIgnore(True)
|
||||
->setAttrib('onclick', 'redirectToLogin();')
|
||||
->setAttrib('onclick', 'window.location = ' . Zend_Controller_Front::getInstance()->getBaseUrl('login'))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($cancel);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
|||
|
||||
public function init()
|
||||
{
|
||||
$this->setAction(Application_Common_OsPath::getBaseDir().'Showbuilder');
|
||||
$this->setAction(Application_Common_OsPath::getBaseDir().'showbuilder');
|
||||
$this->setMethod('post');
|
||||
|
||||
$country_list = Application_Model_Preference::GetCountryList();
|
||||
|
|
28
airtime_mvc/application/forms/SetupLanguageTimezone.php
Normal file
28
airtime_mvc/application/forms/SetupLanguageTimezone.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
class Application_Form_SetupLanguageTimezone extends Zend_Form_SubForm
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/setup-lang-timezone.phtml'))));
|
||||
|
||||
$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->addElement($csrf_element);
|
||||
|
||||
$language = new Zend_Form_Element_Select('setup_language');
|
||||
$language->setLabel(_("Station Language"));
|
||||
$language->setMultiOptions(Application_Model_Locale::getLocales());
|
||||
$this->addElement($language);
|
||||
|
||||
$timezone = new Zend_Form_Element_Select('setup_timezone');
|
||||
$timezone->setLabel(_("Station Timezone"));
|
||||
$timezone->setMultiOptions(Application_Common_Timezone::getTimezones());
|
||||
$this->addElement($timezone);
|
||||
}
|
||||
}
|
||||
|
|
@ -69,7 +69,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
|||
|
||||
// add a select to choose a show.
|
||||
$showSelect = new Zend_Form_Element_Select("sb_show_filter");
|
||||
$showSelect->setLabel(_("Show:"));
|
||||
$showSelect->setLabel(_("Filter by Show"));
|
||||
$showSelect->setMultiOptions($this->getShowNames());
|
||||
$showSelect->setValue(null);
|
||||
$showSelect->setDecorators(array('ViewHelper'));
|
||||
|
@ -85,7 +85,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm
|
|||
|
||||
private function getShowNames()
|
||||
{
|
||||
$showNames = array("0" => "-------------------------");
|
||||
$showNames = array("0" => _("Filter by Show"));
|
||||
|
||||
$shows = CcShowQuery::create()
|
||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||
|
|
|
@ -127,9 +127,9 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
{
|
||||
if (!isset($this->sortOptions)) {
|
||||
$this->sortOptions = array(
|
||||
"random" => _("random"),
|
||||
"newest" => _("newest"),
|
||||
"oldest" => _("oldest")
|
||||
"random" => _("Randomly"),
|
||||
"newest" => _("Newest"),
|
||||
"oldest" => _("Oldest")
|
||||
);
|
||||
}
|
||||
return $this->sortOptions;
|
||||
|
@ -176,7 +176,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
}
|
||||
|
||||
$spType = new Zend_Form_Element_Radio('sp_type');
|
||||
$spType->setLabel(_('Set smart block type:'))
|
||||
$spType->setLabel(_('Type:'))
|
||||
->setDecorators(array('viewHelper'))
|
||||
->setMultiOptions(array(
|
||||
'static' => _('Static'),
|
||||
|
@ -294,7 +294,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
|
||||
$repeatTracks = new Zend_Form_Element_Checkbox('sp_repeat_tracks');
|
||||
$repeatTracks->setDecorators(array('viewHelper'))
|
||||
->setLabel(_('Allow Repeat Tracks:'));
|
||||
->setLabel(_('Allow Repeated Tracks:'));
|
||||
if (isset($storedCrit["repeat_tracks"])) {
|
||||
$repeatTracks->setChecked($storedCrit["repeat_tracks"]["value"] == 1?true:false);
|
||||
}
|
||||
|
@ -303,6 +303,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
$sort = new Zend_Form_Element_Select('sp_sort_options');
|
||||
$sort->setAttrib('class', 'sp_input_select')
|
||||
->setDecorators(array('viewHelper'))
|
||||
->setLabel(_("Sort Tracks:"))
|
||||
->setMultiOptions($this->getSortOptions());
|
||||
if (isset($storedCrit["sort"])) {
|
||||
$sort->setValue($storedCrit["sort"]["value"]);
|
||||
|
@ -320,7 +321,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
|
||||
$limitValue = new Zend_Form_Element_Text('sp_limit_value');
|
||||
$limitValue->setAttrib('class', 'sp_input_text_limit')
|
||||
->setLabel(_('Limit to'))
|
||||
->setLabel(_('Limit to:'))
|
||||
->setDecorators(array('viewHelper'));
|
||||
$this->addElement($limitValue);
|
||||
if (isset($storedCrit["limit"])) {
|
||||
|
@ -341,7 +342,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
}
|
||||
|
||||
$generate = new Zend_Form_Element_Button('generate_button');
|
||||
$generate->setAttrib('class', 'btn btn-small');
|
||||
$generate->setAttrib('class', 'sp-button btn');
|
||||
$generate->setAttrib('title', _('Generate playlist content and save criteria'));
|
||||
$generate->setIgnore(true);
|
||||
$generate->setLabel(_('Generate'));
|
||||
|
@ -349,7 +350,7 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
$this->addElement($generate);
|
||||
|
||||
$shuffle = new Zend_Form_Element_Button('shuffle_button');
|
||||
$shuffle->setAttrib('class', 'btn btn-small');
|
||||
$shuffle->setAttrib('class', 'sp-button btn');
|
||||
$shuffle->setAttrib('title', _('Shuffle playlist content'));
|
||||
$shuffle->setIgnore(true);
|
||||
$shuffle->setLabel(_('Shuffle'));
|
||||
|
@ -369,6 +370,10 @@ class Application_Form_SmartBlockCriteria extends Zend_Form_SubForm
|
|||
// add elelments that needs to be added
|
||||
// set multioption for modifier according to criteria_field
|
||||
$modRowMap = array();
|
||||
if (!isset($data['criteria'])) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
foreach ($data['criteria'] as $critKey=>$d) {
|
||||
$count = 1;
|
||||
foreach ($d as $modKey=>$modInfo) {
|
||||
|
|
|
@ -16,6 +16,10 @@ class Application_Form_StreamSetting extends Zend_Form
|
|||
|
||||
public function startFrom()
|
||||
{
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'preference/stream-setting.phtml'))
|
||||
));
|
||||
|
||||
$setting = $this->setting;
|
||||
|
||||
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
|
||||
|
@ -55,6 +59,13 @@ class Application_Form_StreamSetting extends Zend_Form
|
|||
->setAttribs(array('style' => "border: 0; color: #f6931f; font-weight: bold;"))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($replay_gain);
|
||||
|
||||
$custom = Application_Model_Preference::getUsingCustomStreamSettings();
|
||||
$customSettings = new Zend_Form_Element_Radio('customStreamSettings');
|
||||
$customSettings->setLabel(_('Streaming Server:'));
|
||||
$customSettings->setMultiOptions(array(_("Airtime Pro Streaming"), _("Custom / 3rd Party Streaming")));
|
||||
$customSettings->setValue(!empty($custom) ? $custom : 0);
|
||||
$this->addElement($customSettings);
|
||||
}
|
||||
|
||||
public function isValid($data)
|
||||
|
|
|
@ -6,6 +6,8 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
private $stream_types;
|
||||
private $stream_bitrates;
|
||||
|
||||
static $customizable;
|
||||
|
||||
public function init()
|
||||
{
|
||||
|
||||
|
@ -39,54 +41,49 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
$stream_types = $this->stream_types;
|
||||
$stream_bitrates = $this->stream_bitrates;
|
||||
|
||||
$streamDefaults = Application_Model_StreamSetting::getDefaults($prefix);
|
||||
// If we're not using custom stream settings, use the defaults
|
||||
$useDefaults = !Application_Model_Preference::getUsingCustomStreamSettings();
|
||||
|
||||
$this->setIsArray(true);
|
||||
$this->setElementsBelongTo($prefix."_data");
|
||||
|
||||
$disable_all = Application_Model_Preference::GetEnableStreamConf() == "false";
|
||||
|
||||
$enable = new Zend_Form_Element_Checkbox('enable');
|
||||
$enable->setLabel(_('Enabled:'))
|
||||
->setValue($setting[$prefix.'_enable'] == 'true' ? 1 : 0)
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$enable->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($enable);
|
||||
static::$customizable[] = $enable->getName();
|
||||
|
||||
$mobile = new Zend_Form_Element_Checkbox('mobile');
|
||||
$mobile->setLabel(_('Mobile:'));
|
||||
$mobile->setValue($setting[$prefix.'_mobile']);
|
||||
$mobile->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($mobile);
|
||||
static::$customizable[] = $mobile->getName();
|
||||
|
||||
$type = new Zend_Form_Element_Select('type');
|
||||
$type->setLabel(_("Stream Type:"))
|
||||
->setMultiOptions($stream_types)
|
||||
->setValue(isset($setting[$prefix.'_type'])?$setting[$prefix.'_type']:0)
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$type->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($type);
|
||||
static::$customizable[] = $type->getName();
|
||||
|
||||
$bitrate = new Zend_Form_Element_Select('bitrate');
|
||||
$bitrate->setLabel(_("Bit Rate:"))
|
||||
->setMultiOptions($stream_bitrates)
|
||||
->setValue(isset($setting[$prefix.'_bitrate'])?$setting[$prefix.'_bitrate']:0)
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$bitrate->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($bitrate);
|
||||
static::$customizable[] = $bitrate->getName();
|
||||
|
||||
$output = new Zend_Form_Element_Select('output');
|
||||
$output->setLabel(_("Service Type:"))
|
||||
->setMultiOptions(array("icecast"=>"Icecast", "shoutcast"=>"SHOUTcast"))
|
||||
->setValue(isset($setting[$prefix.'_output'])?$setting[$prefix.'_output']:"icecast")
|
||||
->setValue($useDefaults ? $streamDefaults['output'] :
|
||||
(isset($setting[$prefix.'_output'])?$setting[$prefix.'_output']:"icecast"))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$output->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($output);
|
||||
|
||||
$channels = new Zend_Form_Element_Select('channels');
|
||||
|
@ -94,43 +91,35 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
->setMultiOptions(array("mono"=>_("1 - Mono"), "stereo"=>_("2 - Stereo")))
|
||||
->setValue(isset($setting[$prefix.'_channels']) ? $setting[$prefix.'_channels'] : "stereo")
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$channels->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($channels);
|
||||
static::$customizable[] = $channels->getName();
|
||||
|
||||
$host = new Zend_Form_Element_Text('host');
|
||||
$host->setLabel(_("Server"))
|
||||
->setValue(isset($setting[$prefix.'_host'])?$setting[$prefix.'_host']:"")
|
||||
->setValue($useDefaults ? $streamDefaults['host'] :
|
||||
(isset($setting[$prefix.'_host'])?$setting[$prefix.'_host']:""))
|
||||
->setValidators(array(
|
||||
array('regex', false, array('/^[0-9a-zA-Z-_.]+$/', 'messages' => _('Invalid character entered')))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$host->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$host->setAttrib('alt', 'domain');
|
||||
$this->addElement($host);
|
||||
|
||||
$port = new Zend_Form_Element_Text('port');
|
||||
$port->setLabel(_("Port"))
|
||||
->setValue(isset($setting[$prefix.'_port'])?$setting[$prefix.'_port']:"")
|
||||
->setValue($useDefaults ? $streamDefaults['port'] :
|
||||
(isset($setting[$prefix.'_port'])?$setting[$prefix.'_port']:""))
|
||||
->setValidators(array(new Zend_Validate_Between(array('min'=>0, 'max'=>99999))))
|
||||
->addValidator('regex', false, array('pattern'=>'/^[0-9]+$/', 'messages'=>array('regexNotMatch'=>_('Only numbers are allowed.'))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$port->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($port);
|
||||
|
||||
$pass = new Zend_Form_Element_Text('pass');
|
||||
$pass->setLabel(_("Password"))
|
||||
->setValue(isset($setting[$prefix.'_pass'])?$setting[$prefix.'_pass']:"")
|
||||
->setValue($useDefaults ? $streamDefaults['pass'] :
|
||||
(isset($setting[$prefix.'_pass'])?$setting[$prefix.'_pass']:""))
|
||||
->setValidators(array(
|
||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$pass->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$pass->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($pass);
|
||||
|
||||
|
@ -138,9 +127,6 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
$genre->setLabel(_("Genre"))
|
||||
->setValue(isset($setting[$prefix.'_genre'])?$setting[$prefix.'_genre']:"")
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$genre->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($genre);
|
||||
|
||||
$url = new Zend_Form_Element_Text('url');
|
||||
|
@ -149,9 +135,6 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
->setValidators(array(
|
||||
array('regex', false, array('/^[0-9a-zA-Z\-_.:\/]+$/', 'messages' => _('Invalid character entered')))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$url->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$url->setAttrib('alt', 'url');
|
||||
$this->addElement($url);
|
||||
|
||||
|
@ -159,41 +142,31 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
$name->setLabel(_("Name"))
|
||||
->setValue(isset($setting[$prefix.'_name'])?$setting[$prefix.'_name']:"")
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$name->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($name);
|
||||
|
||||
$description = new Zend_Form_Element_Text('description');
|
||||
$description->setLabel(_("Description"))
|
||||
->setValue(isset($setting[$prefix.'_description'])?$setting[$prefix.'_description']:"")
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$description->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($description);
|
||||
|
||||
$mount = new Zend_Form_Element_Text('mount');
|
||||
$mount->setLabel(_("Mount Point"))
|
||||
->setValue(isset($setting[$prefix.'_mount'])?$setting[$prefix.'_mount']:"")
|
||||
->setValue($useDefaults ? $streamDefaults['mount'] :
|
||||
(isset($setting[$prefix.'_mount'])?$setting[$prefix.'_mount']:""))
|
||||
->setValidators(array(
|
||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$mount->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$mount->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($mount);
|
||||
|
||||
$user = new Zend_Form_Element_Text('user');
|
||||
$user->setLabel(_("Username"))
|
||||
->setValue(isset($setting[$prefix.'_user'])?$setting[$prefix.'_user']:"")
|
||||
->setValue($useDefaults ? $streamDefaults['user'] :
|
||||
(isset($setting[$prefix.'_user'])?$setting[$prefix.'_user']:""))
|
||||
->setValidators(array(
|
||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$user->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$user->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($user);
|
||||
|
||||
|
@ -203,9 +176,6 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
->setValidators(array(
|
||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$adminUser->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$adminUser->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($adminUser);
|
||||
|
||||
|
@ -215,16 +185,16 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
->setValidators(array(
|
||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$adminPass->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$adminPass->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($adminPass);
|
||||
|
||||
$liquidsopa_error_msg = '<div class="stream-status status-info"><h3>'._('Getting information from the server...').'</h3></div>';
|
||||
$liquidsoap_error_msg = '<div class="stream-status status-info"><p>'._('Getting information from the server...').'</p></div>';
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/stream-setting-form.phtml', "stream_number"=>$stream_number, "enabled"=>$enable->getValue(), "liquidsoap_error_msg"=>$liquidsopa_error_msg))
|
||||
array('ViewScript', array('viewScript' => 'form/stream-setting-form.phtml',
|
||||
"stream_number"=>$stream_number,
|
||||
"enabled"=>$enable->getValue(),
|
||||
"liquidsoap_error_msg"=>$liquidsoap_error_msg))
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -232,26 +202,42 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
{
|
||||
$f_data = $data['s'.$this->prefix."_data"];
|
||||
$isValid = parent::isValid($f_data);
|
||||
if ($f_data['enable'] == 1) {
|
||||
if ($f_data['host'] == '') {
|
||||
$element = $this->getElement("host");
|
||||
$element->addError(_("Server cannot be empty."));
|
||||
$isValid = false;
|
||||
}
|
||||
if ($f_data['port'] == '') {
|
||||
$element = $this->getElement("port");
|
||||
$element->addError(_("Port cannot be empty."));
|
||||
$isValid = false;
|
||||
}
|
||||
if ($f_data['output'] == 'icecast') {
|
||||
if ($f_data['mount'] == '') {
|
||||
$element = $this->getElement("mount");
|
||||
$element->addError(_("Mount cannot be empty with Icecast server."));
|
||||
// XXX: A couple of ugly workarounds here, but I guess that's what you get when you
|
||||
// combine an already-complex POST and GET into a single action...
|
||||
if (Application_Model_Preference::getUsingCustomStreamSettings() && $f_data) {
|
||||
if ($f_data['enable'] == 1 && isset($f_data["host"])) {
|
||||
if ($f_data['host'] == '') {
|
||||
$element = $this->getElement("host");
|
||||
$element->addError(_("Server cannot be empty."));
|
||||
$isValid = false;
|
||||
}
|
||||
if ($f_data['port'] == '') {
|
||||
$element = $this->getElement("port");
|
||||
$element->addError(_("Port cannot be empty."));
|
||||
$isValid = false;
|
||||
}
|
||||
if ($f_data['output'] == 'icecast') {
|
||||
if ($f_data['mount'] == '') {
|
||||
$element = $this->getElement("mount");
|
||||
$element->addError(_("Mount cannot be empty with Icecast server."));
|
||||
$isValid = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $isValid;
|
||||
}
|
||||
|
||||
public function toggleState() {
|
||||
$elements = $this->getElements();
|
||||
foreach ($elements as $element) {
|
||||
if (Application_Model_Preference::getUsingCustomStreamSettings()) {
|
||||
$element->setAttrib('disabled', null);
|
||||
} else if (!(in_array($element->getName(), static::$customizable)
|
||||
|| $element->getType() == 'Zend_Form_Element_Hidden')) {
|
||||
$element->setAttrib('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,27 +50,82 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|||
|
||||
</script>
|
||||
|
||||
|
||||
<div id="nav">
|
||||
<div class="logo"></div>
|
||||
<div class="personal-block solo">
|
||||
<ol>
|
||||
<li>
|
||||
<!-- <span class="trial-box-button"><a title="Billing" href=<?php echo $baseUrl . 'billing/upgrade'?>>Upgrade</a></span> -->
|
||||
<a id="current-user" href=<?php echo $baseUrl . "User/edit-user"?>><span class="name"><?php echo $this->escape($this->loggedInAs()); ?></span></a>
|
||||
| <a href=<?php echo $baseUrl . "Login/logout"?>><?php echo _("Logout")?></a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<?php echo $this->navigation()->menu() ?>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
<?php endif; //suspended ?>
|
||||
</div>
|
||||
|
||||
<div id="media_type_nav"> <!-- class="content-pane" -->
|
||||
<div class="btn-group">
|
||||
<ul class="dropdown-menu">
|
||||
<li id="new-playlist">
|
||||
<a href="#"><?php echo _("Playlist") ?></a>
|
||||
</li>
|
||||
<li id="new-smart-block">
|
||||
<a href="#"><?php echo _("Smart Block") ?></a>
|
||||
</li>
|
||||
<li id="new-webstream">
|
||||
<a href="#"><?php echo _("Webstream") ?></a>
|
||||
</li>
|
||||
</ul>
|
||||
<a href="/Plupload">
|
||||
<button id="add_media_btn" class="btn btn-small dashboard-btn btn-new">
|
||||
<span><?php echo _("Upload") ?></span>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
<div class="media_type_selector top-link" data-selection-id="1">
|
||||
<a href="/showbuilder#"><i class='icon-home icon-white'></i><?php echo _("Dashboard") ?></a></div>
|
||||
<div class="media_type_selector dashboard_sub_nav" data-selection-id="1">
|
||||
<a href="/showbuilder#tracks"><i class='icon-music icon-white'></i><?php echo _("Tracks") ?></a></div>
|
||||
<div class="media_type_selector dashboard_sub_nav" data-selection-id="2">
|
||||
<a href="/showbuilder#playlists"><i class='icon-list icon-white'></i><?php echo _("Playlists") ?></a></div>
|
||||
<div class="media_type_selector dashboard_sub_nav" data-selection-id="3">
|
||||
<a href="/showbuilder#smart-blocks"><i class='icon-time icon-white'></i><?php echo _("Smart Blocks") ?></a></div>
|
||||
<div class="media_type_selector dashboard_sub_nav" data-selection-id="4">
|
||||
<a href="/showbuilder#webstreams"><i class='icon-random icon-white'></i><?php echo _("Webstreams") ?></a></div>
|
||||
<hr style="margin-left: 5px; margin-right: 5px">
|
||||
<div id="nav">
|
||||
<?php echo $this->navigation()->menu(); ?>
|
||||
</div>
|
||||
|
||||
<div class="wrapper" id="content"><?php echo $this->layout()->content ?></div>
|
||||
<?php
|
||||
$partitions = Application_Model_Systemstatus::GetDiskInfo();
|
||||
$status = new StdClass;
|
||||
$partitions = $partitions;
|
||||
$disk = $partitions[0];
|
||||
$used = $disk->totalSpace-$disk->totalFreeSpace;
|
||||
$total = $disk->totalSpace;
|
||||
?>
|
||||
<div id="disk_usage" style="height: 13px; position:fixed; bottom: 5px; left: 10px;">
|
||||
<!--<div style="padding-bottom: 2px;">Disk Usage</div>-->
|
||||
<div class="disk_usage_progress_bar"></div>
|
||||
<div class="disk_usage_percent_in_use"><?php echo sprintf("%01.1fGB of %01.1fGB", $used/pow(2, 30), $total/pow(2, 30)); ?></div>
|
||||
<div class="disk_usage_used" style="width:<?php echo sprintf("%01.1f%%", $used/$total*100) ?>;"></div>
|
||||
|
||||
<!--<div style="margin-top: 15px; font-size: 12px;">
|
||||
<?php //echo sprintf("%01.1fGB of %01.1fGB", $used/pow(2, 30), $total/pow(2, 30)); ?>
|
||||
</div>-->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php $hint = Application_Common_UsabilityHints::getUsabilityHint(); ?>
|
||||
<div class="usability_hint <?php if ($hint == "") { echo "hidden"; } ?>"><?php echo $hint; ?></div>
|
||||
|
||||
<div class="wrapper <?php if (isset($this->layout()->parent_page)) echo "wrapper_panel";?>" id="content">
|
||||
<?php echo $this->layout()->content ?>
|
||||
</div>
|
||||
<?php if (isset($this->layout()->parent_page)) { ?>
|
||||
<div id="sub-menu">
|
||||
<h3><?php //parent_page is passed in from controller
|
||||
echo $this->layout()->parent_page; ?></h3>
|
||||
<hr>
|
||||
<?php
|
||||
$page = $this->navigation()->findOneBy('title', $this->layout()->parent_page);
|
||||
echo $this->navigation()->menu()->renderMenu($page);
|
||||
?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<script id="tmpl-pl-cues" type="text/template">
|
||||
<div class="waveform-cues">
|
||||
|
@ -116,3 +171,4 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -30,13 +30,13 @@ class Application_Model_Auth
|
|||
$e_link_port = $_SERVER['SERVER_PORT'];
|
||||
$e_link_path = $view->url(array('user_id' => $user->getDbId(), 'token' => $token), 'password-change');
|
||||
|
||||
$message = sprintf(_("Hi %s, \n\nClick this link to reset your password: "), $user->getDbLogin());
|
||||
$message = sprintf(_("Hi %s, \n\nPlease click this link to reset your password: "), $user->getDbLogin());
|
||||
$message .= "{$e_link_protocol}://{$e_link_base}:{$e_link_port}{$e_link_path}";
|
||||
$message .= sprintf(_pro("\n\nIf you have any problems, please contact our support team: %s"), SUPPORT_EMAIL_ADDRESS);
|
||||
$message .= sprintf(_pro("\n\nThank you,\nThe %s Team"), SAAS_PRODUCT_BRANDING_NAME);
|
||||
|
||||
$str = sprintf(_('%s Password Reset'), PRODUCT_NAME);
|
||||
$success = Application_Model_Email::send($str, $message, $user->getDbEmail());
|
||||
|
||||
return $success;
|
||||
$str = sprintf(_('%s Password Reset'), SAAS_PRODUCT_BRANDING_NAME);
|
||||
return Application_Model_Email::send($str, $message, $user->getDbEmail());
|
||||
}
|
||||
|
||||
public function invalidateTokens($user, $action)
|
||||
|
|
|
@ -1517,27 +1517,27 @@ SQL;
|
|||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
// check if file exists
|
||||
$qry->add("file_exists", "true", Criteria::EQUAL);
|
||||
$qry->add("hidden", "false", Criteria::EQUAL);
|
||||
$sortTracks = 'random';
|
||||
if (isset($storedCrit['sort'])) {
|
||||
$sortTracks = $storedCrit['sort']['value'];
|
||||
}
|
||||
if ($sortTracks == 'newest') {
|
||||
$qry->addDescendingOrderByColumn('utime');
|
||||
}
|
||||
else if ($sortTracks == 'oldest') {
|
||||
$qry->addAscendingOrderByColumn('utime');
|
||||
}
|
||||
else if ($sortTracks == 'random') {
|
||||
$qry->addAscendingOrderByColumn('random()');
|
||||
} else {
|
||||
Logging::warning("Unimplemented sortTracks type in ".__FILE__);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// check if file exists
|
||||
$qry->add("file_exists", "true", Criteria::EQUAL);
|
||||
$qry->add("hidden", "false", Criteria::EQUAL);
|
||||
$sortTracks = 'random';
|
||||
if (isset($storedCrit['sort'])) {
|
||||
$sortTracks = $storedCrit['sort']['value'];
|
||||
}
|
||||
if ($sortTracks == 'newest') {
|
||||
$qry->addDescendingOrderByColumn('utime');
|
||||
}
|
||||
else if ($sortTracks == 'oldest') {
|
||||
$qry->addAscendingOrderByColumn('utime');
|
||||
}
|
||||
else if ($sortTracks == 'random') {
|
||||
$qry->addAscendingOrderByColumn('random()');
|
||||
} else {
|
||||
Logging::warning("Unimplemented sortTracks type in ".__FILE__);
|
||||
}
|
||||
|
||||
// construct limit restriction
|
||||
$limits = array();
|
||||
|
||||
|
|
|
@ -69,8 +69,7 @@ class Application_Model_Datatables
|
|||
|
||||
if (isset($data['advSearch']) && $data['advSearch'] === 'true') {
|
||||
|
||||
$librarySetting =
|
||||
Application_Model_Preference::getCurrentLibraryTableColumnMap();
|
||||
$librarySetting = Application_Model_Preference::getCurrentLibraryTableColumnMap();
|
||||
//$displayColumns[] = 'owner';
|
||||
|
||||
// map that maps original column position to db name
|
||||
|
|
|
@ -2,75 +2,20 @@
|
|||
|
||||
class Application_Model_Email
|
||||
{
|
||||
|
||||
/**
|
||||
* Send email
|
||||
*
|
||||
* @param string $subject
|
||||
* @param string $message
|
||||
* @param mixed $tos
|
||||
* @return void
|
||||
* @param mixed $to
|
||||
* @return boolean
|
||||
*/
|
||||
public static function send($subject, $message, $tos, $from = null)
|
||||
{
|
||||
$mailServerConfigured = Application_Model_Preference::GetMailServerConfigured() == true ? true : false;
|
||||
$mailServerRequiresAuth = Application_Model_Preference::GetMailServerRequiresAuth() == true ? true : false;
|
||||
$success = true;
|
||||
public static function send($subject, $message, $to) {
|
||||
|
||||
if ($mailServerConfigured) {
|
||||
$mailServer = Application_Model_Preference::GetMailServer();
|
||||
$mailServerPort = Application_Model_Preference::GetMailServerPort();
|
||||
if (!empty($mailServerPort)) {
|
||||
$port = $mailServerPort;
|
||||
}
|
||||
|
||||
if ($mailServerRequiresAuth) {
|
||||
$username = Application_Model_Preference::GetMailServerEmailAddress();
|
||||
$password = Application_Model_Preference::GetMailServerPassword();
|
||||
|
||||
$config = array(
|
||||
'auth' => 'login',
|
||||
'ssl' => 'ssl',
|
||||
'username' => $username,
|
||||
'password' => $password
|
||||
);
|
||||
} else {
|
||||
$config = array(
|
||||
'ssl' => 'tls'
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($port)) {
|
||||
$config['port'] = $port;
|
||||
}
|
||||
|
||||
$transport = new Zend_Mail_Transport_Smtp($mailServer, $config);
|
||||
}
|
||||
|
||||
$mail = new Zend_Mail('utf-8');
|
||||
$mail->setSubject($subject);
|
||||
$mail->setBodyText($message);
|
||||
|
||||
foreach ((array) $tos as $to) {
|
||||
$mail->addTo($to);
|
||||
}
|
||||
|
||||
if ($mailServerConfigured) {
|
||||
$mail->setFrom(isset($from) ? $from : Application_Model_Preference::GetMailServerEmailAddress());
|
||||
try {
|
||||
$mail->send($transport);
|
||||
} catch (Exception $e) {
|
||||
$success = false;
|
||||
}
|
||||
} else {
|
||||
$mail->setFrom(isset($from) ? $from : Application_Model_Preference::GetSystemEmail());
|
||||
try {
|
||||
$mail->send();
|
||||
} catch (Exception $e) {
|
||||
$success = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $success;
|
||||
$headers = sprintf('From: %s <noreply@account.sourcefabric.com>', SAAS_PRODUCT_BRANDING_NAME);
|
||||
return mail($to, $subject, $message, $headers);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ class Application_Model_Library
|
|||
$info['className'] = 'Application_Model_Playlist';
|
||||
} elseif (strcmp($p_type, 'block')==0) {
|
||||
$info['className'] = 'Application_Model_Block';
|
||||
} elseif (strcmp($p_type, 'stream')==0) {
|
||||
} elseif (strcmp($p_type, 'webstream')==0) {
|
||||
$info['className'] = 'Application_Model_Webstream';
|
||||
} else {
|
||||
throw new Exception("Unknown object type: '$p_type'");
|
||||
|
|
|
@ -28,7 +28,9 @@ class Application_Model_Preference
|
|||
{
|
||||
$cache = new Cache();
|
||||
$con = Propel::getConnection(CcPrefPeer::DATABASE_NAME);
|
||||
$con->beginTransaction();
|
||||
|
||||
//We are using row-level locking in Postgres via "FOR UPDATE" instead of a transaction here
|
||||
//because sometimes this function needs to be called while a transaction is already started.
|
||||
|
||||
try {
|
||||
/* Comment this out while we reevaluate it in favor of a unique constraint
|
||||
|
@ -40,7 +42,7 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
//Check if key already exists
|
||||
$sql = "SELECT COUNT(*) FROM cc_pref"
|
||||
$sql = "SELECT valstr FROM cc_pref"
|
||||
." WHERE keystr = :key";
|
||||
|
||||
$paramMap = array();
|
||||
|
@ -52,9 +54,11 @@ class Application_Model_Preference
|
|||
$paramMap[':id'] = $userId;
|
||||
}
|
||||
|
||||
$sql .= " FOR UPDATE";
|
||||
|
||||
$result = Application_Common_Database::prepareAndExecute($sql,
|
||||
$paramMap,
|
||||
Application_Common_Database::COLUMN,
|
||||
Application_Common_Database::ROW_COUNT,
|
||||
PDO::FETCH_ASSOC,
|
||||
$con);
|
||||
|
||||
|
@ -99,13 +103,11 @@ class Application_Model_Preference
|
|||
|
||||
Application_Common_Database::prepareAndExecute($sql,
|
||||
$paramMap,
|
||||
'execute',
|
||||
Application_Common_Database::EXECUTE,
|
||||
PDO::FETCH_ASSOC,
|
||||
$con);
|
||||
|
||||
$con->commit();
|
||||
} catch (Exception $e) {
|
||||
$con->rollback();
|
||||
header('HTTP/1.0 503 Service Unavailable');
|
||||
Logging::info("Database error: ".$e->getMessage());
|
||||
exit;
|
||||
|
@ -203,7 +205,7 @@ class Application_Model_Preference
|
|||
if (strlen($title) > 0)
|
||||
$title .= " - ";
|
||||
|
||||
return $title."Airtime";
|
||||
return $title.PRODUCT_NAME;
|
||||
}
|
||||
|
||||
public static function SetHeadTitle($title, $view=null)
|
||||
|
@ -477,10 +479,6 @@ class Application_Model_Preference
|
|||
|
||||
public static function SetUserTimezone($timezone = null)
|
||||
{
|
||||
// When a new user is created they will get the default timezone
|
||||
// setting which the admin sets on preferences page
|
||||
if (is_null($timezone))
|
||||
$timezone = self::GetDefaultTimezone();
|
||||
self::setValue("user_timezone", $timezone, true);
|
||||
}
|
||||
|
||||
|
@ -520,10 +518,10 @@ class Application_Model_Preference
|
|||
public static function GetUserLocale()
|
||||
{
|
||||
$locale = self::getValue("user_locale", true);
|
||||
if (!$locale) {
|
||||
// empty() checks for null and empty strings - more robust than !val
|
||||
if (empty($locale)) {
|
||||
return self::GetDefaultLocale();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return $locale;
|
||||
}
|
||||
}
|
||||
|
@ -1096,6 +1094,13 @@ class Application_Model_Preference
|
|||
|
||||
public static function GetSourceSwitchStatus($sourcename)
|
||||
{
|
||||
// Scheduled play switch should always be "on".
|
||||
// Even though we've hidden this element in the dashboard we should
|
||||
// always make sure it's on or else a station's stream could go offline.
|
||||
if ($sourcename == "scheduled_play") {
|
||||
return "on";
|
||||
}
|
||||
|
||||
$value = self::getValue($sourcename."_switch");
|
||||
return ($value == null || $value == "off") ? 'off' : 'on';
|
||||
}
|
||||
|
@ -1161,87 +1166,6 @@ class Application_Model_Preference
|
|||
{
|
||||
return self::getValue("auto_switch");
|
||||
}
|
||||
|
||||
public static function SetEnableSystemEmail($upload)
|
||||
{
|
||||
self::setValue("enable_system_email", $upload);
|
||||
}
|
||||
|
||||
public static function GetEnableSystemEmail()
|
||||
{
|
||||
$v = self::getValue("enable_system_email");
|
||||
return ($v === "") ? 0 : $v;
|
||||
}
|
||||
|
||||
public static function SetSystemEmail($value)
|
||||
{
|
||||
self::setValue("system_email", $value, false);
|
||||
}
|
||||
|
||||
public static function GetSystemEmail()
|
||||
{
|
||||
return self::getValue("system_email");
|
||||
}
|
||||
|
||||
public static function SetMailServerConfigured($value)
|
||||
{
|
||||
self::setValue("mail_server_configured", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServerConfigured()
|
||||
{
|
||||
return self::getValue("mail_server_configured");
|
||||
}
|
||||
|
||||
public static function SetMailServer($value)
|
||||
{
|
||||
self::setValue("mail_server", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServer()
|
||||
{
|
||||
return self::getValue("mail_server");
|
||||
}
|
||||
|
||||
public static function SetMailServerEmailAddress($value)
|
||||
{
|
||||
self::setValue("mail_server_email_address", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServerEmailAddress()
|
||||
{
|
||||
return self::getValue("mail_server_email_address");
|
||||
}
|
||||
|
||||
public static function SetMailServerPassword($value)
|
||||
{
|
||||
self::setValue("mail_server_password", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServerPassword()
|
||||
{
|
||||
return self::getValue("mail_server_password");
|
||||
}
|
||||
|
||||
public static function SetMailServerPort($value)
|
||||
{
|
||||
self::setValue("mail_server_port", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServerPort()
|
||||
{
|
||||
return self::getValue("mail_server_port");
|
||||
}
|
||||
|
||||
public static function SetMailServerRequiresAuth($value)
|
||||
{
|
||||
self::setValue("mail_server_requires_auth", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServerRequiresAuth()
|
||||
{
|
||||
return self::getValue("mail_server_requires_auth");
|
||||
}
|
||||
/* User specific preferences end */
|
||||
|
||||
public static function ShouldShowPopUp()
|
||||
|
@ -1512,6 +1436,29 @@ class Application_Model_Preference
|
|||
self::setValue("task_manager_lock", $value);
|
||||
}
|
||||
|
||||
// SAAS-876 - Toggle indicating whether user is using custom stream settings
|
||||
|
||||
public static function getUsingCustomStreamSettings() {
|
||||
$val = self::getValue("using_custom_stream_settings");
|
||||
return empty($val) ? false : $val;
|
||||
}
|
||||
|
||||
public static function setUsingCustomStreamSettings($value) {
|
||||
self::setValue("using_custom_stream_settings", $value);
|
||||
}
|
||||
|
||||
// SAAS-876 - Store the default Icecast password to restore when switching
|
||||
// back to Airtime Pro streaming settings
|
||||
|
||||
public static function getDefaultIcecastPassword() {
|
||||
$val = self::getValue("default_icecast_password");
|
||||
return empty($val) ? DEFAULT_ICECAST_PASS : $val;
|
||||
}
|
||||
|
||||
public static function setDefaultIcecastPassword($value) {
|
||||
self::setValue("default_icecast_password", $value);
|
||||
}
|
||||
|
||||
public static function getRadioPageDisplayLoginButton()
|
||||
{
|
||||
return self::getValue("radio_page_display_login_button");
|
||||
|
@ -1521,4 +1468,14 @@ class Application_Model_Preference
|
|||
{
|
||||
self::setValue("radio_page_display_login_button", $value);
|
||||
}
|
||||
|
||||
public static function getLangTimezoneSetupComplete()
|
||||
{
|
||||
return self::getValue("lang_tz_setup_complete");
|
||||
}
|
||||
|
||||
public static function setLangTimezoneSetupComplete($value)
|
||||
{
|
||||
self::setValue("lang_tz_setup_complete", $value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -215,6 +215,7 @@ SQL;
|
|||
$currentMedia["ends"] = $currentMedia["show_ends"];
|
||||
}
|
||||
|
||||
$currentMediaName = "";
|
||||
$currentMediaFileId = $currentMedia["file_id"];
|
||||
$currentMediaStreamId = $currentMedia["stream_id"];
|
||||
if (isset($currentMediaFileId)) {
|
||||
|
@ -256,6 +257,7 @@ SQL;
|
|||
->orderByDbStarts(Criteria::DESC)
|
||||
->findOne();
|
||||
if (isset($previousMedia)) {
|
||||
$previousMediaName = "";
|
||||
$previousMediaFileId = $previousMedia->getDbFileId();
|
||||
$previousMediaStreamId = $previousMedia->getDbStreamId();
|
||||
if (isset($previousMediaFileId)) {
|
||||
|
@ -288,6 +290,7 @@ SQL;
|
|||
->orderByDbStarts(Criteria::ASC)
|
||||
->findOne();
|
||||
if (isset($nextMedia)) {
|
||||
$nextMediaName = "";
|
||||
$nextMediaFileId = $nextMedia->getDbFileId();
|
||||
$nextMediaStreamId = $nextMedia->getDbStreamId();
|
||||
if (isset($nextMediaFileId)) {
|
||||
|
@ -1016,9 +1019,11 @@ SQL;
|
|||
$media_id = $item['file_id'];
|
||||
$storedFile = Application_Model_StoredFile::RecallById($media_id);
|
||||
$file = $storedFile->getPropelOrm();
|
||||
$uri = $file->getAbsoluteFilePath();
|
||||
//Even local files are downloaded through the REST API in case we need to transform
|
||||
//their filenames (eg. in the case of a bad file extension, because Liquidsoap won't play them)
|
||||
$uri = Application_Common_HTTPHelper::getStationUrl() . "/rest/media/" . $media_id;
|
||||
//$uri = $file->getAbsoluteFilePath();
|
||||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
$filesize = $file->getFileSize();
|
||||
self::createFileScheduleEvent($data, $item, $media_id, $uri, $filesize);
|
||||
}
|
||||
|
|
|
@ -412,6 +412,8 @@ class Application_Model_Scheduler
|
|||
|
||||
private function findNextStartTime($DT, $instanceId)
|
||||
{
|
||||
// TODO: there is at least one case where this function creates a filler block with
|
||||
// an incorrect length; should keep an eye on it
|
||||
$sEpoch = $DT->format("U.u");
|
||||
$nEpoch = $this->epochNow;
|
||||
|
||||
|
@ -450,73 +452,58 @@ class Application_Model_Scheduler
|
|||
private function calculateCrossfades($instanceId)
|
||||
{
|
||||
Logging::info("adjusting start, end times of scheduled items to account for crossfades show instance #".$instanceId);
|
||||
|
||||
$sql = "SELECT * FROM cc_show_instances ".
|
||||
"WHERE id = {$instanceId}";
|
||||
$instance = Application_Common_Database::prepareAndExecute(
|
||||
$sql, array(), Application_Common_Database::SINGLE);
|
||||
$instance = CcShowInstancesQuery::create()->findPk($instanceId);
|
||||
|
||||
if (is_null($instance)) {
|
||||
throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!"));
|
||||
}
|
||||
|
||||
$itemStartDT = new DateTime($instance["starts"], new DateTimeZone("UTC"));
|
||||
$itemEndDT = null;
|
||||
|
||||
$schedule_sql = "SELECT * FROM cc_schedule ".
|
||||
"WHERE instance_id = {$instanceId} ".
|
||||
"ORDER BY starts";
|
||||
$schedule = Application_Common_Database::prepareAndExecute($schedule_sql);
|
||||
$schedule = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($instanceId)
|
||||
->orderByDbStarts()
|
||||
->find($this->con);
|
||||
|
||||
$itemStartDT = $instance->getDbStarts(null);
|
||||
foreach ($schedule as $item) {
|
||||
$itemEndDT = $this->findEndTime($itemStartDT, $item["clip_length"]);
|
||||
|
||||
$update_sql = "UPDATE cc_schedule SET ".
|
||||
"starts = '{$itemStartDT->format(DEFAULT_MICROTIME_FORMAT)}', ".
|
||||
"ends = '{$itemEndDT->format(DEFAULT_MICROTIME_FORMAT)}' ".
|
||||
"WHERE id = {$item["id"]}";
|
||||
Application_Common_Database::prepareAndExecute(
|
||||
$update_sql, array(), Application_Common_Database::EXECUTE);
|
||||
|
||||
$itemEndDT = $this->findEndTime($itemStartDT, $item->getDbClipLength());
|
||||
Logging::info($itemEndDT);
|
||||
$item->setDbStarts($itemStartDT)
|
||||
->setDbEnds($itemEndDT)
|
||||
->save($this->con);
|
||||
$itemStartDT = $this->findTimeDifference($itemEndDT, $this->crossfadeDuration);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* @param int $showInstance
|
||||
* @param array $exclude
|
||||
* ids of sched items to remove from the calulation.
|
||||
* This function squeezes all items of a show together so that
|
||||
* there are no gaps between them.
|
||||
*/
|
||||
* @param array $exclude
|
||||
* ids of sched items to remove from the calculation.
|
||||
* This function squeezes all items of a show together so that
|
||||
* there are no gaps between them.
|
||||
*/
|
||||
public function removeGaps($showInstance, $exclude=null)
|
||||
{
|
||||
Logging::info("removing gaps from show instance #".$showInstance);
|
||||
|
||||
$instance = CcShowInstancesQuery::create()->findPK($showInstance, $this->con);
|
||||
$instance = CcShowInstancesQuery::create()->findPk($showInstance, $this->con);
|
||||
if (is_null($instance)) {
|
||||
throw new OutDatedScheduleException(_("The schedule you're viewing is out of date!"));
|
||||
}
|
||||
|
||||
$itemStartDT = $instance->getDbStarts(null);
|
||||
|
||||
$schedule = CcScheduleQuery::create()
|
||||
->filterByDbInstanceId($showInstance)
|
||||
->filterByDbId($exclude, Criteria::NOT_IN)
|
||||
->orderByDbStarts()
|
||||
->find($this->con);
|
||||
|
||||
$itemStartDT = $instance->getDbStarts(null);
|
||||
foreach ($schedule as $item) {
|
||||
|
||||
$itemEndDT = $this->findEndTime($itemStartDT, $item->getDbClipLength());
|
||||
|
||||
$item->setDbStarts($itemStartDT)
|
||||
->setDbEnds($itemEndDT);
|
||||
|
||||
$itemStartDT = $itemEndDT;
|
||||
->setDbEnds($itemEndDT)
|
||||
->save($this->con);
|
||||
$itemStartDT = $this->findTimeDifference($itemEndDT, $this->crossfadeDuration);
|
||||
}
|
||||
|
||||
$schedule->save($this->con);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -67,7 +67,6 @@ class Application_Model_Show
|
|||
public function getColor()
|
||||
{
|
||||
$show = CcShowQuery::create()->findPK($this->_showId);
|
||||
|
||||
return $show->getDbColor();
|
||||
}
|
||||
|
||||
|
@ -111,7 +110,12 @@ class Application_Model_Show
|
|||
{
|
||||
$show = CcShowQuery::create()->findPK($this->_showId);
|
||||
|
||||
return $show->getDbBackgroundColor();
|
||||
$color = $show->getDbBackgroundColor();
|
||||
if (empty($color)) {
|
||||
return DEFAULT_SHOW_COLOR;
|
||||
} else {
|
||||
return $color;
|
||||
}
|
||||
}
|
||||
|
||||
public function setBackgroundColor($backgroundColor)
|
||||
|
@ -843,14 +847,24 @@ SQL;
|
|||
*/
|
||||
public static function createAndFillShowInstancesPastPopulatedUntilDate($needScheduleUntil)
|
||||
{
|
||||
//UTC DateTime object
|
||||
$showsPopUntil = Application_Model_Preference::GetShowsPopulatedUntil();
|
||||
//if application is requesting shows past our previous populated until date, generate shows up until this point.
|
||||
if (is_null($showsPopUntil) || $showsPopUntil->getTimestamp() < $needScheduleUntil->getTimestamp()) {
|
||||
$service_show = new Application_Service_ShowService();
|
||||
$ccShow = $service_show->delegateInstanceCreation(null, $needScheduleUntil, true);
|
||||
Application_Model_Preference::SetShowsPopulatedUntil($needScheduleUntil);
|
||||
$con = Propel::getConnection(CcPrefPeer::DATABASE_NAME);
|
||||
try {
|
||||
$con->beginTransaction();
|
||||
|
||||
//UTC DateTime object
|
||||
$showsPopUntil = Application_Model_Preference::GetShowsPopulatedUntil();
|
||||
//if application is requesting shows past our previous populated until date, generate shows up until this point.
|
||||
if (is_null($showsPopUntil) || $showsPopUntil->getTimestamp() < $needScheduleUntil->getTimestamp()) {
|
||||
$service_show = new Application_Service_ShowService();
|
||||
$ccShow = $service_show->delegateInstanceCreation(null, $needScheduleUntil, true);
|
||||
Application_Model_Preference::SetShowsPopulatedUntil($needScheduleUntil);
|
||||
}
|
||||
$con->commit();
|
||||
} catch (Exception $e) {
|
||||
$con->rollBack();
|
||||
throw $e;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1035,8 +1049,10 @@ SQL;
|
|||
$event["textColor"] = "#".$show["color"];
|
||||
}
|
||||
|
||||
if ($show["background_color"] != "") {
|
||||
$event["color"] = "#".$show["background_color"];
|
||||
if (!empty($show["background_color"])) {
|
||||
$event["color"] = "#" . $show["background_color"];
|
||||
} else {
|
||||
$event["color"] = "#" . self::getDefaultBackgroundColor($startsDT);//DEFAULT_SHOW_COLOR;
|
||||
}
|
||||
|
||||
foreach ($options as $key => $value) {
|
||||
|
@ -1048,6 +1064,22 @@ SQL;
|
|||
return $events;
|
||||
}
|
||||
|
||||
/** Get a palettized colour for the show. */
|
||||
private static function getDefaultBackgroundColor($date) {
|
||||
|
||||
$palette = [['42d5a1', '56bd99', '65ab93', '7b938b'],
|
||||
['42a4d5', '569bbd', '6594ab', '7b8b93'],
|
||||
['4264d5', '566fbd', '6576ab', '7b8193']];
|
||||
|
||||
//$hashValue = (md5($date->format('d'))[0] % $cols) + ((intval($date->format('h'))/24) % $rows);
|
||||
$row = intval($date->format('d')) % sizeof($palette);
|
||||
$foo = $date->format('H');
|
||||
$col = intval(intval($date->format('H'))/24.0 * sizeof($palette[0]));
|
||||
//$color = $palette[$hashValue % sizeof($palette)];
|
||||
$color = $palette[$row][$col];
|
||||
return $color;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the percentage of a show scheduled given the start and end times in date/time format
|
||||
* and the time_filled as the total time the schow is scheduled for in time format.
|
||||
|
|
|
@ -107,7 +107,7 @@ class Application_Model_ShowBuilder
|
|||
private function getItemColor($p_item, &$row)
|
||||
{
|
||||
$defaultColor = "ffffff";
|
||||
$defaultBackground = "3366cc";
|
||||
$defaultBackground = DEFAULT_SHOW_COLOR;
|
||||
|
||||
$color = $p_item["show_color"];
|
||||
if ($color === '') {
|
||||
|
|
|
@ -899,6 +899,7 @@ SQL;
|
|||
// any data from the db for these and datatables will complain
|
||||
$row['checkbox'] = "";
|
||||
$row['image'] = "";
|
||||
$row['options'] = "";
|
||||
|
||||
$type = substr($row['ftype'], 0, 2);
|
||||
$row['tr_id'] = "{$type}_{$row['id']}";
|
||||
|
|
|
@ -246,6 +246,10 @@ class Application_Model_StreamSetting
|
|||
} elseif (is_array($d)) {
|
||||
$temp = explode('_', $key);
|
||||
$prefix = $temp[0];
|
||||
// SAAS-876 - If we're using Airtime Pro streaming, set the stream to use the default settings
|
||||
if (!Application_Model_Preference::getUsingCustomStreamSettings()) {
|
||||
$d = array_merge($d, static::getDefaults($prefix));
|
||||
}
|
||||
foreach ($d as $k => $v) {
|
||||
$keyname = $prefix . "_" . $k;
|
||||
if ($k == 'enable') {
|
||||
|
@ -265,8 +269,28 @@ class Application_Model_StreamSetting
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SAAS-876 - Get the default stream settings values for Airtime Pro streaming
|
||||
*
|
||||
* @param int $prefix
|
||||
*
|
||||
* @return array array of default stream setting values
|
||||
*/
|
||||
public static function getDefaults($prefix) {
|
||||
$config = Config::getConfig();
|
||||
return array(
|
||||
'host' => $config['stationId'] . ".out.airtime.pro",
|
||||
'port' => DEFAULT_ICECAST_PORT,
|
||||
'output' => 'icecast',
|
||||
'user' => $config['stationId'],
|
||||
'pass' => Application_Model_Preference::getDefaultIcecastPassword(),
|
||||
// Kind of ugly... convert prefix int to ascii char
|
||||
'mount' => $config['stationId'] . '_' . chr($prefix[1] + 96),
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets indivisual stream setting.
|
||||
* Sets individual stream setting.
|
||||
*
|
||||
* $data - data array. $data is [].
|
||||
* TODO: Make this SQL a prepared statement!
|
||||
|
|
|
@ -149,7 +149,7 @@ class CcFiles extends BaseCcFiles {
|
|||
|
||||
//Only accept files with a file extension that we support.
|
||||
$fileExtension = pathinfo($originalFilename, PATHINFO_EXTENSION);
|
||||
if (!in_array(strtolower($fileExtension), explode(",", "ogg,mp3,oga,flac,wav,m4a,mp4,opus"))) {
|
||||
if (!in_array(strtolower($fileExtension), array_values(FileDataHelper::getAudioMimeTypeArray()))) {
|
||||
throw new Exception("Bad file extension.");
|
||||
}
|
||||
|
||||
|
@ -363,14 +363,6 @@ class CcFiles extends BaseCcFiles {
|
|||
unset($response[$key]);
|
||||
}
|
||||
|
||||
$mime = $file->getDbMime();
|
||||
if (!empty($mime)) {
|
||||
// Get an extension based on the file's mime type and change the path to use this extension
|
||||
$path = pathinfo($file->getDbFilepath());
|
||||
$ext = FileDataHelper::getFileExtensionFromMime($mime);
|
||||
$response["filepath"] = ($path["dirname"] . '/' . $path["filename"] . $ext);
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
@ -385,8 +377,12 @@ class CcFiles extends BaseCcFiles {
|
|||
public function getFilename()
|
||||
{
|
||||
$info = pathinfo($this->getAbsoluteFilePath());
|
||||
|
||||
//filename doesn't contain the extension because PHP is awful
|
||||
return $info['filename'].".".$info['extension'];
|
||||
$mime = $this->getDbMime();
|
||||
$extension = FileDataHelper::getFileExtensionFromMime($mime);
|
||||
|
||||
return $info['filename'] . $extension;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -70,6 +70,8 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
|
|||
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEIN;
|
||||
$this->save();
|
||||
|
||||
//FIXME(XXX): Propel silently drops the milliseconds from our fadein time. :(
|
||||
|
||||
return $this;
|
||||
} // setDbFadein()
|
||||
|
||||
|
@ -108,6 +110,8 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents {
|
|||
$this->modifiedColumns[] = CcPlaylistcontentsPeer::FADEOUT;
|
||||
$this->save();
|
||||
|
||||
//FIXME(XXX): Propel silently drops the milliseconds from our fadeout time. :(
|
||||
|
||||
return $this;
|
||||
} // setDbFadeout()
|
||||
|
||||
|
|
|
@ -18,6 +18,11 @@ class CcSubjs extends BaseCcSubjs {
|
|||
return $this->type === UTYPE_SUPERADMIN || $this->type === UTYPE_ADMIN || $this->type === UTYPE_PROGRAM_MANAGER;
|
||||
}
|
||||
|
||||
public function isSuperAdmin()
|
||||
{
|
||||
return $this->type === UTYPE_SUPERADMIN;
|
||||
}
|
||||
|
||||
public function isHostOfShow($showId)
|
||||
{
|
||||
return CcShowHostsQuery::create()
|
||||
|
|
|
@ -32,7 +32,7 @@ class CloudFile extends BaseCloudFile
|
|||
if ($this->proxyStorageBackend == null) {
|
||||
$this->proxyStorageBackend = new ProxyStorageBackend($this->getStorageBackend());
|
||||
}
|
||||
return $this->proxyStorageBackend->getDownloadURLs($this->getResourceId());
|
||||
return $this->proxyStorageBackend->getDownloadURLs($this->getResourceId(), $this->getFilename());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -49,7 +49,14 @@ class CloudFile extends BaseCloudFile
|
|||
|
||||
public function getFilename()
|
||||
{
|
||||
return $this->getDbFilepath();
|
||||
$filename = $this->getDbFilepath();
|
||||
$info = pathinfo($filename);
|
||||
|
||||
//Add the correct file extension based on the MIME type, for files that were uploaded with the wrong extension.
|
||||
$mime = $this->getDbMime();
|
||||
$extension = FileDataHelper::getFileExtensionFromMime($mime);
|
||||
|
||||
return $info['filename'] . $extension;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -57,7 +57,8 @@ class Application_Service_CalendarService
|
|||
}
|
||||
} else {
|
||||
$menu["content"] = array(
|
||||
"name"=> _("Show Content"),
|
||||
// "name"=> _("Show Content"),
|
||||
"name"=> _("View"),
|
||||
"icon" => "overview",
|
||||
"url" => $baseUrl."schedule/show-content-dialog");
|
||||
}
|
||||
|
@ -76,12 +77,24 @@ class Application_Service_CalendarService
|
|||
if (!$showIsLinked || ($showIsLinked && $currentShowId != $this->ccShow->getDbId())) {
|
||||
|
||||
$menu["schedule"] = array(
|
||||
"name"=> _("Add / Remove Content"),
|
||||
// "name"=> _("Add / Remove Content"),
|
||||
"name" => _("Schedule Tracks"),
|
||||
"icon" => "add-remove-content",
|
||||
"url" => $baseUrl."showbuilder/builder-dialog/");
|
||||
}
|
||||
}
|
||||
|
||||
//"Show Content" should be a menu item at all times except when
|
||||
//the show is recorded
|
||||
if (!$this->ccShowInstance->isRecorded()) {
|
||||
|
||||
$menu["content"] = array(
|
||||
// "name"=> _("Show Content"),
|
||||
"name"=> _("View"),
|
||||
"icon" => "overview",
|
||||
"url" => $baseUrl."schedule/show-content-dialog");
|
||||
}
|
||||
|
||||
//user can remove all content if the show has not started
|
||||
if ($now < $start && ($isAdminOrPM || $isHostOfShow) && !$this->ccShowInstance->isRecorded() ) {
|
||||
//if the show is not linked OR if the show is linked AND not the current playing show
|
||||
|
@ -89,32 +102,27 @@ class Application_Service_CalendarService
|
|||
if (!$showIsLinked || ($showIsLinked && $currentShowId != $this->ccShow->getDbId())) {
|
||||
|
||||
$menu["clear"] = array(
|
||||
"name"=> _("Remove All Content"),
|
||||
"icon" => "remove-all-content",
|
||||
"url" => $baseUrl."schedule/clear-show");
|
||||
// "name"=> _("Remove All Content"),
|
||||
"name"=> _("Clear Show"),
|
||||
"icon" => "remove-all-content",
|
||||
"url" => $baseUrl."schedule/clear-show");
|
||||
}
|
||||
}
|
||||
|
||||
//"Show Content" should be a menu item at all times except when
|
||||
//the show is recorded
|
||||
if (!$this->ccShowInstance->isRecorded()) {
|
||||
|
||||
$menu["content"] = array(
|
||||
"name"=> _("Show Content"),
|
||||
"icon" => "overview",
|
||||
"url" => $baseUrl."schedule/show-content-dialog");
|
||||
}
|
||||
|
||||
//show is currently playing and user is admin
|
||||
if ($start <= $now && $now < $end && $isAdminOrPM) {
|
||||
// Menu separator
|
||||
$menu["sep1"] = "-----------";
|
||||
|
||||
if ($this->ccShowInstance->isRecorded()) {
|
||||
$menu["cancel_recorded"] = array(
|
||||
"name"=> _("Cancel Current Show"),
|
||||
// "name"=> _("Cancel Current Show"),
|
||||
"name"=> _("Cancel Show"),
|
||||
"icon" => "delete");
|
||||
} else {
|
||||
$menu["cancel"] = array(
|
||||
"name"=> _("Cancel Current Show"),
|
||||
// "name"=> _("Cancel Current Show"),
|
||||
"name"=> _("Cancel Show"),
|
||||
"icon" => "delete");
|
||||
}
|
||||
}
|
||||
|
@ -128,10 +136,14 @@ class Application_Service_CalendarService
|
|||
}
|
||||
|
||||
if (!$this->ccShowInstance->isRebroadcast() && $isAdminOrPM) {
|
||||
// Menu separator
|
||||
$menu["sep2"] = "-----------";
|
||||
|
||||
if ($isRepeating) {
|
||||
if ($populateInstance) {
|
||||
$menu["edit"] = array(
|
||||
"name" => _("Edit This Instance"),
|
||||
// "name" => _("Edit This Instance"),
|
||||
"name" => _("Edit Instance"),
|
||||
"icon" => "edit",
|
||||
"url" => $baseUrl . "Schedule/populate-repeating-show-instance-form"
|
||||
);
|
||||
|
@ -149,7 +161,8 @@ class Application_Service_CalendarService
|
|||
);
|
||||
|
||||
$menu["edit"]["items"]["instance"] = array(
|
||||
"name" => _("Edit This Instance"),
|
||||
// "name" => _("Edit This Instance"),
|
||||
"name" => _("Edit Instance"),
|
||||
"icon" => "edit",
|
||||
"url" => $baseUrl . "Schedule/populate-repeating-show-instance-form"
|
||||
);
|
||||
|
@ -165,6 +178,9 @@ class Application_Service_CalendarService
|
|||
|
||||
//show hasn't started yet and user is admin
|
||||
if ($now < $start && $isAdminOrPM) {
|
||||
// Menu separator
|
||||
$menu["sep3"] = "-----------";
|
||||
|
||||
//show is repeating so give user the option to delete all
|
||||
//repeating instances or just the one
|
||||
if ($isRepeating) {
|
||||
|
@ -174,12 +190,14 @@ class Application_Service_CalendarService
|
|||
"items" => array());
|
||||
|
||||
$menu["del"]["items"]["single"] = array(
|
||||
"name"=> _("Delete This Instance"),
|
||||
// "name"=> _("Delete This Instance"),
|
||||
"name"=> _("Delete Instance"),
|
||||
"icon" => "delete",
|
||||
"url" => $baseUrl."schedule/delete-show-instance");
|
||||
|
||||
$menu["del"]["items"]["following"] = array(
|
||||
"name"=> _("Delete This Instance and All Following"),
|
||||
// "name"=> _("Delete This Instance and All Following"),
|
||||
"name"=> _("Delete Instance and All Following"),
|
||||
"icon" => "delete",
|
||||
"url" => $baseUrl."schedule/delete-show");
|
||||
} elseif ($populateInstance) {
|
||||
|
|
|
@ -62,6 +62,7 @@ class Application_Service_MediaService
|
|||
|
||||
if ($media->getPropelOrm()->isValidPhysicalFile()) {
|
||||
$filename = $media->getPropelOrm()->getFilename();
|
||||
|
||||
//Download user left clicks a track and selects Download.
|
||||
if (!$inline) {
|
||||
//We are using Content-Disposition to specify
|
||||
|
|
|
@ -169,6 +169,9 @@ class Application_Service_ShowFormService
|
|||
}
|
||||
}
|
||||
|
||||
//Disable starting a show 'now' when editing an existing show.
|
||||
$form->getElement('add_show_start_now')->setAttrib('disable', array('now'));
|
||||
|
||||
$form->populate(
|
||||
array(
|
||||
'add_show_start_date' => $showStart->format("Y-m-d"),
|
||||
|
@ -225,8 +228,12 @@ class Application_Service_ShowFormService
|
|||
$form->disableStartDateAndTime();
|
||||
}
|
||||
|
||||
//Disable starting a show 'now' when editing an existing show.
|
||||
$form->getElement('add_show_start_now')->setAttrib('disable', array('now'));
|
||||
|
||||
$form->populate(
|
||||
array(
|
||||
'add_show_start_now' => 'future',
|
||||
'add_show_start_date' => $showStart->format("Y-m-d"),
|
||||
'add_show_start_time' => $showStart->format("H:i"),
|
||||
'add_show_end_date_no_repeat' => $showEnd->format("Y-m-d"),
|
||||
|
@ -337,11 +344,21 @@ class Application_Service_ShowFormService
|
|||
* - the data URI representation of the image
|
||||
*/
|
||||
private function imagePathToDataUri($path) {
|
||||
ob_start();
|
||||
header("Content-type: image/*");
|
||||
readfile($path);
|
||||
$imageData = base64_encode(ob_get_contents());
|
||||
ob_end_clean();
|
||||
$imageData = null;
|
||||
$bytesRead = 0;
|
||||
try {
|
||||
ob_start();
|
||||
header("Content-type: image/*");
|
||||
$bytesRead = @readfile($path);
|
||||
$imageData = base64_encode(ob_get_contents());
|
||||
ob_end_clean();
|
||||
if ($bytesRead === FALSE) {
|
||||
$imageData = null;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
Logging::error("Failed to read image: " . $path);
|
||||
$imageData = null;
|
||||
}
|
||||
// return the data URI - data:{mime};base64,{data}
|
||||
return ($imageData === null || $imageData === '') ?
|
||||
'' : 'data: '.mime_content_type($path).';base64,'.$imageData;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
$this->form->getElement("submit")->setAttrib("class", "right-align");
|
||||
$this->form->getElement("submit")->setAttrib("class", "btn right-floated");
|
||||
$this->form->getElement("country")->setAttrib("class", "right-align");
|
||||
$this->form->getElement("securityqid")->setAttrib("class", "right-align");
|
||||
?>
|
||||
<div class="ui-widget ui-widget-content block-shadow clearfix padded-strong billing-panel">
|
||||
<div class="ui-widget prefpanel simple-formblock clearfix padded-strong">
|
||||
<H2>Billing Account Details</H2>
|
||||
<?php if (isset($this->errorMessage)) {?>
|
||||
<div class="errors"><?php echo $this->errorMessage ?></div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="ui-widget ui-widget-content block-shadow clearfix padded-strong billing-panel">
|
||||
<div class="ui-widget prefpanel clearfix padded-strong billing-panel">
|
||||
<H2>Invoices</H2>
|
||||
<?php
|
||||
$topTextClass = "";
|
||||
|
@ -8,11 +8,11 @@ if (array_key_exists("planupdated", $_GET))
|
|||
$topTextClass = "status-good";
|
||||
}
|
||||
else {
|
||||
$topText = _pro("Tip: To pay an invoice, click \"View Invoice\"<br> and look for the \"Checkout\" button.");
|
||||
$topText = _pro("Tip: To pay an invoice, click \"View Invoice\" and look for the \"Checkout\" button.");
|
||||
}
|
||||
|
||||
?>
|
||||
<p style="text-align: center; padding-left: 20px;" class="<?=$topTextClass?>"><?=$topText?></p>
|
||||
<p class="<?=$topTextClass?>"><?=$topText?></p>
|
||||
<table id="invoices_table">
|
||||
<tr class="header">
|
||||
<th>Date Issued</th>
|
||||
|
|
|
@ -167,9 +167,9 @@ $(document).ready(function() {
|
|||
});
|
||||
</script>
|
||||
|
||||
<div class="ui-widget ui-widget-content block-shadow clearfix padded-strong billing-panel">
|
||||
<H2><?=_("Account Plans")?></H2>
|
||||
<H4><?=_("Upgrade today to get more listeners and storage space!")?></H4>
|
||||
<div class="ui-widget prefpanel clearfix padded-strong billing-panel">
|
||||
<H2><?=_pro("Account Plans")?></H2>
|
||||
<H4><?=_pro("Upgrade today to get more listeners and storage space!")?></H4>
|
||||
<div class="pricing-grid">
|
||||
<table>
|
||||
<tr>
|
||||
|
@ -185,7 +185,7 @@ $(document).ready(function() {
|
|||
</td>
|
||||
<td>2 Streams
|
||||
</td>
|
||||
<td>3 Streams
|
||||
<td class="last-column">3 Streams
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -195,7 +195,7 @@ $(document).ready(function() {
|
|||
</td>
|
||||
<td>64kbps and 196kbps Stream Quality
|
||||
</td>
|
||||
<td>64kbps, 128kbps, and 196kbps Stream Quality
|
||||
<td class="last-column">64kbps, 128kbps, and 196kbps Stream Quality
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -205,7 +205,7 @@ $(document).ready(function() {
|
|||
</td>
|
||||
<td>100 Listeners per stream
|
||||
</td>
|
||||
<td>500 Listeners per stream
|
||||
<td class="last-column">500 Listeners per stream
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -215,7 +215,8 @@ $(document).ready(function() {
|
|||
</td>
|
||||
<td>30GB Storage
|
||||
</td>
|
||||
<td>150GB Storage
|
||||
<td class="last-column">
|
||||
150GB Storage
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -225,7 +226,7 @@ $(document).ready(function() {
|
|||
</td>
|
||||
<td>Live Chat, Ticket, Email, Forum Support
|
||||
</td>
|
||||
<td>Live Chat, Ticket, Email, Forum Support
|
||||
<td class="last-column">Live Chat, Ticket, Email, Forum Support
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -235,25 +236,25 @@ $(document).ready(function() {
|
|||
</td>
|
||||
<td>Save 15% if paid annually
|
||||
</td>
|
||||
<td>Save 15% if paid annually
|
||||
<td class="last-column">Save 15% if paid annually
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="price">
|
||||
<tr class="price last-row">
|
||||
<td id="hobbyist_grid_price">
|
||||
</td>
|
||||
<td id="starter_grid_price">
|
||||
</td>
|
||||
<td id="plus_grid_price">
|
||||
</td>
|
||||
<td id="premium_grid_price">
|
||||
<td class="last-column" id="premium_grid_price">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!--
|
||||
<p> <a target="_blank" href="https://www.airtime.pro/pricing"><?=_("View Plans")?></a> (Opens in a new window)</p>
|
||||
<p> <a target="_blank" href="https://www.airtime.pro/pricing"><?=_pro("View Plans")?></a> (Opens in a new window)</p>
|
||||
-->
|
||||
<p id="current_plan"><b>Current Plan:</b>
|
||||
<p id="current_plan"><span><?php echo(_pro('Your Current Plan:')); ?></span>
|
||||
<?php
|
||||
$currentProduct = Billing::getClientCurrentAirtimeProduct();
|
||||
echo($currentProduct["name"]);
|
||||
|
@ -261,10 +262,12 @@ echo($currentProduct["name"]);
|
|||
?>
|
||||
</p>
|
||||
|
||||
<h3>Choose a plan:</h3>
|
||||
<h3><?php echo(_pro('Choose a plan: ')); ?></h3>
|
||||
<form id="<?php echo $form->getId(); ?>" method="<?php echo $form->getMethod() ?>" action="<?php echo
|
||||
$form->getAction()?>" enctype="<?php echo $form->getEncType();?>">
|
||||
|
||||
<?php echo $form->csrf ?>
|
||||
|
||||
<div id="plantype">
|
||||
<?php echo $form->newproductid ?>
|
||||
</div>
|
||||
|
@ -272,7 +275,7 @@ echo($currentProduct["name"]);
|
|||
<?php echo $form->newproductbillingcycle ?>
|
||||
</div>
|
||||
<div id="billingcycle_disclaimer">
|
||||
Save 15% on annual plans (Hobbyist plan excluded).
|
||||
Save 15% on annual plans (Hobbyist plan excluded).
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
<div id="subtotal_box">
|
||||
|
@ -285,7 +288,7 @@ echo($currentProduct["name"]);
|
|||
VAT will be added below if you are an EU resident without a valid VAT number.
|
||||
</div>
|
||||
|
||||
<h3>Enter your payment details:</h3>
|
||||
<h3><?=_pro("Please enter your payment details:");?></h3>
|
||||
<?php if (isset($this->errorMessage)) {?>
|
||||
<div class="errors"><?php echo $this->errorMessage ?></div>
|
||||
<?php }?>
|
||||
|
@ -356,6 +359,10 @@ echo($currentProduct["name"]);
|
|||
<div id="paymentmethod">
|
||||
<?php echo $form->paymentmethod ?>
|
||||
</div>
|
||||
<!-- PayPal Logo --><table border="0" cellpadding="10" cellspacing="0"><tr><td></td></tr><tr><td align="center"><img src="https://www.paypalobjects.com/webstatic/en_CA/mktg/logo-image/bdg_secured_by_pp_2line.png" border="0" alt="Secured by PayPal"></td></tr></table><!-- PayPal Logo -->
|
||||
<div>
|
||||
<img src="https://www.2checkout.com/upload/images/paymentlogoshorizontal.png" alt="2Checkout.com is a worldwide leader in online payment services" />
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div id="total_box">
|
||||
|
@ -364,7 +371,7 @@ echo($currentProduct["name"]);
|
|||
<b>Total:</b> <span id="total"></span>
|
||||
</div>
|
||||
|
||||
<input type="submit" value="Submit Order" id="atpro_submitorder"></input>
|
||||
<input type="submit" class="btn right-floated" value="Submit Order" id="atpro_submitorder"></input>
|
||||
<div class="clearfix"></div>
|
||||
</form>
|
||||
</div>
|
|
@ -1,15 +1,19 @@
|
|||
<div class="gray-logo"></div>
|
||||
<div class="text-content">
|
||||
<h2><?php echo sprintf(_("Welcome to %s!"), PRODUCT_NAME) ?></h2>
|
||||
<p><?php echo sprintf(_("Here's how you can get started using %s to automate your broadcasts: "), PRODUCT_NAME)?></p>
|
||||
|
||||
<ol>
|
||||
<li><?php echo _("Begin by adding your files to the library using the 'Add Media' menu button. You can drag and drop your files to this window too.")?></li>
|
||||
<li><?php echo _("Create a show by going to 'Calendar' in the menu bar, and then clicking the '+ Show' icon. This can be either a one-time or repeating show. Only admins and program managers can add shows.")?></li>
|
||||
<li><?php echo _("Add media to the show by going to your show in the Schedule calendar, left-clicking on it and selecting 'Add / Remove Content'")?>.</li>
|
||||
<li><?php echo _("Select your media from the left pane and drag them to your show in the right pane."); ?></li>
|
||||
<li><h4><?php echo _("Upload audio tracks");?></h4>
|
||||
<?php echo _("Click the 'Upload' button in the left corner to upload tracks to your library.")?></li>
|
||||
<li><h4><?php echo _("Schedule a show");?></h4>
|
||||
<?php echo _("Click on 'Calendar' in the navigation bar on the left. From there click the '+ New Show' button and fill out the required fields.")?></li>
|
||||
<li><h4><?php echo _("Add tracks to your show"); ?></h4>
|
||||
<?php echo _("Click on your show in the calendar and select 'Schedule Show'. In the popup window drag tracks into your show."); ?>
|
||||
</li>
|
||||
|
||||
|
||||
</ol>
|
||||
<p><strong><?php echo _("Then you're good to go!")?></strong><br />
|
||||
<p><strong><?php echo _("Now you're good to go!")?></strong><br />
|
||||
<?php
|
||||
$userManualAnchorOpen = "<a href='" . USER_MANUAL_URL . "' target='_blank'>";
|
||||
echo sprintf(_("For more detailed help, read the %suser manual%s."),
|
||||
|
|
|
@ -337,7 +337,7 @@
|
|||
not work. It has to be "visible" on the page. As a hacky work around we
|
||||
set the height and width to 1px so users will not see it.
|
||||
*/
|
||||
#muses_skin{width:1px; height:1px; overflow-x: hidden; overflow-y: hidden;}
|
||||
#muses_skin{width:0; height:0; overflow: hidden;}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
<div id="widget-menu" class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong ">
|
||||
<h2><?php echo _("Embeddable Widgets"); ?></h2>
|
||||
<a href="#player-widget">Player</a>
|
||||
<a href="#weekly-schedule-widget">Weekly Schedule</a>
|
||||
</div>
|
||||
|
||||
<div id="player-widget" class="ui-widget ui-widget-content block-shadow simple-formblock embed-player-form clearfix padded-strong ">
|
||||
|
||||
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
|
||||
|
||||
<form method="post" id="player_form" enctype="multipart/form-data">
|
||||
<h2 style="float:left"><?php echo _("Player") ?></h2>
|
||||
<div style="clear:both"></div>
|
||||
<?php echo $this->player_error_msg; ?>
|
||||
<?php echo $this->player_form; ?>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<div id="weekly-schedule-widget" class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong ">
|
||||
|
||||
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
|
||||
|
||||
<h2 style="float:left"><?php echo _("Weekly Schedule") ?></h2>
|
||||
<div style="clear:both"></div>
|
||||
|
||||
<div id="weekly-schedule-widget-error">
|
||||
<?php echo $this->weekly_schedule_error_msg; ?>
|
||||
</div>
|
||||
|
||||
<fieldset class="padded">
|
||||
<div id="weekly-schedule-widget-preview" <?php if (isset($this->weekly_schedule_error_msg)) echo "style=display:none"; ?>>
|
||||
<label><?php echo _("Preview:") ?></label>
|
||||
<div class="schedule_iframe_wrapper">
|
||||
<iframe id="schedule_iframe" height="400px" width="550px" scrolling="no" frameborder="0" src=<?php echo $this->stationUrl."embed/weekly-program"?>></iframe>
|
||||
</div>
|
||||
|
||||
<div style="clear:both"></div>
|
||||
<label>Embeddable Code:</label>
|
||||
<textarea style="width:100%" rows="3" readonly="readonly"><iframe height="400px" width="550px" scrolling="no" frameborder="0" src=<?php echo Application_Common_HTTPHelper::getStationUrl()."embed/weekly-program"?>></iframe>
|
||||
</textarea>
|
||||
Copy this code and paste it into your website's HTML to embed the weekly schedule in your site.
|
||||
Adjust the height and width attributes to your desired size.
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
|
@ -0,0 +1,12 @@
|
|||
<div id="player-widget" class="ui-widget prefpanel simple-formblock embed-player-form clearfix padded-strong ">
|
||||
|
||||
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
|
||||
|
||||
<form method="post" id="player_form" enctype="multipart/form-data">
|
||||
<h2 style="float:left"><?php echo _("Player") ?></h2>
|
||||
<div style="clear:both"></div>
|
||||
<?php echo $this->player_error_msg; ?>
|
||||
<?php echo $this->player_form; ?>
|
||||
|
||||
</form>
|
||||
</div>
|
|
@ -0,0 +1,30 @@
|
|||
<div id="weekly-schedule-widget" class="prefpanel ui-widget simple-formblock clearfix padded-strong ">
|
||||
|
||||
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
|
||||
|
||||
<h2 style="float:left"><?php echo _("Weekly Schedule") ?></h2>
|
||||
<div style="clear:both"></div>
|
||||
|
||||
<div id="weekly-schedule-widget-error">
|
||||
<?php echo $this->weekly_schedule_error_msg; ?>
|
||||
</div>
|
||||
|
||||
<fieldset class="padded">
|
||||
<div id="weekly-schedule-widget-preview" <?php if (isset($this->weekly_schedule_error_msg)) echo "style=display:none"; ?>>
|
||||
<label><?php echo _("Preview:") ?></label>
|
||||
<div class="schedule_iframe_wrapper">
|
||||
<iframe id="schedule_iframe" height="400px" width="550px" scrolling="no" frameborder="0" src=<?php echo Application_Common_HTTPHelper::getStationUrl()."embed/weekly-program"?>></iframe>
|
||||
</div>
|
||||
|
||||
<div style="clear:both"></div>
|
||||
<label>Embeddable Code:</label>
|
||||
<textarea style="width:98%" rows="3" readonly="readonly"><iframe height="400px" width="550px" scrolling="no" frameborder="0" src=<?php echo Application_Common_HTTPHelper::getStationUrl()."embed/weekly-program"?>></iframe>
|
||||
</textarea>
|
||||
<div><p>
|
||||
Copy this code and paste it into your website's HTML to embed the weekly schedule in your site.
|
||||
Adjust the height and width attributes to your desired size.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
|
@ -6,7 +6,7 @@
|
|||
<?php echo $this->element->getElement('custom_username')->render(); ?>
|
||||
<?php echo $this->element->getElement('custom_password')->render(); ?>
|
||||
</div>
|
||||
<fieldset>
|
||||
<fieldset id="add-show-show-source">
|
||||
<legend><?php echo _("Show Source") ?></legend>
|
||||
<p class="input-settings-inline-p">
|
||||
<?php echo _("DJs can use these settings to connect with compatible software and broadcast live during this show. Assign a DJ below.") ?>
|
||||
|
|
|
@ -1,8 +1,18 @@
|
|||
<fieldset>
|
||||
<dl>
|
||||
<dt id="add_show_start_now-label">
|
||||
<label for="add_show_start_now">
|
||||
<?php echo $this->element->getElement('add_show_start_now')->getLabel()?>
|
||||
</label>
|
||||
</dt>
|
||||
<dd>
|
||||
<?php echo $this->element->getElement('add_show_start_now') ?>
|
||||
</dd>
|
||||
|
||||
|
||||
<dt id="add_show_start_date-label">
|
||||
<label for="add_show_start_date" class="required">
|
||||
<?php echo $this->element->getElement('add_show_start_date')->getLabel()?>
|
||||
<?php //echo $this->element->getElement('add_show_start_date')->getLabel()?>
|
||||
</label>
|
||||
</dt>
|
||||
<dd>
|
||||
|
@ -19,6 +29,9 @@
|
|||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
<dt id="add_show_end_date_no_repeat-label">
|
||||
<label for="add_show_end_date_no_repeat" class="required">
|
||||
<?php echo $this->element->getElement('add_show_end_date_no_repeat')->getLabel()?>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<?php echo $this->element->getElement('his_time_start') ?>
|
||||
<?php echo $this->element->getElement('his_date_end') ?>
|
||||
<?php echo $this->element->getElement('his_time_end') ?>
|
||||
<div id="his_submit" class="ui-button ui-state-default" title="<?php echo _("Filter History")?>">
|
||||
<span class="ui-icon ui-icon-search"></span>
|
||||
<div id="his_submit" class=" btn btn-small" title="<?php echo _("Filter History")?>">
|
||||
<i class="icon-white icon-search"></i><span><?php echo _("Filter History")?></span>
|
||||
</div>
|
||||
</div>
|
|
@ -1,9 +1,11 @@
|
|||
<h2><?php echo sprintf(_("%s's Settings"), $this->escape($this->currentUser)) ?></h2>
|
||||
<h2><?php echo _("My Profile") ?></h2>
|
||||
<div id="current-user-container">
|
||||
|
||||
<?php if(Application_Model_User::getCurrentUser()->isSuperAdmin()) : ?>
|
||||
<div class="user-data" id="user_details_superadmin_message" style="text-align: center;">
|
||||
<?=sprintf(_("<b>Note:</b> You are a special \"Super Admin\" type of user.<br>Account details for Super Admins can be changed in your <a href=\"%s\">Billing Settings</a> instead."), "/billing/client");?>
|
||||
<div id="user_details_superadmin_message">
|
||||
<p class="alert alert-error">
|
||||
<?=sprintf(_("<b>Note:</b> Since you're the station owner, your account information can be edited in <a href=\"%s\">Billing Settings</a> instead."), "/billing/client");?>
|
||||
</p>
|
||||
<br><br>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
@ -168,6 +170,6 @@
|
|||
</dd>
|
||||
<?php echo $this->element->getElement('csrf') ?>
|
||||
</dl>
|
||||
<button type="submit" id="cu_save_user" class="btn btn-small right-floated"><?php echo _("Save")?></button>
|
||||
<button type="submit" id="cu_save_user" class="btn right-floated"><?php echo _("Save")?></button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -30,17 +30,15 @@
|
|||
|
||||
<?php echo $this->element->getElement('csrf') ?>
|
||||
|
||||
<?php if (Application_Model_Preference::GetEnableSystemEmail()): ?>
|
||||
<dt id="reset-label" class="hidden"> </dt>
|
||||
<dd id="reset-element" class="text-right">
|
||||
<a href="<?php echo $this->baseUrl('login/password-restore'); ?>" class="link reset"><?php echo _("Reset password") ?></a>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->element->getElement('captcha') ?>
|
||||
<dt id="submit-label"> </dt>
|
||||
<dd id="submit-element">
|
||||
<?php echo $this->element->getElement('submit') ?>
|
||||
</dd>
|
||||
|
||||
<dt id="reset-label" class="hidden"> </dt>
|
||||
<dd id="reset-element" class="text-right">
|
||||
<a href="<?php echo $this->baseUrl('login/password-restore'); ?>" class="link reset"><?php echo _("Forgot your password?") ?></a>
|
||||
</dd>
|
||||
</dl>
|
||||
</form>
|
||||
|
|
|
@ -1,36 +1,54 @@
|
|||
<form enctype="application/x-www-form-urlencoded" method="post" action="">
|
||||
<dl class="zend_form">
|
||||
<dt id="username-label">
|
||||
<label for="username" class="required">
|
||||
<?php echo $this->element->getElement('username')->getLabel() ?>
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="username-element">
|
||||
<?php echo $this->element->getElement('username') ?>
|
||||
</dd>
|
||||
<fieldset>
|
||||
<legend>Station Owners</legend>
|
||||
<p>
|
||||
<?php echo(sprintf(_pro("If you are the primary owner of this station, <a href=\"%s\">please reset your password here</a>."), WHMCS_PASSWORD_RESET_URL)); ?>
|
||||
</p>
|
||||
|
||||
<dt id="email-label">
|
||||
<label for="email" class="required">
|
||||
<?php echo $this->element->getElement('email')->getLabel() ?>
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="email-element">
|
||||
<?php echo $this->element->getElement('email') ?>
|
||||
</dd>
|
||||
<?php if($this->element->getElement('email')->hasErrors()): ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('email')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>DJs, Program Managers, and Others</legend>
|
||||
<form enctype="application/x-www-form-urlencoded" method="post" action="">
|
||||
<dl class="zend_form">
|
||||
|
||||
<p>Please enter both your username and email address.</p>
|
||||
<dt id="username-label">
|
||||
<label for="username" class="required">
|
||||
<?php echo $this->element->getElement('username')->getLabel() ?>
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="username-element">
|
||||
<?php echo $this->element->getElement('username') ?>
|
||||
</dd>
|
||||
</dt>
|
||||
|
||||
<dt id="email-label">
|
||||
<label for="email" class="required">
|
||||
<?php echo $this->element->getElement('email')->getLabel() ?>
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="email-element">
|
||||
<?php echo $this->element->getElement('email') ?>
|
||||
</dd>
|
||||
<?php if ($this->element->getElement('email')->hasErrors()): ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach ($this->element->getElement('email')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<dt id="submit-label"> </dt>
|
||||
<dd id="submit-element">
|
||||
<?php echo $this->element->getElement('submit') ?>
|
||||
</dd>
|
||||
|
||||
<dd id="cancel-element">
|
||||
|
||||
<a href="<?php echo($this->baseUrl('login')); ?>">
|
||||
<button name="cancel" type="button" class="ui-button ui-widget ui-state-default ui-button-text-only center"><?php echo(_("Back")); ?></button>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</form>
|
||||
</fieldset>
|
||||
|
||||
<dt id="submit-label"> </dt>
|
||||
<dd id="submit-element">
|
||||
<?php echo $this->element->getElement('submit') ?>
|
||||
</dd>
|
||||
<dd id="cancel-element">
|
||||
<?php echo $this->element->getElement('cancel') ?>
|
||||
</dd>
|
||||
</dl>
|
||||
</form>
|
|
@ -1,5 +1,5 @@
|
|||
<fieldset class="padded stream-setting-global" style="margin-top: 15px">
|
||||
<legend><?php echo _("Input Stream Settings") ?></legend>
|
||||
<h3><?php echo _("Live Broadcasting") ?></h3>
|
||||
<fieldset class="padded stream-setting-global">
|
||||
<dl class="zend_form">
|
||||
<?php echo $this->element->getElement('auto_transition')->render() ?>
|
||||
<span class="icecast_metadata_help_icon" id="auto_transition_help"></span>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<div id="lang-timezone-popup" class="dialogPopup register-dialog" title="<?php echo sprintf(_("Welcome to %s!"), SAAS_PRODUCT_BRANDING_NAME); ?>" style="display: none;">
|
||||
<form id="lang-timezone-form" method="post" action="/setup/setup-language-timezone">
|
||||
<fieldset>
|
||||
<dl class="zend_form">
|
||||
<?php echo $this->element->getElement('csrf') ?>
|
||||
|
||||
<?php echo $this->element->getElement('setup_language')->render(); ?>
|
||||
|
||||
<?php echo $this->element->getElement('setup_timezone')->render(); ?>
|
||||
</dl>
|
||||
</fieldset>
|
||||
<p style="margin-bottom: 0px; text-align: center;">You can change these later in your preferences and user settings.</p>
|
||||
|
||||
</form>
|
||||
</div>
|
|
@ -1,25 +1,16 @@
|
|||
<?php echo $this->element->getElement('sb_date_start'); ?>
|
||||
<?php echo $this->element->getElement('sb_time_start'); ?>
|
||||
<?php echo $this->element->getElement('sb_date_end'); ?>
|
||||
<?php echo $this->element->getElement('sb_time_end'); ?>
|
||||
<div class="sb-options-form">
|
||||
<?php echo $this->element->getElement('sb_date_start'); ?>
|
||||
<?php echo $this->element->getElement('sb_time_start'); ?>
|
||||
<?php echo $this->element->getElement('sb_date_end'); ?>
|
||||
<?php echo $this->element->getElement('sb_time_end'); ?>
|
||||
<a id="sb_submit" class="btn btn-small" href="#" title="Display shows in the specified date and time range">
|
||||
<i class="icon-white icon-search"></i><span><?php echo _("Find Shows") ?></span>
|
||||
</a>
|
||||
|
||||
<a id="sb_submit" class="btn btn-small" href="#" title="Display shows in the specified date and time range">
|
||||
<i class="icon-white icon-search"></i><?php echo " "._("Find Shows") ?></a>
|
||||
<div class="sb-advanced-options">
|
||||
<fieldset class="padded display_field push-down-8 closed">
|
||||
<legend style="cursor: pointer;">
|
||||
<span class="ui-icon ui-icon-triangle-2-n-s"></span>
|
||||
<?php echo _("Filter By Show:")?>
|
||||
</legend>
|
||||
<?php echo $this->element->getElement('sb_show_filter') ?>
|
||||
|
||||
<div class="sb-options-form">
|
||||
<label><?php echo $this->element->getElement('sb_show_filter')->getLabel() ?></label>
|
||||
<?php echo $this->element->getElement('sb_show_filter') ?>
|
||||
|
||||
<?php if ($this->element->getElement('sb_my_shows')):?>
|
||||
<label><?php echo $this->element->getElement('sb_my_shows')->getLabel(); ?></label>
|
||||
<?php echo $this->element->getElement('sb_my_shows'); ?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php if ($this->element->getElement('sb_my_shows')):?>
|
||||
<label><?php echo $this->element->getElement('sb_my_shows')->getLabel(); ?></label>
|
||||
<?php echo $this->element->getElement('sb_my_shows'); ?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
|
|
@ -1,22 +1,12 @@
|
|||
<form id="smart-block-form" method="post" action="">
|
||||
<fieldset class='toggle <?php echo $this->openOption ? "" : "closed"?> sb-criteria-fieldset' id='smart_block_options'>
|
||||
<legend style='cursor: pointer;'><span class='ui-icon ui-icon-triangle-2-n-s'></span><?php echo _("Smart Block Options") ?></legend>
|
||||
|
||||
<form class="smart-block-form" method="post" action="">
|
||||
<dl class='zend_form search-criteria'>
|
||||
<div class='btn-toolbar clearfix'>
|
||||
<div class='btn-group sp-button'>
|
||||
<?php echo $this->element->getElement('generate_button') ?>
|
||||
</div>
|
||||
<div class='btn-group sp-button'>
|
||||
<?php echo $this->element->getElement('shuffle_button') ?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='sp-success' class='success' style='display:none'></div>
|
||||
<dd id='sp_type-element'>
|
||||
<dt>
|
||||
<label class='sp-label'>
|
||||
<?php echo $this->element->getElement('sp_type')->getLabel() ?>
|
||||
<span class='playlist_type_help_icon'></span>
|
||||
<?php echo $this->element->getElement('sp_type')->getLabel() ?>
|
||||
</label>
|
||||
</dt>
|
||||
<dd id='sp_type-element'>
|
||||
<?php $i=0;
|
||||
$value = $this->element->getElement('sp_type')->getValue();
|
||||
foreach ($this->element->getElement('sp_type')->getMultiOptions() as $radio) : ?>
|
||||
|
@ -26,10 +16,58 @@
|
|||
</label>
|
||||
<?php $i = $i + 1; ?>
|
||||
<?php endforeach; ?>
|
||||
<span class='playlist_type_help_icon'></span>
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
<label class='sp_text_font'><?php echo $this->element->getElement('sp_repeat_tracks')->getLabel() ?></label>
|
||||
</dt>
|
||||
<dd id='sp_repeat_tracks-element'>
|
||||
<?php echo $this->element->getElement('sp_repeat_tracks')?>
|
||||
<?php if($this->element->getElement("sp_repeat_tracks")->hasErrors()) : ?>
|
||||
<?php foreach($this->element->getElement("sp_repeat_tracks")->getMessages() as $error): ?>
|
||||
<span class='errors sp-errors'>
|
||||
<?php echo $error; ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<span class='repeat_tracks_help_icon'></span>
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
<label class='sp_text_font'><?php echo $this->element->getElement('sp_sort_options')->getLabel();?></label>
|
||||
</dt>
|
||||
<dd id='sp_sort-element'>
|
||||
<?php echo $this->element->getElement('sp_sort_options') ?>
|
||||
<?php if($this->element->getElement("sp_sort_options")->hasErrors()) : ?>
|
||||
<?php foreach($this->element->getElement("sp_sort_options")->getMessages() as $error): ?>
|
||||
<span class='errors sp-errors'>
|
||||
<?php echo $error; ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
|
||||
<dt>
|
||||
<label class='sp_text_font'><?php echo $this->element->getElement('sp_limit_value')->getLabel() ?></label>
|
||||
</dt>
|
||||
<dd id='sp_limit-element'>
|
||||
<?php echo $this->element->getElement('sp_limit_value')?>
|
||||
<?php echo $this->element->getElement('sp_limit_options') ?>
|
||||
<?php if($this->element->getElement("sp_limit_value")->hasErrors()) : ?>
|
||||
<?php foreach($this->element->getElement("sp_limit_value")->getMessages() as $error): ?>
|
||||
<span class='errors sp-errors'>
|
||||
<?php echo $error; ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
|
||||
<dt><label><?php echo(_("Search Criteria:"));?></label></dt>
|
||||
<dd id='sp_criteria-element' class='criteria-element'>
|
||||
<?php for ($i = 0; $i < $this->criteriasLength; $i++) {
|
||||
<a class='btn btn-small btn-new' id='criteria_add'><i class='icon-white icon-plus'></i><?php echo(_("New Criteria")); ?></a>
|
||||
|
||||
<?php for ($i = 0; $i < $this->criteriasLength; $i++) {
|
||||
// modRowMap holds the number of modifier rows for each criteria element
|
||||
// i.e. if we have 'Album contains 1' and 'Album contains 2' the modRowMap
|
||||
// for Album is 2
|
||||
|
@ -51,23 +89,24 @@
|
|||
}
|
||||
$nextDisabled = $this->element->getElement("sp_criteria_field_".$nextIndex)->getAttrib('disabled') == 'disabled'?true:false;
|
||||
?>
|
||||
<div <?php if (($i > 0) && $disabled) {
|
||||
echo 'style=display:none';
|
||||
} ?>>
|
||||
<div <?php if (/*($i > 0) && */ $disabled) {
|
||||
echo 'style=display:none';
|
||||
} ?> >
|
||||
<?php echo $this->element->getElement("sp_criteria_field_".$i."_".$j) ?>
|
||||
<a class='btn btn-small' id='modifier_add_<?php echo $i ?>'>
|
||||
<i class='icon-white icon-plus'></i>
|
||||
</a>
|
||||
<?php echo $this->element->getElement("sp_criteria_modifier_".$i."_".$j) ?>
|
||||
<?php echo $this->element->getElement("sp_criteria_value_".$i."_".$j) ?>
|
||||
<span class='sp_text_font' id="extra_criteria" <?php echo $this->element->getElement("sp_criteria_extra_".$i."_".$j)->getAttrib("disabled") == "disabled"?'style="display:none;"':""?>><?php echo _(" to "); ?><?php echo $this->element->getElement('sp_criteria_extra_'.$i."_".$j) ?></span>
|
||||
<a class='btn btn-small btn-new' id='modifier_add_<?php echo $i ?>'>
|
||||
<i class='icon-white icon-plus'></i><?php echo(_("New Modifier")); ?>
|
||||
</a>
|
||||
|
||||
<span class='sp_text_font' id="extra_criteria" <?php echo $this->element->getElement("sp_criteria_extra_".$i."_".$j)->getAttrib("disabled") == "disabled"?'style="display:none;"':""?>><?php echo _(" to "); ?><?php echo $this->element->getElement('sp_criteria_extra_'.$i."_".$j) ?></span>
|
||||
<a style='margin-right:3px' class='btn btn-small btn-danger' id='criteria_remove_<?php echo $i ?>'>
|
||||
<i class='icon-white icon-remove'></i>
|
||||
<i class='icon-white icon-remove spl-no-r-margin'></i>
|
||||
</a>
|
||||
<span class='db-logic-label' <?php if ($nextDisabled) echo "style='display:none'"?>>
|
||||
<?php echo $logicLabel;?>
|
||||
</span>
|
||||
|
||||
<?php if($this->element->getElement("sp_criteria_field_".$i."_".$j)->hasErrors()) : ?>
|
||||
<?php foreach($this->element->getElement("sp_criteria_field_".$i."_".$j)->getMessages() as $error): ?>
|
||||
<span class='errors sp-errors'>
|
||||
|
@ -79,46 +118,6 @@
|
|||
<?php } ?>
|
||||
|
||||
<?php } ?>
|
||||
<br />
|
||||
</dd>
|
||||
|
||||
<dd id='sp_repeate_tracks-element'>
|
||||
<span class='sp_text_font'><?php echo $this->element->getElement('sp_repeat_tracks')->getLabel() ?></span>
|
||||
<span class='repeat_tracks_help_icon'></span>
|
||||
<?php echo $this->element->getElement('sp_repeat_tracks')?>
|
||||
<?php if($this->element->getElement("sp_repeat_tracks")->hasErrors()) : ?>
|
||||
<?php foreach($this->element->getElement("sp_repeat_tracks")->getMessages() as $error): ?>
|
||||
<span class='errors sp-errors'>
|
||||
<?php echo $error; ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<br />
|
||||
</dd>
|
||||
<dd id='sp_sort-element'>
|
||||
<span class='sp_text_font'>Sort tracks by</span>
|
||||
<?php echo $this->element->getElement('sp_sort_options') ?>
|
||||
<?php if($this->element->getElement("sp_sort_options")->hasErrors()) : ?>
|
||||
<?php foreach($this->element->getElement("sp_sort_options")->getMessages() as $error): ?>
|
||||
<span class='errors sp-errors'>
|
||||
<?php echo $error; ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<br />
|
||||
</dd>
|
||||
<dd id='sp_limit-element'>
|
||||
<span class='sp_text_font'><?php echo $this->element->getElement('sp_limit_value')->getLabel() ?></span>
|
||||
<?php echo $this->element->getElement('sp_limit_value')?>
|
||||
<?php echo $this->element->getElement('sp_limit_options') ?>
|
||||
<?php if($this->element->getElement("sp_limit_value")->hasErrors()) : ?>
|
||||
<?php foreach($this->element->getElement("sp_limit_value")->getMessages() as $error): ?>
|
||||
<span class='errors sp-errors'>
|
||||
<?php echo $error; ?>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<br />
|
||||
</dd>
|
||||
|
||||
<?php if ($this->showPoolCount) { ?>
|
||||
|
@ -135,7 +134,7 @@
|
|||
} else if ($this->poolCount == 1) {
|
||||
echo $this->poolCount;
|
||||
?>
|
||||
<?php echo _("file meet the criteria")?>
|
||||
<?php echo _("file meets the criteria")?>
|
||||
</span>
|
||||
<span class='checked-icon sp-checked-icon' id='sp_pool_count_icon'></span>
|
||||
<?php
|
||||
|
@ -149,8 +148,6 @@
|
|||
?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</dl>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
$s_name = "s".$this->stream_number;
|
||||
?>
|
||||
<h3 class="collapsible-header <?php echo $this->stream_number == '1'?"closed":""?>"><span class="arrow-icon"></span><?php echo _("Stream "); ?><?php echo $this->stream_number?></h3>
|
||||
<h3 class="collapsible-header <?php echo $this->enabled == 0?"closed":""?>"><span class="arrow-icon"></span><?php echo _("Stream "); ?><?php echo $this->stream_number?></h3>
|
||||
<div class="stream-setting-content" <?php echo $this->enabled == 0?'style="display: none;':''?> id="<?php echo $s_name?>-config">
|
||||
<fieldset class="padded">
|
||||
<dl class="zend_form clearfix">
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong" id="edit-md-dialog">
|
||||
<div class="inner_editor_title">
|
||||
<?php if ($this->permissionDenied) { ?> <h3>You do not have permission to edit this track.</h3> <?php } ?>
|
||||
<H2><?php
|
||||
if ($this->permissionDenied) {
|
||||
echo(_("Viewing "));
|
||||
} else {
|
||||
echo(_("Editing "));
|
||||
}?>"<span class="title_obj_name"><?php echo($this->title); ?></span>"</H2>
|
||||
</div>
|
||||
<?php echo $this->form; ?>
|
||||
</div>
|
||||
|
|
|
@ -9,7 +9,7 @@ if ($this->showPlaylist) {
|
|||
$display = "display:none";
|
||||
}
|
||||
?>
|
||||
<div id="side_playlist" class="pl-content ui-widget ui-widget-content block-shadow omega-block padded" style="height:697px; width:720px;<?php echo $display?>">
|
||||
<div class="side_playlist pl-content ui-widget ui-widget-content block-shadow omega-block padded" style="height:697px; width:720px;<?php echo $display?>">
|
||||
<?php if ($this->type == 'block') {
|
||||
echo $this->render('playlist/smart-block.phtml');
|
||||
} else if ($this->type == 'playlist') {
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
<div id="listenerstat_content" class="ui-widget ui-widget-content block-shadow alpha-block padded">
|
||||
<?php echo _("Listener Count Over Time")?><br>
|
||||
<div id="flot_placeholder" style="width:600px;height:300px;margin:0px 50px 0px 50px"></div>
|
||||
<div id="listenerstat_content" class="alpha-block padded">
|
||||
<H2><?php echo _("Listeners")?></H2>
|
||||
<div id="flot_placeholder" style="height:300px;margin:0px 50px 0px 50px"></div>
|
||||
<div id="legend" style="width:600px;height:70px;margin:0px 50px 0px 50px"></div>
|
||||
<div id="date_form" style="float:left; margin:0px 50px 0px 50px"><?php echo $this->date_form; ?></div>
|
||||
<div id="date_form" style="float:left; margin:0px 0px">
|
||||
<h3 style="padding-left: 0px">Date Range</h3>
|
||||
<?php echo $this->date_form; ?>
|
||||
</div>
|
||||
<div id="errorStatus" style="float:right; width: 400px">
|
||||
<h3><?php echo _("Stream Data Collection Status")?></h3>
|
||||
<fieldset class="padded stream-setting-global">
|
||||
<legend><?php echo _("Status")?></legend>
|
||||
<?php foreach ($this->errorStatus as $k=>$v) {?>
|
||||
<div class='stream-status <?php echo ($v == 'OK')? 'status-good' : 'status-error' ?>'><h3><?php echo $k?>: <?php echo $v?></h3></div>
|
||||
<div class='stream-status <?php echo ($v == 'OK')? 'status-good' : 'status-error' ?>'><p><?php echo $k?>: <?php echo $v?></p></div>
|
||||
<?php }?>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
<div class="login_box">
|
||||
<div class="logobox"> </div>
|
||||
<h2><?php echo _("Email sent") ?></h2>
|
||||
<h2><?php echo _("Email Sent!") ?></h2>
|
||||
|
||||
<div id="login" class="login-content clearfix">
|
||||
<p class="light"><?php echo _("An email has been sent") ?></p>
|
||||
<p><a class="link" href="<?php echo $this->baseUrl('login'); ?>"><?php echo _("Back to login screen") ?></a></p>
|
||||
<p class="light"><?php echo _("A password reset link has been sent to your email address. Please check your email and follow the instructions inside to reset your password. If you don't see the email, please check your spam folder!") ?></p>
|
||||
<br>
|
||||
<dl class="zend-form">
|
||||
<dd id="cancel-element">
|
||||
<a href="<?php echo($this->baseUrl('login')); ?>">
|
||||
<button name="cancel" type="button" class="ui-button ui-widget ui-state-default ui-button-text-only center"><?php echo(_("Back")); ?></button>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
<div class="login_box">
|
||||
<div class="logobox"> </div>
|
||||
<h2><?php echo _("Reset password") ?></h2>
|
||||
<h2><?php echo _("Password Reset") ?></h2>
|
||||
|
||||
<div id="login" class="login-content clearfix">
|
||||
<p class="light">
|
||||
<?php echo _("Please enter your account e-mail address. You will receive a link to create a new password via e-mail.")?>
|
||||
</p>
|
||||
<?php echo $this->form; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<div id="master-panel">
|
||||
<img class="logo" src="/css/images/airtime_logo_med2.png">
|
||||
<div class="now-playing-block">
|
||||
<div class="text-row"><strong><?php echo _("Previous:"); ?></strong> <span id='previous'></span> <span id='prev-length'></span></div>
|
||||
<div class="now-playing-info song">
|
||||
|
@ -22,7 +23,7 @@
|
|||
</div>
|
||||
<div class="source-info-block">
|
||||
<h3><?php echo _("Source Streams") ?></h3>
|
||||
<ul>
|
||||
<ul style="padding-top: 10px;">
|
||||
<li>
|
||||
<div id="master_dj_div" class="source-label">
|
||||
<a id="master_dj" class="source-kick-button" onclick="kickSource(this)"></a>
|
||||
|
@ -41,12 +42,6 @@
|
|||
<a href="#" id="live_dj" class="source-switch-button" onclick="setSwitchListener(this);"><span><?php echo $this->live_dj_switch?></span></a>
|
||||
<div class="line-to-on-air"></div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="scheduled_play_div" class="source-label"><?php echo " "._("Scheduled Play") ?></div>
|
||||
<div class="line-to-switch"></div>
|
||||
<a href="#" id="scheduled_play" class="source-switch-button" onclick="setSwitchListener(this);"><span><?php echo $this->scheduled_play_switch?></span></a>
|
||||
<div class="line-to-on-air"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="on-air-block">
|
||||
|
@ -56,10 +51,17 @@
|
|||
</div>
|
||||
<div class="time-info-block pull-right">
|
||||
<ul>
|
||||
<li><?php echo _("Station time") ?></li>
|
||||
<li class="time" id="time"></li>
|
||||
<li class="time-zone"><span id="time-zone"></span></li>
|
||||
</ul>
|
||||
<div class="personal-block solo">
|
||||
<ol>
|
||||
<li>
|
||||
<a id="current-user" href=<?php echo $this->baseUrl . "/user/edit-user"?>><span class="name"><?php echo $this->escape($this->loggedInAs()); ?></span></a>
|
||||
| <a href=<?php echo $this->baseUrl . "/login/logout"?>><?php echo _("Logout")?></a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="jquery_jplayer_1" class="jp-jplayer" style="width:0px; height:0px;"></div>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<div class="trial-box-calendar-gray"><?php echo _("days") ?></div>
|
||||
</div>
|
||||
<div class="trial-box-button">
|
||||
<a title="<?php echo sprintf(_("Purchase an %s Pro plan!"), PRODUCT_NAME)?>" href="/billing/upgrade"><?php echo _("My Account") ?></a>
|
||||
<a title="<?php echo sprintf(_pro("Purchase an %s plan!"), SAAS_PRODUCT_BRANDING_NAME)?>" href="/billing/upgrade"><?php echo _pro("My Account") ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?php if ($this->objType == "block") { $displayText = "smart block"; } else { $displayText = $this->escape($this->objType); } ?>
|
||||
<h3>You do not have permission to edit this <?php echo $displayText; ?>.</h3>
|
||||
<input class="obj_id" type="hidden" value="<?php echo $this->obj->getId(); ?>"/>
|
||||
<input class='obj_type' type='hidden' value="<?php echo $this->escape($this->objType); ?>"/>
|
||||
<input type="hidden" class="playlist_name_display" contenteditable="true" value="<?php echo $this->escape($this->obj->getName()); ?>">
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue