diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 269f63c862b..27bc20adbba 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -1888,23 +1888,37 @@ 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'; - print "\n"; - print ''; - if ($picto && $titre) print ''; - print ''; + $title = "\n"; + $title.= '
'.img_picto('',$picto, '', $pictoisfullpath).''; - print '
'.$titre.'
'; - print '
'; + if ($picto && $titre) $title.= ''; + $title.= ''; if (strlen($mesg)) { - print ''; + $title.= ''; } - print '
'.img_picto('',$picto, '', $pictoisfullpath).''; + $title.= '
'.$titre.'
'; + $title.= '
'.$mesg.''.$mesg.'
'."\n"; + $title.= ''."\n"; + + return $title; } /** diff --git a/htdocs/product/canvas/livre/livre-create.tpl b/htdocs/product/canvas/livre/livre-create.tpl index 2c3407eff71..9e18a7ba1ab 100644 --- a/htdocs/product/canvas/livre/livre-create.tpl +++ b/htdocs/product/canvas/livre/livre-create.tpl @@ -19,13 +19,7 @@ * $Source$ *} - - - - -
-
Nouveau Livre
-
+{$title}
diff --git a/htdocs/product/canvas/product.livre.class.php b/htdocs/product/canvas/product.livre.class.php index d61e277637b..e5f89187d18 100644 --- a/htdocs/product/canvas/product.livre.class.php +++ b/htdocs/product/canvas/product.livre.class.php @@ -384,6 +384,8 @@ class ProductLivre extends Product */ function assign_smarty_values(&$smarty, $action='') { + global $langs; + if ($action =='edit' or $action == 'create') { $this->GetAvailableFormat(); @@ -400,6 +402,9 @@ class ProductLivre extends Product $smarty->assign('class_normal_ref', 'normal'); $smarty->assign('class_focus_ref', 'focus'); } + + $title = fiche_titre($langs->trans('NewBook')); + $smarty->assign('title', $title); $smarty->assign('user', $this->user->prenom.' '.$this->user->nom);