示例#1
0
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     $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, JPATH_BASE);
     }
     $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);
 }
示例#2
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");
     jimport("crowdfunding.currency");
     $currencyId = $this->state->params->get("project_currency");
     $this->currency = CrowdFundingCurrency::getInstance(JFactory::getDbo(), $currencyId, $this->params);
     // Add submenu
     CrowdFundingHelper::addSubmenu("projects");
     $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);
 }