From 70459abae972c16f6b877e4dc36b5b495476b0b8 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 9 Jul 2012 21:23:21 +0000 Subject: [PATCH] Get filemanager edit popup working in et2 --- .../inc/class.filemanager_hooks.inc.php | 5 ++++ filemanager/inc/class.filemanager_ui.inc.php | 25 ++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/filemanager/inc/class.filemanager_hooks.inc.php b/filemanager/inc/class.filemanager_hooks.inc.php index 418ff6a94e..32da3c04e6 100644 --- a/filemanager/inc/class.filemanager_hooks.inc.php +++ b/filemanager/inc/class.filemanager_hooks.inc.php @@ -306,6 +306,11 @@ class filemanager_hooks static function search_link() { return array( + 'edit' => array( + 'menuaction' => 'filemanager.filemanager_ui.file', + ), + 'edit_id' => 'path', + 'edit_popup' => '495x425', 'mime' => array( egw_vfs::DIR_MIME_TYPE => array( 'menuaction' => 'filemanager.filemanager_ui.index', diff --git a/filemanager/inc/class.filemanager_ui.inc.php b/filemanager/inc/class.filemanager_ui.inc.php index 6de84dd4ff..ab645b5441 100644 --- a/filemanager/inc/class.filemanager_ui.inc.php +++ b/filemanager/inc/class.filemanager_ui.inc.php @@ -1249,12 +1249,29 @@ function force_download(_action, _senders) } if (($extra_tabs = egw_vfs::getExtraInfo($path,$content))) { - $tabs =& $tpl->get_widget_by_name('tabs=general|perms|eacl|preview|custom'); + if(method_exists($tpl,'get_widget_by_name')) + { + $tabs =& $tpl->get_widget_by_name('tabs=general|perms|eacl|preview|custom'); + } else { + // et2 + $tabs =& $tpl->getElementAttribute('tabs','tabs'); + } + foreach(isset($extra_tabs[0]) ? $extra_tabs : array($extra_tabs) as $extra_tab) { - $tabs['name'] .= '|'.$extra_tab['name']; - $tabs['label'] .= '|'.$extra_tab['label']; - $tabs['help'] .= '|'.$extra_tab['help']; + if(method_exists($tpl,'get_widget_by_name')) + { + $tabs['name'] .= '|'.$extra_tab['name']; + $tabs['label'] .= '|'.$extra_tab['label']; + $tabs['help'] .= '|'.$extra_tab['help']; + } + else + { + $tabs[] = array( + 'label' => $extra_tab['label'], + 'template' => $extra_tab['name'] + ); + } if ($extra_tab['data'] && is_array($extra_tab['data'])) { $content = array_merge($content, $extra_tab['data']);