diff --git a/files/sys/system.js b/files/sys/system.js index 2de0dce..bc195bb 100644 --- a/files/sys/system.js +++ b/files/sys/system.js @@ -19,7 +19,7 @@ function SYSTEM(endpoint, group,start_state){ system.go_state();}); } //internal function to handle pagestate results -SYSTEM.prototype.handle_call_pages = function (data,id) { +SYSTEM.prototype.handle_call_pages = function (data,id,forced) { if(data['status']){ system.log_info('load pages: endpoint '+system.endpoint+' group:'+system.group+' state:'+id+' - success'); //state not found? @@ -31,7 +31,7 @@ SYSTEM.prototype.handle_call_pages = function (data,id) { window.history.pushState(null, "", '#!'+id);} data['result'].forEach(function(entry) { //check loaded state of div - reload only if required - if(system.state[entry['div']] !== entry['url']+'&'+window.location.search.substr(1)){ + if(forced || system.state[entry['div']] !== entry['url']+'&'+window.location.search.substr(1)){ //load pages $.ajax({ async: false, @@ -40,8 +40,6 @@ SYSTEM.prototype.handle_call_pages = function (data,id) { url: entry['url']+'&'+window.location.search.substr(1), success: function(data){ if($(entry['div']).length){ - //console.log(entry['div']); - //console.log(data); $(entry['div']).html(data); system.log_info('load page: '+id+entry['div']+' '+entry['url']+'&'+window.location.search.substr(1)+' - success'); } else { @@ -122,9 +120,9 @@ SYSTEM.prototype.load_page = function(){ return result; }; //load a pagestatewith given id -SYSTEM.prototype.load = function(id){ +SYSTEM.prototype.load = function(id,forced){ system.log(system.LOG_START,'load page '+id); - this.call('call=pages&group='+this.group+'&state='+id,function(data){system.handle_call_pages(data,id);},{},"json",false);}; + this.call('call=pages&group='+this.group+'&state='+id,function(data){system.handle_call_pages(data,id,forced);},{},"json",false);}; SYSTEM.prototype.load_css = function loadCSS(csssrc) { var snode = document.createElement('link'); @@ -143,20 +141,22 @@ SYSTEM.prototype.cur_state = function() { return ''; }; -SYSTEM.prototype.go_state = function(default_state){ +SYSTEM.prototype.go_state = function(default_state,forced){ var pageName = this.cur_state(); - this.load(pageName ? pageName : default_state); + this.load(pageName ? pageName : default_state,forced); }; SYSTEM.prototype.back = function(){ window.history.back();}; SYSTEM.prototype.forwad = function(){ window.history.forward();}; +SYSTEM.prototype.reload = function(){ + //window.location.reload(); + this.go_state(this.cur_state(),true); +}; SYSTEM.prototype.language = function(lang){ this.log_info('change language to '+lang); - //preserve the old parameters - //var search = location.search ? location.search.substring(1).split("&") : []; var search = '_lang='+lang; - window.location.href = '/?' + search + location.hash; + window.location.href = window.location.pathname +'?' + search + location.hash; }; \ No newline at end of file diff --git a/sai/modules/saimod_sys_log/saimod_sys_log.php b/sai/modules/saimod_sys_log/saimod_sys_log.php index 504e3b0..3a026bc 100644 --- a/sai/modules/saimod_sys_log/saimod_sys_log.php +++ b/sai/modules/saimod_sys_log/saimod_sys_log.php @@ -316,7 +316,7 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule { $res = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTERS::QQ(); $result = ''; while($row = $res->next()){ - $result .= '