Html->link( __("$title"), $controllerArgs, /* [ 'controller' => $controller, 'action' => $action, $id, $other_args ], */ [ 'title' => $tip, 'escape' => false, 'onclick' => 'return true;', //'style' => 'margin-right: 10px'.$moreButtonStyle, 'style' => $buttonStyle, 'confirm' => $confirmMessage ] ); } public function displayElement($nom, $valeur, $params = "") { $TD = ($params=="") ? 'TD' : "TD $params"; //$TD = ($params=="") ? '' : ''; //$tdstyle = $params!="" ? $params : ''; // Ca c'est parce que sinon y'a au moins deux tests qui passent pas, a cause de l'espace dans la balise ... //if ($valeur != "") echo ' '.$nom.' ' . $TD.$valeur.''; //if ($valeur != "") echo '' . $nom . ' ' . $balise . $valeur . ''; //if ($valeur!="") echo " ".__($nom)." <$TD>".h($valeur)." "; //if ($valeur!="") echo " ".__($nom)." <$TD>".$valeur." "; if ($valeur!==null && $valeur!=='') { $val = $valeur; if ($valeur === true) $val = 'Oui'; if ($valeur === false) $val = 'Non'; echo " ".__($nom)." <$TD>".$val." "; } //if ($valeur!="") echo " $nom <$TD>$valeur "; } /* Pour src/Template/Configurations/view et edit */ public function echoSectionStart($title) { $WITH_TABLE=true; //echo '

'; //echo "

"; echo "

"; //echo ''; echo ''; echo ''.$title.''; echo '

'; //echo '
'; echo '
'; if ($WITH_TABLE) { echo ''; echo ''; } } public function echoSectionStop() { $WITH_TABLE=true; if ($WITH_TABLE) echo '
'; echo '
'; } //function displaySectionShowHide($controller_name, $entity_type_name, $title, $id_name, $is_masculine, $name_field_name, $entities) { //function displaySectionShowHide($controller_name, $entity_type_name, $title, $is_masculine, $name_field_name, $entities) { function displayAssociatedEntitiesAsSectionShowHide($controller_name, $entity_type_name, $title, $is_masculin, $name_field_name, $entities) { $id_name = $controller_name; $id_h3 = 't_'.$id_name; $id_i = 'i_'.$id_name; $title = ucfirst($title).' associé'. ($is_masculin ? 's' : 'es'); echo "

"; echo ""; //echo " $title (".$entities->count().")"; echo " $title (".count($entities).")"; echo "

"; echo "
"; //if (true) { $shift3 = '   '; $shift5 = '     '; //if ($entities->isEmpty()) { if (empty($entities)) { //echo "Aucune $entity_name liée à ce domaine."; echo $shift5.($is_masculin ? "Aucun $entity_type_name associé" : "Aucune $entity_type_name associée"); } else { echo ""; /* */ foreach ($entities as $entity) { echo ""; echo ""; /* */ echo ""; } echo "
<= __('Nom') ?> <= __('Détail') ?>
"; // Nom de l'entité (ou numéro de l'entité si nom vide, comme pour les emprunts par exemple...) $name = $entity->$name_field_name ? $entity->$name_field_name : "$entity_type_name #".$entity->id; echo $shift3.$this->Html->link(h($name), ['controller' => $controller_name, 'action' => 'view', h($entity->id)]); echo " <= $this->Html->link(__(''), ['controller' => $controller, 'action' => 'view', $entity->id], ['escape' => false, 'style' => 'margin:0']) ?>
"; } echo "
"; } // displaySectionShowHide() }