public function display($tpl = null) { $this->version = new CrowdfundingFinance\Version(); // Load ITPrism library version if (!class_exists("Prism\\Version")) { $this->itprismVersion = JText::_("COM_CROWDFUNDINGFINANCE_PRISM_LIBRARY_DOWNLOAD"); } else { $itprismVersion = new Prism\Version(); $this->itprismVersion = $itprismVersion->getShortVersion(); } /** @var $cfParams Joomla\Registry\Registry */ $cfParams = JComponentHelper::getParams("com_crowdfunding"); $this->cfParams = $cfParams; // Get latest transactions. $this->latest = new Crowdfunding\Statistics\Transactions\Latest(JFactory::getDbo()); $this->latest->load(5); $basic = new Crowdfunding\Statistics\Basic(JFactory::getDbo()); $this->totalProjects = $basic->getTotalProjects(); $this->totalTransactions = $basic->getTotalTransactions(); $this->totalAmount = $basic->getTotalAmount(); // Get currency. $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->cfParams->get("project_currency")); $this->amount = new Crowdfunding\Amount($this->cfParams); $this->amount->setCurrency($currency); // Add submenu CrowdfundingFinanceHelper::addSubmenu($this->getName()); $this->addToolbar(); $this->addSidebar(); $this->setDocument(); parent::display($tpl); }
public function display($tpl = null) { $this->version = new Crowdfundingfinance\Version(); // Load Prism library version if (!class_exists('Prism\\Version')) { $this->prismVersion = JText::_('COM_CROWDFUNDINGFINANCE_PRISM_LIBRARY_DOWNLOAD'); } else { $prismVersion = new Prism\Version(); $this->prismVersion = $prismVersion->getShortVersion(); if (version_compare($this->prismVersion, $this->version->requiredPrismVersion, '<')) { $this->prismVersionLowerMessage = JText::_('COM_CROWDFUNDINGFINANCE_PRISM_LIBRARY_LOWER_VERSION'); } } $this->cfParams = JComponentHelper::getParams('com_crowdfunding'); /** @var $cfParams Joomla\Registry\Registry */ // Get latest transactions. $this->latest = new Crowdfunding\Statistics\Transactions\Latest(JFactory::getDbo()); $this->latest->load(array('limit' => 5)); $basic = new Crowdfunding\Statistics\Basic(JFactory::getDbo()); $this->totalProjects = $basic->getTotalProjects(); $this->totalTransactions = $basic->getTotalTransactions(); $this->totalAmount = $basic->getTotalAmount(); $this->money = $this->getMoneyFormatter($this->cfParams); // Add submenu CrowdfundingfinanceHelper::addSubmenu($this->getName()); $this->addToolbar(); $this->addSidebar(); $this->setDocument(); parent::display($tpl); }