fixed the total count being passed and undid previous commit
This commit is contained in:
parent
895e0a90de
commit
59df8ca6f8
|
@ -37,6 +37,7 @@ class Rest_PodcastController extends Zend_Rest_Controller
|
||||||
$result = PodcastQuery::create()
|
$result = PodcastQuery::create()
|
||||||
// Don't return the Station podcast - we fetch it separately
|
// Don't return the Station podcast - we fetch it separately
|
||||||
->filterByDbId($stationPodcastId, Criteria::NOT_EQUAL);
|
->filterByDbId($stationPodcastId, Criteria::NOT_EQUAL);
|
||||||
|
$total = $result->count();
|
||||||
if ($limit > 0) { $result->setLimit($limit); }
|
if ($limit > 0) { $result->setLimit($limit); }
|
||||||
$result->setOffset($offset)
|
$result->setOffset($offset)
|
||||||
->orderBy($sortColumn, $sortDir);
|
->orderBy($sortColumn, $sortDir);
|
||||||
|
@ -44,9 +45,10 @@ class Rest_PodcastController extends Zend_Rest_Controller
|
||||||
|
|
||||||
$podcastArray = $result->toArray(null, false, BasePeer::TYPE_FIELDNAME);
|
$podcastArray = $result->toArray(null, false, BasePeer::TYPE_FIELDNAME);
|
||||||
|
|
||||||
|
|
||||||
$this->getResponse()
|
$this->getResponse()
|
||||||
->setHttpResponseCode(200)
|
->setHttpResponseCode(200)
|
||||||
->setHeader('X-TOTAL-COUNT', $result->count())
|
->setHeader('X-TOTAL-COUNT', $total)
|
||||||
->appendBody(json_encode($podcastArray));
|
->appendBody(json_encode($podcastArray));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,6 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
"bAutoWidth": false,
|
"bAutoWidth": false,
|
||||||
"aaSorting": [],
|
"aaSorting": [],
|
||||||
"iDisplayLength": 25,
|
"iDisplayLength": 25,
|
||||||
"iDisplayStart": 25,
|
|
||||||
"aLengthMenu": [25, 50, 100],
|
"aLengthMenu": [25, 50, 100],
|
||||||
"oLanguage" : getDatatablesStrings({
|
"oLanguage" : getDatatablesStrings({
|
||||||
"sEmptyTable": $.i18n._(""),
|
"sEmptyTable": $.i18n._(""),
|
||||||
|
@ -429,6 +428,8 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
"type": "GET",
|
"type": "GET",
|
||||||
"url": sSource,
|
"url": sSource,
|
||||||
"data": {
|
"data": {
|
||||||
|
"limit": oSettings._iDisplayLength,
|
||||||
|
"offset": oSettings._iDisplayStart,
|
||||||
"sort": sortColName,
|
"sort": sortColName,
|
||||||
"sort_dir": sortDir,
|
"sort_dir": sortDir,
|
||||||
"search": search
|
"search": search
|
||||||
|
|
Loading…
Reference in New Issue