private function getLink( $texte='' ) { $tab = explode( ";", $texte ); // Chargement de la catégorie $temp_categorie = new produit_categorie(); $temp_categorie->load( $tab[0] ); //echo "-----> " . $temp_categorie->nom . "<br>"; // Liste des catégories $liste = $this->getListe( $temp_categorie->num_parent ); $lien = "<select name='categorie_" . $tab[0] . "' id='categorie_" . $tab[0] . "' onchange='changer_categorie( " . $tab[0] . " );'>"; foreach( $liste as $_categorie ) { $selected = ( $_categorie->num_produit_categorie == $tab[0] ) ? "selected" : ""; $lien .= " <option value='" . strtolower( $_categorie->num_produit_categorie ) . "' " . $selected . " >" . utf8_encode( $_categorie->nom ) . "</option>"; } $lien .= "</select>"; return $lien; }
// On liste tous les sites foreach( $liste_produit as $_produit ) { $index = $index + 1; if ($index % 2) { $choix_couleur = "#F5FFE5"; $fonce = "_fonce"; } else { $choix_couleur = "#E4FDC3"; $fonce = ""; } // Récupération du nom de la catégorie $nom_categorie = ( $categorie_temp->load( $_produit->num_produit_categorie ) ) ? stripcslashes( utf8_encode( $categorie_temp->nom ) ) : "-"; ?> <tr> <td> <table cellpadding=0 cellspacing=0 style="width:100%;background-color:<?php echo $choix_couleur; ?> ;" border="0"> <tr> <td> <table cellpadding=0 cellspacing=0 style="width:100%;" border="0"> <tr> <td width="*" height="20"> <a href="javascript:afficher(<?php echo $_produit->num_produit; ?>
px;"><?php echo stripcslashes(utf8_encode($_categorie->nom)); ?> </a> <? } else echo "<b>" . stripcslashes( utf8_encode( $_categorie->nom ) ) . "</b>"; ?> </td> <td width="150"> <? // Affichage de la catégorie parent if ( $_categorie->num_parent == 0 ) echo "-"; else { $temp = new produit_categorie(); $temp->load( $_categorie->num_parent ); echo stripcslashes( utf8_encode( $temp->nom ) ); } ?> </td> <td width="40" align="right" valign="middle"> <? // Affichage des liens UNIQUEMENT pour les catégories qui ne sont pas à la racine if ( $_categorie->niveau > 0 ) { ?> <a href="javascript:afficher(<?php echo $_categorie->num_produit_categorie; ?> );"><img src="../images/icones/edit.gif" border="0" title="Modifier la catégorie"></a> <a href="javascript:supprimer(<?php echo $_categorie->num_produit_categorie;