From 6a3534c32a6a76604fc260507fa1a80a68e11a5b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 29 Jul 2009 16:19:15 +0000 Subject: [PATCH] Fix: more flexibility --- htdocs/lib/functions.lib.php | 30 +++++-------------- htdocs/product/canvas/livre/livre-create.tpl | 11 ++++++- htdocs/product/canvas/product.livre.class.php | 8 +++-- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 27bc20adbba..269f63c862b 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -1888,37 +1888,23 @@ function print_titre($titre) * \param pictoisfullpath 1=Icon name is a full absolute url of image */ function print_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath=0) -{ - print fiche_titre($titre, $mesg, $picto, $pictoisfullpath); -} - -/** - * \brief Affichage d'un titre d'une fiche, aligne a gauche - * \param titre Le titre a afficher - * \param mesg Message suplementaire a afficher a droite - * \param picto Icon to use before title (should be a 32x32 transparent png file) - * \param pictoisfullpath 1=Icon name is a full absolute url of image - */ -function fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath=0) { global $conf; if ($picto == 'setup') $picto='title.png'; if (empty($conf->browser->firefox) && $picto=='title.png') $picto='title.gif'; - $title = "\n"; - $title.= ''; - if ($picto && $titre) $title.= ''; - $title.= ''; + print "\n"; + print '
'.img_picto('',$picto, '', $pictoisfullpath).''; - $title.= '
'.$titre.'
'; - $title.= '
'; + if ($picto && $titre) print ''; + print ''; if (strlen($mesg)) { - $title.= ''; + print ''; } - $title.= '
'.img_picto('',$picto, '', $pictoisfullpath).''; + print '
'.$titre.'
'; + print '
'.$mesg.''.$mesg.'
'."\n"; - - return $title; + print ''."\n"; } /** diff --git a/htdocs/product/canvas/livre/livre-create.tpl b/htdocs/product/canvas/livre/livre-create.tpl index 9e18a7ba1ab..87a3615790c 100644 --- a/htdocs/product/canvas/livre/livre-create.tpl +++ b/htdocs/product/canvas/livre/livre-create.tpl @@ -19,7 +19,16 @@ * $Source$ *} -{$title} + + + + + +
+ {$title_picto} + +
{$title_text}
+
diff --git a/htdocs/product/canvas/product.livre.class.php b/htdocs/product/canvas/product.livre.class.php index e5f89187d18..b198d67a623 100644 --- a/htdocs/product/canvas/product.livre.class.php +++ b/htdocs/product/canvas/product.livre.class.php @@ -384,7 +384,7 @@ class ProductLivre extends Product */ function assign_smarty_values(&$smarty, $action='') { - global $langs; + global $conf,$langs; if ($action =='edit' or $action == 'create') { @@ -403,8 +403,10 @@ class ProductLivre extends Product $smarty->assign('class_focus_ref', 'focus'); } - $title = fiche_titre($langs->trans('NewBook')); - $smarty->assign('title', $title); + $picto='title.png'; + if (empty($conf->browser->firefox)) $picto='title.gif'; + $smarty->assign('title_picto', img_picto('',$picto)); + $smarty->assign('title_text', $langs->trans('NewBook')); $smarty->assign('user', $this->user->prenom.' '.$this->user->nom);