/////////////////////////////// // PREPARATION DES DONNEES /////////////////////////////////// // champs de saisie /////////////////////////////////// $newfield = new input(); $newfield->field = "code_menu"; $newfield->multiLang = false; $newfield->widthField = 3; $newfield->counter = "countType:'characters', maxCount:20, strictMax:true"; $newfield->label = $datas_lang["code"]; $newfield->add(); $newfield->rule("required", true); $newfield->rule("alphanumeric", true); $newfield->rule("maxlength", 20); $newfield->rule("remote", array("script" => DOS_AJAX_ADMIN . "ajax_checkNotExiste.php", "table" => $myTable, "valOrigin" => "FIELD:code_menu", "params" => ""), $datas_lang["existedeja"]); $newfield = new input(); $newfield->field = "titre"; $newfield->multiLang = true; $newfield->label = $datas_lang["titre"]; $newfield->add(); $newfield->rule("required", true); $newfield = new radio(); $newfield->field = "actif"; $newfield->defaultValue = 1; $newfield->multiLang = false; $newfield->label = $datas_lang["actif"]; $newfield->items = $datas_lang["ouiNon"]; $newfield->add(); $newfield->rule("required", true); include DOS_INCPAGES_ADMIN . "maj-prepare.php";
// chargement des données $formMaj->get_datas(); /////////////////////////////// // PREPARATION DES DONNEES /////////////////////////////////// // champs de saisie /////////////////////////////////// $newfield = new input(); $newfield->field = "parent"; $newfield->multiLang = false; $newfield->readonly = true; $newfield->counter = "countType:'characters', maxCount:50, strictMax:true"; $newfield->label = "Champ parent"; if ($forceTag != "") { $newfield->defaultValue = $forceTag; } else { $newfield->defaultValue = $filtres["F__parent"]; } $newfield->add(); $newfield->rule("required", true); $newfield->rule("alphanumeric", true); $newfield->rule("maxlength", 50); $newfield = new input(); $newfield->field = "titre"; $newfield->multiLang = true; $newfield->label = $datas_lang["titre"]; $newfield->add(); $newfield->rule("required", true); $newfield->rule("remote", array("script" => DOS_AJAX_ADMIN . "ajax_checkNotExiste.php", "table" => $myTable, "valOrigin" => "FIELD:titre", "params" => ""), $datas_lang["existedeja"]); //; include DOS_INCPAGES_ADMIN . "maj-prepare.php";
public function add($param = "") { global $myAdmin; global $formMaj; global $datas_lang; global $smarty; global $thisSite; parent::add(); if ($this->insideForm == false) { $this->fileRequired = true; $this->legendeEnabled = true; } if ($this->insideForm == true) { $prefixe_field = $this->field . "__"; $mySelect = new mySelect(__FILE__); $mySelect->tables = $thisSite->PREFIXE_TBL_GEN . "medias"; $mySelect->fields = "*"; $mySelect->orderby = "id DESC"; // pour prendre le premier élément $mySelect->where = "field_media=:field_media AND id_parent=:id_parent"; $mySelect->whereValue["field_media"] = array($this->field, PDO::PARAM_STR); //$formMaj->tables . "." . $id_parent = $formMaj->datasForm[$myAdmin->LANG_DATAS]["id"]; if ($id_parent == "") { $id_parent = $formMaj->datasForm[""]["id"]; } $mySelect->whereValue["id_parent"] = array($id_parent, PDO::PARAM_INT); $resultmySelect = $mySelect->query(); foreach ($resultmySelect as $rowS) { $lg = $rowS["lg"]; $value_titre_media[$lg] = $rowS["titre_media"]; $value_lien_destination[$lg] = $rowS["lien_destination"]; $value_cible_destination[$lg] = $rowS["cible_destination"]; if ($lg == $myAdmin->LANG_DEF) { // pour les données monolangue $value_idMedia = $rowS["id"]; $value_titre_media[""] = $rowS["titre_media"]; $value_lien_destination[""] = $rowS["lien_destination"]; $value_cible_destination[""] = $rowS["cible_destination"]; } } } else { $prefixe_field = ""; } // champ Titre: légende de l'image, du fichier ou du lien if ($this->legendeEnabled == true) { $newfield = new input(); $newfield->field = $prefixe_field . "titre_media"; $newfield->multiLang = true; $newfield->value = $value_titre_media; $newfield->label = $datas_lang["legende"]; $newfield->addClass = $this->addClass; $newfield->tooltip = $datas_lang["tooltipsLegende"]; $newfield->widthLabel = 2; $newfield->widthField = 9; $result = $newfield->add(); $field_titre_media = $result; } $newfield = new input(); $newfield->field = $prefixe_field . "lien_destination"; $newfield->multiLang = $this->multiLangType; $newfield->label = $datas_lang["lien"]; $newfield->widthLabel = 2; $newfield->widthField = 9; $newfield->value = $value_lien_destination; if ($this->placeholder != "") { $newfield->placeholder = $this->placeholder; } else { $newfield->placeholder = "http://, https:// ..."; } $result = $newfield->add(); $field_lien_destination = $result; if ($this->complete_url == true) { $newfield->rule("complete_url", true); } if ($this->fileRequired == true) { $newfield->rule("required", true); } $newfield = new radio(); $newfield->field = $prefixe_field . "cible_destination"; $newfield->multiLang = false; $newfield->value = $value_cible_destination; $newfield->defaultValue = "_blank"; $newfield->label = $datas_lang["cible"]; $newfield->items = $datas_lang["listeCible"]; $newfield->widthLabel = 2; $newfield->widthField = 9; $result = $newfield->add(); $field_cible_destination = $result; $smarty->assign('field_titre_media', $field_titre_media); $smarty->assign('field_lien_destination', $field_lien_destination); $smarty->assign('field_cible_destination', $field_cible_destination); if ($this->insideForm == true) { $newfield = new hidden(); $newfield->field = "fieldMedia__" . $this->field; $newfield->multiLang = false; $newfield->value = serialize(array("type" => $this->type, "field_media" => $this->field, "idMedia" => $value_idMedia)); $result = $newfield->add(); $smarty->assign('fieldMediaField', $result); } $smarty->assign('this', $this); $data = $smarty->fetch($this->pathTemplate . 'inc/fields/class.mediaLink.tpl'); if ($this->insideForm == true) { $this->smartAssign($this->field, $data); } else { $this->smartAssign("media", $data); } return $data; }
$newfield->field = "confirm_mdp"; $newfield->label = $datas_lang["modepasseconfirmation"]; $newfield->add(); $newfield->rule("equalTo", "'#mdp'"); $newfield = new input(); $newfield->field = "titre"; $newfield->multiLang = false; $newfield->label = $datas_lang["titre"]; $newfield->add(); $newfield->rule("required", true); $newfield = new input(); $newfield->field = "email"; $newfield->multiLang = false; $newfield->label = $datas_lang["email"]; $newfield->add(); $newfield->rule("email", true); $lprivileges = $datas_lang["list_privileges"]; $lprivileges = array(); while (list($c, $v) = each($datas_lang["list_privileges"])) { // on affiche que les privilege égale ou en dessous if ($c <= $myAdmin->PRIVILEGE) { $lprivileges[$c] = $v; } } $newfield = new select(); $newfield->field = "privilege"; $newfield->multiLang = false; $newfield->label = $datas_lang["privilege"]; $newfield->items = $lprivileges; $newfield->defaultValue = "0"; $newfield->add();
$newfield->multiLang = true; $newfield->label = $datas_lang["titre"]; $newfield->add(); $newfield->rule("required", true); $newfield = new input(); $newfield->field = "sous_titre"; $newfield->multiLang = true; $newfield->label = $datas_lang["sous_titre"]; $newfield->add(); $newfield = new input(); $newfield->field = "prix"; $newfield->multiLang = false; $newfield->label = "Prix"; $newfield->widthField = 2; $newfield->add(); $newfield->rule("digits", true); $newfield = new input(); $newfield->field = "duree"; $newfield->multiLang = false; $newfield->label = "Durée"; $newfield->widthField = 4; $newfield->add(); $newfield = new editor(); $newfield->field = "resume"; $newfield->label = "Résumé"; $newfield->multiLang = true; $newfield->height = 200; $newfield->startFolder = "itineraires"; $newfield->variablesAuthorized = true; $newfield->add(); $fieldMedia = new mediaImage();
if ($myAdmin->PRIVILEGE < 9) { $newfield->defaultValue = "pages.php"; } $newfield->add(); $newfield->rule("maxlength", 50); $newfield->rule("endsWith", "'.php'"); $newfield = new input(); $newfield->field = "page_tpl"; $newfield->multiLang = false; $newfield->label = $datas_lang["pageTpl"]; $newfield->widthField = 3; if ($myAdmin->PRIVILEGE < 9) { $newfield->defaultValue = "pages.tpl"; } $newfield->add(); $newfield->rule("maxlength", 50); $newfield->rule("endsWith", "'.tpl'"); $newfield = new radio(); $newfield->field = "page_parent"; $newfield->defaultValue = 0; $newfield->multiLang = false; $newfield->label = $datas_lang["pageParent"]; $newfield->items = $datas_lang["ouiNon"]; $newfield->tooltip = $datas_lang["tooltip_pageParent"]; $newfield->add(); $newfield = new radio(); $newfield->field = "show_sousmenu"; $newfield->defaultValue = 0; $newfield->multiLang = false; $newfield->label = $datas_lang["show_sousmenu"]; $newfield->items = $datas_lang["ouiNon"];
// PREPARATION DES DONNEES /////////////////////////////////// // champs de saisie /////////////////////////////////// $newfield = new input(); $newfield->field = "titre"; $newfield->multiLang = false; $newfield->label = $datas_lang["titre"]; $newfield->add(); $newfield->rule("required", true); $newfield = new input(); $newfield->field = "annonceur"; $newfield->multiLang = false; $newfield->label = $datas_lang["pubAnnonceur"]; $newfield->add(); $newfield->rule("required", true); $newfield->rule("alphanumeric", true); $newfield->rule("minlength", 5); $newfield->rule("maxlength", 20); $newfield = new radio(); $newfield->field = "actif"; $newfield->label = $datas_lang["actif"]; $newfield->items = $datas_lang["ouiNon"]; $newfield->defaultValue = "1"; $newfield->add(); $newfield = new periode(); $newfield->field = "periode"; $newfield->label = $datas_lang["periodeAffichage"]; $newfield->changeYear = false; $newfield->numberOfMonths = 1; $newfield->minDate = 0;
$newfield->field = "lien_destination"; $newfield->multiLang = true; $newfield->label = $datas_lang["lien"]; $newfield->placeholder = "http://, https:// ..."; $result = $newfield->add(); $newfield->rule("complete_url", true); $newfield = new radio(); $newfield->field = "cible_destination"; $newfield->multiLang = false; $newfield->defaultValue = "_blank"; $newfield->label = $datas_lang["cible"]; $newfield->items = $datas_lang["listeCible"]; $result = $newfield->add(); $newfield = new radio(); $newfield->field = "type_affichage"; $newfield->label = $datas_lang["pubTypeAffichage"]; $newfield->items = $datas_lang["pubTypes"]; $newfield->defaultValue = "N"; $newfield->add(); $newfield = new input(); $newfield->field = "couleur_fond"; $newfield->multiLang = false; $newfield->widthField = 3; $newfield->label = $datas_lang["pubCouleurFond"]; $newfield->placeholder = $datas_lang["pubCouleurFond_placeholder"]; $newfield->tooltip = $datas_lang["pubCouleurFond_tooltip"]; $result = $newfield->add(); $newfield->rule("alphanumeric", true); $newfield->rule("minlength", 6); $newfield->rule("maxlength", 6); include DOS_INCPAGES_ADMIN . "maj-prepare.php";
$newfield->defaultValue = "1"; $newfield->add(); $newfield = new input(); $newfield->field = "titre"; $newfield->multiLang = false; $newfield->label = "Nom, prénom"; $newfield->variablesAuthorized = true; $newfield->add(); $newfield->rule("required", true); $newfield = new input(); $newfield->field = "email"; $newfield->multiLang = false; $newfield->label = $datas_lang["email"]; $newfield->variablesAuthorized = true; $newfield->add(); $newfield->rule("required", true); $newfield->rule("email", true); $newfield = new password(); $newfield->field = "mdp"; $newfield->multiLang = false; $newfield->label = $datas_lang["motdepasse"]; $newfield->value = ""; $newfield->add(); if ($majInsert == 1) { $newfield->rule("required", true); } $newfield->rule("alphanumeric", true); $newfield->rule("minlength", 5); $newfield->rule("maxlength", 20); $newfield = new password(); $newfield->field = "confirm_mdp";