/** * Initializes the component */ public function init() { $this->_checker = new Whitelist\Check(); // Load any stored definitions $definitions = Setting::getString('whitelist'); if (!empty($definitions)) { $definitions = $this->parseDefinitions($definitions); $this->setDefinitions($definitions); } parent::init(); }
/** * Initializes the controller. The application name and language is set here. */ public function init() { // Fallback to XBMC Video Server if the user has removed the // application name $name = Setting::getString('applicationName'); if (!$name) { $name = 'XBMC Video Server'; } Yii::app()->name = $name; Yii::app()->language = Yii::app()->languageManager->getCurrent(); parent::init(); }
/** * Initializes the component. The application language is set here. The * language selected is the one the user has specified, if not the * configured application language (which defaults to en). */ public function init() { $applicationLanguage = Setting::getString('language'); $sessionLanguage = Yii::app()->session->get(self::SESSION_KEY); $userLanguage = $this->getUserLanguage(); if ($sessionLanguage) { $this->_currentLanguage = $sessionLanguage; } elseif ($userLanguage) { $this->_currentLanguage = $userLanguage; } else { $this->_currentLanguage = $applicationLanguage; } parent::init(); }
/** * Initializes the controller. The application name and language is set here. */ public function init() { // Use the defined request timeout as execution time limit $requestTimeout = Setting::getInteger('requestTimeout'); set_time_limit($requestTimeout); // Fallback to XBMC Video Server if the user has removed the // application name $name = Setting::getString('applicationName'); if (!$name) { $name = 'XBMC Video Server'; } Yii::app()->name = $name; Yii::app()->language = Yii::app()->languageManager->getCurrent(); parent::init(); }
/** * Factory method for creating playlist objects * @param string $fileName * @param string $format the desired playlist format. Defaults to null, * meaning the configured default format will be used * @return Playlist the playlist object * @throws InvalidRequestException if the playlist format is not supported */ public static function create($fileName, $format = null) { if ($format === null) { $format = Setting::getString('playlistFormat'); } switch ($format) { case Playlist::TYPE_M3U: return new M3UPlaylist($fileName); case Playlist::TYPE_XSPF: return new XSPFPlaylist($fileName); case Playlist::TYPE_PLS: return new PLSPlaylist($fileName); default: throw new InvalidRequestException(); } }
/** * Renders the "Watch as playlist" button */ private function renderWatchButton() { // Select the default playlist format by default $dropdownOptions = array(Setting::getString('playlistFormat') => array('selected' => 'selected')); echo TbHtml::dropDownListControlGroup('playlistFormat', 'playlistFormat', PlaylistFactory::getTypes(), array('label' => Yii::t('Settings', 'Playlist format'), 'options' => $dropdownOptions)); echo TbHtml::submitButton(Yii::t('RetrieveMediaWidget', 'Watch as playlist'), $this->getWatchButtonsOptions()); }
<?php $name = Setting::getString('applicationName'); $subtitle = Setting::getString('applicationSubtitle'); ?> <div class="row-fluid"> <div class="span12 header"> <?php if ($name) { ?> <h1 id="home-url"> <a href="<?php echo Yii::app()->homeUrl; ?> "> <?php echo $name; ?> </a> </h1> <?php } if ($subtitle) { echo CHtml::tag('p', array('class' => 'lead'), $subtitle); } ?> </div> </div>