diff --git a/htdocs/core/tpl/filemanager.tpl.php b/htdocs/core/tpl/filemanager.tpl.php index baf2a66c399..8ca6b6f215a 100644 --- a/htdocs/core/tpl/filemanager.tpl.php +++ b/htdocs/core/tpl/filemanager.tpl.php @@ -38,15 +38,18 @@ if (empty($module)) $module='ecm'; $permtoadd = 0; $permtoupload = 0; +$showroot = 0; if ($module == 'ecm') { $permtoadd = $user->rights->ecm->setup; $permtoupload = $user->rights->ecm->upload; + $showroot = 0; } if ($module == 'medias') { $permtoadd = ($user->rights->mailing->creer || $user->rights->website->write); $permtoupload = ($user->rights->mailing->creer || $user->rights->website->write); + $showroot = 1; } @@ -69,29 +72,25 @@ if (($action == 'delete' || $action == 'file_manager_delete') && empty($conf->us print '
'; // Toolbar -//if (preg_match('/\/ecm/', $_SERVER['PHP_SELF'])) { -//if ($module == 'ecm') { - - if ($permtoadd) - { - print ''; - print ''; - print ''; - } - else - { - print ''; - print ''; - print ''; - } - if ($module == 'ecm') - { - $tmpurl=((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module?'&module='.$module:'').($section?'&section='.$section:''))); - print ''; - print ''; - print ''; - } -//} +if ($permtoadd) +{ + print ''; + print ''; + print ''; +} +else +{ + print ''; + print ''; + print ''; +} +if ($module == 'ecm') +{ + $tmpurl=((! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS))?'#':($_SERVER["PHP_SELF"].'?action=refreshmanual'.($module?'&module='.$module:'').($section?'&section='.$section:''))); + print ''; + print ''; + print ''; +} // Start "Add new file" area $nameforformuserfile = 'formuserfileecm'; @@ -148,7 +147,7 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg print ''."\n"; print ''."\n"; - print ''; + print ''; print ' '.$langs->trans("ECMSections"); print ''; @@ -159,9 +158,17 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg if (! empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) { - print ''; + // Show the link to "Root" + if ($showroot) + { + print '
'.$langs->trans("Root").'
'; + } - // Show filemanager tree (will be filled by call of ajax enablefiletreeajax.tpl.php that execute ajaxdirtree.php) + + + print ''; + + // Show filemanager tree (will be filled by call of ajax /ecm/tpl/enablefiletreeajax.tpl.php that execute ajaxdirtree.php) print '
'; if ($action == 'deletefile') print $form->formconfirm('eeeee', $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 'deletefile'); @@ -170,7 +177,7 @@ if (empty($action) || $action == 'editfile' || $action == 'file_manager' || preg } else { - print ''; + print ''; $_POST['modulepart'] = $module; $_POST['openeddir'] = GETPOST('openeddir'); diff --git a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php index 0a51e8cc73d..b7c20e33d2d 100644 --- a/htdocs/ecm/tpl/enablefiletreeajax.tpl.php +++ b/htdocs/ecm/tpl/enablefiletreeajax.tpl.php @@ -27,7 +27,7 @@ if (empty($conf) || ! is_object($conf)) ?> - + "; - print $out; /*file_put_contents($filetpl, $out);