diff --git a/api/api_default.php b/api/api_default.php index 7626bd4..f104246 100644 --- a/api/api_default.php +++ b/api/api_default.php @@ -14,12 +14,16 @@ abstract class api_default extends api_system { parse_str(\parse_url($row['url'],PHP_URL_QUERY), $params); $class = static::get_class($params); if($class){ - $frag->loadHTML(\SYSTEM\API\api::run('\SYSTEM\API\verify', $class, static::get_params($params), static::get_apigroup(), true, false)); + \libxml_use_internal_errors(true); + $frag->loadHTML(\SYSTEM\API\api::run('\SYSTEM\API\verify', $class, static::get_params($params), static::get_apigroup(), true, false)); $html->getElementById(substr($row['div'], 1))->appendChild($html->importNode($frag->documentElement, true)); + if($error = \libxml_get_last_error()){ + new \SYSTEM\LOG\ERROR('Parse Error: '.$error->message.' line:'.$error->line.' html: '.$html->saveHTML());} + \libxml_clear_errors(); //Load subpage css foreach($row['css'] as $css){ $css_frag = new \DOMDocument(); - $css_frag->loadHTML(''); + $css_frag->loadHTML(''); $html->getElementsByTagName('head')[0]->appendChild($html->importNode($css_frag->documentElement,true)); } } diff --git a/cron/cron_cache_delete.php b/cron/cron_cache_delete.php new file mode 100644 index 0000000..6b14080 --- /dev/null +++ b/cron/cron_cache_delete.php @@ -0,0 +1,9 @@ += $now_year && $oldest['month'] >= $now_month){ return cronstatus::CRON_STATUS_SUCCESFULLY;} - $filename = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$oldest['year'].'.'.$oldest['month'].'.db'; //extract whole month to file $con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite($filename)); - //create table $con->query('CREATE TABLE IF NOT EXISTS `system_log` ('. ' `ID` INT(10) NOT NULL,'. @@ -38,11 +36,11 @@ class cron_log2sqlite extends \SYSTEM\CRON\cronjob{ //write data as trasaction $con->exec('begin transaction'); + set_time_limit(30); $res = \SYSTEM\DBD\SYS_LOG_MONTH::QQ(array($oldest['month'],$oldest['year'])); - $i = 0; while($row = $res->next()){ set_time_limit(30); - $i++; + $row['time'] = array_key_exists('time_pg', $row) ? date("Y-m-d H:i:s", $row['time_pg']) : $row['time']; if(!$con->exec('INSERT OR IGNORE INTO '.\SYSTEM\DBD\system_log::NAME_MYS. '(`ID`, `class`, `message`, `code`, `file`, `line`, `trace`, `ip`, `querytime`, `time`,'. ' `server_name`, `server_port`, `request_uri`, `post`,'. @@ -50,20 +48,20 @@ class cron_log2sqlite extends \SYSTEM\CRON\cronjob{ 'VALUES ('.$row['ID'].', \''.\SQLite3::escapeString($row['class']).'\', \''.\SQLite3::escapeString($row['message']).'\', '. $row['code'].', \''.\SQLite3::escapeString($row['file']).'\', '.$row['line'].', \''.\SQLite3::escapeString($row['trace']).'\', \''. $row['ip'].'\', '.$row['querytime'].', \''.$row['time'].'\', \''. - \SQLite3::escapeString($row['server_name']).'\', '.$row['server_port'].', \''.\SQLite3::escapeString($row['request_uri']).'\', \''.\SQLite3::escapeString($row['post']).'\', \''. - \SQLite3::escapeString($row['http_referer']).'\', \''.\SQLite3::escapeString($row['http_user_agent']).'\', '.$row['user'].','.true.');')){ + \SQLite3::escapeString($row['server_name']).'\', '.($row['server_port'] ? $row['server_port'] : 'NULL').', \''.\SQLite3::escapeString($row['request_uri']).'\', \''.\SQLite3::escapeString($row['post']).'\', \''. + \SQLite3::escapeString($row['http_referer']).'\', \''.\SQLite3::escapeString($row['http_user_agent']).'\', '.($row['user'] ? $row['user'] : 'NULL').','.true.');')){ new \SYSTEM\LOG\ERROR('failed to insert into log archiev'); return cronstatus::CRON_STATUS_FAIL; } + //Delete single + if(!\SYSTEM\DBD\SYS_LOG_DEL::QI(array($row['ID']))){ + new \SYSTEM\LOG\ERROR('failed to delete log entries'); + return cronstatus::CRON_STATUS_FAIL;} } + set_time_limit(30); if(!$con->exec('end transaction')){ new \SYSTEM\LOG\ERROR('failed to insert into log archiev'); return cronstatus::CRON_STATUS_FAIL;}; - - //delete from database - if(!\SYSTEM\DBD\SYS_LOG_MONTH_DEL::QI(array($oldest['month'],$oldest['year']))){ - new \SYSTEM\LOG\ERROR('failed to delete log entries'); - return cronstatus::CRON_STATUS_FAIL;} return cronstatus::CRON_STATUS_SUCCESFULLY; } diff --git a/dbd/qq/SYS_CACHE_DELETE_ALL.php b/dbd/qq/SYS_CACHE_DELETE_ALL.php new file mode 100644 index 0000000..f8dff08 --- /dev/null +++ b/dbd/qq/SYS_CACHE_DELETE_ALL.php @@ -0,0 +1,10 @@ +next()){ + if(!self::is_loaded($row,$substate,$state_name) && $row['type'] == 1){ + continue;} $row['url'] = \SYSTEM\PAGE\replace::replace($row['url'], $vars); $row['url'] = \SYSTEM\PAGE\replace::clean($row['url']); //clean url of empty variables - $row['url'] = preg_replace('/&.*?=(&|$)/', '&', $row['url']); - $row['url'] = preg_replace('/&$/', '', $row['url']); + //$row['url'] = preg_replace('/&.*?=(&|$)/', '&', $row['url']); + $row['url'] = preg_replace('/[^=&]+=(&|$)/', '&', $row['url']); + $row['url'] = preg_replace('/&&$/', '', $row['url']); $row['css'] = $row['js'] = array(); if(\class_exists($row['php_class']) && \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(\class_exists($row['php_class']) && \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'));} $row['php_class'] = ''; - $result[] = $row; + + $skip = false; + for($i=0;$iparse($substate); + } + private static function is_loaded($row,&$substate,$state_name,$parent_id = -1){ + for($i=0;$icurrent = array(); + $this->stack = array(); + + $this->string = $string; + $this->length = strlen($this->string); + // look at each character + for ($this->position=0; $this->position < $this->length; $this->position++) { + switch ($this->string[$this->position]) { + case '(': + $this->push(); + // push current scope to the stack an begin a new scope + array_push($this->stack, $this->current); + $this->current = array(); + break; + + case ')': + $this->push(); + // save current scope + $t = $this->current; + // get the last scope from stack + $this->current = array_pop($this->stack); + // add just saved scope to current scope + $this->current[count($this->current)-1]['sub'] = $t; + break; + case '|': + // make each word its own token + $this->push(); + break; + default: + // remember the offset to do a string capture later + // could've also done $buffer .= $string[$position] + // but that would just be wasting resources… + if ($this->buffer_start === null) { + $this->buffer_start = $this->position; + } + } + } + $this->push(); + return $this->current; + } + + protected function push() + { + if ($this->buffer_start !== null) { + // extract string from buffer start to current position + $buffer = substr($this->string, $this->buffer_start, $this->position - $this->buffer_start); + // clean buffer + $this->buffer_start = null; + // throw token into current scope + $this->current[] = array('name' => $buffer); + } + } } \ No newline at end of file diff --git a/sai/modules/autoload.inc b/sai/modules/autoload.inc index 4bb638c..28c0857 100644 --- a/sai/modules/autoload.inc +++ b/sai/modules/autoload.inc @@ -7,10 +7,12 @@ require_once dirname(__FILE__).'/saimod_sys_security/autoload.inc'; require_once dirname(__FILE__).'/saimod_sys_mod/autoload.inc'; require_once dirname(__FILE__).'/saimod_sys_config/autoload.inc'; require_once dirname(__FILE__).'/saimod_sys_api/autoload.inc'; +require_once dirname(__FILE__).'/saimod_sys_page/autoload.inc'; require_once dirname(__FILE__).'/saimod_sys_text/autoload.inc'; require_once dirname(__FILE__).'/saimod_sys_files/autoload.inc'; require_once dirname(__FILE__).'/saimod_sys_cache/autoload.inc'; require_once dirname(__FILE__).'/saimod_sys_cron/autoload.inc'; require_once dirname(__FILE__).'/saimod_sys_todo/autoload.inc'; require_once dirname(__FILE__).'/saimod_sys_docu/autoload.inc'; +require_once dirname(__FILE__).'/saimod_sys_langswitcher/autoload.inc'; require_once dirname(__FILE__).'/saimod_sys_login/autoload.inc'; \ No newline at end of file diff --git a/sai/modules/saimod_sys_api/css/saimod_sys_api.css b/sai/modules/saimod_sys_api/css/saimod_sys_api.css index 07df088..e69de29 100644 --- a/sai/modules/saimod_sys_api/css/saimod_sys_api.css +++ b/sai/modules/saimod_sys_api/css/saimod_sys_api.css @@ -1,64 +0,0 @@ -p { - font-size: 90%; -} -.tree { - min-height:20px; - padding:19px; - margin-bottom:20px; - background-color:#fbfbfb; - border:1px solid #999; - -webkit-border-radius:4px; - -moz-border-radius:4px; - border-radius:4px; - -webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05); - -moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05); - box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05) -} -.tree li { - list-style-type:none; - margin:0; - padding:10px 5px 0 5px; - position:relative -} -.tree li::before, .tree li::after { - content:''; - left:-20px; - position:absolute; - right:auto -} -.tree li::before { - border-left:1px solid #999; - bottom:50px; - height:100%; - top:0; - width:1px -} -.tree li::after { - border-top:1px solid #999; - height:20px; - top:25px; - width:25px -} -.tree li span { - -moz-border-radius:5px; - -webkit-border-radius:5px; - border:1px solid #999; - border-radius:5px; - display:inline-block; - padding:3px 8px; - text-decoration:none -} -.tree li.parent_li>span { - cursor:pointer -} -.tree>ul>li::before, .tree>ul>li::after { - border:0 -} -.tree li:last-child::before { - height:30px -} -.tree li.parent_li>span:hover, .tree li.parent_li>span:hover+ul li span { - background:#eee; - border:1px solid #94a0b4; - color:#000 -} \ No newline at end of file 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 7bfe99a..c1bf6d9 100644 --- a/sai/modules/saimod_sys_api/js/saimod_sys_api.js +++ b/sai/modules/saimod_sys_api/js/saimod_sys_api.js @@ -1,97 +1,54 @@ -var currentID = ''; - function init_saimod_sys_api() { - saimod_sys_api_tree(); - saimod_sys_api_register_clickevents(); - -} - -function saimod_sys_api_loadcontent(){ - $('#api_wrapper').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_api', function(){ - console.log('api module loaded'); - saimod_sys_api_register_clickevents(); + $('#tabs_log a').click(function (e) { + $('#tabs_log li').each(function(){ + $(this).removeClass('active');}); + $(this).parent().addClass('active'); }); - + api_menu(); } -function saimod_sys_api_register_clickevents(){ - $('tr.api_entries').click(function() { - currentID = $(this).attr("id"); - $.ajax({ - url: './sai.php', - data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', - action: 'deletedialog', - ID: currentID}, - type: 'GET', - success: function(data) { - console.log("works"); - $('#api_content').html(data); - $('#del_api_close').click(function() { - console.log("olenski"); - $('#del_api_description').hide(); - $('#del_api_del').show(); - saimod_sys_api_loadcontent(); - }); - $('#del_api_del').click(function() { - $.ajax({ - url: './sai.php', - data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', - action: 'deletecall', - ID: currentID}, - type: 'GET', - success: function(data) { - console.log("api call deleted"); - $('#api_deletedialog').html('

Api call deleted!

'); - $('#del_api_del').hide(); - }});});}});}); - +function init_saimod_sys_api_new(){ $('#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(); - $.ajax({ - url: './sai.php', - data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', - action: 'addcall', - ID: id, - group: group, - type: type, - parentID: parentid, - parentValue : parentvalue, - name: name, - verify: verify}, - type: 'GET', - success: function(data) { - console.log("new api call added"); - saimod_sys_api_loadcontent(); - } - }); - + $.ajax({ url: './sai.php', + data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', + action: 'addcall', + ID: $('#new_call_id').val(), + group: $('#new_call_group').val(), + type: $('#new_call_type').val(), + parentID: $('#new_call_parentid').val(), + parentValue : $('#new_call_parentvalue').val(), + name: $('#new_call_name').val(), + verify: $('#new_call_verify').val()}, + type: 'GET', + success: function(data) { + system.load('api;group.'+$('#new_call_group').val());} + }); }); - $('#del_api_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(); +function api_menu(){ + $('#tabs_log li').each(function(){ + $(this).removeClass('active');}); + if($('#menu_group_'+system.cur_state().split('.')[1]).length){ + $('#menu_group_'+system.cur_state().split('.')[1]).parent().addClass('active'); + } else { + $('#menu_all').parent().addClass('active');} +} +function init_saimod_sys_api_list(){ + api_menu();} +function init_saimod_sys_api_delete(){ + $('#del_api_del').click(function() { + $.ajax({ url: './sai.php', + data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', + action: 'deletecall', + ID: $(this).attr('api_id'), + group: $(this).attr('api_group')}, + type: 'GET', + success: function(data) { + console.log("api call deleted"); + $('#api_deletedialog').html('

Api call deleted!

'); + $('#del_api_del').hide(); + } + }); }); } \ No newline at end of file diff --git a/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_DEL.php b/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_DEL.php index be23730..64ac997 100644 --- a/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_DEL.php +++ b/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_DEL.php @@ -5,7 +5,7 @@ class SYS_SAIMOD_API_DEL extends \SYSTEM\DB\QP { protected static function query(){ return new \SYSTEM\DB\QQuery(get_class(), //pg -'DELETE FROM '.\SYSTEM\DBD\system_api::NAME_PG.' WHERE `ID` = $1;', +'DELETE FROM '.\SYSTEM\DBD\system_api::NAME_PG.' WHERE `ID` = $1 AND group = $2;', //mys -'DELETE FROM '.\SYSTEM\DBD\system_api::NAME_MYS.' WHERE `ID` = ?;' +'DELETE FROM '.\SYSTEM\DBD\system_api::NAME_MYS.' WHERE `ID` = ? AND `group` = ?;' );}} diff --git a/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_GET.php b/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_GET.php new file mode 100644 index 0000000..f0543e0 --- /dev/null +++ b/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_GET.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 ? 'active' : ''), - '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); - -/* $result = ""; - $result .= ''.''.$r['ID'].''.''.$r['group'].''.''.$r['type'].''.''.$r['parentID'].''.''.$r['parentValue'].''.''.$r['name'].''.''.$r['verify'].''.''; - return $result;*/ + $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_deletedialog($ID){ - $res = \SYSTEM\DBD\SYS_SAIMOD_API_SINGLE_SELECT::Q1(array($ID)); + public static function sai_mod__system_sai_saimod_sys_api_action_list($group=null){ + $res = \SYSTEM\DBD\SYS_SAIMOD_API_GET::QQ(); + $tab = array('content' => ''); + while($r = $res->next()){ + if($group != null && $r['group'] != $group){ + continue;} + $tab['tab_id'] = $r['group']; + $r['tr_class'] = self::tablerow_class($r['type']); + $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/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)){ @@ -64,10 +42,10 @@ class saimod_sys_api extends \SYSTEM\SAI\SaiModule { return \SYSTEM\LOG\JsonResult::ok(); } - public static function sai_mod__system_sai_saimod_sys_api_action_deletecall($ID){ + public static function sai_mod__system_sai_saimod_sys_api_action_deletecall($ID,$group){ if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){ throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} - \SYSTEM\DBD\SYS_SAIMOD_API_DEL::QI(array($ID)); + \SYSTEM\DBD\SYS_SAIMOD_API_DEL::QI(array($ID,$group)); return \SYSTEM\LOG\JsonResult::ok(); } diff --git a/sai/modules/saimod_sys_api/tpl/delete_dialog.tpl b/sai/modules/saimod_sys_api/tpl/delete_dialog.tpl index 54505c1..aaee966 100644 --- a/sai/modules/saimod_sys_api/tpl/delete_dialog.tpl +++ b/sai/modules/saimod_sys_api/tpl/delete_dialog.tpl @@ -22,5 +22,5 @@ - - + + diff --git a/sai/modules/saimod_sys_api/tpl/list_entry.tpl b/sai/modules/saimod_sys_api/tpl/list_entry.tpl index b7d9845..8fa6641 100644 --- a/sai/modules/saimod_sys_api/tpl/list_entry.tpl +++ b/sai/modules/saimod_sys_api/tpl/list_entry.tpl @@ -1,4 +1,4 @@ - + ${ID} ${group} ${type} 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..ac20605 --- /dev/null +++ b/sai/modules/saimod_sys_api/tpl/new_dialog.tpl @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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/saimod_sys_api_list.tpl b/sai/modules/saimod_sys_api/tpl/saimod_sys_api_list.tpl new file mode 100644 index 0000000..ecdbde4 --- /dev/null +++ b/sai/modules/saimod_sys_api/tpl/saimod_sys_api_list.tpl @@ -0,0 +1,12 @@ + + + + + + + + + + + ${content} +
IDGroupTypeParentIDParentValueNameVerify
\ No newline at end of file diff --git a/sai/modules/saimod_sys_api/tpl/tab.tpl b/sai/modules/saimod_sys_api/tpl/tab.tpl deleted file mode 100644 index 7e43161..0000000 --- a/sai/modules/saimod_sys_api/tpl/tab.tpl +++ /dev/null @@ -1,14 +0,0 @@ -
- - - - - - - - - - - ${content} -
IDGroupTypeParentIDParentValueNameVerify
-
\ No newline at end of file diff --git a/sai/modules/saimod_sys_api/tpl/tabopt.tpl b/sai/modules/saimod_sys_api/tpl/tabopt.tpl index cf223b0..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 aa9102c..0000000 --- a/sai/modules/saimod_sys_api/tpl/tabs.tpl +++ /dev/null @@ -1,36 +0,0 @@ -
    -

    System API

    -
    -
    -
    - -
    - ${tabs} -
    -
    - - - - - - - - - - - - - - - - - - - - -
    IDGroupTypeParentIDParentValueNameVerify
    - -
    -
    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_config/saimod_sys_config.php b/sai/modules/saimod_sys_config/saimod_sys_config.php index 87016ef..6ed9f48 100644 --- a/sai/modules/saimod_sys_config/saimod_sys_config.php +++ b/sai/modules/saimod_sys_config/saimod_sys_config.php @@ -2,33 +2,75 @@ namespace SYSTEM\SAI; class saimod_sys_config extends \SYSTEM\SAI\SaiModule { public static function sai_mod__SYSTEM_SAI_saimod_sys_config(){ - $result = '

    System Config


    '. - '
    '.'ID'.''.'CacheID'.''.'Ident'.''.'Data'.'
    '. - ''.''.''.''.''; + $vars = array(); + $vars['basics'] = $vars['database'] = $vars['sai'] = ''; + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING', + 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING))); + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL', + 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL))); + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH', + 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH))); + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL', + 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL))); + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT', + 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT))); + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS', + 'value' =>implode(',',\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS)))); + $vars['basics'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG', + 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG))); - $result .= ''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''.''; - $result .= ''.''.''.''.''; + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE', + 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE))); + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST', + 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST))); + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT', + 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT))); + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER', + 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER))); + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD', + 'value' =>'<hidden>')); + $vars['database'] .=\SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME', + 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME))); - $result .= '
    '.'Config ID'.''.'Config Name'.''.'Value'.'
    Basics
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_ERRORREPORTING). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS'. ''.implode(',',\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS)). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_LANG). '
    Database
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_TYPE). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_HOST). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PORT). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_USER). '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_PASSWORD'. ''.'<hidden>'. '
    '.\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME. ''.'\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DB_DBNAME). '
    System Admin Interface
    '.\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT. ''.'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT). '
    '.\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT. ''.'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT). '
    '.\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE. ''.'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE'. ''.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE). '
    '; - - return $result; + $vars['sai'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT', + 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT))); + $vars['sai'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT', + 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT))); + $vars['sai'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config_tr.tpl'), + array( 'id' =>\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE, + 'name' =>'\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE', + 'value' =>\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE))); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_config/tpl/config.tpl'),$vars); } public static function html_li_menu(){return '
  • Config
  • ';} public static function right_public(){return false;} diff --git a/sai/modules/saimod_sys_config/tpl/config.tpl b/sai/modules/saimod_sys_config/tpl/config.tpl new file mode 100644 index 0000000..a336cdb --- /dev/null +++ b/sai/modules/saimod_sys_config/tpl/config.tpl @@ -0,0 +1,27 @@ +

    System Config

    +
    + + + + + + + + + + + + ${basics} + + + + + + ${database} + + + + + + ${sai} +
    Config IDConfig NameValue
    Basics
    Database
    System Admin Interface
    \ No newline at end of file diff --git a/sai/modules/saimod_sys_config/tpl/config_tr.tpl b/sai/modules/saimod_sys_config/tpl/config_tr.tpl new file mode 100644 index 0000000..3222cc0 --- /dev/null +++ b/sai/modules/saimod_sys_config/tpl/config_tr.tpl @@ -0,0 +1,5 @@ + + ${id} + ${name} + ${value} + \ No newline at end of file diff --git a/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON_CHANGE.php b/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON_CHANGE.php index dc690a3..aa278b5 100644 --- a/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON_CHANGE.php +++ b/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON_CHANGE.php @@ -5,7 +5,7 @@ class SYS_SAIMOD_CRON_CHANGE extends \SYSTEM\DB\QP { protected static function query(){ return new \SYSTEM\DB\QQuery(get_class(), //pg -'UPDATE '.\SYSTEM\DBD\system_cron::NAME_PG.' SET status = $1 WHERE `class` = $2;', +'UPDATE '.\SYSTEM\DBD\system_cron::NAME_PG.' SET status = $1 WHERE class = $2;', //mys 'UPDATE '.\SYSTEM\DBD\system_cron::NAME_MYS.' SET status = ? WHERE `class` = ?;' );}} diff --git a/sai/modules/saimod_sys_cron/saimod_sys_cron.php b/sai/modules/saimod_sys_cron/saimod_sys_cron.php index d7a9e43..0ce889b 100644 --- a/sai/modules/saimod_sys_cron/saimod_sys_cron.php +++ b/sai/modules/saimod_sys_cron/saimod_sys_cron.php @@ -20,7 +20,7 @@ class saimod_sys_cron extends \SYSTEM\SAI\SaiModule { public static function sai_mod__system_sai_saimod_sys_cron_action_change($cls,$status){ 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_CRON_CHANGE::QI(array($status,$cls)); + \SYSTEM\DBD\SYS_SAIMOD_CRON_CHANGE::QI(array($status, $cls)); return \SYSTEM\LOG\JsonResult::ok(); } diff --git a/sai/modules/saimod_sys_langswitcher/autoload.inc b/sai/modules/saimod_sys_langswitcher/autoload.inc new file mode 100644 index 0000000..29ebcbf --- /dev/null +++ b/sai/modules/saimod_sys_langswitcher/autoload.inc @@ -0,0 +1,4 @@ + $lang,'endpoint' => $endpoint));} + return $result; + } + + //public static function css(){} + //public static function js(){} +} \ No newline at end of file diff --git a/sai/modules/saimod_sys_langswitcher/tpl/language.tpl b/sai/modules/saimod_sys_langswitcher/tpl/language.tpl new file mode 100644 index 0000000..6d45b57 --- /dev/null +++ b/sai/modules/saimod_sys_langswitcher/tpl/language.tpl @@ -0,0 +1 @@ +${lang}  \ No newline at end of file diff --git a/sai/modules/saimod_sys_log/js/saimod_sys_log.js b/sai/modules/saimod_sys_log/js/saimod_sys_log.js index dd1ddd8..a8b1419 100644 --- a/sai/modules/saimod_sys_log/js/saimod_sys_log.js +++ b/sai/modules/saimod_sys_log/js/saimod_sys_log.js @@ -1,60 +1,19 @@ google.load("visualization", "1", {packages:["corechart"]}); function init_saimod_sys_log() { $('#tabs_log a').click(function (e) { - e.preventDefault(); - $(this).tab('show'); - load_log_tab($(this).attr('action')); - }); - - load_log_tab("log"); -}; - -function load_log_tab(action){ - $('img#loader').show(); - switch(action){ - case 'log': - $('#tab_log').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action='+action, function(){ - register_log(); - register_error(); - $('img#loader').hide();}); - return; - case 'stats': - $('#tab_stats').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action='+action, function(){ - register_stats(); - $('img#loader').hide();}); - return; - default: - $('img#loader').hide(); - } -} - -function register_error(){ - $('.sai_log_error').click(function(){ - $('img#loader').show(); - $('#table_log').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=error&error='+$(this).attr('error'), function(){ - $('img#loader').hide();})}); -} - -function load_table_log(filter){ - $('img#loader').show(); - $('#table_log').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=filter&filter='+filter, function(){ - register_error(); - $('img#loader').hide();}); -} - -var filter = "%"; -function register_log(){ - $('#refresh_error_table').click(function(){ - load_table_log(filter);}); - $("#error_filter a").click(function(){ - $('#error_filter li').each(function(){ + $('#tabs_log li').each(function(){ $(this).removeClass('active');}); $(this).parent().addClass('active'); - filter = $(this).attr('filter'); - load_table_log($(this).attr('filter')); }); +}; + +function init_saimod_sys_log_log() { + $('#tabs_log li').each(function(){ + $(this).removeClass('active');}); + $('#menu_loglist').parent().addClass('active'); } -function register_stats(){ + +function init_saimod_sys_log_stats() { load_visualisation(); $('#vis_filter_time').change(function(){ load_visualisation();}) @@ -65,8 +24,10 @@ function register_stats(){ $(this).tab('show'); load_visualisation(); }); + $('#tabs_log li').each(function(){ + $(this).removeClass('active');}); + $('#menu_stats').parent().addClass('active'); } - function load_visualisation(){ $('img#loader').show(); var name = $('#vis_filter_type').val();; @@ -89,7 +50,7 @@ function load_visualisation(){ data.addColumn('number',key); } }); - $.each(json, function(key, value){first = true; data.addRow($.map(value, function(v) { if(first){first=false;return [new Date(v)];}else{return [(v == null || parseFloat(v) <= 0) ? 0.1 : parseFloat(v)];}}));}); + $.each(json, function(key, value){first = true; data.addRow($.map(value, function(v) { if(first){first=false;return [new Date(v)];}else{return [(v == null || parseFloat(v) <= 0) ? parseFloat(0.00001) : parseFloat(v)];}}));}); var options = {title: name, aggregationTarget: 'category', selectionMode: 'multiple', curveType: 'function', /*focusTarget: 'category',*/ chartArea:{left:100,top:40}, vAxis:{logScale: true}, interpolateNulls: false, width: "1200", height: "500"}; new google.visualization.LineChart(document.getElementById('vis')).draw(data, options); diff --git a/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_ANALYTICS.php b/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_ANALYTICS.php new file mode 100644 index 0000000..da49f4d --- /dev/null +++ b/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_ANALYTICS.php @@ -0,0 +1,18 @@ + $file));} } + //positioning problem + //$vars['analytics'] = self::analytics(); return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_stats.tpl'), $vars);} public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_stats_name_class_system($filter,$db){ @@ -99,7 +121,7 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule { $res = $con->prepare('unique_basic', 'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,' .'count(*) as count,' - .'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_USER.') as user_unique,' .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,' .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_SERVER_NAME.') as server_name_unique' .' FROM '.\SYSTEM\DBD\system_log::NAME_MYS @@ -169,7 +191,7 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule { $res = $con->prepare('unique_referer', 'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,' .'count(*) as count,' - .'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_USER.') as user_unique,' .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique,' .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_REFERER.') as http_referer_unique,' .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_HTTP_USER_AGENT.') as http_user_agent_unique' @@ -193,7 +215,7 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule { $res = $con->prepare('basic_visitor', 'SELECT datetime(strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.') - strftime("%s",'.\SYSTEM\DBD\system_log::FIELD_TIME.')%:filter,"unixepoch", "localtime") as day,' .'count(*) as count,' - .'count(distinct "'.\SYSTEM\DBD\system_log::FIELD_USER.'") as user_unique,' + .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_USER.') as user_unique,' .'count(distinct '.\SYSTEM\DBD\system_log::FIELD_IP.') as ip_unique' .' FROM '.\SYSTEM\DBD\system_log::NAME_MYS .' GROUP BY day' @@ -268,6 +290,7 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule { return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_error.tpl'), $vars);} public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_filter($filter = "%"){ + $filter_ = $filter; $filter = str_replace('\\', '\\\\', $filter); $count = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTER_COUNT::Q1(array($filter)); $res = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTER::QQ(array($filter)); @@ -276,20 +299,17 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule { //print_r($r); $r['class_row'] = self::tablerow_class($r['class']); $r['time'] = self::time_elapsed_string(strtotime($r['time'])); - $r['message'] = substr($r['message'],0,255); + $r['message'] = htmlspecialchars(substr($r['message'],0,255)); + $r['request_uri'] = htmlspecialchars($r['request_uri']); $table .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl'),$r); } $vars = array(); $vars['count'] = $count['count']; $vars['table'] = $table; - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_table.tpl'), $vars); - } - - public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_log(){ - $vars = array(); - $vars['table'] = self::sai_mod__SYSTEM_SAI_saimod_sys_log_action_filter(); - $vars['error_filter'] = self::generate_error_filters(); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl'), + array( 'table' => \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_table.tpl'), $vars), + 'error_filter' => self::generate_error_filters($filter_), + 'active' => $filter == '%' ? 'active' : '')); } private static function time_elapsed_string($ptime){ @@ -312,11 +332,11 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule { } } - private static function generate_error_filters(){ + private static function generate_error_filters($filter){ $res = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTERS::QQ(); $result = ''; while($row = $res->next()){ - $result .= '
  • '.$row['class'].'
  • ';} + $result .= ''.$row['class'].'';} return $result; } diff --git a/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl b/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl index d7fce53..5b1d122 100644 --- a/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl +++ b/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl @@ -2,13 +2,12 @@
    -
    \ No newline at end of file diff --git a/sai/modules/saimod_sys_log/tpl/saimod_sys_log_analytics.tpl b/sai/modules/saimod_sys_log/tpl/saimod_sys_log_analytics.tpl new file mode 100644 index 0000000..7c1d174 --- /dev/null +++ b/sai/modules/saimod_sys_log/tpl/saimod_sys_log_analytics.tpl @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +
    PV: ${page_value}TodayWeekMonth
    Log${log_today}${log_week}${log_month}
    IPs${ip_today}${ip_week}${ip_month}
    Users${user_today}${user_week}${user_month}
    \ No newline at end of file diff --git a/sai/modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl b/sai/modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl index 3dbf4aa..205f080 100644 --- a/sai/modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl +++ b/sai/modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl @@ -1,5 +1,5 @@
    ${table}
    \ No newline at end of file diff --git a/sai/modules/saimod_sys_log/tpl/saimod_sys_log_stats.tpl b/sai/modules/saimod_sys_log/tpl/saimod_sys_log_stats.tpl index a004b46..2f0bb19 100644 --- a/sai/modules/saimod_sys_log/tpl/saimod_sys_log_stats.tpl +++ b/sai/modules/saimod_sys_log/tpl/saimod_sys_log_stats.tpl @@ -6,7 +6,7 @@
    + + + name + + + + group + + + + state + + + + parent_id + + + + type + + + + div + + + + url + + + + func + + + + php_class + + + + + \ No newline at end of file diff --git a/sai/modules/saimod_sys_page/tpl/saimod_sys_page.tpl b/sai/modules/saimod_sys_page/tpl/saimod_sys_page.tpl new file mode 100644 index 0000000..82b7a60 --- /dev/null +++ b/sai/modules/saimod_sys_page/tpl/saimod_sys_page.tpl @@ -0,0 +1,12 @@ +

    System Page

    +
    +
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/sai/modules/saimod_sys_page/tpl/saimod_sys_page_list.tpl b/sai/modules/saimod_sys_page/tpl/saimod_sys_page_list.tpl new file mode 100644 index 0000000..1049e64 --- /dev/null +++ b/sai/modules/saimod_sys_page/tpl/saimod_sys_page_list.tpl @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + ${content} +
    idnamegroupstateparent_idtypedivurlfuncphp_class
    \ No newline at end of file diff --git a/sai/modules/saimod_sys_page/tpl/tabopt.tpl b/sai/modules/saimod_sys_page/tpl/tabopt.tpl new file mode 100644 index 0000000..b99eb35 --- /dev/null +++ b/sai/modules/saimod_sys_page/tpl/tabopt.tpl @@ -0,0 +1 @@ +
  • Group ${tab_id}
  • \ No newline at end of file diff --git a/sai/modules/saimod_sys_security/js/saimod_sys_security.js b/sai/modules/saimod_sys_security/js/saimod_sys_security.js index 08e5dd5..4a9ab0f 100644 --- a/sai/modules/saimod_sys_security/js/saimod_sys_security.js +++ b/sai/modules/saimod_sys_security/js/saimod_sys_security.js @@ -1,46 +1,47 @@ -var user_search = ''; function init_saimod_sys_security() { - $('#securitytab a').click(function (e) { - e.preventDefault(); - $(this).tab('show'); - load_security_tab($(this).attr('action')); - }) + $('#securitytab a').click(function (e) { + $('#securitytab li').each(function(){ + $(this).removeClass('active');}); + $(this).parent().addClass('active'); + }); - load_security_tab('users'); + $('#user_go').click(function(){ + system.load('security;search.'+encodeURIComponent($('#user_search').val()));}) }; -function load_security_tab(action){ - $('img#loader').show(); - switch(action){ - case 'users': - $('#tab_users').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action='+action+'&search='+encodeURIComponent(user_search), function(){ - register_users(); - $('img#loader').hide();}); - return; - case 'rights': - $('#tab_rights').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action='+action, function(){ - register_rights(); - $('img#loader').hide();}); - return; - case 'groups': - $('#tab_groups').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action='+action, function(){ - $('img#loader').hide();}); - return; - case 'stats': - $('#tab_stats').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action='+action, function(){ - $('img#loader').hide();}); - return; - default: - $('img#loader').hide(); - } +function init_saimod_sys_security_users() { + $('#securitytab li').each(function(){ + $(this).removeClass('active');}); + $('#menu_users').parent().addClass('active'); } -function register_rights(){ - $('#new_right').click(function(){ - $('#tab_rights').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=newright',function(){ - register_newright(); - }); +function init_saimod_sys_security_user() { + $('.deleteuserright').click(function(){ + $.get( './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=deleterightuser&rightid='+$(this).attr('right_id')+ + '&userid='+$(this).attr('user_id'),function(data){ + if(data==1){ + alert('sucess'); + } else { + alert('fail'); + } + }); + }) + $('#adduserright_add').click(function(){ + $.get( './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=addrightuser&rightid='+$('#adduserright_rightid').val()+ + '&userid='+$(this).attr('user_id'),function(data){ + if(data==1){ + alert('sucess'); + } else { + alert('fail'); + } + }); }); +} + +function init_saimod_sys_security_rights() { + $('#securitytab li').each(function(){ + $(this).removeClass('active');}); + $('#menu_rights').parent().addClass('active'); $('.right_edit').click(function(){ alert('todo'); @@ -51,9 +52,28 @@ function register_rights(){ register_deleteright(); }); }); + + $('#new_right').click(function(){ + $('#tab_rights').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=newright',function(){ + register_newright(); + }); + }); +} +function init_saimod_sys_security_newright() { + $('#addright').click(function(){ + $.get( './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=addright&id='+$('#addright_id').val()+ + '&name='+encodeURIComponent($('#addright_name').val())+ + '&description='+encodeURIComponent($('#addright_description').val()),function(data){ + if(data==1){ + alert('sucess'); + } else { + alert('fail'); + } + }); + }) } -function register_deleteright(){ +function init_saimod_sys_security_delright(){ $('#deleteright_confirm').click(function(){ $.get('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=deleteright&id='+$(this).attr('right_id'), function(data){ @@ -68,50 +88,4 @@ function register_deleteright(){ $('#deleteright_abort').click(function(){ load_security_tab('rights'); }); -} - -function register_newright(){ - $('#addright').click(function(){ - $.get( './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=addright&id='+$('#addright_id').val()+ - '&name='+encodeURIComponent($('#addright_name').val())+ - '&description='+encodeURIComponent($('#addright_description').val()),function(data){ - if(data==1){ - alert('sucess'); - } else { - alert('fail'); - } - }); - }) -} - -function register_users(){ - $('#user_go').click(function(){ - user_search = $('#user_search').val(); - load_security_tab('users'); - }); - $('#user_search').val(user_search); - $('.user_entry').click(function(){ - $('#tab_users').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=user&username='+encodeURIComponent($(this).attr('username')),function(){ - $('.deleteuserright').click(function(){ - $.get( './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=deleterightuser&rightid='+$(this).attr('right_id')+ - '&userid='+$(this).attr('user_id'),function(data){ - if(data==1){ - alert('sucess'); - } else { - alert('fail'); - } - }); - }) - $('#adduserright_add').click(function(){ - $.get( './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_security&action=addrightuser&rightid='+$('#adduserright_rightid').val()+ - '&userid='+$(this).attr('user_id'),function(data){ - if(data==1){ - alert('sucess'); - } else { - alert('fail'); - } - }); - }); - }); - }); } \ No newline at end of file diff --git a/sai/modules/saimod_sys_security/saimod_sys_security.php b/sai/modules/saimod_sys_security/saimod_sys_security.php index 6923d92..f19b1eb 100644 --- a/sai/modules/saimod_sys_security/saimod_sys_security.php +++ b/sai/modules/saimod_sys_security/saimod_sys_security.php @@ -15,13 +15,13 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule { $res = \SYSTEM\DBD\SYS_SAIMOD_SECURITY_RIGHTS::QQ(); while($r = $res->next()){ $r['right_edit_btn'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT) ? - ' + ' ' : 'Missing rights.'; $rows .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_right.tpl'),$r);} $vars['rows'] = $rows; $vars['addright_btn'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT) ? - '' : + '' : 'You are missing the required rights for adding or removing rights.'; return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_rights.tpl'),$vars); } diff --git a/sai/modules/saimod_sys_security/tpl/saimod_sys_security.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security.tpl index 2c05cb5..4d536e5 100644 --- a/sai/modules/saimod_sys_security/tpl/saimod_sys_security.tpl +++ b/sai/modules/saimod_sys_security/tpl/saimod_sys_security.tpl @@ -2,16 +2,13 @@
    -
    -
    -
    -
    +
    \ No newline at end of file diff --git a/sai/modules/saimod_sys_security/tpl/saimod_sys_security_deleteright.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_deleteright.tpl index 819ead4..9b131d8 100644 --- a/sai/modules/saimod_sys_security/tpl/saimod_sys_security_deleteright.tpl +++ b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_deleteright.tpl @@ -14,4 +14,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user.tpl index c89c39b..27c6596 100644 --- a/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user.tpl +++ b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user.tpl @@ -1,4 +1,4 @@ - + ${id} ${username} ${email} diff --git a/sai/modules/saimod_sys_security/tpl/saimod_sys_security_users.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_users.tpl index 6b8d711..2602e14 100644 --- a/sai/modules/saimod_sys_security/tpl/saimod_sys_security_users.tpl +++ b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_users.tpl @@ -1,7 +1,3 @@ - - -
    -
    Users: ${count} diff --git a/sai/modules/saimod_sys_text/saimod_sys_text.php b/sai/modules/saimod_sys_text/saimod_sys_text.php index 18faa84..ffb5970 100644 --- a/sai/modules/saimod_sys_text/saimod_sys_text.php +++ b/sai/modules/saimod_sys_text/saimod_sys_text.php @@ -70,7 +70,7 @@ class saimod_sys_text extends \SYSTEM\SAI\SaiModule { $con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo()); $res = null; if(\SYSTEM\system::isSystemDbInfoPG()){ - $res = $con->prepare('newText' ,'UPDATE '.\SYSTEM\DBD\system_locale_string::NAME_PG.' SET "'.$lang.'"=$1 WHERE category = $1 AND id=$2;', array($newtext, $category, $id)); + $res = $con->prepare('newText' ,'UPDATE '.\SYSTEM\DBD\system_locale_string::NAME_PG.' SET "'.$lang.'"=$1 WHERE category = $2 AND id=$3;', array($newtext, $category, $id)); } else { $res = $con->prepare('newText' ,'UPDATE '.\SYSTEM\DBD\system_locale_string::NAME_MYS.' SET '.$lang.'=? WHERE category = ? AND id=?;', array($newtext, $category, $id)); } diff --git a/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js b/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js index cbf1d7f..cc0d1ba 100644 --- a/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js +++ b/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js @@ -1,46 +1,77 @@ -function init_saimod_sys_todo() { +function init_saimod_sys_todo() { $('#tabs_todo a').click(function (e) { - e.preventDefault(); - $(this).tab('show'); - load_todo_tab($(this).attr('action')); + $('#tabs_todo li').each(function(){ + $(this).removeClass('active');}); + $(this).parent().addClass('active'); }); - - load_todo_tab('todolist'); - register_new(); + + $('#btn_close_all').click(function(){ + if (confirm('Are you sure you want to delete all open entries in the todolist?')) { + $.ajax({ type :'GET', + url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=close_all', + success : function(data) { + if(data.status){ + system.load('todo'); + }else{ + alert('Problem: '+data);} + } + }); + } + }) }; -function register_new(){ - $('#btn_new').click(function(){ - $('#img_loader').show(); - $('#tab_todo').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=new', function(){ - register_newform(); - $('#btn_back').click(function(){ - load_todo_tab('todolist');}); - $('#img_loader').hide(); - }); - }); +function init_saimod_sys_todo_todo() { + $('#tabs_todo li').each(function(){ + $(this).removeClass('active');}); + $('#menu_todolist').parent().addClass('active'); } -function register_edit(){ +function init_saimod_sys_todo_doto() { + $('#tabs_todo li').each(function(){ + $(this).removeClass('active');}); + $('#menu_doto').parent().addClass('active'); +} + +function init_saimod_sys_todo_stats() { + $('#tabs_todo li').each(function(){ + $(this).removeClass('active');}); + $('#menu_stats').parent().addClass('active'); +} + +function init_saimod_sys_todo_todoopen(){ $('#btn_edit').click(function(){ $.ajax({ type : 'GET', url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=edit&todo='+$(this).attr('todo')+'&message='+encodeURIComponent($('#ta_message').val()), success : function(data) { if(data.status){ - load_todo_tab('todolist'); + system.load('todo'); } } }); }); + register_open(); +} +function init_saimod_sys_todo_todoclose(){ + $('#btn_edit').click(function(){ + $.ajax({ type : 'GET', + url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=edit&todo='+$(this).attr('todo')+'&message='+encodeURIComponent($('#ta_message').val()), + success : function(data) { + if(data.status){ + system.load('todo'); + } + } + }); + }); + register_close(); } -function register_newform(){ +function init_saimod_sys_todo_new(){ $('#btn_add').click(function(){ $.ajax({ type : 'GET', url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=add&todo='+encodeURIComponent($('#input_message').val()), success : function(data) { if(data.status){ - load_todo_tab('todolist'); + system.load('todo'); } } }); @@ -48,42 +79,6 @@ function register_newform(){ $('#input_message').focus(); } -function load_todo_tab(action){ - $('#img_loader').show(); - switch(action){ - case 'todolist': - $('#tab_todo').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action='+action, function(){ - register_todolist(); - register_listclick(true); - $('#img_loader').hide();}); - return; - case 'dotolist': - $('#tab_todo').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action='+action, function(){ - register_doto(); - register_listclick(); - $('#img_loader').hide();}); - return; - case 'stats': - $('#tab_todo').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action='+action, function(){ - register_stats(); - $('#img_loader').hide();}); - return; - default: - $('#img_loader').hide(); - } -} - -function register_listclick(todo){ - $('.sai_todo_element').click(function(){ - $('#img_loader').show(); - $('#tab_todo').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=todo&todo='+$(this).attr('todo'), function(){ - register_edit(); - $('#btn_back').click(function(){ - if(todo){load_todo_tab('todolist');}else{load_todo_tab('dotolist');}}); - if(todo){register_close();}else{register_open();} - $('#img_loader').hide();})}); -} - function register_open(){ $('#btn_open').show(); $('#btn_open').click(function(){ @@ -113,39 +108,3 @@ function register_close(){ }); }); } - -function register_todolist(){ - $('#btn_refresh').unbind('click'); - $('#btn_refresh').click(function(){ - load_todo_tab('todolist');}); - $('#btn_close_all').unbind('click'); - $('#btn_close_all').click(function(){ - if (confirm('Are you sure you want to delete all open entries in the todolist?')) { - $.ajax({ type :'GET', - url : './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_todo&action=close_all', - success : function(data) { - if(data.status){ - load_todo_tab('todolist'); - }else{ - alert('Problem: '+data);} - } - }); - } - }) -} -function register_doto(){ - $('#btn_refresh').unbind('click'); - $('#btn_refresh').click(function(){ - load_todo_tab('dotolist');}); - $('#btn_close_all').unbind('click'); - $('#btn_close_all').click(function(){ - alert('operation not possible on this list');}); -} -function register_stats(){ - $('#btn_refresh').unbind('click'); - $('#btn_refresh').click(function(){ - load_todo_tab('stats');}); - $('#btn_close_all').unbind('click'); - $('#btn_close_all').click(function(){ - alert('operation not possible on this list');}); -} \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/saimod_sys_todo.php b/sai/modules/saimod_sys_todo/saimod_sys_todo.php index 14bfab7..b47ff6e 100644 --- a/sai/modules/saimod_sys_todo/saimod_sys_todo.php +++ b/sai/modules/saimod_sys_todo/saimod_sys_todo.php @@ -47,6 +47,9 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule { //$row['report_type'] = self::reporttype($row['type']); $row['state_string'] = self::state($row['count']); $row['state_btn'] = self::statebtn($row['count']); + $row['message'] = htmlspecialchars($row['message']); + $row['request_uri'] = htmlspecialchars($row['request_uri']); + $row['openclose'] = 'close'; if($row['type'] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){ $row['message'] = str_replace("\r", '
    ', $row['message']); $result_user .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_user_list_element.tpl'), $row); @@ -65,6 +68,9 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule { $row['time_elapsed'] = self::time_elapsed_string(strtotime($row['time'])); $row['state_string'] = self::state($row['count']); $row['state_btn'] = self::statebtn($row['count']); + $row['message'] = htmlspecialchars($row['message']); + $row['request_uri'] = htmlspecialchars($row['request_uri']); + $row['openclose'] = 'open'; if($row['type'] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){ $row['message'] = str_replace("\r", '
    ', $row['message']); $result_user .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_user_list_element.tpl'), $row); diff --git a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl index f2d4bae..0266dfa 100644 --- a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl +++ b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl @@ -2,13 +2,13 @@
    diff --git a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_new.tpl b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_new.tpl index f122f54..c463488 100644 --- a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_new.tpl +++ b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_new.tpl @@ -1,5 +1,5 @@
    Message
    - + \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl index f688d84..833cb6d 100644 --- a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl +++ b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl @@ -21,6 +21,6 @@ thrown${thrown} message${message} - + \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl index 21a2e41..05d2a04 100644 --- a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl +++ b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl @@ -10,7 +10,7 @@ user${username} message - + \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/tpl/todo_list_element.tpl b/sai/modules/saimod_sys_todo/tpl/todo_list_element.tpl index ee9c842..1a52768 100644 --- a/sai/modules/saimod_sys_todo/tpl/todo_list_element.tpl +++ b/sai/modules/saimod_sys_todo/tpl/todo_list_element.tpl @@ -1,4 +1,4 @@ - + ${time_elapsed} ${class} ${message} diff --git a/sai/modules/saimod_sys_todo/tpl/todo_user_list_element.tpl b/sai/modules/saimod_sys_todo/tpl/todo_user_list_element.tpl index e37d0b7..a52d051 100644 --- a/sai/modules/saimod_sys_todo/tpl/todo_user_list_element.tpl +++ b/sai/modules/saimod_sys_todo/tpl/todo_user_list_element.tpl @@ -1,4 +1,4 @@ - + ${time_elapsed} ${message} ${username} diff --git a/sai/modules/saistart_sys_sai/saistart_sys_sai.php b/sai/modules/saistart_sys_sai/saistart_sys_sai.php index ec0f552..7b7ad79 100644 --- a/sai/modules/saistart_sys_sai/saistart_sys_sai.php +++ b/sai/modules/saistart_sys_sai/saistart_sys_sai.php @@ -24,15 +24,16 @@ class saistart_sys_sai extends \SYSTEM\SAI\SaiModule { protected static function html_content(){ if(!\SYSTEM\SECURITY\Security::isLoggedIn()){ $vars = array(); - $vars['login'] = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/login.tpl'), array()); return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/content.tpl'),$vars); } $vars = array(); $vars['project_name'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT); $vars['project_url'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL); - $vars['todo_entries'] = \SYSTEM\SAI\saimod_sys_todo::sai_mod__SYSTEM_SAI_saimod_sys_todo_action_todolist(); - $vars['log_entries'] = \SYSTEM\SAI\saimod_sys_log::sai_mod__SYSTEM_SAI_saimod_sys_log_action_filter(); - $vars['logout'] = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/logout.tpl')); + $vars['analytics'] = \SYSTEM\SAI\saimod_sys_log::analytics(); + $user = \SYSTEM\SECURITY\Security::getUser(); + $vars['username'] = $user->username; + $vars['locale'] = $user->locale; + $vars['isadmin'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) ? "yes" : "no"; $vars = array_merge($vars,\SYSTEM\SAI\saimod_sys_todo::statistics()); return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/content_loggedin.tpl'), $vars); } diff --git a/sai/modules/saistart_sys_sai/tpl/content.tpl b/sai/modules/saistart_sys_sai/tpl/content.tpl index 2f0d400..6e6747b 100644 --- a/sai/modules/saistart_sys_sai/tpl/content.tpl +++ b/sai/modules/saistart_sys_sai/tpl/content.tpl @@ -16,5 +16,37 @@
    - ${login} +

    ${basic_login}

    + ${basic_text_login} +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + + +
    +
    \ No newline at end of file diff --git a/sai/modules/saistart_sys_sai/tpl/content_loggedin.tpl b/sai/modules/saistart_sys_sai/tpl/content_loggedin.tpl index 2837e71..8d0221e 100644 --- a/sai/modules/saistart_sys_sai/tpl/content_loggedin.tpl +++ b/sai/modules/saistart_sys_sai/tpl/content_loggedin.tpl @@ -10,15 +10,8 @@ Progress: ${project}%
    -

    Analytics

    - IPs today: ${ip_today}
    - Users today: ${user_today}
    -
    - IPs this week: ${ip_week}
    - Users this week: ${user_week}
    -
    - IPs this month: ${ip_month}
    - Users this month: ${user_month} +

    Analytics

    + ${analytics}

    Git

    @@ -26,17 +19,39 @@ Current SYSTEM Version: ${git_system}
    - ${logout} +

    ${basic_logout}

    + + + + + + + + + + + + + +
    ${basic_username}${username}
    ${basic_locale}${locale}
    ${basic_admin_rights}${isadmin}
    + ${basic_text_logout} +
    +
    +
    + + +
    +

    Todo

    Status: ${project_count}/${project_all}
    Progress: ${project}% - ${todo_entries} +

    Log

    100 Latest Log Entries

    - ${log_entries} +
    \ No newline at end of file diff --git a/sai/modules/saistart_sys_sai/tpl/login.tpl b/sai/modules/saistart_sys_sai/tpl/login.tpl deleted file mode 100644 index 7682d4c..0000000 --- a/sai/modules/saistart_sys_sai/tpl/login.tpl +++ /dev/null @@ -1,33 +0,0 @@ -

    ${basic_login}

    -${basic_text_login} -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - - -
    -
    \ No newline at end of file diff --git a/sai/modules/saistart_sys_sai/tpl/logout.tpl b/sai/modules/saistart_sys_sai/tpl/logout.tpl deleted file mode 100644 index 5c71dbe..0000000 --- a/sai/modules/saistart_sys_sai/tpl/logout.tpl +++ /dev/null @@ -1,11 +0,0 @@ -

    ${basic_logout}

    -${basic_text_logout} -
    -
    -
    -
    -
    - - -
    -
    \ No newline at end of file diff --git a/sai/page/css/sai.css b/sai/page/css/sai.css index 9344ed1..3ccab6d 100644 --- a/sai/page/css/sai.css +++ b/sai/page/css/sai.css @@ -1,24 +1,48 @@ -/* - Document : index.css - Created on : 31.01.2013, 01:59:37 - Author : CHRIS MEURISCH - Description: - Purpose of the stylesheet follows. -*/ - -.brand-logo{ +#sai_logo { + padding-left: 10px; float: left; padding-top: 8px; padding-right: 10px; } +#sai_brand{ + width: 170px; +} -.footer{ + +#sai_navbar{ + height:40px; +} + +#project_navbar{ + width:224px; + position: fixed; + left: 0px; + bottom: 0px; + top: 38px; +} + +#content-wrapper{ + overflow: auto; + position: absolute; + top: 40px; + bottom: 0px; + left: 224px; + right: 0px; + padding: 15px; + min-width:1000px; +} + +#content{ + width:100% +} + +#footer{ text-align: right; padding-right: 20px; color: #777; } -.footer a{ +#footer a{ color: #777; } diff --git a/sai/page/default_page.php b/sai/page/default_page.php index e526fd6..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 = ''. ''. - ''. + ''. ''. ''. ''. @@ -48,14 +48,6 @@ class default_page extends \SYSTEM\PAGE\Page { ''; return $result; } - - private static function lang_switcher(){ - $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(),'page/tpl/language.tpl'),array('lang' => $lang));} - return $result; - } public function html($_escaped_fragment_ = NULL){ $vars = array(); @@ -68,7 +60,6 @@ class default_page extends \SYSTEM\PAGE\Page { $vars['menu_proj'] = self::menu_proj(); $vars['title'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE); $vars['copyright'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_COPYRIGHT); - $vars['lang_switcher'] = self::lang_switcher(); $vars = array_merge($vars,\SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI)); return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'page/tpl/sai.tpl'), $vars); diff --git a/sai/page/js/sai.js b/sai/page/js/sai.js index c387aff..393cd25 100644 --- a/sai/page/js/sai.js +++ b/sai/page/js/sai.js @@ -14,7 +14,7 @@ $(document).ready(function() { }); function sys_hashchange(state){ - $('#sai_navbar li, #project_navbar li').each(function(){ + $('.nav li,#sai_navbar li, #project_navbar li').each(function(){ $(this).removeClass('active');}); $('#menu_'+state).parent().addClass('active'); } \ No newline at end of file diff --git a/sai/page/tpl/language.tpl b/sai/page/tpl/language.tpl deleted file mode 100644 index 94b7686..0000000 --- a/sai/page/tpl/language.tpl +++ /dev/null @@ -1 +0,0 @@ -${lang}  \ No newline at end of file diff --git a/sai/page/tpl/sai.tpl b/sai/page/tpl/sai.tpl index c35b87a..f18fabc 100644 --- a/sai/page/tpl/sai.tpl +++ b/sai/page/tpl/sai.tpl @@ -3,33 +3,33 @@ ${title} - + + ${css} ${js} -