Merge branch 'master' of dev.sourcefabric.org:campcaster
This commit is contained in:
commit
d2fb99eff9
5 changed files with 131 additions and 41 deletions
|
@ -103,41 +103,55 @@ class ApiController extends Zend_Controller_Action
|
|||
exit;
|
||||
}
|
||||
|
||||
public function liveInfoAction(){
|
||||
// disable the view and the layout
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
public function liveInfoAction()
|
||||
{
|
||||
if (Application_Model_Preference::GetAllow3rdPartyApi()){
|
||||
// disable the view and the layout
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$result = Schedule::GetPlayOrderRange(0, 1);
|
||||
$result = Schedule::GetPlayOrderRange(0, 1);
|
||||
|
||||
$date = new Application_Model_DateHelper;
|
||||
$timeNow = $date->getDate();
|
||||
$result = array("env"=>APPLICATION_ENV,
|
||||
"schedulerTime"=>gmdate("Y-m-d H:i:s"),
|
||||
"currentShow"=>Show_DAL::GetCurrentShow($timeNow),
|
||||
"nextShow"=>Show_DAL::GetNextShows($timeNow, 5),
|
||||
"timezone"=> date("T"),
|
||||
"timezoneOffset"=> date("Z"));
|
||||
|
||||
//echo json_encode($result);
|
||||
header("Content-type: text/javascript");
|
||||
echo $_GET['callback'].'('.json_encode($result).')';
|
||||
$date = new Application_Model_DateHelper;
|
||||
$timeNow = $date->getDate();
|
||||
$result = array("env"=>APPLICATION_ENV,
|
||||
"schedulerTime"=>gmdate("Y-m-d H:i:s"),
|
||||
"currentShow"=>Show_DAL::GetCurrentShow($timeNow),
|
||||
"nextShow"=>Show_DAL::GetNextShows($timeNow, 5),
|
||||
"timezone"=> date("T"),
|
||||
"timezoneOffset"=> date("Z"));
|
||||
|
||||
//echo json_encode($result);
|
||||
header("Content-type: text/javascript");
|
||||
echo $_GET['callback'].'('.json_encode($result).')';
|
||||
} else {
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
print 'You are not allowed to access this resource. ';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
public function weekInfoAction(){
|
||||
// disable the view and the layout
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
public function weekInfoAction()
|
||||
{
|
||||
if (Application_Model_Preference::GetAllow3rdPartyApi()){
|
||||
// disable the view and the layout
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$dow = array("sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday");
|
||||
$dow = array("sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday");
|
||||
|
||||
$result = array();
|
||||
for ($i=0; $i<7; $i++){
|
||||
$result[$dow[$i]] = Show_DAL::GetShowsByDayOfWeek($i);
|
||||
$result = array();
|
||||
for ($i=0; $i<7; $i++){
|
||||
$result[$dow[$i]] = Show_DAL::GetShowsByDayOfWeek($i);
|
||||
}
|
||||
|
||||
header("Content-type: text/javascript");
|
||||
echo $_GET['callback'].'('.json_encode($result).')';
|
||||
} else {
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
print 'You are not allowed to access this resource. ';
|
||||
exit;
|
||||
}
|
||||
|
||||
header("Content-type: text/javascript");
|
||||
echo $_GET['callback'].'('.json_encode($result).')';
|
||||
}
|
||||
|
||||
public function scheduleAction()
|
||||
|
|
|
@ -30,12 +30,13 @@ class PreferenceController extends Zend_Controller_Action
|
|||
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
||||
Application_Model_Preference::SetDefaultFade($values["stationDefaultFade"]);
|
||||
Application_Model_Preference::SetStreamLabelFormat($values["streamFormat"]);
|
||||
Application_Model_Preference::SetAllow3rdPartyApi($values["thirdPartyApi"]);
|
||||
Application_Model_Preference::SetDoSoundCloudUpload($values["UseSoundCloud"]);
|
||||
Application_Model_Preference::SetSoundCloudUser($values["SoundCloudUser"]);
|
||||
Application_Model_Preference::SetSoundCloudPassword($values["SoundCloudPassword"]);
|
||||
Application_Model_Preference::SetSoundCloudTags($values["SoundCloudTags"]);
|
||||
|
||||
$this->view->statusMsg = "Preferences Updated.";
|
||||
$this->view->statusMsg = "<div class='success'>Preferences updated.</div>";
|
||||
}
|
||||
|
||||
$this->view->form = $form;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue