當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。