Fix: debut simplification template smarty
This commit is contained in:
parent
5fe7b641d1
commit
0f16946a03
@ -1888,23 +1888,37 @@ function print_titre($titre)
|
|||||||
* \param pictoisfullpath 1=Icon name is a full absolute url of image
|
* \param pictoisfullpath 1=Icon name is a full absolute url of image
|
||||||
*/
|
*/
|
||||||
function print_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath=0)
|
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;
|
global $conf;
|
||||||
|
|
||||||
if ($picto == 'setup') $picto='title.png';
|
if ($picto == 'setup') $picto='title.png';
|
||||||
if (empty($conf->browser->firefox) && $picto=='title.png') $picto='title.gif';
|
if (empty($conf->browser->firefox) && $picto=='title.png') $picto='title.gif';
|
||||||
|
|
||||||
print "\n";
|
$title = "\n";
|
||||||
print '<table width="100%" border="0" class="notopnoleftnoright" style="margin-bottom: 2px;"><tr>';
|
$title.= '<table width="100%" border="0" class="notopnoleftnoright" style="margin-bottom: 2px;"><tr>';
|
||||||
if ($picto && $titre) print '<td class="nobordernopadding" width="40" align="left" valign="middle">'.img_picto('',$picto, '', $pictoisfullpath).'</td>';
|
if ($picto && $titre) $title.= '<td class="nobordernopadding" width="40" align="left" valign="middle">'.img_picto('',$picto, '', $pictoisfullpath).'</td>';
|
||||||
print '<td class="nobordernopadding" valign="middle">';
|
$title.= '<td class="nobordernopadding" valign="middle">';
|
||||||
print '<div class="titre">'.$titre.'</div>';
|
$title.= '<div class="titre">'.$titre.'</div>';
|
||||||
print '</td>';
|
$title.= '</td>';
|
||||||
if (strlen($mesg))
|
if (strlen($mesg))
|
||||||
{
|
{
|
||||||
print '<td class="nobordernopadding" align="right" valign="middle"><b>'.$mesg.'</b></td>';
|
$title.= '<td class="nobordernopadding" align="right" valign="middle"><b>'.$mesg.'</b></td>';
|
||||||
}
|
}
|
||||||
print '</tr></table>'."\n";
|
$title.= '</tr></table>'."\n";
|
||||||
|
|
||||||
|
return $title;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -19,13 +19,7 @@
|
|||||||
* $Source$
|
* $Source$
|
||||||
*}
|
*}
|
||||||
<!-- BEGIN SMARTY TEMPLATE -->
|
<!-- BEGIN SMARTY TEMPLATE -->
|
||||||
<table width="100%" border="0" class="notopnoleftnoright">
|
{$title}
|
||||||
<tr>
|
|
||||||
<td class="notopnoleftnoright" valign="middle">
|
|
||||||
<div class="titre">Nouveau Livre</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<form id="evolForm" action="fiche.php" method="post">
|
<form id="evolForm" action="fiche.php" method="post">
|
||||||
<input type="hidden" name="action" value="add">
|
<input type="hidden" name="action" value="add">
|
||||||
|
|||||||
@ -384,6 +384,8 @@ class ProductLivre extends Product
|
|||||||
*/
|
*/
|
||||||
function assign_smarty_values(&$smarty, $action='')
|
function assign_smarty_values(&$smarty, $action='')
|
||||||
{
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
if ($action =='edit' or $action == 'create')
|
if ($action =='edit' or $action == 'create')
|
||||||
{
|
{
|
||||||
$this->GetAvailableFormat();
|
$this->GetAvailableFormat();
|
||||||
@ -400,6 +402,9 @@ class ProductLivre extends Product
|
|||||||
$smarty->assign('class_normal_ref', 'normal');
|
$smarty->assign('class_normal_ref', 'normal');
|
||||||
$smarty->assign('class_focus_ref', 'focus');
|
$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);
|
$smarty->assign('user', $this->user->prenom.' '.$this->user->nom);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user