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');
     $this->params = $this->state->get('params');
     // Get currency
     $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->state->params->get('project_currency'));
     // Create object 'Amount'.
     $this->amount = new Crowdfunding\Amount($this->params);
     $this->amount->setCurrency($currency);
     // Get projects IDs
     $projectsIds = array();
     foreach ($this->items as $item) {
         $projectsIds[] = $item->id;
     }
     // Get number of rewards.
     $projects = new Crowdfunding\Projects(JFactory::getDbo());
     $this->rewards = $projects->getRewardsNumber($projectsIds);
     // Prepare sorting data
     $this->prepareSorting();
     if ($this->getLayout() !== 'modal') {
         // Prepare actions
         $this->addToolbar();
         $this->addSidebar();
     }
     $this->setDocument();
     parent::display($tpl);
 }
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->params = $this->state->get("params");
     // Get currency
     $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->state->params->get("project_currency"));
     // Create object "Amount".
     $this->amount = new Crowdfunding\Amount($this->params);
     $this->amount->setCurrency($currency);
     // Get projects IDs
     $projectsIds = array();
     foreach ($this->items as $item) {
         $projectsIds[] = $item->id;
     }
     // Get number of rewards.
     $projects = new Crowdfunding\Projects(JFactory::getDbo());
     $this->rewards = $projects->getRewardsNumber($projectsIds);
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->getName());
     // 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');
     $this->params = $this->state->get('params');
     $this->money = $this->money = $this->getMoneyFormatter($this->params);
     // Get projects IDs
     $projectsIds = array();
     foreach ($this->items as $item) {
         $projectsIds[] = $item->id;
     }
     // Get number of rewards.
     $projects = new Crowdfunding\Projects(JFactory::getDbo());
     $this->rewards = $projects->getRewardsNumber($projectsIds);
     // Prepare sorting data
     $this->prepareSorting();
     if ($this->getLayout() !== 'modal') {
         // Prepare actions
         $this->addToolbar();
         $this->addSidebar();
     }
     $this->setDocument();
     parent::display($tpl);
 }