Exemple #1
0
 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();
         }
     }
 }
Exemple #2
0
 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();
     }
 }