示例#1
0
文件: News.php 项目: ratbird/hope
 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);
 }