Subversion Repositories Applications.projet

Compare Revisions

Ignore whitespace Rev 248 → Rev 249

/trunk/classes/HTML_formulaireCouperColler.class.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: HTML_formulaireCouperColler.class.php,v 1.2 2005-09-27 16:39:25 alexandre_tb Exp $
// CVS : $Id: HTML_formulaireCouperColler.class.php,v 1.3 2007-06-25 12:15:06 alexandre_tb Exp $
/**
* Application projet
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
*@version $Revision: 1.3 $
// +------------------------------------------------------------------------------------------------------+
*/
 
39,6 → 39,8
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
require_once 'HTML/QuickForm.php' ;
 
/**
* class HTML_formulaireCouperColler
*
58,18 → 60,13
$squelette->setElementTemplate( '<li style="list-style-type: none;">'."\n".'{element}'."\n".'</li>'."\n");
$this->addElement('radio', 'projet_repertoire', '', PROJET_RACINE, 0) ;
if (count ($tableau_repertoire)) {
$this->addElement('html', '<ul>') ;
foreach ($tableau_repertoire as $cle => $valeur) {
if ($valeur->_id_pere ==0) {
$this->addElement ('radio', 'projet_repertoire', '', $valeur->getNomLong(), $valeur->getIdDocument()) ;
$sous_tableau = array() ;
foreach ($tableau_repertoire as $valeur_fils) {
if ($valeur_fils->_id_pere == $valeur->getIdDocument()) {
array_push ($sous_tableau, $valeur_fils) ;
}
}
if (count ($sous_tableau)) $this->construitLigneRepertoire($sous_tableau) ;
foreach ($tableau_repertoire as $valeur) {
if ($valeur['id_pere'] ==0) {
$this->addElement ('radio', 'projet_repertoire', '', $valeur['label'], $valeur['id']) ;
if (count ($valeur['fils'])) $this->construireArbreRadio ($valeur['fils']);
}
}
$this->addElement('html', '</ul>') ;
82,13 → 79,20
$buttons[] = &HTML_QuickForm::createElement('link', 'annuler', '',
preg_replace ("/&amp;/", "&", $url_annuler->getURL()), PROJET_FICHIER_ANNULER
); // Le preg_replace contourne un pb de QuickForm et Net_URL
// qui remplacent deux fois les & par des &amp;
// ce qui fait échouer le lien
// qui remplacent deux fois les & par des &amp;
// ce qui fait échouer le lien
$buttons[] = &HTML_QuickForm::createElement('submit', 'valider_inscription_projet', PROJET_FICHIER_VALIDER);
$this->addGroup($buttons, null, null, '&nbsp;');
} // end of member function construitFormulaire
 
 
function construireArbreRadio(&$noeud) {
foreach ($noeud as $val) {
$this->addElement('html', '<ul>') ;
$this->construitLigneRepertoire($val) ;
if (count($val['fils'])) $this->construireArbreRadio ($val['fils']) ;
$this->addElement('html', '</ul>') ;
}
}
/**
*
*
96,11 → 100,9
*
*/
function construitLigneRepertoire($tableau) {
function construitLigneRepertoire($noeud) {
$this->addElement('html', '<ul>') ;
foreach ($tableau as $valeur) {
$this->addElement('radio', 'projet_repertoire', '', $valeur->getNomLong(), $valeur->getIdDocument()) ;
}
$this->addElement('radio', 'projet_repertoire', '', $noeud['label'], $noeud['id']) ;
$this->addElement('html', '</ul>') ;
}
/**
127,6 → 129,6
$res .= '<h2>'.PROJET_CHOISISSEZ_REPERTOIRE.'</h2>' ;
$res .= HTML_QuickForm::toHTML() ;
return $res ;
} // end of member function toHTML
} // end of HTML_formulaireCouperColler
}
}
?>