/** * List "child" resources without any parent associations * * @return void */ public function orphansTask() { $this->view->pid = '-1'; // Incoming $this->view->filters = array('parent_id' => $this->view->pid, 'limit' => Request::getState($this->_option . '.orphans.limit', 'limit', Config::get('list_limit'), 'int'), 'start' => Request::getState($this->_option . '.orphans.limitstart', 'limitstart', 0, 'int'), 'search' => urldecode(Request::getState($this->_option . '.orphans.search', 'search', '')), 'sort' => Request::getState($this->_option . '.orphans.sort', 'filter_order', 'created'), 'sort_Dir' => Request::getState($this->_option . '.orphans.sortdir', 'filter_order_Dir', 'DESC'), 'status' => Request::getState($this->_option . '.orphans.status', 'status', 'all')); $model = new Resource($this->database); // Record count $this->view->total = $model->getItemChildrenCount($this->view->filters); // Get only children of this parent $this->view->rows = $model->getItemChildren($this->view->filters); // Get sections for learning modules // TODO: Phase out all learning modules code $rt = new Type($this->database); $this->view->sections = $rt->getTypes(29); // Set any errors foreach ($this->getErrors() as $error) { $this->view->setError($error); } // Output the HTML $this->view->setLayout('children')->display(); }