/** * Tests the JApplicationSite::getParams method. * * @return void * * @since 3.2 */ public function testGetParams() { JFactory::$application = $this->class; $this->class->loadLanguage(); $params = $this->class->getParams('com_content'); $this->assertEquals($params->get('show_item_navigation'), '1', 'com_content show_item_navigation defaults to 1'); }
/** * Display the view. * * @param mixed $tpl * * @throws \Exception * @return string */ public function display($tpl = null) { $this->app = JFactory::getApplication(); $this->option = $this->app->input->getCmd('option'); $this->userId = (int) JFactory::getUser()->get('id'); if (!$this->userId) { $this->setLayout('intro'); } // Get component params. $this->params = $this->app->getParams($this->option); // Get date format. $this->dateFormat = $this->params->get('date_format_views', JText::_('DATE_FORMAT_LC3')); $this->rewardsEnabled = (bool) $this->params->get('rewards_enabled', Prism\Constants::ENABLED); $this->disabledButton = ''; $this->layout = $this->getLayout(); switch ($this->layout) { case 'funding': $this->prepareFunding(); break; case 'story': $this->prepareStory(); break; case 'rewards': $this->prepareRewards(); break; case 'extras': $this->prepareExtras(); break; case 'manager': $this->prepareManager(); break; case 'intro': $this->prepareIntro(); break; default: // Basic data for project $this->prepareBasic(); break; } // Get wizard type $this->wizardType = $this->params->get('project_wizard_type', 'five_steps'); $this->sixSteps = strcmp('six_steps', $this->wizardType) === 0; $this->layoutData = array('layout' => $this->layout, 'item_id' => ($this->item !== null and (int) $this->item->id > 0) ? (int) $this->item->id : 0, 'rewards_enabled' => $this->rewardsEnabled); $this->prepareDebugMode(); $this->prepareDocument(); parent::display($tpl); }
/** * Display the view. * * @param mixed $tpl * * @return string */ public function display($tpl = null) { $this->userId = JFactory::getUser()->get("id"); if (!$this->userId) { $this->setLayout("intro"); } // Get component params. $this->params = $this->app->getParams($this->option); $this->rewardsEnabled = (bool) $this->params->get("rewards_enabled", 1); $this->disabledButton = ""; $this->layout = $this->getLayout(); switch ($this->layout) { case "funding": $this->prepareFunding(); break; case "story": $this->prepareStory(); break; case "rewards": $this->prepareRewards(); break; case "extras": $this->prepareExtras(); break; case "manager": $this->prepareManager(); break; case "intro": $this->prepareIntro(); break; default: // Basic data for project $this->prepareBasic(); break; } // Get wizard type $this->wizardType = $this->params->get("project_wizard_type", "five_steps"); $this->sixSteps = strcmp("six_steps", $this->wizardType) != 0 ? false : true; $this->layoutData = array("layout" => $this->layout, "item_id" => !empty($this->item->id) ? $this->item->id : 0, "rewards_enabled" => $this->rewardsEnabled); $this->prepareDebugMode(); $this->prepareDocument(); parent::display($tpl); }