/** * Display module content * * @return void */ public function display() { $db = \App::get('db'); // Get the module parameters $params = $this->params; $this->moduleclass = $params->get('moduleclass', ''); $limit = intval($params->get('limit', 5)); // Load component configs $config = Component::params('com_projects'); // Load classes require_once Component::path('com_projects') . DS . 'tables' . DS . 'project.php'; require_once Component::path('com_projects') . DS . 'helpers' . DS . 'html.php'; // Set filters $filters = array('mine' => 1, 'limit' => $limit, 'start' => 0, 'updates' => 1, 'sortby' => 'myprojects', 'getowner' => 1); $setup_complete = $config->get('confirm_step', 0) ? 3 : 2; $this->filters = $filters; $this->pconfig = $config; // Get a record count $obj = new \Components\Projects\Tables\Project($db); $this->total = $obj->getCount($filters, false, User::get('id'), 0, $setup_complete); // Get records $this->rows = $obj->getRecords($filters, false, User::get('id'), 0, $setup_complete); // pass limit to view $this->limit = $limit; require $this->getLayoutPath(); }
/** * Start page * * @return void */ public function displayTask() { $project = new \Components\Projects\Tables\Project($this->database); // Get filters $filters = array('sortby' => 'title', 'sortdir' => 'DESC', 'authorized' => true); $this->view->projects = $project->getRecords($filters, true, 0, 1); // Set any errors if ($this->getError()) { $this->view->setError($this->getError()); } // Output the HTML $this->view->setLayout('display')->display(); }