Can edit style if admin even if demo

This commit is contained in:
Laurent Destailleur 2011-08-31 22:33:37 +00:00
parent 489c57c78c
commit 7b4b302be0
4 changed files with 36 additions and 35 deletions

View File

@ -168,9 +168,6 @@ if (isset($_SERVER["HTTP_USER_AGENT"]))
// Other // Other
if (in_array($conf->browser->name,array('firefox','iceweasel'))) $conf->browser->firefox=1; if (in_array($conf->browser->name,array('firefox','iceweasel'))) $conf->browser->firefox=1;
//$conf->browser->phone='android'; //$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->theme=$user->conf->MAIN_THEME;
$conf->css = "/theme/".$conf->theme."/style.css.php"; $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 // Set javascript option
if (! GETPOST('nojs')) // If javascript was not disabled on URL 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, //togglerLength_open: 0,
// effect defaults - overridden on some panes // effect defaults - overridden on some panes
//slideTrigger_open: "mouseover", //slideTrigger_open: "mouseover",
//initClosed: true, initClosed: '.(empty($conf->browser->phone)?'false':'true').',
fxName: "drop", fxName: "drop",
fxSpeed: "fast", fxSpeed: "fast",
fxSettings: { easing: "" } fxSettings: { easing: "" }

View File

@ -54,8 +54,8 @@ if (GETPOST('theme')) $conf->theme=GETPOST('theme'); // If theme was forced on
$langs->load("main",0,1); $langs->load("main",0,1);
$right=($langs->trans("DIRECTION")=='rtl'?'left':'right'); $right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
$left=($langs->trans("DIRECTION")=='rtl'?'right':'left'); $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
$fontsize=empty($conf->browser->phone)?'12':'12'; $fontsize=empty($conf->browser->phone)?'12':'14';
$fontsizesmaller=empty($conf->browser->phone)?'11':'11'; $fontsizesmaller=empty($conf->browser->phone)?'11':'14';
$path=''; // This value may be used in future for external module to overwrite theme $path=''; // This value may be used in future for external module to overwrite theme
@ -217,7 +217,7 @@ td.showDragHandle {
/* ============================================================================== */ /* ============================================================================== */
div.fiche { div.fiche {
margin-<?php print $left; ?>: <?php print empty($conf->browser->phone)?'10':'2'; ?>px; margin-<?php print $left; ?>: <?php print empty($conf->browser->phone)?'10':'24'; ?>px;
margin-<?php print $right; ?>: <?php print empty($conf->browser->phone)?'8':''; ?>px; margin-<?php print $right; ?>: <?php print empty($conf->browser->phone)?'8':''; ?>px;
} }
@ -226,23 +226,25 @@ div.fichecenter {
clear: both; /* This is to have div fichecenter that are true rectangles */ clear: both; /* This is to have div fichecenter that are true rectangles */
} }
div.fichethirdleft { div.fichethirdleft {
<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?> <?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
<?php if (empty($conf->browser->phone)) { print "width: 35%;\n"; } ?> <?php if (empty($conf->browser->phone)) { print "width: 35%;\n"; } ?>
<?php if (! empty($conf->browser->phone)) { print "padding-bottom: 4px;\n"; } ?>
} }
div.fichetwothirdright { div.fichetwothirdright {
<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?> <?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
<?php if (empty($conf->browser->phone)) { print "width: 65%;\n"; } ?> <?php if (empty($conf->browser->phone)) { print "width: 65%;\n"; } ?>
<?php if (! empty($conf->browser->phone)) { print "padding-bottom: 4px\n"; } ?>
} }
div.fichehalfleft { div.fichehalfleft {
<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?> <?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
<?php if (empty($conf->browser->phone)) { print "width: 50%;\n"; } ?> <?php if (empty($conf->browser->phone)) { print "width: 50%;\n"; } ?>
} }
div.fichehalfright { div.fichehalfright {
<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?> <?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
<?php if (empty($conf->browser->phone)) { print "width: 50%;\n"; } ?> <?php if (empty($conf->browser->phone)) { print "width: 50%;\n"; } ?>
} }
div.ficheaddleft { div.ficheaddleft {
<?php if (empty($conf->browser->phone)) { print "padding-left: 10px;\n"; } ?> <?php if (empty($conf->browser->phone)) { print "padding-left: 10px;\n"; } ?>
} }
@ -706,7 +708,7 @@ td.photo {
/* ============================================================================== */ /* ============================================================================== */
.toolbar { .toolbar {
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$conf->theme.'/img/tmenu2.png',1) ?>) !important; background-image: url(<?php echo dol_buildpath($path.'/theme/'.$conf->theme.'/img/tmenu2.jpg',1) ?>) !important;
background-repeat: repeat-x !important; background-repeat: repeat-x !important;
border: 1px solid #BBB !important; border: 1px solid #BBB !important;
} }
@ -757,7 +759,7 @@ td.photo {
* RESIZER-BARS * RESIZER-BARS
*/ */
.ui-layout-resizer { /* all 'resizer-bars' */ .ui-layout-resizer { /* all 'resizer-bars' */
width: 8px !important; width: <?php echo (empty($conf->browser->phone)?'8':'24'); ?>px !important;
} }
.ui-layout-resizer-hover { /* affects both open and closed states */ .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-open-hover ,*/ /* hover-color to 'resize' */
.ui-layout-resizer-dragging { /* resizer beging 'dragging' */ .ui-layout-resizer-dragging { /* resizer beging 'dragging' */
background: #DDD; background: #DDD;
width: 8px; width: <?php echo (empty($conf->browser->phone)?'8':'24'); ?>px;
} }
.ui-layout-resizer-dragging { /* CLONED resizer being dragged */ .ui-layout-resizer-dragging { /* CLONED resizer being dragged */
border-left: 1px solid #BBB; border-left: 1px solid #BBB;
@ -782,13 +784,13 @@ td.photo {
.ui-layout-resizer-sliding { /* resizer when pane is 'slid open' */ .ui-layout-resizer-sliding { /* resizer when pane is 'slid open' */
opacity: .10; /* show only a slight shadow */ opacity: .10; /* show only a slight shadow */
filter: alpha(opacity=10); filter: alpha(opacity=10);
} }
.ui-layout-resizer-sliding-hover { /* sliding resizer - hover */ .ui-layout-resizer-sliding-hover { /* sliding resizer - hover */
opacity: 1.00; /* on-hover, show the resizer-bar normally */ opacity: 1.00; /* on-hover, show the resizer-bar normally */
filter: alpha(opacity=100); filter: alpha(opacity=100);
} }
/* sliding resizer - add 'outside-border' to resizer on-hover /* sliding resizer - add 'outside-border' to resizer on-hover */
* this sample illustrates how to target specific panes and states */ /* this sample illustrates how to target specific panes and states */
.ui-layout-resizer-north-sliding-hover { border-bottom-width: 1px; } .ui-layout-resizer-north-sliding-hover { border-bottom-width: 1px; }
.ui-layout-resizer-south-sliding-hover { border-top-width: 1px; } .ui-layout-resizer-south-sliding-hover { border-top-width: 1px; }
.ui-layout-resizer-west-sliding-hover { border-right-width: 1px; } .ui-layout-resizer-west-sliding-hover { border-right-width: 1px; }
@ -806,14 +808,14 @@ td.photo {
} }
.ui-layout-toggler-open { .ui-layout-toggler-open {
height: 48px !important; height: 48px !important;
width: 5px !important; width: <?php echo (empty($conf->browser->phone)?'7':'22'); ?>px !important;
-moz-border-radius:0px 10px 10px 0px; -moz-border-radius:0px 10px 10px 0px;
-webkit-border-radius:0px 10px 10px 0px; -webkit-border-radius:0px 10px 10px 0px;
border-radius:0px 10px 10px 0px; border-radius:0px 10px 10px 0px;
} }
.ui-layout-toggler-closed { .ui-layout-toggler-closed {
height: 48px !important; height: 48px !important;
width: 5px !important; width: <?php echo (empty($conf->browser->phone)?'7':'22'); ?>px !important;
-moz-border-radius:0px 10px 10px 0px; -moz-border-radius:0px 10px 10px 0px;
-webkit-border-radius:0px 10px 10px 0px; -webkit-border-radius:0px 10px 10px 0px;
border-radius:0px 10px 10px 0px; border-radius:0px 10px 10px 0px;

View File

@ -821,9 +821,10 @@ if (($action == 'create') || ($action == 'adduserldap'))
print "<tr>".'<td valign="top">'.$langs->trans("PassPenix").'</td>'; print "<tr>".'<td valign="top">'.$langs->trans("PassPenix").'</td>';
print '<td><input size="30" type="text" name="phenix_pass" value="'.$_POST["phenix_pass"].'"></td></tr>'; print '<td><input size="30" type="text" name="phenix_pass" value="'.$_POST["phenix_pass"].'"></td></tr>';
} }
print "</table>\n";
print '<center><br><input class="button" value="'.$langs->trans("CreateUser").'" name="create" type="submit"></center>';
print "<tr>".'<td align="center" colspan="2"><input class="button" value="'.$langs->trans("CreateUser").'" type="submit"></td></tr>';
print "</table>\n";
print "</form>"; print "</form>";
} }
else else

View File

@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -185,9 +185,8 @@ if ($_GET["action"] == 'edit')
print '</table><br>'; print '</table><br>';
// Theme // Theme
show_theme($fuser,empty($dolibarr_main_demo)?1:0,true); show_theme($fuser,(($user->admin || empty($dolibarr_main_demo))?1:0),true);
print '</div>'; print '</div>';
@ -235,7 +234,7 @@ else
print '</div>'; print '</div>';
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if (! empty($dolibarr_main_demo)) if (empty($user->admin) && ! empty($dolibarr_main_demo))
{ {
print "<a class=\"butActionRefused\" title=\"".$langs->trans("FeatureDisabledInDemo")."\" href=\"#\">".$langs->trans("Modify")."</a>"; print "<a class=\"butActionRefused\" title=\"".$langs->trans("FeatureDisabledInDemo")."\" href=\"#\">".$langs->trans("Modify")."</a>";
} }