From 7b4b302be020fd26fdb5b730c01a41bb8f3fb4ef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Aug 2011 22:33:37 +0000 Subject: [PATCH] Can edit style if admin even if demo --- htdocs/main.inc.php | 7 ++--- htdocs/theme/eldy/style.css.php | 50 +++++++++++++++++---------------- htdocs/user/fiche.php | 7 +++-- htdocs/user/param_ihm.php | 7 ++--- 4 files changed, 36 insertions(+), 35 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6da4b2937d8..b2897fc840d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -168,9 +168,6 @@ if (isset($_SERVER["HTTP_USER_AGENT"])) // Other if (in_array($conf->browser->name,array('firefox','iceweasel'))) $conf->browser->firefox=1; //$conf->browser->phone='android'; - - // Force usage of left menu when smartphone is used - if ($conf->browser->phone && ! empty($conf->global->MAIN_MENU_FORCE_USE_JQUERY_LAYOUT)) $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT='forced'; } @@ -643,6 +640,8 @@ if (! defined('NOLOGIN')) $conf->theme=$user->conf->MAIN_THEME; $conf->css = "/theme/".$conf->theme."/style.css.php"; } + // If theme support flip-hide left menu and we use a smartphone, we force it + if ($conf->browser->phone && $conf->theme == 'eldy') $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT='forced'; // Set javascript option if (! GETPOST('nojs')) // If javascript was not disabled on URL { @@ -1113,7 +1112,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a //togglerLength_open: 0, // effect defaults - overridden on some panes //slideTrigger_open: "mouseover", - //initClosed: true, + initClosed: '.(empty($conf->browser->phone)?'false':'true').', fxName: "drop", fxSpeed: "fast", fxSettings: { easing: "" } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index cb22aff6921..848a86e427d 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -54,8 +54,8 @@ if (GETPOST('theme')) $conf->theme=GETPOST('theme'); // If theme was forced on $langs->load("main",0,1); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); -$fontsize=empty($conf->browser->phone)?'12':'12'; -$fontsizesmaller=empty($conf->browser->phone)?'11':'11'; +$fontsize=empty($conf->browser->phone)?'12':'14'; +$fontsizesmaller=empty($conf->browser->phone)?'11':'14'; $path=''; // This value may be used in future for external module to overwrite theme @@ -217,7 +217,7 @@ td.showDragHandle { /* ============================================================================== */ div.fiche { - margin-: browser->phone)?'10':'2'; ?>px; + margin-: browser->phone)?'10':'24'; ?>px; margin-: browser->phone)?'8':''; ?>px; } @@ -226,23 +226,25 @@ div.fichecenter { clear: both; /* This is to have div fichecenter that are true rectangles */ } div.fichethirdleft { - browser->phone)) { print "float: ".$left.";\n"; } ?> - browser->phone)) { print "width: 35%;\n"; } ?> + browser->phone)) { print "float: ".$left.";\n"; } ?> + browser->phone)) { print "width: 35%;\n"; } ?> + browser->phone)) { print "padding-bottom: 4px;\n"; } ?> } div.fichetwothirdright { - browser->phone)) { print "float: ".$left.";\n"; } ?> - browser->phone)) { print "width: 65%;\n"; } ?> + browser->phone)) { print "float: ".$left.";\n"; } ?> + browser->phone)) { print "width: 65%;\n"; } ?> + browser->phone)) { print "padding-bottom: 4px\n"; } ?> } div.fichehalfleft { - browser->phone)) { print "float: ".$left.";\n"; } ?> - browser->phone)) { print "width: 50%;\n"; } ?> + browser->phone)) { print "float: ".$left.";\n"; } ?> + browser->phone)) { print "width: 50%;\n"; } ?> } div.fichehalfright { - browser->phone)) { print "float: ".$left.";\n"; } ?> - browser->phone)) { print "width: 50%;\n"; } ?> + browser->phone)) { print "float: ".$left.";\n"; } ?> + browser->phone)) { print "width: 50%;\n"; } ?> } div.ficheaddleft { - browser->phone)) { print "padding-left: 10px;\n"; } ?> + browser->phone)) { print "padding-left: 10px;\n"; } ?> } @@ -706,7 +708,7 @@ td.photo { /* ============================================================================== */ .toolbar { - background-image: url(theme.'/img/tmenu2.png',1) ?>) !important; + background-image: url(theme.'/img/tmenu2.jpg',1) ?>) !important; background-repeat: repeat-x !important; border: 1px solid #BBB !important; } @@ -757,7 +759,7 @@ td.photo { * RESIZER-BARS */ .ui-layout-resizer { /* all 'resizer-bars' */ - width: 8px !important; + width: browser->phone)?'8':'24'); ?>px !important; } .ui-layout-resizer-hover { /* affects both open and closed states */ } @@ -766,7 +768,7 @@ td.photo { /*.ui-layout-resizer-open-hover ,*/ /* hover-color to 'resize' */ .ui-layout-resizer-dragging { /* resizer beging 'dragging' */ background: #DDD; - width: 8px; + width: browser->phone)?'8':'24'); ?>px; } .ui-layout-resizer-dragging { /* CLONED resizer being dragged */ border-left: 1px solid #BBB; @@ -782,13 +784,13 @@ td.photo { .ui-layout-resizer-sliding { /* resizer when pane is 'slid open' */ opacity: .10; /* show only a slight shadow */ filter: alpha(opacity=10); - } - .ui-layout-resizer-sliding-hover { /* sliding resizer - hover */ - opacity: 1.00; /* on-hover, show the resizer-bar normally */ - filter: alpha(opacity=100); - } -/* sliding resizer - add 'outside-border' to resizer on-hover - * this sample illustrates how to target specific panes and states */ +} +.ui-layout-resizer-sliding-hover { /* sliding resizer - hover */ + opacity: 1.00; /* on-hover, show the resizer-bar normally */ + filter: alpha(opacity=100); +} +/* sliding resizer - add 'outside-border' to resizer on-hover */ +/* this sample illustrates how to target specific panes and states */ .ui-layout-resizer-north-sliding-hover { border-bottom-width: 1px; } .ui-layout-resizer-south-sliding-hover { border-top-width: 1px; } .ui-layout-resizer-west-sliding-hover { border-right-width: 1px; } @@ -806,14 +808,14 @@ td.photo { } .ui-layout-toggler-open { height: 48px !important; - width: 5px !important; + width: browser->phone)?'7':'22'); ?>px !important; -moz-border-radius:0px 10px 10px 0px; -webkit-border-radius:0px 10px 10px 0px; border-radius:0px 10px 10px 0px; } .ui-layout-toggler-closed { height: 48px !important; - width: 5px !important; + width: browser->phone)?'7':'22'); ?>px !important; -moz-border-radius:0px 10px 10px 0px; -webkit-border-radius:0px 10px 10px 0px; border-radius:0px 10px 10px 0px; diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index c3347cce4e8..ca6dba6d87d 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -821,9 +821,10 @@ if (($action == 'create') || ($action == 'adduserldap')) print "".''.$langs->trans("PassPenix").''; print ''; } - - print "".''; - print "\n"; + print "\n"; + + print '

'; + print ""; } else diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index c7a1e8fea53..395224478e8 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2011 Laurent Destailleur * Copyright (C) 2010 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -185,9 +185,8 @@ if ($_GET["action"] == 'edit') print '
'; - // Theme - show_theme($fuser,empty($dolibarr_main_demo)?1:0,true); + show_theme($fuser,(($user->admin || empty($dolibarr_main_demo))?1:0),true); print ''; @@ -235,7 +234,7 @@ else print ''; print '
'; - if (! empty($dolibarr_main_demo)) + if (empty($user->admin) && ! empty($dolibarr_main_demo)) { print "trans("FeatureDisabledInDemo")."\" href=\"#\">".$langs->trans("Modify").""; }