From 50ad9e4ba0c2cd72236899e195633824b3ec8174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20St=C3=B6ckel?= Date: Fri, 9 Sep 2011 14:03:18 +0000 Subject: [PATCH] Included dhtmlx js files in egw_menu_dhtmlx.js, fixed problem with removing action objects, improved egw_include_mgr a bit --- phpgwapi/inc/class.egw_include_mgr.inc.php | 28 ++++++++++++++-------- phpgwapi/js/egw_action/egw_action.js | 5 +++- phpgwapi/js/egw_action/egw_menu_dhtmlx.js | 3 +++ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/phpgwapi/inc/class.egw_include_mgr.inc.php b/phpgwapi/inc/class.egw_include_mgr.inc.php index 477e7b5f5b..472aa47647 100644 --- a/phpgwapi/inc/class.egw_include_mgr.inc.php +++ b/phpgwapi/inc/class.egw_include_mgr.inc.php @@ -189,19 +189,26 @@ class egw_include_mgr // base file if (count($entry) == 1) { - // Assemble a filename - $filename = dirname($path).'/'.$entry[0].'.js'; - - if (is_readable(EGW_SERVER_ROOT.($filename))) + if ($entry[0][0] == "/") { - if (!$this->file_processed($filename)) - { - $uses_path = $filename; - } + $uses_path = $this->translate_params($entry[0], null, ''); } else { - $uses_path = $this->translate_params($entry[0], null, 'phpgwapi'); + // Assemble a filename + $filename = dirname($path).'/'.$entry[0].'.js'; + + if (is_readable(EGW_SERVER_ROOT.($filename))) + { + if (!$this->file_processed($filename)) + { + $uses_path = $filename; + } + } + else + { + $uses_path = $this->translate_params($entry[0], null, 'phpgwapi'); + } } } else if (count($entry) == 2) @@ -267,7 +274,8 @@ class egw_include_mgr */ private function translate_params($package, $file, $app) { - if ($package[0] == '/' && is_readable(EGW_SERVER_ROOT.(parse_url($path = $package, PHP_URL_PATH))) || + if ($package[0] == '/' && (is_readable(EGW_SERVER_ROOT.(parse_url($path = $package, PHP_URL_PATH))) || + is_readable(EGW_SERVER_ROOT.($path = $package))) || is_readable(EGW_SERVER_ROOT.($path="/$app/js/$package/$file.js")) || $app != 'phpgwapi' && is_readable(EGW_SERVER_ROOT.($path="/phpgwapi/js/$package/$file.js"))) { diff --git a/phpgwapi/js/egw_action/egw_action.js b/phpgwapi/js/egw_action/egw_action.js index 0d68c5519a..e31340d739 100644 --- a/phpgwapi/js/egw_action/egw_action.js +++ b/phpgwapi/js/egw_action/egw_action.js @@ -879,7 +879,10 @@ egwActionObject.prototype.remove = function() { { var idx = this.parent.children.indexOf(this); - this.parent.children.splice(idx, 1); + if (idx >= 0) + { + this.parent.children.splice(idx, 1); + } } } diff --git a/phpgwapi/js/egw_action/egw_menu_dhtmlx.js b/phpgwapi/js/egw_action/egw_menu_dhtmlx.js index 21fd7c69bf..535e604c5f 100644 --- a/phpgwapi/js/egw_action/egw_menu_dhtmlx.js +++ b/phpgwapi/js/egw_action/egw_menu_dhtmlx.js @@ -11,6 +11,9 @@ /*egw:uses egw_menu; + /phpgwapi/js/dhtmlxtree/dhtmlxMenu/codebase/dhtmlxmenu.js; + /phpgwapi/js/dhtmlxtree/dhtmlxMenu/codebase/ext/dhtmlxmenu_ext.js; + /phpgwapi/js/dhtmlxtree/dhtmlxMenu/codebase/dhtmlxcommon.js; */ function egwMenuImpl(_structure)