From c2ec4a4fd2a036c892b57e68681226c26856f74b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Nov 2015 22:38:29 +0100 Subject: [PATCH] Move online help link at a better place (top right). Link is also always visible. --- htdocs/admin/events.php | 3 +- htdocs/admin/perms.php | 3 +- htdocs/admin/proxy.php | 3 +- htdocs/admin/security.php | 3 +- htdocs/admin/security_file.php | 3 +- htdocs/admin/security_other.php | 3 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/main.inc.php | 80 +++++++++++++----------- htdocs/theme/eldy/img/helpdoc.png | Bin 693 -> 307 bytes htdocs/theme/eldy/style.css.php | 2 + htdocs/theme/md/img/helpdoc.png | Bin 693 -> 307 bytes htdocs/theme/md/img/logout.png | Bin 608 -> 168 bytes htdocs/theme/md/img/printer.png | Bin 270 -> 329 bytes htdocs/theme/md/style.css.php | 2 + 14 files changed, 61 insertions(+), 43 deletions(-) diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index a2b5a24c82a..6092a95d0b9 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -70,7 +70,8 @@ if ($action == "save") * View */ -llxHeader('',$langs->trans("Audit")); +$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; +llxHeader('',$langs->trans("Audit"),$wikihelp); //$linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index cf9dce45c08..aaf2f91688a 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -62,7 +62,8 @@ if ($action == 'remove') * View */ -llxHeader('',$langs->trans("DefaultRights")); +$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; +llxHeader('',$langs->trans("DefaultRights"), $wikihelp); print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index 080dafca744..4591c4636a8 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -79,7 +79,8 @@ if (GETPOST("action") == 'set_proxy') $form = new Form($db); -llxHeader('',$langs->trans("Proxy")); +$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; +llxHeader('',$langs->trans("Proxy"), $wikihelp); print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index ea81e63305e..97cae20377c 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -187,7 +187,8 @@ if ($action == 'maj_pattern') */ $form = new Form($db); -llxHeader('',$langs->trans("Passwords")); +$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; +llxHeader('',$langs->trans("Passwords"),$wikihelp); print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index d1237a8c734..1213a9b2238 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -109,7 +109,8 @@ else if ($action == 'delete') $form = new Form($db); -llxHeader('',$langs->trans("Files")); +$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; +llxHeader('',$langs->trans("Files"),$wikihelp); print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index cd84962107d..ac0a1e883eb 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -87,7 +87,8 @@ else if ($action == 'updateform') $form = new Form($db); -llxHeader('',$langs->trans("Miscellaneous")); +$wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; +llxHeader('',$langs->trans("Miscellaneous"),$wikihelp); print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 6d31fbc52f6..2ac7135c5db 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -444,7 +444,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu print ''; print ''; print ''; print ''; print ''."\n"; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b629b265012..05c96f38e07 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -927,7 +927,7 @@ if (! function_exists("llxHeader")) // top menu and left menu area if (empty($conf->dol_hide_topmenu)) { - top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss, $morequerystring); + top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss, $morequerystring, $help_url); } if (empty($conf->dol_hide_leftmenu)) { @@ -1327,9 +1327,12 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs * @param array $arrayofjs Array of js files to add in header * @param array $arrayofcss Array of css files to add in header * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) + * @param string $helppagename Name of wiki page for help ('' by default). + * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage + * For other external page: http://server/url * @return void */ -function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='') +function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $helppagename='') { global $user, $conf, $langs, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; @@ -1501,6 +1504,44 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $toprightmenu.=Form::textwithtooltip('',$langs->trans("PrintContentArea"),2,1,$text,'login_block_elem',2); } + // Link to Dolibarr wiki pages + if (empty($conf->global->MAIN_HELP_DISABLELINK)) + { + $langs->load("help"); + + $helpbaseurl=''; + $helppage=''; + $mode=''; + + if (empty($helppagename)) $helppagename='EN:User_documentation|FR:Documentation_utilisateur|ES:Documentación_usuarios'; + + // Get helpbaseurl, helppage and mode from helppagename and langs + $arrayres=getHelpParamFor($helppagename,$langs); + $helpbaseurl=$arrayres['helpbaseurl']; + $helppage=$arrayres['helppage']; + $mode=$arrayres['mode']; + + // Link to help pages + if ($helpbaseurl && $helppage) + { + $text=''; + $title=''; + //$text.='
'; + $title.=$langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage': 'GoToHelpPage'); + if ($mode == 'wiki') $title.=' - '.$langs->trans("PageWiki").' "'.dol_escape_htmltag(strtr($helppage,'_',' ')).'"'; + $text.=''; + $text.=img_picto('', 'helpdoc').' '; + //$toprightmenu.=$langs->trans($mode == 'wiki' ? 'OnlineHelp': 'Help'); + //if ($mode == 'wiki') $text.=' ('.dol_trunc(strtr($helppage,'_',' '),8).')'; + $text.=''; + //$toprightmenu.='
'."\n"; + $toprightmenu.=Form::textwithtooltip('',$title,2,1,$text,'login_block_elem',2); + } + } + // Logout link $toprightmenu.=Form::textwithtooltip('',$logouthtmltext,2,1,$logouttext,'login_block_elem',2); @@ -1689,39 +1730,6 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra if ($doliurl) print ''; print ''."\n"; - // Link to Dolibarr wiki pages - if ($helppagename && empty($conf->global->MAIN_HELP_DISABLELINK)) - { - $langs->load("help"); - - $helpbaseurl=''; - $helppage=''; - $mode=''; - - // Get helpbaseurl, helppage and mode from helppagename and langs - $arrayres=getHelpParamFor($helppagename,$langs); - $helpbaseurl=$arrayres['helpbaseurl']; - $helppage=$arrayres['helppage']; - $mode=$arrayres['mode']; - - // Link to help pages - if ($helpbaseurl && $helppage) - { - print '
'; - print ''; - print img_picto('', 'helpdoc').' '; - print $langs->trans($mode == 'wiki' ? 'OnlineHelp': 'Help'); - //if ($mode == 'wiki') print ' ('.dol_trunc(strtr($helppage,'_',' '),8).')'; - print ''; - print '
'."\n"; - } - } - // Link to bugtrack if (! empty($conf->global->MAIN_BUGTRACK_ENABLELINK)) { @@ -1856,7 +1864,7 @@ function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinput } $ret=''; - $ret.='
'; + $ret.=''; $ret.='