private function getRangedNews($range_id) { $news = \StudipNews::getNewsByRange($range_id, true, true); if (!self::checkRangePermission($range_id, $GLOBALS['user']->id)) { $this->error(401); } $total = count($news); $news = array_slice($news, $this->offset, $this->limit); $json = array(); foreach ($news as $n) { $json[$this->urlf('/news/%s', array($n->id))] = $this->newsToJson($n); } return array($json, $total); }