コード例 #1
0
ファイル: image.php プロジェクト: uzura8/flockbird
 /**
  * Index action.
  * 
  * @access  public
  * @return  void
  */
 public function action_index()
 {
     $this->set_title_and_breadcrumbs(term('site.image', 'site.management'), array('admin/content' => term('site.content', 'site.management')));
     $this->template->subtitle = \View::forge('content/image/_parts/list_subtitle');
     $this->template->post_footer = \View::forge('_parts/load_masonry');
     list($limit, $page) = $this->common_get_pager_list_params(\Config::get('admin.articles.images.limit'), \Config::get('admin.articles.images.limit_max'));
     $data = \Model_SiteImage::get_pager_list(array('order_by' => array('id' => 'desc'), 'limit' => $limit), $page);
     $this->template->content = \View::forge('content/image/_parts/list', $data);
 }
コード例 #2
0
ファイル: api.php プロジェクト: uzura8/flockbird
 /**
  * Get image list
  * 
  * @access  public
  * @return  Response (html)
  * @throws  Exception in Controller_Base::controller_common_api
  * @see  Controller_Base::controller_common_api
  */
 public function get_list()
 {
     $this->api_accept_formats = array('html', 'json');
     $this->controller_common_api(function () {
         list($limit, $page) = $this->common_get_pager_list_params(\Config::get('admin.articles.images.limit'), \Config::get('admin.articles.images.limit_max'));
         $params = array('order_by' => array('id' => 'desc'));
         if ($limit) {
             $params['limit'] = $limit;
         }
         $data = \Model_SiteImage::get_pager_list($params, $page, $this->format == 'json');
         $this->set_response_body_api($data, $this->format == 'html' ? 'content/image/_parts/list' : null);
     });
 }