From f677f2e72c1c4c7abc9de2101e65fd66452275d9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 30 Oct 2010 07:54:26 +0000 Subject: [PATCH] Test: use jquery layout for the left menu --- htdocs/admin/menus/other.php | 28 ++++++++++++++++++++++++++++ htdocs/main.inc.php | 2 -- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index f9b772558c6..1dd37b580e2 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -50,6 +50,19 @@ else if ($_GET["action"] == 'disable_hidemenu') exit; } +if ($_GET["action"] == 'activate_layoutmenu') +{ + dolibarr_set_const($db, "MAIN_MENU_USE_JQUERY_LAYOUT", '1','chaine',0,'',$conf->entity); + Header("Location: ".$_SERVER["PHP_SELF"]); + exit; +} +else if ($_GET["action"] == 'disable_layoutmenu') +{ + dolibarr_del_const($db, "MAIN_MENU_USE_JQUERY_LAYOUT",$conf->entity); + Header("Location: ".$_SERVER["PHP_SELF"]); + exit; +} + /* * View @@ -105,7 +118,22 @@ if($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED == 1) print ''.img_picto($langs->trans("Enabled"),'on').''; } print ""; +print ''; +// hide unauthorized menu +$var=!$var; +print ""; +print ''.$langs->trans("MenuUseLayout").''; +print ''; +if ($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT == 0) +{ + print ''.img_picto($langs->trans("Disabled"),'off').''; +} +if($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT == 1) +{ + print ''.img_picto($langs->trans("Enabled"),'on').''; +} +print ""; print ''; print ''; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 28d0d5b1c8a..3836f7e15d4 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1010,8 +1010,6 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a return jQuery(this).attr("tooltipText"); } }); }); - - jQuery("body").layout({ applyDefaultStyles: true }); '; /*