diff --git a/dbd/sql/mysql/data/sai_api.sql b/dbd/sql/mysql/data/sai_api.sql index 7357e0c..d148062 100644 --- a/dbd/sql/mysql/data/sai_api.sql +++ b/dbd/sql/mysql/data/sai_api.sql @@ -5,7 +5,6 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1, 42, 1, 0, NULL, 'js', NULL); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (2, 42, 1, 0, NULL, 'css', NULL); -- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (3, 42, 0, 0, NULL, 'page', NULL); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (5, 42, 4, -1, NULL, '_escaped_fragment_', 'STRING'); -- system_api INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10, 42, 0, -1, NULL, 'call', NULL); @@ -30,6 +29,7 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (56, 42, 2, 55, NULL, 'group', 'UINT'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (90, 42, 4, -1, NULL, '_lang', 'LANG'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (91, 42, 4, -1, NULL, '_result', 'RESULT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (92, 42, 4, -1, NULL, '_escaped_fragment_', 'STRING'); -- specific stuff for mods INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_login', 'action', NULL); diff --git a/dbd/sql/mysql/data/system_api.sql b/dbd/sql/mysql/data/system_api.sql index 8c1bf33..6d00a43 100644 --- a/dbd/sql/mysql/data/system_api.sql +++ b/dbd/sql/mysql/data/system_api.sql @@ -22,4 +22,5 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (51, 0, 2, 10, 'pages', 'state', 'STRING'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (90, 0, 4, -1, NULL, '_lang', 'LANG'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (91, 0, 4, -1, NULL, '_result', 'RESULT'); \ No newline at end of file +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (91, 0, 4, -1, NULL, '_result', 'RESULT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (92, 42, 4, -1, NULL, '_escaped_fragment_', 'STRING'); \ No newline at end of file diff --git a/dbd/sql/mysql/data/system_page.sql b/dbd/sql/mysql/data/system_page.sql index 29a3750..70ffddc 100644 --- a/dbd/sql/mysql/data/system_page.sql +++ b/dbd/sql/mysql/data/system_page.sql @@ -3,6 +3,10 @@ INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (2, 'log', 42, 'start', 0, 0, '#log_entries', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=filter', '', ''); INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (10, 'api', 42, 'api', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_api', 'init_saimod_sys_api', '\\SYSTEM\\SAI\\saimod_sys_api'); +INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (11, 'all', 42, 'api', 10, 0, '#tab_api', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_api&action=list&group=${group}', 'init_saimod_sys_api_list', '\\SYSTEM\\SAI\\saimod_sys_api'); +INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (12, 'delete', 42, 'api', 10, 1, '#tab_api', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_api&action=deletedialog&group=${group}&ID=${id}', 'init_saimod_sys_api_delete', '\\SYSTEM\\SAI\\saimod_sys_api'); +INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (13, 'new', 42, 'api', 10, 1, '#tab_api', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_api&action=newdialog', 'init_saimod_sys_api_new', '\\SYSTEM\\SAI\\saimod_sys_api'); + INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (20, 'cache', 42, 'cache', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_cache', 'init_saimod_sys_cache', '\\SYSTEM\\SAI\\saimod_sys_cache'); INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (30, 'config', 42, 'config', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_config', 'init_saimod_sys_config', '\\SYSTEM\\SAI\\saimod_sys_config'); INSERT INTO `system_page` (`id`, `name`, `group`, `state`, `parent_id`, `type`, `div`, `url`, `func`, `php_class`) VALUES (40, 'cron', 42, 'cron', -1, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_cron', 'init_saimod_sys_cron', '\\SYSTEM\\SAI\\saimod_sys_cron'); diff --git a/sai/modules/saimod_sys_api/js/saimod_sys_api.js b/sai/modules/saimod_sys_api/js/saimod_sys_api.js index b9a7c0e..c1bf6d9 100644 --- a/sai/modules/saimod_sys_api/js/saimod_sys_api.js +++ b/sai/modules/saimod_sys_api/js/saimod_sys_api.js @@ -5,7 +5,9 @@ function init_saimod_sys_api() { $(this).parent().addClass('active'); }); api_menu(); - +} + +function init_saimod_sys_api_new(){ $('#addcall').click(function() { $.ajax({ url: './sai.php', data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', @@ -19,9 +21,7 @@ function init_saimod_sys_api() { verify: $('#new_call_verify').val()}, type: 'GET', success: function(data) { - console.log("new api call added"); - saimod_sys_api_loadcontent(); - } + system.load('api;group.'+$('#new_call_group').val());} }); }); } diff --git a/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_GROUPS.php b/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_GROUPS.php new file mode 100644 index 0000000..5d3d4f9 --- /dev/null +++ b/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_GROUPS.php @@ -0,0 +1,11 @@ +query('SELECT "group", count(*) as "count" FROM system.api GROUP BY "group" ORDER BY "group" ASC;'); - } else { - $res = $con->query('SELECT `group`, count(*) as `count` FROM system_api GROUP BY `group` ORDER BY `group` ASC;'); - } - $vars['tabopts'] = ''; - $first = true; + + $res = \SYSTEM\DBD\SYS_SAIMOD_API_GROUPS::QQ(); + while($r = $res->next()){ - $vars2 = array( 'active' => ($first ? '' : ''), - 'tab_id' => $r['group']); - $first = false; - $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tabopt.tpl'), $vars2); - } - - /*if(\SYSTEM\system::isSystemDbInfoPG()){ - $res = $con->query('SELECT * FROM system.api ORDER BY "group", "ID" ASC;'); - } else { - $res = $con->query('SELECT * FROM system_api ORDER BY `group`, `ID` ASC;'); - } - - while($r = $res->next()){ - $tabs[$r['group']]['tab_id'] = $r['group']; - $tabs[$r['group']]['content'] = isset($tabs[$r['group']]['content']) ? $tabs[$r['group']]['content'] : ''; - $r['tr_class'] = self::tablerow_class($r['type']); - $r['type'] = self::type_names($r['type']); - $tabs[$r['group']]['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/list_entry.tpl'), $r); - } - - $vars['tabs'] = ''; - $first = true; - foreach($tabs as $tab){ - $tab['active'] = ($first ? 'active' : ''); - $first = false; - $vars['tabs'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tab.tpl'), $tab);}*/ - - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tabs.tpl'), $vars); + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tabopt.tpl'), array( 'tab_id' => $r['group']));} + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/saimod_sys_api.tpl'), $vars); } public static function sai_mod__system_sai_saimod_sys_api_action_list($group=null){ @@ -55,13 +23,15 @@ class saimod_sys_api extends \SYSTEM\SAI\SaiModule { $r['type'] = self::type_names($r['type']); $tab['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/list_entry.tpl'), $r); } - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tab.tpl'), $tab); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/saimod_sys_api_list.tpl'), $tab); } public static function sai_mod__system_sai_saimod_sys_api_action_deletedialog($ID,$group){ $res = \SYSTEM\DBD\SYS_SAIMOD_API_SINGLE_SELECT::Q1(array($ID,$group)); return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/delete_dialog.tpl'), $res); } + public static function sai_mod__system_sai_saimod_sys_api_action_newdialog(){ + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/new_dialog.tpl'));} public static function sai_mod__system_sai_saimod_sys_api_action_addcall($ID,$group,$type,$parentID,$parentValue,$name,$verify){ if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){ diff --git a/sai/modules/saimod_sys_api/tpl/new_dialog.tpl b/sai/modules/saimod_sys_api/tpl/new_dialog.tpl new file mode 100644 index 0000000..a4f8e1f --- /dev/null +++ b/sai/modules/saimod_sys_api/tpl/new_dialog.tpl @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + +
ID
Group
Type
ParentID
ParentValue
Name
Verify
+ + \ No newline at end of file diff --git a/sai/modules/saimod_sys_api/tpl/saimod_sys_api.tpl b/sai/modules/saimod_sys_api/tpl/saimod_sys_api.tpl new file mode 100644 index 0000000..41d4a58 --- /dev/null +++ b/sai/modules/saimod_sys_api/tpl/saimod_sys_api.tpl @@ -0,0 +1,12 @@ +

System API

+
+
+ +
+
+
+
\ No newline at end of file diff --git a/sai/modules/saimod_sys_api/tpl/tab.tpl b/sai/modules/saimod_sys_api/tpl/saimod_sys_api_list.tpl similarity index 100% rename from sai/modules/saimod_sys_api/tpl/tab.tpl rename to sai/modules/saimod_sys_api/tpl/saimod_sys_api_list.tpl diff --git a/sai/modules/saimod_sys_api/tpl/tabopt.tpl b/sai/modules/saimod_sys_api/tpl/tabopt.tpl index 1315e72..04f8d55 100644 --- a/sai/modules/saimod_sys_api/tpl/tabopt.tpl +++ b/sai/modules/saimod_sys_api/tpl/tabopt.tpl @@ -1 +1 @@ -
  • Group ${tab_id}
  • \ No newline at end of file +
  • Group ${tab_id}
  • \ No newline at end of file diff --git a/sai/modules/saimod_sys_api/tpl/tabs.tpl b/sai/modules/saimod_sys_api/tpl/tabs.tpl deleted file mode 100644 index b21b49d..0000000 --- a/sai/modules/saimod_sys_api/tpl/tabs.tpl +++ /dev/null @@ -1,32 +0,0 @@ -

    System API

    -
    -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - -
    IDGroupTypeParentIDParentValueNameVerify
    - \ No newline at end of file diff --git a/sai/modules/saimod_sys_cache/saimod_sys_cache.php b/sai/modules/saimod_sys_cache/saimod_sys_cache.php index 3720746..faacb19 100644 --- a/sai/modules/saimod_sys_cache/saimod_sys_cache.php +++ b/sai/modules/saimod_sys_cache/saimod_sys_cache.php @@ -12,7 +12,7 @@ class saimod_sys_cache extends \SYSTEM\SAI\SaiModule { $r = $res->next(); - $result = '

    Cache


    '. + $result = '

    System Cache


    '. 'Entries: '.$r['count'].' showing 100'. ''. ''.''.''.''.''.''; diff --git a/sai/modules/saimod_sys_langswitcher/saimod_sys_langswitcher.php b/sai/modules/saimod_sys_langswitcher/saimod_sys_langswitcher.php index 0607683..6df4eb8 100644 --- a/sai/modules/saimod_sys_langswitcher/saimod_sys_langswitcher.php +++ b/sai/modules/saimod_sys_langswitcher/saimod_sys_langswitcher.php @@ -3,14 +3,17 @@ namespace SYSTEM\SAI; class saimod_sys_langswitcher extends \SYSTEM\SAI\SaiModule { public static function html_li_menu(){ + return self::lang_menu('./sai.php');} + public static function right_public(){return true;} + public static function right_right(){return true;} + + public static function lang_menu($endpoint = './api.php'){ $result = ''; $langs = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS); foreach($langs as $lang){ - $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_langswitcher/tpl/language.tpl'),array('lang' => $lang));} + $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_langswitcher/tpl/language.tpl'),array('lang' => $lang,'endpoint' => $endpoint));} return $result; } - public static function right_public(){return true;} - public static function right_right(){return true;} //public static function css(){} //public static function js(){} diff --git a/sai/modules/saimod_sys_langswitcher/tpl/language.tpl b/sai/modules/saimod_sys_langswitcher/tpl/language.tpl index 4f00ce8..6d45b57 100644 --- a/sai/modules/saimod_sys_langswitcher/tpl/language.tpl +++ b/sai/modules/saimod_sys_langswitcher/tpl/language.tpl @@ -1 +1 @@ -${lang}  \ No newline at end of file +${lang}  \ No newline at end of file diff --git a/sai/page/default_page.php b/sai/page/default_page.php index 9290fb7..0b7fec5 100644 --- a/sai/page/default_page.php +++ b/sai/page/default_page.php @@ -32,7 +32,7 @@ class default_page extends \SYSTEM\PAGE\Page { private static function css(){ $result = ''. - ''. + ''. ''; return $result; } @@ -40,7 +40,7 @@ class default_page extends \SYSTEM\PAGE\Page { private static function js(){ $result = ''. ''. - ''. + ''. ''. ''. ''. diff --git a/sai/page/tpl/sai.tpl b/sai/page/tpl/sai.tpl index 043a08c..f18fabc 100644 --- a/sai/page/tpl/sai.tpl +++ b/sai/page/tpl/sai.tpl @@ -4,7 +4,7 @@ ${title} - + ${css} ${js} @@ -13,7 +13,7 @@
    '.'ID'.''.'CacheID'.''.'Ident'.''.'Data'.'