/** * Display the view */ public function display($tpl = null) { $this->option = JFactory::getApplication()->input->get('option'); $this->state = $this->get('State'); $this->item = $this->get('Item'); $this->form = $this->get('Form'); $this->params = $this->state->get('params'); // Get rewards images URI. if (!empty($this->item->id)) { $userId = CrowdfundingHelper::getUserIdByRewardId($this->item->id); $uri = JUri::getInstance(); $this->rewardsImagesUri = $uri->toString(array('scheme', 'host')) . '/' . CrowdfundingHelper::getImagesFolderUri($userId); } $app = JFactory::getApplication(); /** @var $app JApplicationAdministrator */ // Get project title. $projectId = $app->getUserState('com_crowdfunding.rewards.pid'); $this->projectTitle = CrowdfundingHelper::getProjectTitle($projectId); // Get a property that give us ability to upload images. $this->allowedImages = $this->params->get('rewards_images', 0); $this->layout = $this->getLayout(); if (strcmp('default', $this->layout) === 0) { $this->prepareDefaultLayout(); } // Prepare actions, behaviors, scripts and document. $this->addToolbar(); $this->setDocument(); parent::display($tpl); }
/** * Method to get the data that should be injected in the form. * * @return mixed The data for the form. * @since 1.6 */ protected function loadFormData() { // Check the session for previously entered form data. $data = JFactory::getApplication()->getUserState($this->option . '.edit.report.data', array()); if (empty($data)) { $data = $this->getItem(); $data->title = CrowdfundingHelper::getProjectTitle($data->project_id); } return $data; }
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); $projectId = $this->state->get('project_id'); $this->projectTitle = CrowdfundingHelper::getProjectTitle($projectId); // 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); $projectId = $this->state->get('project_id'); $this->projectTitle = CrowdfundingHelper::getProjectTitle($projectId); // 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->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'); // Get currencies $currencyCodes = array(); foreach ($this->items as $item) { $currencyCodes[] = $item->txn_currency; $currencyCodes = array_unique($currencyCodes); } if (count($currencyCodes) > 0) { $this->currencies = new Crowdfunding\Currencies(JFactory::getDbo()); $this->currencies->load(array('codes' => $currencyCodes)); $this->money = $this->getMoneyFormatter($this->cfParams); } // Get project title. $search = $this->state->get('filter.search'); if (JString::strlen($search) > 0 and strpos($search, 'pid') === 0) { $projectId = (int) substr($search, 4); $this->projectTitle = CrowdfundingHelper::getProjectTitle($projectId); } // Get enabled specific plugins. $extensions = new Prism\Extensions(JFactory::getDbo(), $this->specificPlugins); $this->enabledSpecificPlugins = $extensions->getEnabled(); // Prepare sorting data $this->prepareSorting(); // Prepare actions $this->addToolbar(); $this->addSidebar(); $this->setDocument(); // Include HTML helper JLoader::register('JHtmlString', JPATH_LIBRARIES . '/joomla/html/html/string.php'); parent::display($tpl); }
public function display($tpl = null) { $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"); // Get currencies foreach ($this->items as $item) { $currencies[] = $item->txn_currency; $currencies = array_unique($currencies); } if (!empty($currencies)) { $this->currencies = new Crowdfunding\Currencies(JFactory::getDbo()); $this->currencies->load(array("codes" => $currencies)); $this->amount = new Crowdfunding\Amount($this->cfParams); } // Get project title. $search = $this->state->get("filter.search"); if (!empty($search) and 0 === strpos($search, "pid")) { $projectId = (int) substr($search, 4); $this->projectTitle = CrowdfundingHelper::getProjectTitle($projectId); } // Get enabled specific plugins. $extensions = new Prism\Extensions(JFactory::getDbo(), $this->specificPlugins); $this->enabledSpecificPlugins = $extensions->getEnabled(); // Add submenu CrowdfundingFinanceHelper::addSubmenu($this->getName()); // Prepare sorting data $this->prepareSorting(); // Prepare actions $this->addToolbar(); $this->addSidebar(); $this->setDocument(); // Include HTML helper JLoader::register('JHtmlString', JPATH_LIBRARIES . '/joomla/html/html/string.php'); parent::display($tpl); }