CC-4100: Make number of shows displayed in widget customizable
-fixed
This commit is contained in:
parent
b782b9a9b6
commit
bd51b4db02
6 changed files with 23 additions and 21 deletions
|
@ -271,31 +271,31 @@ class ApiController extends Zend_Controller_Action
|
|||
|
||||
$request = $this->getRequest();
|
||||
$type = $request->getParam('type');
|
||||
if($type == "endofday") {
|
||||
if ($type == "endofday") {
|
||||
|
||||
$limit = $request->getParam('limit');
|
||||
Logging::log($limit);
|
||||
if($limit == "" || !is_numeric($limit)) {
|
||||
$limit = "5";
|
||||
}
|
||||
|
||||
// make GetNextShows use end of day
|
||||
$utcTimeEnd = Application_Common_DateHelper::GetDayEndTimestampInUtc();
|
||||
$result = array("env"=>APPLICATION_ENV,
|
||||
"schedulerTime"=>gmdate("Y-m-d H:i:s"),
|
||||
"nextShow"=>Application_Model_Show::GetNextShows($utcTimeNow, 5, $utcTimeEnd));
|
||||
"nextShow"=>Application_Model_Show::GetNextShows($utcTimeNow, $limit, $utcTimeEnd));
|
||||
|
||||
Application_Model_Show::ConvertToLocalTimeZone($result["nextShow"], array("starts", "ends", "start_timestamp", "end_timestamp"));
|
||||
}else{
|
||||
|
||||
$limit = $request->getParam('limit');
|
||||
if($limit == "" || !is_numeric($limit)) {
|
||||
$limit = "5";
|
||||
}
|
||||
|
||||
} else {
|
||||
$result = Application_Model_Schedule::GetPlayOrderRange();
|
||||
|
||||
//Convert from UTC to localtime for user.
|
||||
|
||||
//Convert from UTC to localtime for Web Browser.
|
||||
Application_Model_Show::ConvertToLocalTimeZone($result["currentShow"], array("starts", "ends", "start_timestamp", "end_timestamp"));
|
||||
Application_Model_Show::ConvertToLocalTimeZone($result["nextShow"], array("starts", "ends", "start_timestamp", "end_timestamp"));
|
||||
}
|
||||
|
||||
$result['AIRTIME_API_VERSION'] = AIRTIME_API_VERSION; //used by caller to determine if the airtime they are running or widgets in use is out of date.
|
||||
|
||||
//echo json_encode($result);
|
||||
header("Content-type: text/javascript");
|
||||
echo $_GET['callback'].'('.json_encode($result).')';
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue