From 944345b625c2b127bce552c065762228ed718b95 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@users.sourceforge.net> Date: Wed, 19 Aug 2009 16:26:12 +0000 Subject: [PATCH] New: Can add parameter &optioncss=print on url to have a page ready to print (menu removed) --- htdocs/main.inc.php | 9 +++--- htdocs/theme/auguria/auguria.css.php | 19 ++++++++---- htdocs/theme/bluelagoon/bluelagoon.css.php | 34 +++++++++++++--------- htdocs/theme/eldy/eldy.css.php | 14 +++++++-- htdocs/theme/freelug/freelug.css.php | 32 +++++++++++++------- htdocs/theme/print.css | 23 --------------- htdocs/theme/rodolphe/rodolphe.css.php | 34 +++++++++++++--------- htdocs/theme/yellow/yellow.css.php | 30 ++++++++++++------- 8 files changed, 112 insertions(+), 83 deletions(-) delete mode 100644 htdocs/theme/print.css diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ce7cde67fd6..7a35d96a424 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -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"; } } diff --git a/htdocs/theme/auguria/auguria.css.php b/htdocs/theme/auguria/auguria.css.php index c2188597cd0..22c8790f509 100644 --- a/htdocs/theme/auguria/auguria.css.php +++ b/htdocs/theme/auguria/auguria.css.php @@ -40,7 +40,7 @@ $left=($langs->direction=='rtl'?'right':'left'); ?> /* ============================================================================== */ -/* Styles par d�faut */ +/* Styles par d�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�roulante de l'autocompletion */ /* ============================================================================== */ div.autocomplete { diff --git a/htdocs/theme/bluelagoon/bluelagoon.css.php b/htdocs/theme/bluelagoon/bluelagoon.css.php index 4a4d53d8a03..940146295c5 100644 --- a/htdocs/theme/bluelagoon/bluelagoon.css.php +++ b/htdocs/theme/bluelagoon/bluelagoon.css.php @@ -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; } diff --git a/htdocs/theme/eldy/eldy.css.php b/htdocs/theme/eldy/eldy.css.php index d6bc40452dd..86cab91efd7 100644 --- a/htdocs/theme/eldy/eldy.css.php +++ b/htdocs/theme/eldy/eldy.css.php @@ -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; } diff --git a/htdocs/theme/freelug/freelug.css.php b/htdocs/theme/freelug/freelug.css.php index a2bcb358fa7..fe573a72047 100644 --- a/htdocs/theme/freelug/freelug.css.php +++ b/htdocs/theme/freelug/freelug.css.php @@ -40,7 +40,7 @@ $left=($langs->direction=='rtl'?'right':'left'); ?> /* ============================================================================== */ -/* Styles par d�faut */ +/* Styles par d�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 � 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; } diff --git a/htdocs/theme/print.css b/htdocs/theme/print.css deleted file mode 100644 index a121c27cfac..00000000000 --- a/htdocs/theme/print.css +++ /dev/null @@ -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;} diff --git a/htdocs/theme/rodolphe/rodolphe.css.php b/htdocs/theme/rodolphe/rodolphe.css.php index d5b576b1aed..5b5a225a980 100644 --- a/htdocs/theme/rodolphe/rodolphe.css.php +++ b/htdocs/theme/rodolphe/rodolphe.css.php @@ -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; } diff --git a/htdocs/theme/yellow/yellow.css.php b/htdocs/theme/yellow/yellow.css.php index 35a6fd2da9f..a09749d4417 100644 --- a/htdocs/theme/yellow/yellow.css.php +++ b/htdocs/theme/yellow/yellow.css.php @@ -40,7 +40,7 @@ $left=($langs->direction=='rtl'?'right':'left'); ?> /* ============================================================================== */ -/* Styles par d�faut */ +/* Styles par d�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; } -- GitLab