本文整理汇总了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();
}
}