public function ConstruireElementModele() { $elem = NULL; // Consultation. $divConsult = new SBalise(BAL_DIV); $divConsult->AddClass(LISTE_JQ_ELEM_ETAGE); $elemConsult = $this->ConstruireElemConsultation(); if ($elemConsult !== NULL) { $divEtageConsult = new SBalise(BAL_DIV); $divEtageConsult->AddClass(LISTE_JQ_ELEM_ETAGE_NUM); $divEtageConsult->SetText('1'); $divConsult->Attach($divEtageConsult); $divConsult->Attach($elemConsult); } // Modification. $divModif = new SBalise(BAL_DIV); $divModif->AddClass(LISTE_JQ_ELEM_ETAGE); $elemModif = $this->ConstruireElemModification(); if ($elemModif !== NULL) { $divEtageModif = new SBalise(BAL_DIV); $divEtageModif->AddClass(LISTE_JQ_ELEM_ETAGE_NUM); $divEtageModif->SetText('2'); $divModif->Attach($divEtageModif); if ($this->chargementModifDiffere === true) { // Construction de la fonction de chargement du contenu de l'étage. $divChargePageFonc = new SBalise(BAL_DIV); $divChargePageFonc->AddClass(LISTE_JQ_ELEM_ETAGE_CHARGEFONC); $divChargePageFonc->SetText($this->foncAjaxRechargement); $divModif->Attach($divChargePageFonc); $divChargePageFonc->AddProp(PROP_STYLE, 'display:none'); // Construction des paramètres pour la fonction de chargement du contenu de l'étage. $divChargePageParam = new SBalise(BAL_DIV); $divChargePageParam->AddClass(LISTE_JQ_ELEM_ETAGE_CHARGEPARAM); $param = 'contexte=' . $this->contexte . '&' . $this->contexte . '[etage][' . $this->TypeSynchro() . '][' . $this->Numero() . '][2]'; $divChargePageParam->SetText(to_ajax($param)); $divModif->Attach($divChargePageParam); $divChargePageParam->AddProp(PROP_STYLE, 'display:none'); } $divModif->Attach($elemModif); } // Menu. $divMenu = new SBalise(BAL_DIV); $divMenu->AddClass(LISTE_JQ_ELEM_MENUS); $divMenu->AddProp(PROP_STYLE, 'display: none;'); $elemMenu = $this->ConstruireElemMenu(); if ($elemMenu !== NULL) { $divMenu->Attach($elemMenu); } if ($elemConsult !== NULL && $elemModif !== NULL) { $elem = new SElemOrg(2, 2, $this->prefixIdClass . LISTECLASS_ELEMENT . $this->Niveau(), true, false, false); $elem->AjouterClasse(LISTECLASS_ELEMENT . $this->Niveau()); $elem->AddClass(LISTE_JQ_ELEMENTMODELE); $elem->FusionnerCellule(1, 2, 1, 0); $elem->SetCelluleDominante(1, 1); $elem->AjouterPropCellule(1, 2, PROP_STYLE, 'display: none;'); $elem->AttacherCellule(1, 1, $divConsult); $elem->AttacherCellule(2, 1, $divModif); $elem->AttacherCellule(1, 2, $divMenu); } else { if ($elemConsult !== NULL) { $elem = new SElemOrg(1, 2, $this->prefixIdClass . LISTECLASS_ELEMENT . $this->Niveau(), true, false, false); $elem->AjouterClasse(LISTECLASS_ELEMENT . $this->Niveau()); $elem->AddClass(LISTE_JQ_ELEMENTMODELE); $elem->SetCelluleDominante(1, 1); $elem->AjouterPropCellule(1, 2, PROP_STYLE, 'display: none;'); $elem->AttacherCellule(1, 1, $divConsult); $elem->AttacherCellule(1, 2, $divMenu); } else { if ($elemModif !== NULL) { $elem = new SElemOrg(1, 2, $this->prefixIdClass . LISTECLASS_ELEMENT . $this->Niveau(), true, false, false); $elem->AjouterClasse(LISTECLASS_ELEMENT . $this->Niveau()); $elem->AddClass(LISTE_JQ_ELEMENTMODELE); $elem->SetCelluleDominante(1, 1); $elem->AjouterPropCellule(1, 2, PROP_STYLE, 'display: none;'); $elem->AttacherCellule(1, 1, $divModif); $elem->AttacherCellule(1, 2, $divMenu); } else { GLog::LeverException(EXS_0000, 'SListe::ConstruireElementModele, la liste de type [' . $this->TypeSynchro() . '] n\'a pas d\'élément modèle pour le contexte [' . $this->contexte . '].'); } } } if ($elem !== NULL) { $elem->AddProp(PROP_STYLE, 'visibility: hidden; height:0;'); } return $elem; }