public function action_index() { $this->view = new View_Item_Safe_Index(); $config = Kohana::$config->load('items.safe'); $max_items = $config['pagination']; $items = Item::location('safe'); $paginate = Paginate::factory($items, array('total_items' => $max_items), $this->request)->execute(); $this->view->pagination = $paginate->render(); $this->view->items = $paginate->result(); $this->view->process_url = Route::url('item.safe.move'); $this->view->shop = ORM::factory('User_Shop')->where('user_id', '=', $this->user->id)->find()->loaded(); $this->view->links = array(array('name' => 'Inventory', 'link' => Route::url('item.inventory')), array('name' => 'Shop', 'link' => Route::url('item.user_shop.index')), array('name' => 'Cookbook', 'link' => Route::url('item.cookbook'))); }
public function action_index() { $this->view = new View_Item_Inventory_Index(); $config = Kohana::$config->load('items.inventory'); $max_items = $config['pagination']; if ($config['ajax'] === TRUE) { $this->view->ajax = TRUE; } $items = Item::location('inventory'); $paginate = Paginate::factory($items, array('total_items' => $max_items), $this->request)->execute(); $this->view->pagination = $paginate->render(); $this->view->items = $paginate->result(); $this->view->links = array(array('name' => 'Safe', 'link' => Route::url('item.safe')), array('name' => 'Shop', 'link' => Route::url('item.user_shop.index')), array('name' => 'Cookbook', 'link' => Route::url('item.cookbook'))); }
public function items() { return Item::location('trade.lot', FALSE, $this->id, $this->user)->find_all(); }
public function action_view() { $id = $this->request->param('id'); $shop = ORM::factory('User_Shop', $id); if (!$shop->loaded()) { throw HTTP_Exception::Factory('404', 'No such user shop.'); } $this->view = new View_Item_Shop_View(); $this->view->shop = $shop->as_array(); $this->view->owner = $shop->user->as_array(); $inventory = Item::location('shop', FALSE, NULL, $shop->user)->where('parameter', '>', '0')->find_all(); $this->view->items = $inventory; }
public function items() { return Item::location('trade.bid', TRUE, $this->id, $this->user)->find_all(); }