From 058d4d3b905f9b9e533e54f7b4372c49e81744a1 Mon Sep 17 00:00:00 2001 From: rylon Date: Fri, 7 Nov 2014 17:25:04 +0100 Subject: [PATCH] updated system state system into a working prototype --- api/api_system.php | 6 +- dbd/qq/SYS_PAGESTATES_GROUP.php | 15 --- dbd/qq/SYS_PAGE_GROUP.php | 15 +++ dbd/sql/mysql/data/system_api.sql | 6 +- ...{system_pagestates.sql => system_page.sql} | 2 +- ...{system_pagestates.php => system_page.php} | 6 +- files/autoload.inc.php | 2 +- files/register_sys_files.php | 2 - files/sys/system.js | 109 ++++++++++++++++++ files/sys_js/system.js | 74 ------------ page/State.php | 16 ++- 11 files changed, 141 insertions(+), 112 deletions(-) delete mode 100644 dbd/qq/SYS_PAGESTATES_GROUP.php create mode 100644 dbd/qq/SYS_PAGE_GROUP.php rename dbd/sql/mysql/schema/{system_pagestates.sql => system_page.sql} (85%) rename dbd/tbl/{system_pagestates.php => system_page.php} (68%) delete mode 100644 files/register_sys_files.php create mode 100644 files/sys/system.js delete mode 100644 files/sys_js/system.js diff --git a/api/api_system.php b/api/api_system.php index 1fcd7c9..b8efcf7 100644 --- a/api/api_system.php +++ b/api/api_system.php @@ -12,12 +12,8 @@ class api_system extends api_login{ public static function call_files($cat,$id = null){ return \SYSTEM\FILES\files::get($cat, $id, true);} - public static function call_pagestates($group){ + public static function call_pages($group){ return \SYSTEM\PAGE\State::get($group);} - public static function call_pagestates_flag_js($group){ - return \SYSTEM\PAGE\State::get_js($group);} - public static function call_pagestates_flag_css($group){ - return \SYSTEM\PAGE\State::get_css($group);} public static function static__lang($lang){ \SYSTEM\locale::set($lang);} diff --git a/dbd/qq/SYS_PAGESTATES_GROUP.php b/dbd/qq/SYS_PAGESTATES_GROUP.php deleted file mode 100644 index ca52066..0000000 --- a/dbd/qq/SYS_PAGESTATES_GROUP.php +++ /dev/null @@ -1,15 +0,0 @@ -next()){ + $row['css'] = $row['js'] = array(); + if(\method_exists($row['php_class'], 'css') && \is_callable($row['php_class'].'::css')){ + $row['css'] = array_merge($row['css'], call_user_func($row['php_class'].'::css'));} + if(\method_exists($row['php_class'], 'js') && \is_callable($row['php_class'].'::js')){ + $row['js'] = array_merge($row['js'], call_user_func($row['php_class'].'::js'));} + $result[] = $row;} + return \SYSTEM\LOG\JsonResult::toString($result);} } \ No newline at end of file