From 1d7c0a4070d2f8c06526347014d6e20aa256945c Mon Sep 17 00:00:00 2001 From: rylon Date: Mon, 13 Apr 2015 01:56:46 +0200 Subject: [PATCH] removed start state enforce - start state is now also loaded on blank url, saimod docu menu fix --- dbd/sql/mysql/data/system_page.sql | 2 +- files/sys/system.js | 7 ++++--- sai/modules/saimod_sys_docu/js/saimod_sys_docu.js | 5 +++++ sai/modules/saistart_sys_sai/saistart_sys_sai.php | 2 +- sai/page/js/sai.js | 5 ++++- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dbd/sql/mysql/data/system_page.sql b/dbd/sql/mysql/data/system_page.sql index f3e6374..54341f6 100644 --- a/dbd/sql/mysql/data/system_page.sql +++ b/dbd/sql/mysql/data/system_page.sql @@ -15,7 +15,7 @@ INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (50, 42, 'docu', 'docu', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu', 'init_saimod_sys_docu', '\\SYSTEM\\SAI\\saimod_sys_docu'); INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (51, 42, 'cat', 'docu', 50, 0, 0, '#tab_docu', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu&action=cat&cat=${cat}', 'init_saimod_sys_docu_cat', '\\SYSTEM\\SAI\\saimod_sys_docu'); -INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (55, 42, 'doc', 'docu', 51, 0, 0, '#tab2_docu', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu&action=doc&cat=${cat}&doc=${doc}', '', ''); +INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (55, 42, 'doc', 'docu', 51, 0, 0, '#tab2_docu', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu&action=doc&cat=${cat}&doc=${doc}', 'init_saimod_sys_docu_doc', '\\SYSTEM\\SAI\\saimod_sys_docu'); INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (60, 42, 'files', 'files', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files', 'init_saimod_sys_files', '\\SYSTEM\\SAI\\saimod_sys_files'); INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (61, 42, 'list', 'files', 60, 0, 0, '#tab_files', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files&action=tab&name=${folder}', 'init_saimod_sys_files_list', '\\SYSTEM\\SAI\\saimod_sys_files'); diff --git a/files/sys/system.js b/files/sys/system.js index 9340ceb..481f47c 100644 --- a/files/sys/system.js +++ b/files/sys/system.js @@ -119,10 +119,11 @@ SYSTEM.prototype.handle_call_pages = function (data,id,forced,cached) { //cache state info data this.state_info[id] = data; //update history? - if(id !== this.cur_state()){ + if( !(id === this.start_state && this.cur_state() === '') && //avoid start state in url unless called explicit + id !== this.cur_state()){//new state? window.history.pushState(null, "", '#!'+id);} - data['result'].forEach( - function(entry) { system.handle_call_pages_entry(entry,id,forced,cached);}); + data['result'].forEach( + function(entry) { system.handle_call_pages_entry(entry,id,forced,cached);}); } else { this.log_info('Problem with your Pages: '+data['result']['message']); } diff --git a/sai/modules/saimod_sys_docu/js/saimod_sys_docu.js b/sai/modules/saimod_sys_docu/js/saimod_sys_docu.js index e9c5ac8..e63bcc8 100644 --- a/sai/modules/saimod_sys_docu/js/saimod_sys_docu.js +++ b/sai/modules/saimod_sys_docu/js/saimod_sys_docu.js @@ -16,6 +16,11 @@ function init_saimod_sys_docu_cat() { docu2_menu(); }; +function init_saimod_sys_docu_doc() { + docu_menu(); + docu2_menu(); +} + function docu_menu(){ $('#tabs_docu li').each(function(){ $(this).removeClass('active');}); diff --git a/sai/modules/saistart_sys_sai/saistart_sys_sai.php b/sai/modules/saistart_sys_sai/saistart_sys_sai.php index 7b7ad79..7133192 100644 --- a/sai/modules/saistart_sys_sai/saistart_sys_sai.php +++ b/sai/modules/saistart_sys_sai/saistart_sys_sai.php @@ -8,7 +8,7 @@ class saistart_sys_sai extends \SYSTEM\SAI\SaiModule { \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI), \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI_ERROR)); return \SYSTEM\PAGE\replace::replaceFile( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/saistart.tpl'),$vars);} - public static function html_li_menu(){return '
  • '.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE).'
  • ';} + public static function html_li_menu(){return '
  • '.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE).'
  • ';} public static function right_public(){return true;} public static function right_right(){return true;} diff --git a/sai/page/js/sai.js b/sai/page/js/sai.js index 393cd25..4a48678 100644 --- a/sai/page/js/sai.js +++ b/sai/page/js/sai.js @@ -16,5 +16,8 @@ $(document).ready(function() { function sys_hashchange(state){ $('.nav li,#sai_navbar li, #project_navbar li').each(function(){ $(this).removeClass('active');}); - $('#menu_'+state).parent().addClass('active'); + if($('#menu_'+state).parent().length){ + $('#menu_'+state).parent().addClass('active'); + } else { + $('#menu_start').parent().addClass('active');} } \ No newline at end of file