function add_language_selection($display_std_form_obj) { global $string; $this->savetodebug('add_language_selection'); $newfield = new displaystdformobjfield(); $newfield->type = 'select'; $newfield->description = ''; $newfield->default = LangUtils::getLang($this->settings['cfg_web_root']); $newfield->name = 'ROGO_language'; $newfield->options = isset($this->settings['available_languages']) ? $this->settings['available_languages'] : array('English' => 'en'); $display_std_form_obj->fields[] = $newfield; return $display_std_form_obj; }
static function loadlangfile($file, $str = null) { if (is_null($str)) { global $string; } else { $string = $str; } $configObj = Config::get_instance(); $cfg_web_root = $configObj->get('cfg_web_root'); $language = LangUtils::getLang($cfg_web_root); $lang_path = "{$cfg_web_root}lang/{$language}/" . $file; if (file_exists($lang_path)) { require $lang_path; } return $string; }
} echo "<li><a href=\"./unittest.php?test={$t}\">{$t}</a></li>\n"; } ?> </ul> </body> </html> <?php } else { //setup the Rogo config object $root = str_replace('/testing', '/', str_replace('\\', '/', dirname(__FILE__))); require_once $root . 'classes/configobject.class.php'; $configObject = Config::get_instance(); $cfg_web_root = $configObject->get('cfg_web_root'); require_once $cfg_web_root . 'classes/lang.class.php'; $language = LangUtils::getLang($cfg_web_root); //load the mysqli mocking classes require_once './include/mockmysqli.class.php'; // Include the test framework require_once './include/EnhanceTestFramework.php'; require_once './include/codespy.php'; \codespy\Analyzer::$outputdir = $cfg_web_root . 'testing/coverage'; \codespy\Analyzer::$outputformat = 'html'; \codespy\Analyzer::$coveredcolor = '#c2ffc2'; $run = false; switch ($_GET['test']) { case 'all': \Enhance\Core::discoverTests('./unit_tests/'); \Enhance\Core::discoverTests('../plugins/'); $run = TRUE; break;