mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-27 13:34:30 -04:00
Refactor PHP code.
This commit is contained in:
parent
65caa0fe9d
commit
77d6da3a24
2 changed files with 6 additions and 23 deletions
|
@ -41,29 +41,12 @@ class Api {
|
|||
|
||||
$response = array();
|
||||
|
||||
if (Util::get_boolean_request_param("setup", false)) {
|
||||
foreach (array("setup", "options", "types", "theme", "langs") as $name) {
|
||||
if (Util::get_boolean_request_param($name, false)) {
|
||||
|
||||
$response["setup"] = $this->app->get_setup();
|
||||
}
|
||||
|
||||
if (Util::get_boolean_request_param("options", false)) {
|
||||
|
||||
$response["options"] = $this->app->get_options();
|
||||
}
|
||||
|
||||
if (Util::get_boolean_request_param("types", false)) {
|
||||
|
||||
$response["types"] = $this->app->get_types();
|
||||
}
|
||||
|
||||
if (Util::get_boolean_request_param("theme", false)) {
|
||||
|
||||
$response["theme"] = $this->app->get_theme();
|
||||
}
|
||||
|
||||
if (Util::get_boolean_request_param("langs", false)) {
|
||||
|
||||
$response["langs"] = $this->app->get_l10n_list();
|
||||
$methodname = "get_${name}";
|
||||
$response[$name] = $this->app->$methodname();
|
||||
}
|
||||
}
|
||||
|
||||
if (Util::get_boolean_request_param("l10n", false)) {
|
||||
|
|
|
@ -259,7 +259,7 @@ class App {
|
|||
}
|
||||
|
||||
|
||||
public function get_l10n_list() {
|
||||
public function get_langs() {
|
||||
|
||||
$langs = array();
|
||||
$l10n_path = APP_PATH . "/conf/l10n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue