当前位置: 首页>>代码示例>>PHP>>正文


PHP JApplication::initialise方法代码示例

本文整理汇总了PHP中JApplication::initialise方法的典型用法代码示例。如果您正苦于以下问题:PHP JApplication::initialise方法的具体用法?PHP JApplication::initialise怎么用?PHP JApplication::initialise使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JApplication的用法示例。


在下文中一共展示了JApplication::initialise方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initialise

 /**
  * Initialise the application.
  *
  * @param	array	$options	An optional associative array of configuration settings.
  *
  * @return	void
  * @since	1.5
  */
 public function initialise($options = array())
 {
     $config = JFactory::getConfig();
     // if a language was specified it has priority
     // otherwise use user or default language settings
     if (empty($options['language'])) {
         $user = JFactory::getUser();
         $lang = $user->getParam('admin_language');
         // Make sure that the user's language exists
         if ($lang && JLanguage::exists($lang)) {
             $options['language'] = $lang;
         } else {
             $params = JComponentHelper::getParams('com_languages');
             $client = JApplicationHelper::getClientInfo($this->getClientId());
             $options['language'] = $params->get($client->name, $config->get('language', 'es-LA'));
         }
     }
     // One last check to make sure we have something
     if (!JLanguage::exists($options['language'])) {
         $lang = $config->get('language', 'es-LA');
         if (JLanguage::exists($lang)) {
             $options['language'] = $lang;
         } else {
             $options['language'] = 'es-LA';
             // as a last ditch fail to english
         }
     }
     // Execute the parent initialise method.
     parent::initialise($options);
     // Load Library language
     $lang = JFactory::getLanguage();
     $lang->load('lib_joomla', JPATH_ADMINISTRATOR, null, false, true);
 }
开发者ID:networksoft,项目名称:seekerplus2.com,代码行数:41,代码来源:application.php

示例2: initialise

	/**
	* Initialise the application.
	*
	* @access public
	*/
	function initialise( $options = array())
	{
		// if a language was specified it has priority
		// otherwise use user or default language settings
		if (empty($options['language']))
		{
			$user = & JFactory::getUser();
			$lang	= $user->getParam( 'language' );

			// Make sure that the user's language exists
			if ( $lang && JLanguage::exists($lang) ) {
				$options['language'] = $lang;
			} 
			else 
			{
				$params =  JComponentHelper::getParams('com_extensions');
				$client	=& JApplicationHelper::getClientInfo($this->getClientId());
				$options['language'] = $params->get('language_'.$client->name, 'en-GB');
			}

		}

		// One last check to make sure we have something
		if ( ! JLanguage::exists($options['language']) ) {
			$options['language'] = 'en-GB';
		}

		parent::initialise($options);
	}
开发者ID:raeldc,项目名称:com_learn,代码行数:34,代码来源:application.php

示例3: initialise

 /**
  * Initialise the application.
  *
  * @param	array	An optional associative array of configuration settings.
  */
 function initialise($options = array())
 {
     $config =& JFactory::getConfig();
     // if a language was specified it has priority
     // otherwise use user or default language settings
     if (empty($options['language'])) {
         $user =& JFactory::getUser();
         $lang = $user->getParam('admin_language');
         // Make sure that the user's language exists
         if ($lang && JLanguage::exists($lang)) {
             $options['language'] = $lang;
         } else {
             $params = JComponentHelper::getParams('com_languages');
             $client =& JApplicationHelper::getClientInfo($this->getClientId());
             $options['language'] = $params->get($client->name, $config->getValue('config.language', 'en-GB'));
         }
     }
     // One last check to make sure we have something
     if (!JLanguage::exists($options['language'])) {
         $lang = $config->getValue('config.language', 'en-GB');
         if (JLanguage::exists($lang)) {
             $options['language'] = $lang;
         } else {
             $options['language'] = 'en-GB';
             // as a last ditch fail to english
         }
     }
     parent::initialise($options);
 }
开发者ID:joebushi,项目名称:joomla,代码行数:34,代码来源:application.php

示例4: initialise

 /**
  * Initialise the application.
  *
  * @param   array
  */
 public function initialise($options = array())
 {
     $config = JFactory::getConfig();
     $user = JFactory::getUser();
     // If the user is a guest we populate it with the guest user group.
     if ($user->guest) {
         $guestUsergroup = JComponentHelper::getParams('com_users')->get('guest_usergroup', 1);
         $user->groups = array($guestUsergroup);
     }
     // if a language was specified it has priority
     // otherwise use user or default language settings
     JPluginHelper::importPlugin('system', 'languagefilter');
     if (empty($options['language'])) {
         $lang = $this->input->getString('language', null);
         if ($lang && JLanguage::exists($lang)) {
             $options['language'] = $lang;
         }
     }
     if ($this->_language_filter && empty($options['language'])) {
         // Detect cookie language
         $lang = $this->input->getString(self::getHash('language'), null, 'cookie');
         // Make sure that the user's language exists
         if ($lang && JLanguage::exists($lang)) {
             $options['language'] = $lang;
         }
     }
     if (empty($options['language'])) {
         // Detect user language
         $lang = $user->getParam('language');
         // Make sure that the user's language exists
         if ($lang && JLanguage::exists($lang)) {
             $options['language'] = $lang;
         }
     }
     if ($this->_detect_browser && empty($options['language'])) {
         // Detect browser language
         $lang = JLanguageHelper::detectLanguage();
         // Make sure that the user's language exists
         if ($lang && JLanguage::exists($lang)) {
             $options['language'] = $lang;
         }
     }
     if (empty($options['language'])) {
         // Detect default language
         $params = JComponentHelper::getParams('com_languages');
         $client = JApplicationHelper::getClientInfo($this->getClientId());
         $options['language'] = $params->get($client->name, $config->get('language', 'en-GB'));
     }
     // One last check to make sure we have something
     if (!JLanguage::exists($options['language'])) {
         $lang = $config->get('language', 'en-GB');
         if (JLanguage::exists($lang)) {
             $options['language'] = $lang;
         } else {
             $options['language'] = 'en-GB';
             // as a last ditch fail to english
         }
     }
     // Execute the parent initialise method.
     parent::initialise($options);
     // Load Library language
     $lang = JFactory::getLanguage();
     // Try the lib_joomla file in the current language (without allowing the loading of the file in the default language)
     $lang->load('lib_joomla', JPATH_SITE, null, false, false) || $lang->load('lib_joomla', JPATH_ADMINISTRATOR, null, false, false) || $lang->load('lib_joomla', JPATH_SITE, null, true) || $lang->load('lib_joomla', JPATH_ADMINISTRATOR, null, true);
 }
开发者ID:TFToto,项目名称:playjoom-builds,代码行数:70,代码来源:application.php

示例5: initialise

	/**
	 * Initialise the application.
	 *
	 * @param	array
	 */
	public function initialise($options = array())
	{
		$config = JFactory::getConfig();

		jimport('joomla.language.helper');

		if (empty($options['language'])) {
			$lang = JRequest::getString('language', null);
			if ($lang && JLanguage::exists($lang)) {
				$options['language'] = $lang;
			}
		}

		if ($this->_language_filter && empty($options['language'])) {
			// Detect cookie language
			jimport('joomla.utilities.utility');
			$lang = JRequest::getString(JUtility::getHash('language'), null ,'cookie');
			// Make sure that the user's language exists
			if ($lang && JLanguage::exists($lang)) {
				$options['language'] = $lang;
			}
		}

		if (empty($options['language'])) {
			// Detect user language
			$lang = JFactory::getUser()->getParam('language');
			// Make sure that the user's language exists
			if ($lang && JLanguage::exists($lang)) {
				$options['language'] = $lang;
			}
		}

		if ($this->_detect_browser && empty($options['language'])) {
			// Detect browser language
			$lang = JLanguageHelper::detectLanguage();
			// Make sure that the user's language exists
			if ($lang && JLanguage::exists($lang)) {
				$options['language'] = $lang;
			}
		}

		if (empty($options['language'])) {
			// Detect default language
			$params =  JComponentHelper::getParams('com_languages');
			$client	= JApplicationHelper::getClientInfo($this->getClientId());
			$options['language'] = $params->get($client->name, $config->get('language', 'en-GB'));
		}

		// One last check to make sure we have something
		if (!JLanguage::exists($options['language'])) {
			$lang = $config->get('language','en-GB');
			if (JLanguage::exists($lang)) {
				$options['language'] = $lang;
			}
			else {
				$options['language'] = 'en-GB'; // as a last ditch fail to english
			}
		}

		// Execute the parent initialise method.
		parent::initialise($options);

		// Load Library language
		$lang = JFactory::getLanguage();
		$lang->load('lib_joomla', JPATH_SITE)
		|| $lang->load('lib_joomla', JPATH_ADMINISTRATOR);

	}
开发者ID:nikosdion,项目名称:Akeeba-Example,代码行数:73,代码来源:application.php


注:本文中的JApplication::initialise方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。