Esempio n. 1
0
 function &getInstance()
 {
     return SB_Localizer::staticInstance();
 }
Esempio n. 2
0
 function loadPlugins()
 {
     $this->plugins = array();
     $this->pluginPaths = array();
     $dirName = "./plugins";
     if (is_dir($dirName) && ($dir = opendir($dirName))) {
         while (($plugin = readdir($dir)) !== false) {
             $plugdir = $dirName . '/' . $plugin;
             if (!is_dir($plugdir)) {
                 continue;
             }
             $authfile = $plugdir . '/auth.inc.php';
             if (is_file($authfile) && $this->getParam('config', 'auth') != $plugin) {
                 continue;
             }
             $plugfile = $plugdir . '/command.inc.php';
             if (is_file($plugfile)) {
                 include $plugfile;
                 $this->pluginPaths[] = $plugdir;
                 $plugin['dir'] = $plugdir;
                 // $plugin gets injected
                 $this->plugins[] = $plugin;
             }
         }
         closedir($dir);
     }
     if (count($this->plugins)) {
         $l =& SB_Localizer::staticInstance();
         $l->setPlugins($this->pluginPaths);
     }
 }
Esempio n. 3
0
 function _buildLangList($select = null)
 {
     $l =& SB_Localizer::staticInstance();
     foreach ($l->getLanguages() as $lang) {
         $dir = $lang['dir'] . str_repeat(" ", 5 - strlen($lang['dir']));
         echo '<option class="fixed" ' . ($select == $lang['dir'] ? 'selected' : '') . ' value="' . $lang['dir'] . '">' . $dir . " " . $lang['language'] . "</option>\n";
     }
 }