diff --git a/files/sys/system.js b/files/sys/system.js index 36d73f7..b2a1672 100644 --- a/files/sys/system.js +++ b/files/sys/system.js @@ -25,7 +25,7 @@ SYSTEM.prototype.hashchange = function () { system.go_state(system.start_state); //user callback if(system.hash_change){ - system.hash_change(system.cur_state().split('(')[0]);} + system.hash_change(system.cur_state().split(';')[0].split('(')[0]);} }; SYSTEM.prototype.handle_call_pages_page = function (html,entry,id,forced,cached) { var url = entry['url']+(window.location.search.substr(1) ? '&'+window.location.search.substr(1) : '' ); @@ -76,6 +76,13 @@ SYSTEM.prototype.handle_call_pages_page = function (html,entry,id,forced,cached) } } } + //try 2 call function even when no js is loaded(substates do that) + var fn = window[entry['func']]; + if(call_func && typeof fn === 'function'){ + call_func = false; + fn(); + system.log_info('call func: '+entry['func']); + } //update state this.state[entry['div']] = url; } diff --git a/page/State.php b/page/State.php index 36c14d5..60e2bce 100644 --- a/page/State.php +++ b/page/State.php @@ -22,15 +22,27 @@ class State { $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;$i \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_))); } private static function time_elapsed_string($ptime){ @@ -335,11 +331,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..9fc571c 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_table_row.tpl b/sai/modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl index 97b6b72..884092a 100644 --- a/sai/modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl +++ b/sai/modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl @@ -1,4 +1,4 @@ - + ${time} ${class} ${message} 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