本文整理汇总了PHP中file::add方法的典型用法代码示例。如果您正苦于以下问题:PHP file::add方法的具体用法?PHP file::add怎么用?PHP file::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类file
的用法示例。
在下文中一共展示了file::add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: file
$newfield->field = "suffixe_title";
$newfield->multiLang = true;
$newfield->label = "Suffixe Titre des pages";
$newfield->add();
$newfield = new file();
$newfield->field = "social_image";
$newfield->label = $datas_lang["socialImage"];
$newfield->multiLang = false;
$newfield->startFolder = "";
$newfield->upload = true;
$newfield->disabled = false;
$newfield->browse = true;
$newfield->extensionsAuthorized = "images";
$newfield->variablesAuthorized = true;
$newfield->tooltip = $datas_lang["tooltip_socialImage"];
$newfield->add();
$newfield = new radio();
$newfield->field = "skin";
$newfield->label = $datas_lang["skinCurrent"];
$newfield->items = $listSkins;
$newfield->add();
$newfield = new select();
$newfield->field = "etat";
$newfield->label = $datas_lang["etatSite"];
$newfield->items = $datas_lang["listeEtatSite"];
$newfield->add();
$newfield->rule("required", true);
$newfield = new select();
$newfield->field = "error_log";
$newfield->label = $datas_lang["gestionErreurs"];
$newfield->items = $datas_lang["listeGestionErreurs"];
示例2: file
$resultat .= "<td align='center'>{$id}</td>";
$resultat .= "<td >{$fichier} </td>";
$resultat .= "<td class=\"erreur\">Pb lors de l'Update</td>";
$resultat .= "</tr>";
$cpterr++;
}
}
}
}
// fin boucle ligne
$resultat .= "</tbody></table>";
$resultat .= "Total lus: <b>" . ($cpt - $cpt_entete) . "</b><br>";
$resultat .= "Total intégrés: <b>{$cptok}</b><br>";
$resultat .= "Total non intégrés : <b>{$cpterr}</b><br>";
$resultat .= "<hr>";
$resultat .= "</div>";
$smarty->assign("resultat", $resultat);
}
$fieldMedia = new file();
$fieldMedia->field = "fichier";
$fieldMedia->label = $datas_lang["fichier"];
$fieldMedia->multiLangType = false;
$fieldMedia->browse = false;
$fieldMedia->add();
$newfield = new radio();
$newfield->field = "majok";
$newfield->label = $datas_lang["majBdD"];
$newfield->items = $datas_lang["ouiNon"];
$newfield->defaultValue = "0";
$newfield->add();
include DOS_INCPAGES_ADMIN . "maj-prepare.php";
示例3: 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;
//.........这里部分代码省略.........
示例4: file
<?php
require 'FDSGeoSim/autoload.php';
//Create a generic file object to hold all the info
$f = new file('couch', 'Single Couch Test Case');
$f->dir = "geosim";
//Create a new mesh, set the dimensions, and then add it to the file object
$mesh = new mesh("main");
$mesh->ijk(1.1, 3.5, 3.6, 4.6, 0.0, 2.4, 24, 10, 24);
$f->add($mesh);
//Set time boundaries.
$f->set_time(0, 600);
//Add the REAC line
$f->add(new reac(array("soot_yield" => 0.01, "fuel" => "propane")));
//Add MATL and SURF lines
$m_fabric = new matl("FABRIC", array("FYI" => "Properties completely fabricated", "SPECIFIC_HEAT" => 1.0, "CONDUCTIVITY" => 0.1, "DENSITY" => 100.0, "N_REACTIONS" => 1, "NU_SPEC" => 1, "SPEC_ID" => "PROPANE", "REFERENCE_TEMPERATURE" => 320, "HEAT_OF_REACTION" => 3000, "HEAT_OF_COMBUSTION" => 15000));
$m_foam = new matl("FOAM", array("FYI" => "Properties completely fabricated", "SPECIFIC_HEAT" => 1.0, "CONDUCTIVITY" => 0.05, "DENSITY" => 40.0, "N_REACTIONS" => 1, "NU_SPEC" => 1, "SPEC_ID" => "PROPANE", "REFERENCE_TEMPERATURE" => 320, "HEAT_OF_REACTION" => 1500, "HEAT_OF_COMBUSTION" => 30000));
$m_gypsum = new matl("GYPSUM PLASTER", array("FYI" => "Quintiere, Fire Behavior", "CONDUCTIVITY" => 0.48, "SPECIFIC_HEAT" => 0.84, "DENSITY" => 1440));
$s_upholstery = new surf("UPHOLSTERY", array("FYI" => "Properties completely fabricated", "COLOR" => "PURPLE", "BURN_AWAY" => TRUE, "MATL_ID(1:2,1)" => array("FABRIC", "FOAM"), "THICKNESS(1:2)" => array(0.002, 0.1)));
$s_wall = new surf("WALL", array("DEFAULT" => TRUE, "RGB" => array(200, 200, 200), "MATL_ID" => "GYPSUM PLASTER", "THICKNESS" => 0.012));
$f->add($m_fabric);
$f->add($m_foam);
$f->add($m_gypsum);
$f->add($s_upholstery);
$f->add($s_wall);
//Obstructions
$f->add(new obst(array("XB" => array(1.5, 3.1, 3.8, 4.6, 0.0, 0.4))));
$f->add(new obst(array("XB" => array(1.5, 3.1, 3.8, 4.6, 0.4, 0.6), "SURF_ID" => "UPHOLSTERY", "BULK_DENSITY" => 41.176)));
$f->add(new obst(array("XB" => array(1.3, 1.5, 3.8, 4.6, 0.0, 0.9), "SURF_ID" => "UPHOLSTERY", "BULK_DENSITY" => 41.176)));
$f->add(new obst(array("XB" => array(3.1, 3.3, 3.8, 4.6, 0.0, 0.9), "SURF_ID" => "UPHOLSTERY", "BULK_DENSITY" => 41.176)));
$f->add(new obst(array("XB" => array(1.5, 3.1, 4.4, 4.6, 0.6, 1.2), "SURF_ID" => "UPHOLSTERY", "BULK_DENSITY" => 41.176)));