Bug FrontEnd, Non affichage des champs vides + libellé image

Si vous détectez un bug, signalez-le ici
jcfiguet
Messages : 3
Enregistré le : jeu. 16 janv. 2014 12:39

Bug FrontEnd, Non affichage des champs vides + libellé image

Message par jcfiguet »

Voici le fichier default_default.php avec 2 modifications :

1° La prise en charge du non affichage des champs vides (qui ne fonctionne pas en V2.5)

2° Une petite amélioration perso (qui ne conviendra pas forcément à tous) : le non affichage des libellés des champs images (je sais, c'est du "code en dur", mais ça marche et ça peut dépanner...



<?php defined('_JEXEC') or die('Restricted access');
if(version_compare(JVERSION,'1.6.0','<')){
//Code pour Joomla! 1.5
?>
<table class="adminform" width="100%" >
<?php
for ($i=0, $n=count($this->fields);$i<$n;$i++)
{
$field = $this->fields[$i];
$name_field = $field->tablecolumn;

if (!$notValued = (($this->item->$name_field)=='0') && (($field->type=='4') || ($field->type=='3')))
{
$notValued = (($this->item->$name_field)=='');
}

if (($this->params->get('show_emptyfield')) || (!$notValued)) {
echo '<tr>';
?>
<td>
<label for="name">
<?php echo JText::_($field->field) . ' :' ; ?>
</label>
</td>
<td>
<?php echo $this->createFieldDescription($field); ?>
</td>
<?php
echo '</tr>';
}
}
?>
</table>
<?php
}else{
//Code pour Joomla >= 1.6.0
?>
<table class="category" width="100%" >
<?php
for ($i=0, $n=count($this->fields);$i<$n;$i++)
{
$field = $this->fields[$i];
$name_field = $field->_field->tablecolumn;

// Bug Correction prise en charge non affichage des champs vides
if (!$notValued = (($this->item->$name_field)=='0') && (($field->type=='item') || ($field->type=='define')))
{
$notValued = (($this->item->$name_field)=='');
}
if (($this->params->get('show_emptyfield')) || (!$notValued)) {
// Fin Bug Correction prise en charge non affichage des champs vides


echo '<tr>';
?>
<td>
<!-- Amélioration : suppression du label des champs images -->
<?php if (!$notLabeled = ($field->type=='image'))
{
$notLabeled = (($this->item->$name_field)=='');
}
if (!$notLabeled) { ?>
<!-- Fin Amélioration : suppression du label des champs images -->

<label for="name">
<?php echo JText::_($field->getFieldName()) . ' :'; ?>
</label>
<!-- Amélioration : suppression du label des champs images -->
<?php } ?>
<!-- Fin Amélioration : suppression du label des champs images -->

</td>
<td>
<?php echo $field->display($this->item->$name_field,false); ?>
</td>
<?php
echo '</tr>';
// Bug Correction prise en charge non affichage des champs vides
}
// Fin Bug Correction prise en charge non affichage des champs vides

}
?>
</table>
<?php
}
?>