/** * Display a list of all collections * * @return void */ public function displayTask() { // Get filters $this->view->filters = array('sort' => Request::getState($this->_option . '.' . $this->_controller . '.sort', 'filter_order', 'title'), 'sort_Dir' => Request::getState($this->_option . '.' . $this->_controller . '.sortdir', 'filter_order_Dir', 'ASC'), 'limit' => Request::getState($this->_option . '.' . $this->_controller . '.limit', 'limit', Config::get('list_limit'), 'int'), 'start' => Request::getState($this->_option . '.' . $this->_controller . '.limitstart', 'limitstart', 0, 'int')); //print_r($this->view->filters); $obj = new Archive(); // Get record count $this->view->total = $obj->collections('count', $this->view->filters); // Get records $this->view->rows = $obj->collections('list', $this->view->filters); //print_r($this->view->rows); die; // Set any errors if ($this->getError()) { foreach ($this->getErrors() as $error) { $this->view->setError($error); } } // Output the HTML //print_r($this->view); die; $this->view->display(); }
/** * Edit a category * * @return void */ public function editTask($row = null) { Request::setVar('hidemainmenu', 1); $obj = new Archive(); // Get types $this->view->types = $obj->getProductTypes(); // Get collections $this->view->collections = $obj->collections('list', array('sort' => 'cType')); // Get all option groups $this->view->optionGroups = $obj->optionGroups('list', array('sort' => 'ogName')); if (is_object($row)) { $id = $row->getId(); $this->view->row = $row; $this->view->task = 'edit'; } else { // Incoming $id = Request::getVar('id', array(0)); if (is_array($id) && !empty($id)) { $id = $id[0]; } // Load product $this->view->row = $obj->product($id); } // Get product option groups $this->view->productOptionGroups = $this->view->row->getOptionGroups(); $this->view->config = $this->config; // Check if meta is needed for this product $pType = $this->view->row->getType(); $this->view->metaNeeded = false; // Only software needs meta if ($pType == 30) { $this->view->metaNeeded = true; } // Get number of downloads $downloaded = CartDownload::countProductDownloads($id); $this->view->downloaded = $downloaded; // Set any errors foreach ($this->getErrors() as $error) { $this->view->setError($error); } // Output the HTML $this->view->setLayout('edit')->display(); }