public function __construct($prefixIdClass, $typeInput = INPUTFILE_TYPE_IMAGE, $oblig = false, $retour = '', $chemin = '', $id = '', $info = '', $erreur = '', $type = '', $contexte = '', $niveau = '') { parent::__construct(2, 1, '', true); GSession::PoidsJavascript(1); if ($typeInput === '') { $typeInput = INPUTFILE_TYPE_IMAGE; } switch ($typeInput) { case INPUTFILE_TYPE_LISTEIMAGE: $this->AddClass(LISTEINPUTIMAGE_JQ); break; default: $this->AddClass(INPUTIMAGE_JQ); } $elemImage = new SElement($prefixIdClass . INPUTIMAGE_IMAGE . $niveau); $elemImage->AjouterClasse(INPUTIMAGE_IMAGE . $niveau); $image = new SImage(''); $image->AddClass(INPUTIMAGE_JQ_IMAGE); $elemImage->Attach($image); $this->AttacherCellule(1, 1, $elemImage); $elemFile = new SElement($prefixIdClass . INPUTIMAGE_FILE . $niveau); //, true, '', '', false); $elemFile->AjouterClasse(INPUTIMAGE_FILE . $niveau); $this->inputFile = new SInputFile($prefixIdClass, $typeInput, $oblig, $retour, $chemin, REF_FICHIERSEXTENSIONS_IMAGES, $id, $info, $erreur, $type, $contexte, $niveau); $this->inputFile->AddClass(INPUTIMAGE_JQ_FILE); $elemFile->Attach($this->inputFile); $this->AttacherCellule(2, 1, $elemFile); }
public function __construct($prefixIdClass, $typeInput = '', $oblig = false, $niveau = '') { parent::__construct(BAL_DIV); GSession::PoidsJavascript(1); switch ($typeInput) { default: if ($typeInput === '') { $typeInput = INPUTNEW_TYPE_SELECT; } break; } $this->prefixIdClass = $prefixIdClass; $this->niveau = $niveau; $this->AddClass(INPUTNEW_JQ); $this->AddClass('jq_fill'); if ($oblig == true) { $this->AddClass('jq_input_form_oblig'); } $elem = new SElement($this->prefixIdClass . INPUTNEW . $this->niveau); $elem->AjouterClasse(INPUTNEW . $this->niveau); $this->Attach($elem); $org = new SOrganiseur(1, 2); $elem->Attach($org); // Input. if ($typeInput == INPUTNEW_TYPE_SELECT && $this->select != NULL) { $org->AttacherCellule(1, 1, $this->select); } else { if ($typeInput == INPUTNEW_TYPE_TEXT && $this->text != NULL) { $org->AttacherCellule(1, 1, $this->text); } } $this->newTab = new STableau(true); $this->newTab->AddClass('jq_fill'); $org->AttacherCellule(1, 2, $this->newTab); }
public function __construct($prefixIdClass, $type = '', $oblig = false, $retour = '', $valeurParDefaut = '', $longueurMin = -1, $longueurMax = -1, $taille = -1, $tailleAuto = false, $unite = '', $info = '', $erreur = '', $formatValide = '', $min = NULL, $max = NULL, $niveau = '') { parent::__construct(BAL_DIV); GSession::PoidsJavascript(2); $this->AddClass('jq_fill'); if ($oblig == true) { $this->AddClass('jq_input_form_oblig'); } if ($tailleAuto === true) { $this->AddClass(INPUTTEXT_JQ_AUTOWIDTH); } $this->prefixIdClass = $prefixIdClass; switch ($type) { case INPUTTEXT_TYPE_NEW: $this->AddClass(INPUTNEWTEXT_JQ); break; case INPUTTEXT_TYPE_LISTE: $this->AddClass(LISTEINPUTTEXT_JQ); break; default: $this->AddClass(INPUTTEXT_JQ); } $elem = new SElement($this->prefixIdClass . INPUTTEXT . $niveau); $elem->AjouterClasse(INPUTTEXT . $niveau); $elem->AddClass(INPUTTEXT_JQ_EDIT); if ($type === INPUTTEXT_TYPE_PASSWORD) { $edit = new SInput('', 'password', '', $this->prefixIdClass . INPUTTEXT_VALEUREDIT); } else { if ($longueurMax === NULL && $formatValide !== INPUTTEXT_REGEXP_DECIMAL_FV) { $edit = new SText($this->prefixIdClass . INPUTTEXT_VALEUREDIT . $niveau, $valeurParDefaut); } else { $edit = new SInput('', 'text', '', $this->prefixIdClass . INPUTTEXT_VALEUREDIT . $niveau); } } $edit->AddClass(INPUTTEXT_VALEUREDIT . $niveau); $edit->AddClass(INPUTTEXT_JQ_EDITVAL); if ($valeurParDefaut !== '') { $edit->AddProp(PROP_VALUE, $valeurParDefaut); } else { $edit->AddProp(PROP_VALUE, '- null -'); } if ($longueurMax !== NULL && $longueurMax > 0) { $edit->AddProp(PROP_MAXLENGTH, $longueurMax); } if ($taille !== NULL && $taille > 0) { if ($longueurMax === NULL && $formatValide !== INPUTTEXT_REGEXP_DECIMAL_FV) { $edit->AddProp(PROP_ROWS, $taille); } else { $edit->AddProp(PROP_SIZE, $taille); } } else { if ($tailleAuto === true && $taille <= 0) { $edit->AddProp(PROP_SIZE, '1'); } } $org = NULL; if ($unite !== '') { $org = new SOrganiseur(1, 2); $org->AttacherCellule(1, 1, $edit); if ($taille === -1) { $org->SetCelluleDominante(1, 1); } $org->SetTexteCellule(1, 2, strval($unite)); } else { $org = $edit; } $elem->Attach($org); $this->Attach($elem); // Format valide et caractères valides (min et max quand nécessaires). switch ($formatValide) { case INPUTTEXT_REGEXP_EMAIL_FV: $caracteresValides = INPUTTEXT_REGEXP_EMAIL_CV; break; case INPUTTEXT_REGEXP_DECIMAL_FV: $caracteresValides = INPUTTEXT_REGEXP_DECIMAL_CV; $this->AddClass(INPUTTEXT_JQ_DECIMAL); if ($min !== NULL) { $divMin = new SBalise(BAL_DIV); $divMin->SetText(strval($min)); $divMin->AddClass(INPUTTEXT_JQ_MIN); $divMin->AddStyle('display:none;'); $this->Attach($divMin); } if ($max !== NULL) { $divMax = new SBalise(BAL_DIV); $divMax->SetText(strval($max)); $divMax->AddClass(INPUTTEXT_JQ_MAX); $divMax->AddStyle('display:none;'); $this->Attach($divMax); } break; case INPUTTEXT_REGEXP_TOUT_FV: default: $formatValide = INPUTTEXT_REGEXP_TOUT_FV; $caracteresValides = INPUTTEXT_REGEXP_TOUT_CV; if ($longueurMin === NULL) { $longueurMin = ''; } else { if ($longueurMin <= 0) { $longueurMin = 1; } } if ($longueurMax === NULL) { $longueurMax = ''; } else { if ($longueurMax <= 0) { $longueurMax = 1; } } $formatValide = str_replace('min', strval($longueurMin), $formatValide); $formatValide = str_replace('max', strval($longueurMax), $formatValide); break; } $divFV = new SBalise(BAL_DIV); $divFV->SetText(strval($formatValide)); $divFV->AddClass(INPUTTEXT_JQ_FV); $divFV->AddStyle('display:none;'); $this->Attach($divFV); if ($caracteresValides !== '') { $divCA = new SBalise(BAL_DIV); $divCA->SetText(strval($caracteresValides)); $divCA->AddClass(INPUTTEXT_JQ_CV); $divCA->AddStyle('display:none;'); $this->Attach($divCA); } // Retour. if ($retour !== '') { $divRetour = new SBalise(BAL_DIV); $divRetour->SetText(strval($retour)); $divRetour->AddClass(INPUTTEXT_JQ_RETOUR); $divRetour->AddStyle('display:none;'); $this->Attach($divRetour); } // Info. if ($info !== '') { $divInfo = new SBalise(BAL_DIV); $elemInfo = new SElement(CLASSCADRE_INFO, false); $elemInfo->SetText($info); $divInfo->AddClass(INPUTTEXT_JQ_INFO); $divInfo->Attach($elemInfo); $divInfo->AddStyle('display:none;'); $this->Attach($divInfo); } // Erreur. if ($erreur !== '') { $divErreur = new SBalise(BAL_DIV); $elemErreur = new SElement(CLASSCADRE_ERREUR, false); $elemErreur->SetText($erreur); $divErreur->AddClass(INPUTTEXT_JQ_ERREUR); $divErreur->Attach($elemErreur); $divErreur->AddStyle('display:none;'); $this->Attach($divErreur); } }
public function AjouterElement($id, $libelle, $description = '', $valParDefaut = false, $elementFiltre = true) { //if ($id != '' && $libelle != '') //{ GSession::PoidsJavascript(1); $this->nbElemCurCat++; $this->liste->AddLigne(); $cellule = $this->liste->AddCellule(); $cellule->AddClass(INPUTSELECT_JQ_ELEMENT); if ($valParDefaut === true) { $cellule->AddClass(INPUTSELECT_JQ_ELEMENT_DEFAUT); } $divId = new SBalise(BAL_DIV); $divId->AddProp(PROP_CLASS, INPUTSELECT_JQ_ELEMENT_ID); $divId->SetText(strval($id)); $cellule->Attach($divId); $elemLibelle = new SElement($this->prefixIdClass . INPUTSELECT_ELEMENT . $this->niveau); $elemLibelle->AjouterClasse(INPUTSELECT_ELEMENT . $this->niveau); $elemLibelle->AddClass(INPUTSELECT_JQ_ELEMENT_LIBELLE); if ($elementFiltre !== true) { $elemLibelle->AddClass(INPUTSELECT_JQ_ELEMENT_NONFILTRE); } $elemLibelle->SetText($libelle); $cellule->Attach($elemLibelle); if ($description !== NULL && $description !== '') { $divDescription = new SBalise(BAL_DIV); $divDescription->AddProp(PROP_CLASS, INPUTSELECT_JQ_ELEMENT_DESCRIPTION); if (is_string($description)) { $divDescription->SetText($description); } else { $divDescription->Attach($description); } $cellule->Attach($divDescription); } if ($this->currentCategorie != NULL) { $divCategorie = new SBalise(BAL_DIV); $divCategorie->AddProp(PROP_CLASS, INPUTSELECT_JQ_ELEMENT_CATEGORIE); $divCategorie->SetText(strval($this->currentCategorie)); $divCategorie->AddStyle('display:none;'); $cellule->Attach($divCategorie); } //} }
public function __construct($prefixIdClass, $typeInput, $libelle, $libelleOnClick = '', $cadre = '', $fonction = '', $ajax = false, $reset = false, $niveau = '') { parent::__construct(true); GSession::PoidsJavascript(4); $this->AddLigne(); switch ($typeInput) { case INPUTBUTTONTYPE_GAUCHE: $cellule = $this->AddCellule(); $cell = $this->AddCellule(); $cell->AddProp(PROP_STYLE, 'width: 100%'); break; case INPUTBUTTONTYPE_DROIT: $cell = $this->AddCellule(); $cell->AddProp(PROP_STYLE, 'width: 100%'); $cellule = $this->AddCellule(); break; case INPUTBUTTONTYPE_REMPLI: $cellule = $this->AddCellule(); $cellule->AddProp(PROP_STYLE, 'width: 100%'); break; case INPUTBUTTONTYPE_MILIEU: default: $cell = $this->AddCellule(); $cell->AddProp(PROP_STYLE, 'width: 50%'); $cellule = $this->AddCellule(); $cell = $this->AddCellule(); $cell->AddProp(PROP_STYLE, 'width: 50%'); break; } $this->bouton = new SBalise(BAL_DIV); $cellule->Attach($this->bouton); $this->prefixIdClass = $prefixIdClass; $this->bouton->AddClass(INPUTBUTTON_JQ); $this->ajax = $ajax; if ($ajax == true) { $this->bouton->AddClass(INPUTBUTTON_JQ_AJAX); } if ($reset == true) { $this->bouton->AddClass(INPUTBUTTON_JQ_RESET); } $this->retour = new SBalise(BAL_DIV); $this->retour->AddClass(INPUTBUTTON_JQ_PARAM); $this->retour->SetText(''); $this->bouton->Attach($this->retour); if ($libelleOnClick !== '') { $div = new SBalise(BAL_DIV); $div->AddClass(INPUTBUTTON_JQ_VALONCLICK); $div->SetText($libelleOnClick); $this->bouton->Attach($div); } if ($cadre !== '') { $div = new SBalise(BAL_DIV); $div->AddClass(INPUTBUTTON_JQ_CADRE); $div->SetText($cadre); $this->bouton->Attach($div); } if ($fonction !== '') { $div = new SBalise(BAL_DIV); $div->AddClass(INPUTBUTTON_JQ_FONCTION); $div->SetText($fonction); $this->bouton->Attach($div); } $element = new SElement($this->prefixIdClass . INPUTBUTTON . $niveau, false); $element->AjouterClasse(INPUTBUTTON . $niveau); $element->AddClass(INPUTBUTTON_JQ_BOUTON); $element->SetText($libelle); $this->bouton->Attach($element); }
public function BuildHTML() { if ($this->chargement === true) { $contexteCourant = GContexte::ContexteCourant(); // Rétablissement du contexte de fabrication de la liste (pour le chargement des référentiels notamment). GContexte::ContexteCourant($this->contexte); GSession::PoidsJavascript(15); $this->listeContexte = array(); $this->listeSuppressions = NULL; $this->ConstruireListe(); if ($this->nomFichierPresMod !== '') { $this->AppliquerStyleToBaliseListe($this); } if ($this->statique !== true) { GContexte::ListeActive($this->contexte, $this->TypeSynchroPage()); } return parent::BuildHTML(); GContexte::ContexteCourant($contexteCourant); } return ''; }
protected function ConstruireListe() { $this->AjouterClasse($this->prefixIdClass . LISTECLASS . $this->Niveau(), false); $this->AjouterClasse(LISTECLASS . $this->Niveau()); $this->AddClass(LISTE_JQ); /*// Construction de la fonction appelée en cas de changement de page. $divChangePageFonc = new SBalise(BAL_DIV); $divChangePageFonc->AddClass(LISTE_JQ_PAGE_CHANGEFONC); $divChangePageFonc->SetText($this->foncAjaxRechargement); $divChangePageFonc->AddProp(PROP_STYLE, 'display:none'); $this->Attach($divChangePageFonc); // Construction des paramètres pour la fonction appelée en cas de changement de page. $divChangePageParam = new SBalise(BAL_DIV); $divChangePageParam->AddClass(LISTE_JQ_PAGE_CHANGEPARAM); $param = 'contexte='.$this->contexte.'&'.$this->contexte.'[page]['.$this->TypeSynchro().']['.$this->Numero().']'; $divChangePageParam->SetText(to_html($param)); $divChangePageParam->AddProp(PROP_STYLE, 'display:none'); $this->Attach($divChangePageParam);*/ // Construction du type de synchronisation de la liste (utilisé pour recharger une liste via ajax). $divTypeSynchro = new SBalise(BAL_DIV); $divTypeSynchro->AddClass(LISTE_JQ_TYPESYNCHRO); $divTypeSynchro->SetText($this->TypeSynchroPage()); $divTypeSynchro->AddProp(PROP_STYLE, 'display:none'); $this->Attach($divTypeSynchro); // Construction du numéro de la liste (utilisé pour recharger une liste unique via ajax). $divNumero = new SBalise(BAL_DIV); $divNumero->AddClass(LISTE_JQ_NUMERO); $divNumero->SetText(strval($this->Numero())); $divNumero->AddProp(PROP_STYLE, 'display:none'); $this->Attach($divNumero); // Construction du niveau de la liste (utilisé pour savoir si la liste est contenu dans une autre). $divNiveau = new SBalise(BAL_DIV); $divNiveau->AddClass(LISTE_JQ_NIVEAU); $divNiveau->SetText(strval($this->Niveau())); $divNiveau->AddProp(PROP_STYLE, 'display:none'); $this->Attach($divNiveau); // Construction de la ligne de titre. $ligneTitre = $this->ConstruireLigneTitre(); if ($ligneTitre !== NULL) { $this->Attach($ligneTitre); } // Construction d'une ligne de changement de page. $changePage = $this->ConstruireChangementPage(); if ($changePage !== NULL) { $this->Attach($changePage); } $divElem = new SBalise(BAL_DIV); $divElem->AddClass(LISTE_JQ_LISTE); $this->Attach($divElem); // Construction des éléments de la liste. $poidsJavascriptMax = GSession::PoidsJavascriptMax(); $noSupp = false; $id = 0; foreach ($this->elements as &$element) { $element[LISTE_ELEMENT_ID] = strval($id); $elem = $this->ConstruireElement($element); GSession::PoidsJavascript(1); $divElem->Attach($elem); $id++; } }
public function __construct($prefixIdClass, $typeInput = '', $oblig = false, $retour = '', $chemin = '', $extensions = '', $id = '', $info = '', $erreur = '', $type = '', $contexte = '', $niveau = '') { parent::__construct(BAL_DIV); GSession::PoidsJavascript(1); $this->select == NULL; $this->prefixIdClass = $prefixIdClass; $this->niveau = $niveau; if ($typeInput === INPUTFILE_TYPE_LISTEFICHIER) { $this->AddClass(LISTEINPUTFILE_JQ); } else { if ($typeInput === '' || $typeInput === INPUTFILE_TYPE_FICHIER) { $this->AddClass(INPUTFILE_JQ); } } $this->AddClass('jq_fill'); if ($oblig == true) { $this->AddClass('jq_input_form_oblig'); } $elem = new SElement($this->prefixIdClass . INPUTFILE . $this->niveau, true, '', '', false); $elem->AjouterClasse(INPUTFILE . $this->niveau); $this->Attach($elem); $org = new SOrganiseur(1, 2, true); $org->SetCelluleDominante(1, 1); $elem->Attach($org); // Select. $rechargeFonc = ''; $rechargeParam = ''; if ($contexte !== '') { $rechargeFonc = AJAXFONC_CHARGERREFERENTIELCONTEXTE; $rechargeParam = to_html('contexte=' . $contexte); } $this->select = new SInputSelect($this->prefixIdClass, INPUTSELECT_TYPE_FICHIER, $oblig, $retour, $info, $erreur, $type, '', '', $rechargeFonc, $rechargeParam, '', '', $niveau); $org->AttacherCellule(1, 1, $this->select); // InputFile. $action = ''; switch ($type) { default: if ($type === '') { $type = INPUTFILE_TYPE_FICHIER; } $action = PATH_SERVER_HTTP . 'fonctions/General/fUploadFichier.php'; } // - Input. $div = new SBalise(BAL_DIV); $div->AddClass(INPUTFILE_JQ_NEWINPUT); $div->AddProp(PROP_STYLE, 'overflow:hidden;'); $form = new SBalise(BAL_FORM); $form->AddProp(PROP_ACTION, $action); $form->AddProp(PROP_METHOD, 'post'); $form->AddProp(PROP_ENCTYPE, 'multipart/form-data'); //$form->AddStyle('display:none;'); $div->Attach($form); $rand = mt_rand(); $file = new SInput('', 'file', '', ''); $file->AddProp(PROP_NAME, 'fichierUp' . $rand); $file->AddStyle('display:none;'); $form->Attach($file); $fileType = new SInput('', 'hidden', '', ''); $fileType->AddProp(PROP_NAME, 'type' . $rand); $fileType->AddProp(PROP_VALUE, $type); $form->Attach($fileType); $fileId = new SInput('', 'hidden', '', ''); $fileId->AddProp(PROP_NAME, 'id' . $rand); $fileId->AddProp(PROP_VALUE, $id); $form->Attach($fileId); /*$fileFrame = new SInput('', 'hidden', '', ''); $fileFrame->AddClass(INPUTFILE_JQ_IFRAMEINPUT); $fileFrame->AddProp(PROP_NAME, 'iframe'.$rand); $form->Attach($fileFrame);*/ $org->AttacherCellule(1, 2, $div); // - Declencheur. //$element = new SElement($this->prefixIdClass.INPUTFILE_NEWDECLENCHEUR.$this->niveau, false); //$element->AjouterClasse(INPUTFILE_NEWDECLENCHEUR.$this->niveau); $element = new SElement($this->prefixIdClass . INPUTNEW_DECLENCHEUR . $this->niveau, false); $element->AjouterClasse(INPUTNEW_DECLENCHEUR . $this->niveau); $element->AddClass(INPUTFILE_JQ_NEWDECLENCHEUR); $org->AttacherCellule(1, 2, $element); //if ($chemin !== '') // $this->GetNomsFichiers($chemin); }