public function BuildHTML() { if ($this->jsOnClick !== '') { $jsFoncStopEvent = new JsFonction(JS_STOPEVENEMENT_NAME, JS_STOPEVENEMENT_NBPARAMS); $jsFoncStopEvent->AddParamEvent(); $this->AddProp(PROP_ONCLICK, $this->jsOnClick . ';' . $jsFoncStopEvent->BuildJS()); } return parent::BuildHTML(); /*$HTML = parent::BuildHTML(); while(list($i, $sousMenu) = each($this->sousMenus)) { $HTML .= $sousMenu->BuildHTML(); } return $HTML;*/ }
public function AjouterElement($id, $libelle, $description = '') { if ($id != '' && $libelle != '') { $this->liste->AddLigne(); $cellule = $this->liste->AddCellule(); $cellule->AddProp(PROP_ID, $this->prefixIdClass . $this->prefixIdComp . SELECT_ELEMENT . $id); $cellule->AddProp(PROP_CLASS, $this->prefixIdClass . SELECT_ELEMENT); $jsFonc = new JsFonction(JS_INPUTSELECT_ONMOUSEDOWNELEMENT_NAME, 4); $jsFonc->AddParamThis(); $jsFonc->AddParamText($this->prefixIdClass . $this->prefixIdComp . SELECT_LISTE); $jsFonc->AddParamText($this->prefixIdClass . SELECT_VALEUREDIT); $jsFonc->AddParamText($this->prefixIdClass . $this->prefixIdComp . SELECT_INFO); $cellule->AddProp(PROP_ONMOUSEDOWN, $jsFonc->BuildJS()); $jsFonc = new JsFonction(JS_INPUTSELECT_ONMOUSEUPELEMENT_NAME, 4); $jsFonc->AddParamThis(); $jsFonc->AddParamText($this->prefixIdClass . $this->prefixIdComp . SELECT_LISTE); $jsFonc->AddParamText($this->prefixIdClass . SELECT_VALEUREDIT); $jsFonc->AddParamText($this->prefixIdClass . $this->prefixIdComp . SELECT_INFO); $cellule->AddProp(PROP_ONMOUSEUP, $jsFonc->BuildJS()); $jsFonc = new JsFonction(JS_INPUTSELECT_ONMOUSEOVERELEMENT_NAME, 5); $jsFonc->AddParamThis(); $jsFonc->AddParamEvent(); $jsFonc->AddParamText($this->prefixIdClass . $this->prefixIdComp . SELECT_LISTE); $jsFonc->AddParamText($this->prefixIdClass . SELECT_VALEUREDIT); $jsFonc->AddParamText($this->prefixIdClass . $this->prefixIdComp . SELECT_INFO); $cellule->AddProp(PROP_ONMOUSEOVER, $jsFonc->BuildJS()); $jsFonc = new JsFonction(JS_INPUTSELECT_ONMOUSEOUTELEMENT_NAME, 5); $jsFonc->AddParamThis(); $jsFonc->AddParamEvent(); $jsFonc->AddParamText($this->prefixIdClass . $this->prefixIdComp . SELECT_LISTE); $jsFonc->AddParamText($this->prefixIdClass . SELECT_VALEUREDIT); $jsFonc->AddParamText($this->prefixIdClass . $this->prefixIdComp . SELECT_INFO); $cellule->AddProp(PROP_ONMOUSEOUT, $jsFonc->BuildJS()); $divId = new SBalise(BAL_DIV); $divId->AddProp(PROP_CLASS, SELECT_ID); $divId->AddProp(PROP_STYLE, 'display: none'); $divId->SetText($id); $cellule->Attach($divId); $divLibelle = new SBalise(BAL_DIV); $divLibelle->AddProp(PROP_CLASS, SELECT_LIBELLE); $divLibelle->SetText($libelle); $cellule->Attach($divLibelle); if ($description !== '') { $divDescription = new SBalise(BAL_DIV); $divDescription->AddProp(PROP_CLASS, SELECT_DESCRIPTION); $divDescription->AddProp(PROP_STYLE, 'display: none'); $divDescription->SetText($description); $cellule->Attach($divDescription); } } }
$js->AddScript(JS_INPUTIMAGE_FILE); $js->AddScript(JS_INPUTCOLOR_FILE); $js->AddScript(JS_VISUALISEUR_FILE); $js->AddScript(JS_POPDIV_FILE); $js->AddScript(JS_INPUTBUTTON_FILE); $js->AddScript(JS_CLASSEUR); $js->AddScript(JS_INPUTLISTE_FILE); $js->AddScript(JS_INPUTLISTEDOUBLE_FILE); $js->AddScript(JS_LISTE); $js->AddScript(JS_CSS_FILE); $js->AddScript(JS_GLOBALTIMER_FILE); $js->AddScript(AJAX); $head->Attach($titre); $head->Attach($metaUTF8); $head->Attach($metaCss); $head->Attach($metaIE8); //$head->Attach($metaNoCache1); //$head->Attach($metaNoCache2); $head->Attach($css); $head->Attach($js); // Appel de la fonction Ajax de chargement de la balise body. $jsFonc = new JsFonction('ChargerOrganisation', 0); $jsBal = new SBalise(BAL_SCRIPT); $jsBal->AddProp(PROP_TYPE, 'text/javascript'); $jsBal->SetText($jsFonc->BuildJS() . ';'); $div = new SBalise(BAL_DIV); $div->AddProp(PROP_ID, 'main'); $body->Attach($div); $body->Attach($jsBal); // Traduction des objets en balises HTML. echo $html->BuildHTML();