本文整理汇总了PHP中file::rule方法的典型用法代码示例。如果您正苦于以下问题:PHP file::rule方法的具体用法?PHP file::rule怎么用?PHP file::rule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类file
的用法示例。
在下文中一共展示了file::rule方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: count
$smarty->assign("cptLus", $cpt - $cpt_entete);
$smarty->assign("cptAvertissements", count($msgAvertissements));
$smarty->assign("cptErreurs", count($msgErreurs));
$smarty->assign("cptMaj", $cptMaj);
$smarty->assign("msgAvertissements", $msgAvertissements);
$smarty->assign("msgErreurs", $msgErreurs);
$smarty->assign("msgMaj", $msgMaj);
}
$fieldMedia = new file();
$fieldMedia->field = "fichier";
$fieldMedia->label = $datas_lang["fichier"];
$fieldMedia->multiLangType = false;
$fieldMedia->browse = false;
$fieldMedia->upload = false;
$fieldMedia->add();
$fieldMedia->rule("required", true);
$newfield = new radio();
$newfield->field = "majok";
$newfield->label = $datas_lang["majBdD"];
$newfield->items = $datas_lang["ouiNon"];
$newfield->defaultValue = "0";
$newfield->add();
$obj_article = new article("type_produit");
$obj_article->fields = "id,titre";
$result = $obj_article->query();
$tab_type_produit = array();
foreach ($result as $row) {
$tab_type_produit[$row["id"]] = $row["titre"];
}
$newfield = new select();
$newfield->field = "type";
示例2: 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;
//.........这里部分代码省略.........
示例3: file
$newfield->items = $listCampagnes;
//$newfield->noneItem=true;
$newfield->defaultValue = $filtres["F__id_campagne"];
$newfield->add();
$newfield = new file();
$newfield->field = "image_bandeau";
$newfield->multiLang = true;
$newfield->startFolder = "pub";
$newfield->upload = true;
$newfield->disabled = false;
$newfield->browse = true;
$newfield->extensionsAuthorized = "images";
$newfield->variablesAuthorized = true;
$newfield->addClass = "pub";
$newfield->add();
$newfield->rule("required", true);
$newfield = new textarea();
$newfield->field = "script_bandeau";
$newfield->multiLang = true;
$newfield->rows = 10;
$newfield->addClass = "pub";
$newfield->add();
$newfield = new input();
$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";