New: A page can force reload of css style sheet

This commit is contained in:
Laurent Destailleur 2012-01-15 17:40:44 +01:00
parent 15cd3794c9
commit 25a505534b
4 changed files with 30 additions and 20 deletions

View File

@ -51,6 +51,7 @@ For developers:
- New: Can define different requests according to database type into migration files.
- New: Add "canvas" feature to overwrite page of thirdparty, contact, product with yours.
- New: Removed artichow deprecated libraries.
- New: A page can force reload of css style sheet
- Qual: Add a lot of more PHPUnit tests.
- Qual: Data structure for supplier prices is simpler.
- Qual: Removed no more used external libraries.

View File

@ -57,7 +57,7 @@ class FormOther
/**
* Return HTML select list of export models
*
*
* @param string $selected Id modele pre-selectionne
* @param string $htmlname Nom de la zone select
* @param string $type Type des modeles recherches
@ -106,7 +106,7 @@ class FormOther
/**
* Return list of export models
*
*
* @param string $selected Id modele pre-selectionne
* @param string $htmlname Nom de la zone select
* @param string $type Type des modeles recherches
@ -155,7 +155,7 @@ class FormOther
/**
* Retourne la liste des ecotaxes avec tooltip sur le libelle
*
*
* @param string $selected code ecotaxes pre-selectionne
* @param string $htmlname nom de la liste deroulante
* @return void
@ -209,7 +209,7 @@ class FormOther
/**
* Return a HTML select list to select a percent
*
*
* @param selected pourcentage pre-selectionne
* @param htmlname nom de la liste deroulante
* @param increment increment value
@ -242,7 +242,7 @@ class FormOther
/**
* Return select list for categories (to use in form search selectors)
*
*
* @param type Type of categories (0=product, 1=suppliers, 2=customers, 3=members)
* @param selected Preselected value
* @param htmlname Name of combo list
@ -278,7 +278,7 @@ class FormOther
/**
* Return select list for categories (to use in form search selectors)
*
*
* @param selected Preselected value
* @param htmlname Name of combo list
* @param user Object user
@ -419,7 +419,7 @@ class FormOther
title: \''.dol_escape_js($langs->trans("SelectAColor")).'\',
newColor: \''.dol_escape_js($langs->trans("New")).'\',
currentColor: \''.dol_escape_js($langs->trans("Current")).'\',
ok: \''.dol_escape_js($langs->trans("Change")).'\',
ok: \''.dol_escape_js($langs->trans("Save")).'\',
cancel: \''.dol_escape_js($langs->trans("Cancel")).'\'
}
}
@ -493,7 +493,7 @@ class FormOther
/**
* Return HTML combo list of week
*
*
* @param string $selected Preselected value
* @param string $htmlname Nom de la zone select
* @param int $useempty Affiche valeur vide dans liste
@ -534,7 +534,7 @@ class FormOther
/**
* Return HTML combo list of month
*
*
* @param string $selected Preselected value
* @param string $htmlname Nom de la zone select
* @param int $useempty Affiche valeur vide dans liste
@ -569,7 +569,7 @@ class FormOther
/**
* Return HTML combo list of years
*
*
* @param string $selected Preselected value (''=current year, -1=none, year otherwise)
* @param string $htmlname Name of HTML select object
* @param int $useempty Affiche valeur vide dans liste
@ -584,7 +584,7 @@ class FormOther
/**
* Return HTML combo list of years
*
*
* @param string $selected Preselected value (''=current year, -1=none, year otherwise)
* @param string $htmlname Name of HTML select object
* @param int $useempty Affiche valeur vide dans liste
@ -635,7 +635,7 @@ class FormOther
/**
* Write all lines of a project (if parent = 0)
*
*
* @param int &$inc Cursor counter
* @param int $parent Id parent
* @param Object $lines Line object

View File

@ -864,16 +864,18 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print '<!-- Includes for Dolibarr, modules or specific pages-->'."\n";
// Output style sheets (optioncss='print' or '')
$themepath=dol_buildpath((empty($conf->global->MAIN_FORCETHEMEDIR)?'':$conf->global->MAIN_FORCETHEMEDIR).$conf->css,1);
//print 'themepath='.$themepath;exit;
print '<link rel="stylesheet" type="text/css" title="default" href="'.$themepath.'?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss')?'&optioncss='.GETPOST('optioncss','alpha',1):'').'">'."\n";
$themeparam='?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss')?'&optioncss='.GETPOST('optioncss','alpha',1):'');
if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&dol_resetcache='.$_SESSION['dol_resetcache'];
//print 'themepath='.$themepath.' themeparam='.$themeparam;exit;
print '<link rel="stylesheet" type="text/css" title="default" href="'.$themepath.$themeparam.'">'."\n";
// CSS forced by modules (relative url starting with /)
if (is_array($conf->css_modules))
{
foreach($conf->css_modules as $cssfile)
{ // cssfile is an absolute path
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters and browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss')?'&optioncss='.GETPOST('optioncss','alpha',1):'');
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters, so browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
print '">'."\n";
}
}
@ -884,7 +886,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
{
print '<link rel="stylesheet" type="text/css" title="default" href="'.dol_buildpath($cssfile,1);
// We add params only if page is not static, because some web server setup does not return content type text/css if url has parameters and browser cache is not used.
if (!preg_match('/\.css$/i',$cssfile)) print '?lang='.$langs->defaultlang.'&theme='.$conf->theme.(GETPOST('optioncss')?'&optioncss='.GETPOST('optioncss','alpha',1):'');
if (!preg_match('/\.css$/i',$cssfile)) print $themeparam;
print '">'."\n";
}
}

View File

@ -68,9 +68,11 @@ $img_button=dol_buildpath($path.'/theme/eldy/img/button_bg.png',1);
// Example: Pink: $colred=230;$colgreen=210;$colblue=230;
// Example: Green: $colred=210;$colgreen=230;$colblue=210;
// Example: Ocean: $colred=220;$colgreen=220;$colblue=240;
$colred=235;$colgreen=235;$colblue=235;
//$conf->global->THEME_ELDY_ENABLE_PERSONALIZED=0;
//$user->conf->THEME_ELDY_ENABLE_PERSONALIZED=0;
$colred =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,0,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,0,2)));
$colgreen=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,2,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,2,2)));
$colblue =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,4,2))):(empty($user->conf->THEME_ELDY_RGB)?235:hexdec(substr($conf->global->THEME_ELDY_RGB,4,2)));
// Colors
$isred=max(0,(2*$colred-$colgreen-$colblue)/2); // 0 - 255
@ -90,6 +92,7 @@ $colorbacklineimpair2=(250+round($isred/3)).','.(250+round($isgreen/3)).','.(250
$colorbacklinepair1='255,255,255'; // line pair
$colorbacklinepair2='255,255,255'; // line pair
$colorbackbody='#ffffff url('.$img_head.') 0 0 no-repeat;';
$colortext='40,40,40';
// Eldy colors
if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED))
@ -109,6 +112,7 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED))
$conf->global->THEME_ELDY_LINEPAIR1='255,255,255';
$conf->global->THEME_ELDY_LINEPAIR2='255,255,255';
$conf->global->THEME_ELDY_BACKBODY='#ffffff url('.$img_head.') 0 0 no-repeat;';
$conf->global->THEME_ELDY_TEXT='48,102,102';
}
$colorback1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorback1:$user->conf->THEME_ELDY_TOPMENU_BACK1);
@ -124,9 +128,11 @@ $colorbacklineimpair1=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty(
$colorbacklineimpair2=empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEIMPAIR2) ?$colorbacklineimpair2:$conf->global->THEME_ELDY_LINEIMPAIR2):(empty($user->conf->THEME_ELDY_LINEIMPAIR2)?$colorbacklineimpair2:$user->conf->THEME_ELDY_LINEIMPAIR2);
$colorbacklinepair1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR1) ?$colorbacklinepair1:$conf->global->THEME_ELDY_LINEPAIR1) :(empty($user->conf->THEME_ELDY_LINEPAIR1)?$colorbacklinepair1:$user->conf->THEME_ELDY_LINEPAIR1);
$colorbacklinepair2 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_LINEPAIR2) ?$colorbacklinepair2:$conf->global->THEME_ELDY_LINEPAIR2) :(empty($user->conf->THEME_ELDY_LINEPAIR2)?$colorbacklinepair2:$user->conf->THEME_ELDY_LINEPAIR2);
$colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY);
$colorbackbody =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_BACKBODY) ?$colorbackbody:$conf->global->THEME_ELDY_BACKBODY) :(empty($user->conf->THEME_ELDY_BACKBODY)?$colorbackbody:$user->conf->THEME_ELDY_BACKBODY);
$colortext =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TEXT) ?$colortext:$conf->global->THEME_ELDY_TEXT) :(empty($user->conf->THEME_ELDY_TEXT)?$colortext:$user->conf->THEME_ELDY_TEXT);
print '/*'."\n";
print 'colred='.$colred.' colgreen='.$colgreen.' colblue='.$colblue."\n";
print 'isred='.$isred.' isgreen='.$isgreen.' isblue='.$isblue."\n";
print 'colorbacklineimpair1='.$colorbacklineimpair1."\n";
print 'colorbacklineimpair2='.$colorbacklineimpair2."\n";
@ -1680,8 +1686,9 @@ border: 0px;
div.titre {
font-family: <?php print $fontlist ?>;
font-weight: bold;
color: #336666;
color: rgb(<?php print $colortext; ?>);
text-decoration: none;
text-shadow: 1px 2px 3px #AFAFAF;
}