From fb065f3315ceb826d94933b9bf106ea276f47499 Mon Sep 17 00:00:00 2001 From: rylon Date: Tue, 1 Jul 2014 14:08:39 +0200 Subject: [PATCH 1/6] autoload for system divided into sub-autoloads --- api/autoload.inc.php | 2 ++ autoload.inc.php | 33 +++++++++++---------------------- cache/autoload.inc.php | 2 ++ config/autoload.inc.php | 2 ++ cron/autoload.inc.php | 2 ++ db/autoload.inc.php | 6 ++++++ dbd/autoload.inc.php | 3 +++ docu/autoload.inc.php | 4 ++++ files/autoload.inc.php | 3 +++ files/register_sys_files.php | 2 ++ log/autoload.inc.php | 6 ++++++ page/autoload.inc.php | 2 ++ security/autoload.inc.php | 2 ++ 13 files changed, 47 insertions(+), 22 deletions(-) create mode 100644 api/autoload.inc.php create mode 100644 cache/autoload.inc.php create mode 100644 config/autoload.inc.php create mode 100644 cron/autoload.inc.php create mode 100644 db/autoload.inc.php create mode 100644 dbd/autoload.inc.php create mode 100644 docu/autoload.inc.php create mode 100644 files/autoload.inc.php create mode 100644 files/register_sys_files.php create mode 100644 log/autoload.inc.php create mode 100644 page/autoload.inc.php create mode 100644 security/autoload.inc.php diff --git a/api/autoload.inc.php b/api/autoload.inc.php new file mode 100644 index 0000000..9c5b8af --- /dev/null +++ b/api/autoload.inc.php @@ -0,0 +1,2 @@ + Date: Wed, 2 Jul 2014 02:55:05 +0200 Subject: [PATCH 2/6] new tinymce mod tingy --- .../saimod_sys_locale/saimod_sys_locale.js | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/sai/modules/saimod_sys_locale/saimod_sys_locale.js b/sai/modules/saimod_sys_locale/saimod_sys_locale.js index 300d909..1f31b38 100644 --- a/sai/modules/saimod_sys_locale/saimod_sys_locale.js +++ b/sai/modules/saimod_sys_locale/saimod_sys_locale.js @@ -215,21 +215,21 @@ function init_tinymce(){ // Example content CSS (should be your site CSS) content_css : "../../page/index.css"*/ // General options - mode : "textareas", +/* mode : "textareas", //theme : "advanced", theme : "modern", - plugins : "autolink,lists,pagebreak,layer,table,save,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,template,code", + plugins : "autolink,lists,pagebreak,layer,table,save,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,template,code",*/ //xhtmlxtras,emotions,advimage,advlink,iespell,inlinepopups,advhr,style,spellchecker, // Theme options - theme_modern_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", - theme_modern_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", - theme_modern_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", - theme_modern_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage", - theme_modern_toolbar_location : "top", - theme_modern_toolbar_align : "left", - theme_modern_statusbar_location : "bottom", - theme_modern_resizing : true, + /*theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", + theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", + theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", + theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage", + theme_advanced_toolbar_location : "top", + theme_advanced_toolbar_align : "left", + theme_advanced_statusbar_location : "bottom", + theme_advanced_resizing : true,*/ // Skin options //skin : "o2k7", @@ -242,7 +242,7 @@ function init_tinymce(){ //content_css : "../../page/index.css" // Drop lists for link/image/media/template dialogs - template_external_list_url : "js/template_list.js", + /*template_external_list_url : "js/template_list.js", external_link_list_url : "js/link_list.js", external_image_list_url : "js/image_list.js", media_external_list_url : "js/media_list.js", @@ -254,6 +254,22 @@ function init_tinymce(){ template_replace_values : { username : "Some User", staffid : "991234" - } + }*/ + + selector: "textarea", + theme: "modern", + plugins: [ + "advlist autolink lists link image charmap print preview hr anchor pagebreak", + "searchreplace wordcount visualblocks visualchars code fullscreen", + "insertdatetime media nonbreaking save table contextmenu directionality", + "emoticons template paste textcolor" + ], + toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", + toolbar2: "print preview media | forecolor backcolor emoticons", + image_advtab: true, + templates: [ + {title: 'Test template 1', content: 'Test 1'}, + {title: 'Test template 2', content: 'Test 2'} + ] }); } From 4550496102251bc7f4932712b5f759b9db728d5e Mon Sep 17 00:00:00 2001 From: rylon Date: Sun, 6 Jul 2014 14:03:48 +0200 Subject: [PATCH 3/6] state js/css ideas(wrong ideas) --- api/api_system.php | 4 ++ dbd/sql/mysql/data/sai_api.sql | 4 ++ dbd/sql/mysql/data/system_api.sql | 4 ++ files/register_sys_files.php | 2 +- files/sys_js/system.js | 74 +++++++++++++++++++++++++++++++ page/Page.php | 2 + page/State.php | 6 +++ system/HEADER.php | 3 ++ 8 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 files/sys_js/system.js diff --git a/api/api_system.php b/api/api_system.php index 46e1959..1fcd7c9 100644 --- a/api/api_system.php +++ b/api/api_system.php @@ -14,6 +14,10 @@ class api_system extends api_login{ public static function call_pagestates($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/sql/mysql/data/sai_api.sql b/dbd/sql/mysql/data/sai_api.sql index f987904..48356e6 100644 --- a/dbd/sql/mysql/data/sai_api.sql +++ b/dbd/sql/mysql/data/sai_api.sql @@ -22,6 +22,10 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (40, 42, 2, 10, 'text', 'request', 'STRING'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (41, 42, 2, 40, 'text', 'lang', 'LANG'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (50, 42, 2, 10, 'pagestates', 'group', 'UINT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (51, 42, 1, 50, NULL, 'js', NULL); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (52, 42, 2, 51, NULL, 'group', 'UINT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (55, 42, 1, 50, NULL, 'css', NULL); +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'); diff --git a/dbd/sql/mysql/data/system_api.sql b/dbd/sql/mysql/data/system_api.sql index 13ccb10..88b9f7f 100644 --- a/dbd/sql/mysql/data/system_api.sql +++ b/dbd/sql/mysql/data/system_api.sql @@ -19,6 +19,10 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (41, 0, 2, 10, 'text', 'lang', 'LANG'); INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (50, 0, 2, 10, 'pagestates', 'group', 'UINT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (51, 0, 1, 50, NULL, 'js', NULL); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (52, 0, 2, 50, NULL, 'group', 'UINT'); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (55, 0, 1, 50, NULL, 'css', NULL); +INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (56, 0, 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'); \ No newline at end of file diff --git a/files/register_sys_files.php b/files/register_sys_files.php index 884e243..47ef7d8 100644 --- a/files/register_sys_files.php +++ b/files/register_sys_files.php @@ -1,2 +1,2 @@ Date: Thu, 10 Jul 2014 17:34:56 +0200 Subject: [PATCH 4/6] example text for basic strings --- dbd/sql/mysql/data/basic_locale_string.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbd/sql/mysql/data/basic_locale_string.sql b/dbd/sql/mysql/data/basic_locale_string.sql index 798c60d..9078861 100644 --- a/dbd/sql/mysql/data/basic_locale_string.sql +++ b/dbd/sql/mysql/data/basic_locale_string.sql @@ -21,4 +21,6 @@ INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('b INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_placeholder_password', 1, 'my secret123', 'geheim567'); INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_placeholder_email', 1, 'peter@world.org', 'peter@world.org'); -INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_state_login', 1, 'You are logged in.', 'You are logged in.'); \ No newline at end of file +INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_state_login', 1, 'You are logged in.', 'You are logged in.'); + +INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_example', 1, '

TinyMCE LogoWelcome to the TinyMCE editor demo!

\n

Feel free to try out the different features that are provided, please note that the MoxieManager specific functionality is part of our commercial offering. The demo is to show the integration.

\n

Got questions or need help?

\n

If you have questions or need help, feel free to visit our community forum! We also offer Enterprise support solutions. Also do not miss out on the documentation, its a great resource wiki for understanding how TinyMCE works and integrates.

\n

Found a bug?

\n

If you think you have found a bug, you can use the Bug Tracker to report bugs to the developers.

\n

And here is a simple table for you to play with.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ProductCostReally?
TinyMCEFreeYES!
PluploadFreeYES!
\n

Enjoy our software and create great content!

\n

Oh, and by the way, don\'t forget to check out our other product called Plupload, your ultimate upload solution with HTML5 upload support!

', '

TinyMCE LogoWelcome to the TinyMCE editor demo!

\n

Feel free to try out the different features that are provided, please note that the MoxieManager specific functionality is part of our commercial offering. The demo is to show the integration.

\n

Got questions or need help?

\n

If you have questions or need help, feel free to visit our community forum! We also offer Enterprise support solutions. Also do not miss out on the documentation, its a great resource wiki for understanding how TinyMCE works and integrates.

\n

Found a bug?

\n

If you think you have found a bug, you can use the Bug Tracker to report bugs to the developers.

\n

And here is a simple table for you to play with.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ProductCostReally?
TinyMCEFreeYES!
PluploadFreeYES!
\n

Enjoy our software and create great content!

\n

Oh, and by the way, don\'t forget to check out our other product called Plupload, your ultimate upload solution with HTML5 upload support!

'); \ No newline at end of file From 83e275af9f9ae5525d1d6e04303443833b2ebf44 Mon Sep 17 00:00:00 2001 From: rylon Date: Thu, 10 Jul 2014 17:36:41 +0200 Subject: [PATCH 5/6] removed warning --- sai/modules/saimod_sys_locale/saimod_sys_locale.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sai/modules/saimod_sys_locale/saimod_sys_locale.php b/sai/modules/saimod_sys_locale/saimod_sys_locale.php index 1925d7e..835bc45 100644 --- a/sai/modules/saimod_sys_locale/saimod_sys_locale.php +++ b/sai/modules/saimod_sys_locale/saimod_sys_locale.php @@ -50,13 +50,11 @@ class saimod_sys_locale extends \SYSTEM\SAI\SaiModule { $con = new \SYSTEM\DB\Connection(); $result = ""; $query = 'SELECT '.$lang.' FROM `'.\SYSTEM\DBD\system_locale_string::NAME_MYS.'` WHERE id=\''.$id.'\' ORDER BY category ASC;'; - new \SYSTEM\LOG\WARNING($query); - $res = $con->query($query); - $entries = ''; - $temparr = array(); - while($r = $res->next()){ - $entries .= $r[$lang]; - } + $res = $con->query($query); + $entries = ''; + $temparr = array(); + while($r = $res->next()){ + $entries .= $r[$lang];} return $entries; } From d67ae0ef45fd6381997c988b10f43e459d0915b7 Mon Sep 17 00:00:00 2001 From: rylon Date: Thu, 10 Jul 2014 18:26:09 +0200 Subject: [PATCH 6/6] cron saimod improvements --- dbd/qq/SYS_SAIMOD_CRON_ADD.php | 11 ++ dbd/qq/SYS_SAIMOD_CRON_DEL.php | 11 ++ dbd/qq/SYS_SAIMOD_CRON_SINGLE_SELECT.php | 11 ++ dbd/sql/mysql/data/sai_api.sql | 12 +- dbd/sql/mysql/data/system_rights.sql | 4 +- sai/modules/saimod_sys_cron/delete_dialog.tpl | 34 +++--- sai/modules/saimod_sys_cron/list_entry.tpl | 2 +- .../saimod_sys_cron/saimod_sys_cron.js | 105 ++++++------------ .../saimod_sys_cron/saimod_sys_cron.php | 37 ++---- sai/modules/saimod_sys_cron/tab.tpl | 15 --- sai/modules/saimod_sys_cron/tabopt.tpl | 1 - sai/modules/saimod_sys_cron/tabs.tpl | 61 +++++----- security/RIGHTS.php | 4 +- 13 files changed, 139 insertions(+), 169 deletions(-) create mode 100644 dbd/qq/SYS_SAIMOD_CRON_ADD.php create mode 100644 dbd/qq/SYS_SAIMOD_CRON_DEL.php create mode 100644 dbd/qq/SYS_SAIMOD_CRON_SINGLE_SELECT.php delete mode 100644 sai/modules/saimod_sys_cron/tab.tpl delete mode 100644 sai/modules/saimod_sys_cron/tabopt.tpl diff --git a/dbd/qq/SYS_SAIMOD_CRON_ADD.php b/dbd/qq/SYS_SAIMOD_CRON_ADD.php new file mode 100644 index 0000000..703e62a --- /dev/null +++ b/dbd/qq/SYS_SAIMOD_CRON_ADD.php @@ -0,0 +1,11 @@ + -
Api Call: ${ID}
+
+
Cron Job: ${class}

- - - - - - - + + + + + + - - - - - - - + + + + + +
IDGroupTypeParentIDParentValueNameVerifyclassminhourdayday_weekmonth
${ID}${group}${type}${parentID}${parentValue}${name}${verify}${class}${min}${hour}${day}${day_week}${month}
- - + + diff --git a/sai/modules/saimod_sys_cron/list_entry.tpl b/sai/modules/saimod_sys_cron/list_entry.tpl index 894c367..017fc0d 100644 --- a/sai/modules/saimod_sys_cron/list_entry.tpl +++ b/sai/modules/saimod_sys_cron/list_entry.tpl @@ -1,4 +1,4 @@ - + ${class} ${min} ${hour} diff --git a/sai/modules/saimod_sys_cron/saimod_sys_cron.js b/sai/modules/saimod_sys_cron/saimod_sys_cron.js index c80b5a1..635f5b2 100644 --- a/sai/modules/saimod_sys_cron/saimod_sys_cron.js +++ b/sai/modules/saimod_sys_cron/saimod_sys_cron.js @@ -1,98 +1,63 @@ -var currentID = ''; - -function init__SYSTEM_SAI_saimod_sys_api() { - saimod_sys_api_tree(); - saimod_sys_api_register_clickevents(); - -} +function init__SYSTEM_SAI_saimod_sys_cron() { + saimod_sys_cron_register_clickevents();} -function saimod_sys_api_loadcontent(){ - $('#api_wrapper').load(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_api', function(){ - console.log('api module loaded'); - saimod_sys_api_register_clickevents(); - }); - -} - -function saimod_sys_api_register_clickevents(){ - $('tr.api_entries').click(function() { +function saimod_sys_cron_register_clickevents(){ + $('tr.cron_entries').click(function() { console.log("ahsf"); - currentID = $(this).attr("id"); $.ajax({ url: SAI_ENDPOINT, - data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', - action: 'deletedialog', - ID: currentID}, + data: { sai_mod: '.SYSTEM.SAI.saimod_sys_cron', + action: 'deldialog', + cls: $(this).attr("cls")}, type: 'GET', success: function(data) { console.log("works"); - $('#api_content').html(data); - $('#del_api_close').click(function() { + $('#cron_content').html(data); + $('#del_cron_close').click(function() { console.log("olenski"); $('#del_api_description').hide(); $('#del_api_del').show(); - saimod_sys_api_loadcontent(); }); - $('#del_api_del').click(function() { + $('#del_cron_del').click(function() { $.ajax({ url: SAI_ENDPOINT, - data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', - action: 'deletecall', - ID: currentID}, + data: { sai_mod: '.SYSTEM.SAI.saimod_sys_cron', + action: 'del', + cls: $(this).attr("cls")}, type: 'GET', success: function(data) { - console.log("api call deleted"); - $('#api_deletedialog').html('

Api call deleted!

'); - $('#del_api_del').hide(); + console.log("cron call deleted"); + $('#cron_deletedialog').html('

Api call deleted!

'); + $('#del_cron_del').hide(); }});});}});}); - $('#addcall').click(function() { - var id = $('#new_call_id').val(); - var group = $('#new_call_group').val(); - var type = $('#new_call_type').val(); - var parentid = $('#new_call_parentid').val(); - var parentvalue = $('#new_call_parentvalue').val(); - var name = $('#new_call_name').val(); - var verify = $('#new_call_verify').val(); + $('#addcron').click(function() { + var cls = $('#new_cron_class').val(); + var min = $('#new_cron_min').val(); + var hour = $('#new_cron_hour').val(); + var day = $('#new_cron_day').val(); + var day_week = $('#new_cron_day_week').val(); + var month = $('#new_cron_month').val(); $.ajax({ url: SAI_ENDPOINT, - data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', - action: 'addcall', - ID: id, - group: group, - type: type, - parentID: parentid, - parentValue : parentvalue, - name: name, - verify: verify}, + data: { sai_mod: '.SYSTEM.SAI.saimod_sys_cron', + action: 'add', + cls: cls, + min: min, + hour: hour, + day: day, + day_week: day_week, + month: month}, type: 'GET', success: function(data) { - console.log("new api call added"); - saimod_sys_api_loadcontent(); + console.log("new cronjob added"); } }); }); - $('#del_api_close').click(function() { + $('#del_cron_close').click(function() { console.log("olenski"); - $('#del_api_description').hide(); - $('#del_api_del').show(); - saimod_sys_api_loadcontent(); - }); - $('#localetab a').click(function (e) {e.preventDefault(); $(this).tab('show');}); -} - -function saimod_sys_api_tree(){ - $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch'); - $('.tree li.parent_li > span').on('click', function (e) { - var children = $(this).parent('li.parent_li').find(' > ul > li'); - if (children.is(":visible")) { - children.hide('fast'); - $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign'); - } else { - children.show('fast'); - $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign'); - } - e.stopPropagation(); + $('#del_cron_description').hide(); + $('#del_cron_del').show(); }); } \ No newline at end of file diff --git a/sai/modules/saimod_sys_cron/saimod_sys_cron.php b/sai/modules/saimod_sys_cron/saimod_sys_cron.php index 698b6ea..db24caa 100644 --- a/sai/modules/saimod_sys_cron/saimod_sys_cron.php +++ b/sai/modules/saimod_sys_cron/saimod_sys_cron.php @@ -4,48 +4,33 @@ namespace SYSTEM\SAI; class saimod_sys_cron extends \SYSTEM\SAI\SaiModule { public static function sai_mod__SYSTEM_SAI_saimod_sys_cron(){ $vars = array(); - $vars['tabopts'] = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/tabopt.tpl'), array()); $vars['content'] = ''; - $res = \SYSTEM\DBD\SYS_SAIMOD_CRON::QQ(); while($r = $res->next()){ $vars['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/list_entry.tpl'), $r);} - - $vars['tabs'] = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/tab.tpl'), $vars); return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/tabs.tpl'), $vars); } - public static function sai_mod__system_sai_saimod_sys_api_action_deletedialog($ID){ - $res = \SYSTEM\DBD\SYS_SAIMOD_API_SINGLE_SELECT::Q1(array($ID)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/delete_dialog.tpl'), $res); - } + public static function sai_mod__system_sai_saimod_sys_cron_action_deldialog($cls){ + $res = \SYSTEM\DBD\SYS_SAIMOD_CRON_SINGLE_SELECT::Q1(array($cls)); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/delete_dialog.tpl'), $res);} - 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)){ + public static function sai_mod__system_sai_saimod_sys_cron_action_add($cls,$min,$hour,$day,$day_week,$month){ + if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON)){ throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} - \SYSTEM\DBD\SYS_SAIMOD_API_ADD::QI(array($ID,$group,$type,$parentID,$parentValue,$name,$verify)); + \SYSTEM\DBD\SYS_SAIMOD_CRON_ADD::QI(array($cls,$min,$hour,$day,$day_week,$month)); return \SYSTEM\LOG\JsonResult::ok(); } - public static function sai_mod__system_sai_saimod_sys_api_action_deletecall($ID){ - if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){ + public static function sai_mod__system_sai_saimod_sys_cron_action_del($cls){ + if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON)){ throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} - \SYSTEM\DBD\SYS_SAIMOD_API_DEL::QI(array($ID)); - return \SYSTEM\LOG\JsonResult::ok(); - } - - private static function tablerow_class($flag){ - switch($flag){ - case 0: return 'info'; - case 1: return ''; - case 4: return 'warning'; - default: return 'success'; - } - } + \SYSTEM\DBD\SYS_SAIMOD_CRON_DEL::QI(array($cls)); + return \SYSTEM\LOG\JsonResult::ok();} public static function html_li_menu(){return '
  • Cron
  • ';} public static function right_public(){return false;} - public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);} + public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON);} public static function sai_mod__SYSTEM_SAI_saimod_sys_cron_flag_css(){ return \SYSTEM\LOG\JsonResult::toString( diff --git a/sai/modules/saimod_sys_cron/tab.tpl b/sai/modules/saimod_sys_cron/tab.tpl deleted file mode 100644 index 3de066f..0000000 --- a/sai/modules/saimod_sys_cron/tab.tpl +++ /dev/null @@ -1,15 +0,0 @@ -
    - - - - - - - - - - - - ${content} -
    classminhourdayday_weekmonthlast_runstatus
    -
    \ No newline at end of file diff --git a/sai/modules/saimod_sys_cron/tabopt.tpl b/sai/modules/saimod_sys_cron/tabopt.tpl deleted file mode 100644 index bb18245..0000000 --- a/sai/modules/saimod_sys_cron/tabopt.tpl +++ /dev/null @@ -1 +0,0 @@ -
  • Cron
  • \ No newline at end of file diff --git a/sai/modules/saimod_sys_cron/tabs.tpl b/sai/modules/saimod_sys_cron/tabs.tpl index b8877bb..a454a7a 100644 --- a/sai/modules/saimod_sys_cron/tabs.tpl +++ b/sai/modules/saimod_sys_cron/tabs.tpl @@ -1,38 +1,29 @@
    -

    System Cron

    -
    -
    -
    - -
    - ${tabs} +

    System Cron

    +
    +
    + + + + + + + + + + + + ${content} + + + + + + + + + + +
    classminhourdayday_weekmonthlast_runstatus
    - - - - - - - - - - - - - - - - - - - - - - -
    classminhourdayday_weekmonthlast_runstatus
    - -
    -
    diff --git a/security/RIGHTS.php b/security/RIGHTS.php index 41c67c7..2e6d162 100644 --- a/security/RIGHTS.php +++ b/security/RIGHTS.php @@ -15,7 +15,9 @@ class RIGHTS { const SYS_SAI_FILES = 15; //Api Module const SYS_SAI_API = 20; - const SYS_SAI_API_EDIT = 21; + //const SYS_SAI_API_EDIT = 21; + + const SYS_SAI_CRON = 25; //Reserve first 1000 ids. const RESERVED_SYS_0_999 = 999;