Exemple #1
0
 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");
     $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->state->params->get("project_currency"));
     $this->amount = new Crowdfunding\Amount($this->params);
     $this->amount->setCurrency($currency);
     // Get rewards number
     $usersIds = array();
     foreach ($this->items as $item) {
         $usersIds[] = $item->id;
     }
     // Get number of rewards.
     $statistics = new Crowdfunding\Statistics\Users(JFactory::getDbo(), $usersIds);
     $this->projects = $statistics->getProjectsNumber();
     $this->amounts = $statistics->getAmounts();
     // 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->getMoneyFormatter($this->params);
     // Get user IDs.
     $usersIds = Prism\Utilities\ArrayHelper::getIds($this->items);
     // Get the number of user's project.
     $statistics = new Crowdfunding\Statistics\Users(JFactory::getDbo(), $usersIds);
     $this->projects = $statistics->getProjectsNumber();
     $this->amounts = $statistics->getAmounts();
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->getName());
     // Prepare sorting data
     $this->prepareSorting();
     // Prepare actions
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }