Merge branch 'master' of dev.sourcefabric.org:campcaster
This commit is contained in:
commit
374b168804
|
@ -10,6 +10,8 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
|
$this->view->statusMsg = "";
|
||||||
|
|
||||||
$form = new Application_Form_Preferences();
|
$form = new Application_Form_Preferences();
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
}
|
}
|
||||||
|
@ -23,15 +25,18 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
|
|
||||||
$form = new Application_Form_Preferences();
|
$form = new Application_Form_Preferences();
|
||||||
if (!$form->isValid($request->getPost())) {
|
if (!$form->isValid($request->getPost())) {
|
||||||
// Failed validation; redisplay form
|
|
||||||
$this->view->form = $form;
|
} else {
|
||||||
return $this->render('index'); //render the phtml file
|
$values = $form->getValues();
|
||||||
|
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
||||||
|
|
||||||
|
$this->view->statusMsg = "Preferences Updated.";
|
||||||
}
|
}
|
||||||
|
|
||||||
$values = $form->getValues();
|
|
||||||
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
|
||||||
|
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
|
return $this->render('index'); //render the phtml file
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,24 +9,16 @@ class Application_Form_Preferences extends Zend_Form
|
||||||
|
|
||||||
// Add login element
|
// Add login element
|
||||||
$this->addElement('text', 'stationName', array(
|
$this->addElement('text', 'stationName', array(
|
||||||
|
'class' => 'input_text',
|
||||||
'label' => 'Station Name:',
|
'label' => 'Station Name:',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'filters' => array('StringTrim'),
|
'filters' => array('StringTrim'),
|
||||||
'validators' => array('NotEmpty'),
|
'validators' => array('NotEmpty'),
|
||||||
'value' => Application_Model_Preference::GetValue("station_name")
|
'value' => Application_Model_Preference::GetValue("station_name")
|
||||||
));
|
));
|
||||||
|
|
||||||
/*
|
|
||||||
$this->addElement('select', 'test', array(
|
|
||||||
'label' => 'Live Stream Button: ',
|
|
||||||
'multiOptions' => array(
|
|
||||||
"e" => "enabled",
|
|
||||||
"d" => "disabled"
|
|
||||||
))
|
|
||||||
);
|
|
||||||
*/
|
|
||||||
|
|
||||||
$this->addElement('submit', 'submit', array(
|
$this->addElement('submit', 'submit', array(
|
||||||
|
'class' => 'ui-button ui-state-default',
|
||||||
'ignore' => true,
|
'ignore' => true,
|
||||||
'label' => 'Submit',
|
'label' => 'Submit',
|
||||||
));
|
));
|
||||||
|
|
|
@ -444,12 +444,13 @@ class Schedule {
|
||||||
public static function GetPlayOrderRange($prev = 1, $next = 1) {
|
public static function GetPlayOrderRange($prev = 1, $next = 1) {
|
||||||
if (!is_int($prev) || !is_int($next)){
|
if (!is_int($prev) || !is_int($next)){
|
||||||
//must enter integers to specify ranges
|
//must enter integers to specify ranges
|
||||||
return "{}";
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$date = Schedule::GetSchedulerTime();
|
$date = Schedule::GetSchedulerTime();
|
||||||
$timeNow = $date->getDate();
|
$timeNow = $date->getDate();
|
||||||
return array("schedulerTime"=>gmdate("Y-m-d H:i:s"),
|
return array("env"=>APPLICATION_ENV,
|
||||||
|
"schedulerTime"=>gmdate("Y-m-d H:i:s"),
|
||||||
"previous"=>Schedule::Get_Scheduled_Item_Data($timeNow, -1, $prev, "24 hours"),
|
"previous"=>Schedule::Get_Scheduled_Item_Data($timeNow, -1, $prev, "24 hours"),
|
||||||
"current"=>Schedule::Get_Scheduled_Item_Data($timeNow, 0),
|
"current"=>Schedule::Get_Scheduled_Item_Data($timeNow, 0),
|
||||||
"next"=>Schedule::Get_Scheduled_Item_Data($timeNow, 1, $next, "48 hours"),
|
"next"=>Schedule::Get_Scheduled_Item_Data($timeNow, 1, $next, "48 hours"),
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong">
|
||||||
<?php
|
<?php
|
||||||
|
echo $this->statusMsg;
|
||||||
echo $this->form;
|
echo $this->form;
|
||||||
?>
|
?>
|
||||||
|
</div>
|
||||||
|
|
|
@ -1,4 +1 @@
|
||||||
Preferences Updated.
|
Left empty on purpose
|
||||||
<?php
|
|
||||||
echo $this->form;
|
|
||||||
?>
|
|
||||||
|
|
|
@ -1,3 +1,17 @@
|
||||||
|
/* function to create popup window */
|
||||||
|
function popup(mylink){
|
||||||
|
if (!window.focus)
|
||||||
|
return true;
|
||||||
|
var href;
|
||||||
|
if (typeof(mylink) == 'string')
|
||||||
|
href=mylink;
|
||||||
|
else
|
||||||
|
href=mylink.href;
|
||||||
|
window.open(href, "player", 'width=300,height=100,scrollbars=yes');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Takes an input parameter of milliseconds and converts these into
|
/* Takes an input parameter of milliseconds and converts these into
|
||||||
* the format HH:MM:SS */
|
* the format HH:MM:SS */
|
||||||
function convertToHHMMSS(timeInMS){
|
function convertToHHMMSS(timeInMS){
|
||||||
|
@ -100,10 +114,10 @@ function convertDateToHHMMSS(epochTime){
|
||||||
* and converts this to epoch/posix time. */
|
* and converts this to epoch/posix time. */
|
||||||
function convertDateToPosixTime(s){
|
function convertDateToPosixTime(s){
|
||||||
|
|
||||||
var temp = s.split(" ");
|
var datetime = s.split(" ");
|
||||||
|
|
||||||
var date = temp[0].split("-");
|
var date = datetime[0].split("-");
|
||||||
var time = temp[1].split(":");
|
var time = datetime[1].split(":");
|
||||||
|
|
||||||
var year = date[0];
|
var year = date[0];
|
||||||
var month = date[1];
|
var month = date[1];
|
||||||
|
@ -114,9 +128,9 @@ function convertDateToPosixTime(s){
|
||||||
var msec = 0;
|
var msec = 0;
|
||||||
|
|
||||||
if (time[2].indexOf(".") != -1){
|
if (time[2].indexOf(".") != -1){
|
||||||
var temp1 = time[2].split(".");
|
var temp = time[2].split(".");
|
||||||
sec = temp1[0];
|
sec = temp[0];
|
||||||
msec = temp1[1];
|
msec = temp[1];
|
||||||
} else
|
} else
|
||||||
sec = time[2];
|
sec = time[2];
|
||||||
|
|
||||||
|
|
|
@ -15,10 +15,9 @@ var uiUpdateInterval = 200;
|
||||||
|
|
||||||
var songEndFunc;
|
var songEndFunc;
|
||||||
|
|
||||||
//var showStartPosixTime = 0;
|
//set to "development" if we are developing :). Useful to disable alerts
|
||||||
//var showEndPosixTime = 0;
|
//when entering production mode.
|
||||||
//var showLengthMs = 1;
|
var APPLICATION_ENV = "";
|
||||||
//var currentShowName = "";
|
|
||||||
|
|
||||||
/* boolean flag to let us know if we should prepare to execute a function
|
/* boolean flag to let us know if we should prepare to execute a function
|
||||||
* that flips the playlist to the next song. This flags purpose is to
|
* that flips the playlist to the next song. This flags purpose is to
|
||||||
|
@ -108,8 +107,9 @@ function updateProgressBarValue(){
|
||||||
if (diff < serverUpdateInterval && diff >= 0){
|
if (diff < serverUpdateInterval && diff >= 0){
|
||||||
nextSongPrepare = false;
|
nextSongPrepare = false;
|
||||||
setTimeout(newSongStart, diff);
|
setTimeout(newSongStart, diff);
|
||||||
} else if (diff < 0){
|
} else if (diff < 0 && APPLICATION_ENV == "development"){
|
||||||
alert ("Warning: estimatedSchedulePosixTime > songStartPosixTime");
|
alert ("Warning: estimatedSchedulePosixTime > songStartPosixTime");
|
||||||
|
alert (estimatedSchedulePosixTime + " " + nextSongs[0].songStartPosixTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ function updateProgressBarValue(){
|
||||||
if (diff < serverUpdateInterval && diff >= 0){
|
if (diff < serverUpdateInterval && diff >= 0){
|
||||||
nextShowPrepare = false;
|
nextShowPrepare = false;
|
||||||
setTimeout(nextShowStart, diff);
|
setTimeout(nextShowStart, diff);
|
||||||
} else if (diff < 0){
|
} else if (diff < 0 && APPLICATION_ENV == "development"){
|
||||||
alert ("Warning: estimatedSchedulePosixTime > showStartPosixTime");
|
alert ("Warning: estimatedSchedulePosixTime > showStartPosixTime");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,6 +202,8 @@ function calcAdditionalShowData(show){
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseItems(obj){
|
function parseItems(obj){
|
||||||
|
APPLICATION_ENV = obj.env;
|
||||||
|
|
||||||
var schedulePosixTime = convertDateToPosixTime(obj.schedulerTime);
|
var schedulePosixTime = convertDateToPosixTime(obj.schedulerTime);
|
||||||
schedulePosixTime += parseInt(obj.timezoneOffset)*1000;
|
schedulePosixTime += parseInt(obj.timezoneOffset)*1000;
|
||||||
|
|
||||||
|
@ -244,18 +246,6 @@ function init() {
|
||||||
secondsTimer();
|
secondsTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
function popup(mylink){
|
|
||||||
if (!window.focus)
|
|
||||||
return true;
|
|
||||||
var href;
|
|
||||||
if (typeof(mylink) == 'string')
|
|
||||||
href=mylink;
|
|
||||||
else
|
|
||||||
href=mylink.href;
|
|
||||||
window.open(href, "player", 'width=300,height=100,scrollbars=yes');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
init();
|
init();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue