public function display($tpl = null) { $this->option = JFactory::getApplication()->input->get('option'); $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); // Get parameters of com_crowdfunding. /** @var $cParams Joomla\Registry\Registry */ $cParams = JComponentHelper::getParams('com_crowdfunding'); $this->cfParams = $cParams; $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->cfParams->get('project_currency')); $this->amount = new Crowdfunding\Amount($this->cfParams); $this->amount->setCurrency($currency); // Get rewards number $projectsIds = array(); foreach ($this->items as $item) { $projectsIds[] = $item->id; } $projects = new Crowdfunding\Projects(JFactory::getDbo()); $this->transactions = $projects->getTransactionsNumber($projectsIds); // Prepare sorting data $this->prepareSorting(); // Prepare actions $this->addToolbar(); $this->addSidebar(); $this->setDocument(); parent::display($tpl); }
public function display($tpl = null) { $this->option = JFactory::getApplication()->input->get('option'); $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); // Get parameters of com_crowdfunding. $this->cfParams = JComponentHelper::getParams('com_crowdfunding'); $this->money = $this->getMoneyFormatter($this->cfParams); // Get transactions number. $projectsIds = Prism\Utilities\ArrayHelper::getIds($this->items); $projects = new Crowdfunding\Projects(JFactory::getDbo()); $this->transactions = $projects->getTransactionsNumber($projectsIds); // Prepare sorting data $this->prepareSorting(); // Prepare actions $this->addToolbar(); $this->addSidebar(); $this->setDocument(); parent::display($tpl); }