/** * @access public * @return Response */ public function action_pictures() { $data = array(); $data['Form'] = new \Form(); $data['Input'] = new \Input(); // $options = array(); $options = \Input::get(); $config = array('pagination_url' => \Input::uri() . '?' . http_build_query($options), 'total_items' => \Collection\Interaction::countSearchResults($options), 'uri_segment' => 'page', 'name' => 'bootstrap', 'per_page' => 50); $pagination = \Pagination::forge('venues', $config); $data['pagination'] = $pagination->render(); // get venues $options['per_page'] = $pagination->per_page; $options['offset'] = $pagination->offset; $data['pictures'] = \Collection\Interaction::search($options); // get all regions $options = array(); $data['regions'] = \Collection\Region::search($options); $data['order_by'] = \Form::select('order_by', \Input::get('order_by'), array('time_created' => 'Date', 'likes' => 'Likes', 'comments' => 'Comments'), array('style' => 'width: 80px')); $data['order_dir'] = \Form::select('order_dir', \Input::get('order_dir'), array('desc' => 'Desc', 'asc' => 'Asc'), array('style' => 'width: 80px')); $data['date_range'] = \Form::select('filter[date_range]', \Input::get('filter.date_range'), array('today' => 'Today', 'yesterday' => 'Yesterday', 'last2days' => 'Last 2 days ago', '2days' => '2 days ago', '3days' => '3 days ago', 'thisweek' => 'This week', 'thismonth' => 'This month'), array('style' => 'width: 80px')); $view = \View::forge('dashboard/pictures.twig', $data); return \Response::forge($view); }
public function get_pictures() { header('Access-Control-Allow-Origin: *'); $options = array(); $options['order_by'] = 'likes'; $options['order_dir'] = 'desc'; $options['filter'] = array(); $options['filter']['date_range'] = 'thisweek'; // get pics $options['per_page'] = 500; $options['offset'] = 0; $data['pictures'] = \Collection\Interaction::search($options); return $this->response($data); }