本文整理匯總了PHP中WYSIJA::load_lang_init方法的典型用法代碼示例。如果您正苦於以下問題:PHP WYSIJA::load_lang_init方法的具體用法?PHP WYSIJA::load_lang_init怎麽用?PHP WYSIJA::load_lang_init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WYSIJA
的用法示例。
在下文中一共展示了WYSIJA::load_lang_init方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: load_lang
function load_lang($extendedplugin = false)
{
static $extensionloaded = false;
if (!$extendedplugin) {
return $extensionloaded;
}
if (!$extensionloaded) {
add_action('init', array("WYSIJA", "load_lang_init"));
}
/*load the language file*/
if (!$extensionloaded || !isset($extensionloaded[$extendedplugin])) {
switch ($extendedplugin) {
case "wysija-newsletters":
$transstring = WYSIJA;
break;
case "wysijashop":
$transstring = WYSIJASHOP;
break;
case "wysijacrons":
$transstring = WYSIJACRONS;
break;
case "get_all":
return $extensionloaded;
}
/*
* Who commented that line ? I don't remember doing it.(Ben)
* Leave it be please
*/
if (!isset($extensionloaded[$extendedplugin])) {
load_plugin_textdomain($transstring, false, $extendedplugin . DS . 'languages');
}
$extensionloaded[$extendedplugin] = $transstring;
$config =& WYSIJA::get('config', 'model');
//TODO I don't remember why do we load_lang_init twice I think it has to do with qTranslate compatibility ....
if (!((int) $config->getValue('debug_new') > 1)) {
WYSIJA::load_lang_init();
}
}
}
示例2: load_lang
public static function load_lang($extendedplugin = false)
{
static $extensionloaded = false;
if (!$extendedplugin) {
return $extensionloaded;
}
if (!$extensionloaded) {
add_action('init', array('WYSIJA', 'load_lang_init'));
}
/*load the language file*/
if (!$extensionloaded || !isset($extensionloaded[$extendedplugin])) {
$transstring = null;
switch ($extendedplugin) {
case 'wysija-newsletters':
$transstring = WYSIJA;
break;
case 'wysijashop':
$transstring = WYSIJASHOP;
break;
case 'wysijacrons':
$transstring = WYSIJACRONS;
break;
case 'wysija-newsletters-premium':
$transstring = WYSIJANLP;
break;
case 'get_all':
return $extensionloaded;
}
/*
* Necessary somehow
*/
if ($transstring !== null) {
if (!isset($extensionloaded[$extendedplugin])) {
//we need to call the config this way otherwise it will loop
$config =& WYSIJA::get('config', 'model', false, 'wysija-newsletters', false);
$debugmode = 0;
if (is_object($config) && method_exists($config, 'getValue')) {
$debugmode = (int) $config->getValue('debug_new');
}
if ($debugmode == 0 || $debugmode > 0 && !WYSIJA::is_wysija_admin($debugmode)) {
load_plugin_textdomain($transstring, false, $extendedplugin . DS . 'languages');
}
}
$extensionloaded[$extendedplugin] = $transstring;
}
//TODO I don't remember why do we load_lang_init twice I think it has to do with qTranslate compatibility ....
WYSIJA::load_lang_init();
}
}