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; }
public function queryAppUserDataByDate($appId, $date) { if (!LangUtils::validateDate($date)) { throw new Exception("DateError|" . $date); } $params = array(); $params["action"] = "queryAppUserData"; $params["appkey"] = $this->appkey; $params["appId"] = $appId; $params["date"] = $date; return $this->httpPostJson($this->host, $params); }
/** * @param $appId * @param $date * @return mixed|null * @throws \InvalidArgumentException * @throws RequestException * @throws \UnexpectedValueException */ public function queryAppUserDataByDate($appId, $date) { if (!LangUtils::validateDate($date)) { throw new \InvalidArgumentException('DateError|' . $date); } $params = array(); $params['action'] = 'queryAppUserData'; $params['appkey'] = $this->appkey; $params['appId'] = $appId; $params['date'] = $date; return $this->httpPostJSON($this->host, $params); }
} 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;
require_once $root . '/../include/auth.inc'; include_once $root . '/../include/load_config.php'; $cfg_web_root = $configObject->get('cfg_web_root'); require_once $cfg_web_root . 'classes/configobject.class.php'; require_once $cfg_web_root . 'classes/lang.class.php'; require_once $cfg_web_root . 'lang/' . $language . '/include/common.inc'; // Include common language file that all scripts need require_once $cfg_web_root . 'include/custom_error_handler.inc'; require_once $cfg_web_root . 'classes/dbutils.class.php'; require_once $cfg_web_root . 'classes/userobject.class.php'; require_once $cfg_web_root . 'classes/authentication.class.php'; require_once $cfg_web_root . 'classes/lang.class.php'; require_once $cfg_web_root . '/classes/moduleutils.class.php'; require_once $cfg_web_root . '/classes/schoolutils.class.php'; require_once $cfg_web_root . '/classes/usernotices.class.php'; LangUtils::loadlangfile('admin/detailed_authentication_info.php'); if (is_null($configObject->get('cfg_db_port'))) { $configObject->set('cfg_db_port', 3306); } $mysqli = DBUtils::get_mysqli_link($configObject->get('cfg_db_host'), $configObject->get('cfg_db_username'), $configObject->get('cfg_db_passwd'), $configObject->get('cfg_db_database'), $configObject->get('cfg_db_charset'), $notice, $configObject->get('dbclass'), $configObject->get('cfg_db_port')); $notice = UserNotices::get_instance(); if (is_null($configObject->get('display_auth_debug'))) { $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], '"display_auth_debug" not correctly set in the config file', $string['accessdenied'], $configObject->get('cfg_root_path') . '/artwork/page_not_found.png', '#C00000', true, true); } if ($configObject->get('cfg_session_name') != '') { session_name($configObject->get('cfg_session_name')); } else { session_name('RogoAuthentication'); } $return = session_start(); $authentication = new Authentication($configObject, $mysqli, $_REQUEST, $_SESSION);