New: Can add parameter &optioncss=print on url to have a page ready to print (menu removed)

This commit is contained in:
Laurent Destailleur 2009-08-19 16:26:12 +00:00
parent 3035c51217
commit 944345b625
8 changed files with 112 additions and 83 deletions

View File

@ -691,7 +691,8 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
{
global $user, $conf, $langs, $db;
if (empty($conf->css)) $conf->css ='/theme/eldy/eldy.css.php';
if (empty($conf->css)) $conf->css = 'theme/eldy/eldy.css.php';
//header("Content-type: text/html; charset=UTF-8");
header("Content-type: text/html; charset=".$conf->file->character_set_client);
@ -718,13 +719,13 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
print "\n";
// Output style sheets
print '<link rel="stylesheet" type="text/css" title="default" href="'.DOL_URL_ROOT.'/'.$conf->css.'?lang='.$langs->defaultlang.'">'."\n";
print '<link rel="stylesheet" type="text/css" title="default" href="'.DOL_URL_ROOT.'/'.$conf->css.'?lang='.$langs->defaultlang.(! empty($_GET["optioncss"])?'&optioncss='.$_GET["optioncss"]:'').'">'."\n";
// CSS forced by modules
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_URL_ROOT.$cssfile.'?lang='.$langs->defaultlang.'">'."\n";
print '<link rel="stylesheet" type="text/css" title="default" href="'.DOL_URL_ROOT.$cssfile.'?lang='.$langs->defaultlang.(! empty($_GET["optioncss"])?'&optioncss='.$_GET["optioncss"]:'').'">'."\n";
}
}
// CSS forced by page (in top_htmlhead call)
@ -732,7 +733,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
{
foreach($arrayofcss as $cssfile)
{
print '<link rel="stylesheet" type="text/css" title="default" href="'.DOL_URL_ROOT.'/'.$cssfile.'?lang='.$langs->defaultlang.'">'."\n";
print '<link rel="stylesheet" type="text/css" title="default" href="'.DOL_URL_ROOT.'/'.$cssfile.'?lang='.$langs->defaultlang.(! empty($_GET["optioncss"])?'&optioncss='.$_GET["optioncss"]:'').'">'."\n";
}
}

View File

@ -40,7 +40,7 @@ $left=($langs->direction=='rtl'?'right':'left');
?>
/* ============================================================================== */
/* Styles par défaut */
/* Styles par d<EFBFBD>faut */
/* ============================================================================== */
body {
@ -161,6 +161,9 @@ div.fiche
div.tmenu
{
<?php if (! empty($_GET["optioncss"]) && $_GET["optioncss"] == 'print') { ?>
display:none;
<?php } else { ?>
position: relative;
display: block;
white-space: nowrap;
@ -170,6 +173,7 @@ div.tmenu
font-size: 13px;
background-image : url(<?php echo DOL_URL_ROOT.'/theme/auguria/img/nav.jpg' ?>) ;
height: 22px;
<?php } ?>
}
a.tmenudisabled
@ -265,9 +269,6 @@ a.tmenusel:active
font-weight: normal;
}
/* Top menu */
table.tmenu
{
padding: 1px 0px 0px 0px; // x y z w x=top offset
@ -326,9 +327,15 @@ img.login
/* ============================================================================== */
/* Barre de gauche */
/* Menu gauche */
/* ============================================================================== */
<?php if (! empty($_GET["optioncss"]) && $_GET["optioncss"] == 'print') { ?>
.vmenu {
display:none;
}
<?php } ?>
a.vmenu:link { font-size:12px; text-align:left; font-weight: normal; color: #FFFFFF; margin: 1px 1px 1px 4px; }
a.vmenu:visited { font-size:12px; text-align:left; font-weight: normal; color: #FFFFFF; margin: 1px 1px 1px 4px; }
a.vmenu:active { font-size:12px; text-align:left; font-weight: normal; color: #FFFFFF; margin: 1px 1px 1px 4px; }
@ -1290,7 +1297,7 @@ table.cal_event td { border: 0px; padding-left: 0px; padding-right: 2px; padding
/* ============================================================================== */
/* Ajax - Liste déroulante de l'autocompletion */
/* Ajax - Liste d<EFBFBD>roulante de l'autocompletion */
/* ============================================================================== */
div.autocomplete {

View File

@ -87,16 +87,6 @@ form
/* Styles de positionnement des zones */
/* ============================================================================== */
/* Removed div.vmenuplusfiche, replaced div.vmenu by td.vmenu, removed div.fiche */
td.vmenu
{
margin-right: 2px;
padding: 0px;
padding-bottom: 0px;
width: 164px;
}
div.fiche
{
margin-left: 4px;
@ -110,6 +100,9 @@ div.fiche
div.tmenu
{
<?php if (! empty($_GET["optioncss"]) && $_GET["optioncss"] == 'print') { ?>
display:none;
<?php } else { ?>
float: top;
display:block;
white-space: nowrap;
@ -123,6 +116,7 @@ div.tmenu
height: 18px;
color: #000000;
text-decoration: none;
<?php } ?>
}
a.tmenu:link
@ -253,9 +247,23 @@ img.login
}
/*
* Barre de gauche
*/
/* ============================================================================== */
/* Menu gauche */
/* ============================================================================== */
<?php if (! empty($_GET["optioncss"]) && $_GET["optioncss"] == 'print') { ?>
.vmenu {
display:none;
}
<?php } ?>
td.vmenu
{
margin-right: 2px;
padding: 0px;
padding-bottom: 0px;
width: 164px;
}
a.vmenu:link { font-size: 12px; font: helvetica, verdana, arial, sans-serif; text-align:left; font-weight: bold; }
a.vmenu:visited { font-size: 12px; font: helvetica, verdana, arial, sans-serif; text-align:left; font-weight: bold; }

View File

@ -167,6 +167,9 @@ div.fiche
div.tmenu
{
<?php if (! empty($_GET["optioncss"]) && $_GET["optioncss"] == 'print') { ?>
display:none;
<?php } else { ?>
position: relative;
display: block;
white-space: nowrap;
@ -183,6 +186,7 @@ div.tmenu
background-image: url(<?php echo DOL_URL_ROOT.'/theme/eldy/img/tmenu.jpg' ?>);
color: #000000;
text-decoration: none;
<?php } ?>
}
a.tmenudisabled:link
@ -314,8 +318,6 @@ a.tmenusel:active
border-bottom: 2px solid #F4F4F4;
}
/* Top menu */
table.tmenu
{
padding: 0px 0px 10px 0px; /* x y z w x=top offset */
@ -378,9 +380,15 @@ img.login
/* ============================================================================== */
/* Barre de gauche */
/* Menu gauche */
/* ============================================================================== */
<?php if (! empty($_GET["optioncss"]) && $_GET["optioncss"] == 'print') { ?>
.vmenu {
display:none;
}
<?php } ?>
a.vmenu:link { font-size:12px; font-family: helvetica, verdana, arial, sans-serif; text-align: <?php print $left; ?>; font-weight: bold; }
a.vmenu:visited { font-size:12px; font-family: helvetica, verdana, arial, sans-serif; text-align: <?php print $left; ?>; font-weight: bold; }
a.vmenu:active { font-size:12px; font-family: helvetica, verdana, arial, sans-serif; text-align: <?php print $left; ?>; font-weight: bold; }

View File

@ -40,7 +40,7 @@ $left=($langs->direction=='rtl'?'right':'left');
?>
/* ============================================================================== */
/* Styles par défaut */
/* Styles par d<EFBFBD>faut */
/* ============================================================================== */
body {
@ -141,14 +141,6 @@ form
/* Styles de positionnement des zones */
/* ============================================================================== */
td.vmenu
{
padding-right: 2px;
padding: 0px;
padding-bottom: 0px;
width: 180px;
}
div.fiche
{
margin-left: 5px;
@ -160,6 +152,9 @@ div.fiche
div.tmenu
{
<?php if (! empty($_GET["optioncss"]) && $_GET["optioncss"] == 'print') { ?>
display:none;
<?php } else { ?>
position: relative;
display: block;
white-space: nowrap;
@ -175,6 +170,7 @@ div.tmenu
background: #dddddd;
color: #000000;
text-decoration: none;
<?php } ?>
}
a.tmenudisabled
@ -356,9 +352,23 @@ img.login
/* ============================================================================== */
/* Barre de gauche */
/* Menu gauche */
/* ============================================================================== */
<?php if (! empty($_GET["optioncss"]) && $_GET["optioncss"] == 'print') { ?>
.vmenu {
display:none;
}
<?php } ?>
td.vmenu
{
padding-right: 2px;
padding: 0px;
padding-bottom: 0px;
width: 180px;
}
a.vmenu:link { font-family: helvetica, verdana, arial, sans-serif; text-align:left; font-weight: bold; }
a.vmenu:visited { font-family: helvetica, verdana, arial, sans-serif; text-align:left; font-weight: bold; }
a.vmenu:active { font-family: helvetica, verdana, arial, sans-serif; text-align:left; font-weight: bold; }
@ -516,7 +526,7 @@ a.tabimage {
/* Boutons actions */
/* ============================================================================== */
/* Nouvelle syntaxe à utiliser */
/* Nouvelle syntaxe <EFBFBD> utiliser */
a.butAction:link { font-family: helvetica, verdana, arial, sans-serif; background: white; border: 1px solid #999999; color: #436969; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; }
a.butAction:visited { font-family: helvetica, verdana, arial, sans-serif; background: white; border: 1px solid #999999; color: #436969; padding: 0em 0.7em; margin: 0em 0.5em; text-decoration: none; white-space: nowrap; }

View File

@ -1,23 +0,0 @@
/* Copyright (C) 2003 Xavier DUTOIT <doli@sydesy.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/
/*
Avec ces styles, on imprime pas les menus de gauches et celui du haut
*/
.leftmenu,.menu,.noprint {display:none;}

View File

@ -110,16 +110,6 @@ form
/* Styles de positionnement des zones */
/* ============================================================================== */
/* Removed div.vmenuplusfiche, replaced div.vmenu by td.vmenu, removed div.fiche */
td.vmenu
{
margin-right: 2px;
padding: 0px;
padding-bottom: 0px;
width: 164px;
}
div.fiche
{
margin-left: 4px;
@ -132,6 +122,9 @@ div.fiche
div.tmenu
{
<?php if (! empty($_GET["optioncss"]) && $_GET["optioncss"] == 'print') { ?>
display:none;
<?php } else { ?>
display:block;
white-space: nowrap;
border:0;
@ -145,6 +138,7 @@ div.tmenu
background: #ded8d2;
color: #000000;
text-decoration: none;
<?php } ?>
}
a.tmenu:link
@ -281,9 +275,23 @@ img.login
}
/*
* Barre de gauche
*/
/* ============================================================================== */
/* Menu gauche */
/* ============================================================================== */
<?php if (! empty($_GET["optioncss"]) && $_GET["optioncss"] == 'print') { ?>
.vmenu {
display:none;
}
<?php } ?>
td.vmenu
{
padding-right: 2px;
padding: 0px;
padding-bottom: 0px;
width: 164px;
}
a.vmenu:link { font-family: helvetica, verdana, arial, sans-serif; text-align:left; font-weight: bold; }
a.vmenu:visited { font-family: helvetica, verdana, arial, sans-serif; text-align:left; font-weight: bold; }

View File

@ -40,7 +40,7 @@ $left=($langs->direction=='rtl'?'right':'left');
?>
/* ============================================================================== */
/* Styles par défaut */
/* Styles par d<EFBFBD>faut */
/* ============================================================================== */
body {
@ -126,14 +126,6 @@ form
/* Styles de positionnement des zones */
/* ============================================================================== */
td.vmenu
{
margin-right: 2px;
padding: 0px;
padding-bottom: 0px;
width: 164px;
}
div.fiche
{
margin-left: 4px;
@ -148,6 +140,9 @@ div.fiche
div.tmenu
{
<?php if (! empty($_GET["optioncss"]) && $_GET["optioncss"] == 'print') { ?>
display:none;
<?php } else { ?>
position: relative;
display: block;
white-space: nowrap;
@ -162,7 +157,9 @@ div.tmenu
background: #dcdcb3;
color: #000000;
text-decoration: none;
<?php } ?>
}
a.tmenudisabled
{
color: #757575;
@ -325,9 +322,22 @@ img.login
/* ============================================================================== */
/* Barre de gauche */
/* Menu gauche */
/* ============================================================================== */
<?php if (! empty($_GET["optioncss"]) && $_GET["optioncss"] == 'print') { ?>
.vmenu {
display:none;
}
<?php } ?>
td.vmenu
{
padding-right: 2px;
padding: 0px;
padding-bottom: 0px;
width: 164px;
}
a.vmenu:link { font-family: helvetica, verdana, arial, sans-serif; text-align:left; font-weight: bold; }
a.vmenu:visited { font-family: helvetica, verdana, arial, sans-serif; text-align:left; font-weight: bold; }