当前位置: 首页>>代码示例>>PHP>>正文


PHP input::add方法代码示例

本文整理汇总了PHP中input::add方法的典型用法代码示例。如果您正苦于以下问题:PHP input::add方法的具体用法?PHP input::add怎么用?PHP input::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在input的用法示例。


在下文中一共展示了input::add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: add

 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_fichier_media[$lg] = $rowS["fichier_media"];
             $value_titre_media[$lg] = $rowS["titre_media"];
             if ($lg == $myAdmin->LANG_DEF) {
                 // pour les données monolangue
                 $value_idMedia = $rowS["id"];
                 $value_fichier_media[""] = $rowS["fichier_media"];
                 $value_titre_media[""] = $rowS["titre_media"];
             }
         }
     } else {
         $prefixe_field = "";
     }
     $newfield = new file();
     $newfield->field = $prefixe_field . "fichier_media";
     $newfield->multiLang = $this->multiLangType;
     if ($this->insideForm == true) {
         $newfield->label = $this->label;
     } else {
         $newfield->label = $datas_lang["fichier_media"];
     }
     $newfield->value = $value_fichier_media;
     $newfield->startFolder = $this->startFolder;
     $newfield->tooltip = $this->tooltip;
     $newfield->addClass = $this->addClass;
     $newfield->extensionsAuthorized = "";
     if ($this->extensionsAuthorized != "") {
         $newfield->extensionsAuthorized = $this->extensionsAuthorized;
     }
     $newfield->multi = $this->multi;
     $newfield->upload = $this->upload;
     $newfield->uploadDirect = $this->uploadDirect;
     $newfield->widthLabel = 2;
     $newfield->widthField = 9;
     $newfield->placeholder = $this->placeholder;
     $result = $newfield->add();
     $field_fichier_media = $result;
     if ($this->fileRequired == true) {
         $newfield->rule("required", true);
     }
     // 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->tooltip = $datas_lang["tooltipsLegende"];
         $newfield->widthLabel = 2;
         $newfield->widthField = 9;
         $result = $newfield->add();
         $field_titre_media = $result;
     }
     $smarty->assign('field_fichier_media', $field_fichier_media);
     $smarty->assign('field_titre_media', $field_titre_media);
     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.mediaFile.tpl');
     if ($this->insideForm == true) {
         $this->smartAssign($this->field, $data);
     } else {
         $this->smartAssign("media", $data);
     }
     return $data;
//.........这里部分代码省略.........
开发者ID:wedesign-pf,项目名称:Tit,代码行数:101,代码来源:class.mediaFile.php

示例2: hidden

$formMaj->multiLang = true;
$formMaj->clause_where();
// si validation du formulaire
if ($__POST["actionForm"] != "") {
    $formMaj->set_datas();
}
$newfield = new hidden();
$newfield->field = "id_parent";
$newfield->multiLang = false;
$newfield->defaultValue = $idParent;
$newfield->add();
$newfield = new input();
$newfield->field = "titre";
$newfield->multiLang = true;
$newfield->label = "Titre (si différent du type)";
$newfield->add();
// on charge tout les types de texte
$obj_article = new article("type_texte_itineraire");
$obj_article->fields = "id,titre";
$result = $obj_article->query();
$tab_type_texte_itineraire = array();
foreach ($result as $row) {
    $tab_type_texte_itineraire[$row["id"]] = $row["titre"];
}
// on charge les types de texte utilisés
$mySelect = new mySelect(__FILE__);
$mySelect->tables = $myTable;
$mySelect->fields = "type_texte";
$mySelect->where = "actif=1 AND lg='fr' and id_parent=" . $idParent;
$result = $mySelect->query();
$tab_type_texte = array();
开发者ID:wedesign-pf,项目名称:Tit,代码行数:31,代码来源:itineraire-texte.php

示例3: radio

$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";
开发者ID:wedesign-pf,项目名称:Tit,代码行数:31,代码来源:bandeaux-maj.php


注:本文中的input::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。