本文整理汇总了PHP中Zend_Form_Element_File::setAttrib方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_File::setAttrib方法的具体用法?PHP Zend_Form_Element_File::setAttrib怎么用?PHP Zend_Form_Element_File::setAttrib使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_File
的用法示例。
在下文中一共展示了Zend_Form_Element_File::setAttrib方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$this->setAttribs(array('id' => 'form-exposicao-add'));
// exposicao_nome
$exposicao_nome = new Zend_Form_Element_Text("exposicao_nome");
$exposicao_nome->setLabel("Nome da Exposição:");
$exposicao_nome->setAttrib('placeholder', 'Digite o nome de sua exposição');
$exposicao_nome->setRequired();
//exposicao_descricao
$exposicao_descricao = new Zend_Form_Element_Textarea("exposicao_descricao");
$exposicao_descricao->setLabel("Descrição da Exposição:");
$exposicao_descricao->setAttrib('placeholder', 'Conte aos usuários sobre sua exposição');
$exposicao_descricao->setAttrib('rows', 10);
$exposicao_descricao->setRequired();
// tipo_exposicao_id
$tipo_exposicao_id = new Zend_Form_Element_Select("tipo_exposicao_id");
$tipo_exposicao_id->setLabel("Categoria da Exposição:");
$tipo_exposicao_id->setRequired();
$tipo_exposicao_id->setMultiOptions($this->getTipoExposicao());
//exposicao_capa
$exposicao_capa = new Zend_Form_Element_File("files");
$exposicao_capa->setLabel("Selecione a capa:");
$exposicao_capa->setDestination(Zend_Registry::get('config')->path->images->exposicao->capa);
$exposicao_capa->addValidator('Extension', false, 'jpg,png,gif');
$exposicao_capa->addValidator('Size', false, 2097152)->setMaxFileSize(2097152);
$exposicao_capa->setAttrib('id', 'exposicao_capa');
$exposicao_capa->setRequired();
// add elements
$this->addElement($exposicao_nome);
$this->addElement($exposicao_descricao);
$this->addElement($tipo_exposicao_id);
$this->addElement($exposicao_capa);
parent::init();
}
示例2: init
public function init()
{
/* Form Elements & Other Definitions Here ... */
$this->setMethod("POST");
$name = new Zend_Form_Element_Text("name");
$name->setRequired();
$name->setLabel("material name:");
$name->setAttrib("placeholder", "Enter material name");
$name->addValidator(new Zend_Validate_Alnum("true"));
$name->setAttrib("class", "form-control");
$name->getDecorator("Label")->setOption("class", "control-label");
$name->getDecorator("Errors")->setOption("class", "alert alert-danger");
$name->getDecorator("Errors")->setOption("style", " list-style-type:none");
$path = new Zend_Form_Element_File('path');
$path->setLabel('Select File:');
$path->setRequired();
$path->setAttrib("class", "form-control");
$path->setAttrib("class", "file-loading");
$path->getDecorator("Label")->setOption("class", "control-label");
$path->getDecorator("Errors")->setOption("class", "alert alert-danger");
$path->getDecorator("Errors")->setOption("style", " list-style-type:none");
$course = new Zend_Form_Element_Select('cid');
$course->setLabel('Course Name:');
//$course ->setMultiOptions(array( '5'=>'a','6'=>'c'));
$course->setRequired(true)->addValidator('NotEmpty', true);
$course->setAttrib("class", "form-control");
$course->getDecorator("Label")->setOption("class", "control-label");
$course->getDecorator("Errors")->setOption("class", "alert alert-danger");
$course->getDecorator("Errors")->setOption("style", " list-style-type:none");
$type = new Zend_Form_Element_Select('tid');
$type->setLabel('Material Type:');
//$type->setMultiOptions(array( '1'=>'pdf','2'=>'ppt'));
$type->setRequired(true)->addValidator('NotEmpty', true);
$type->setAttrib("class", "form-control");
$type->getDecorator("Label")->setOption("class", "control-label");
$type->getDecorator("Errors")->setOption("class", "alert alert-danger");
$type->getDecorator("Errors")->setOption("style", " list-style-type:none");
$mdate = new Zend_Form_Element_Hidden("mdate");
$submit = new Zend_Form_Element_Submit("submit");
$submit->setAttrib("class", "btn btn-xl center-block");
//$submit->setAttrib("class", "btn");
$this->addElements(array($name, $path, $course, $type, $mdate, $submit));
}
示例3: init
public function init()
{
$country_list = Application_Model_Preference::GetCountryList();
$isSass = Application_Model_Preference::GetPlanLevel() == 'disabled' ? false : true;
$this->isSass = $isSass;
$this->setDecorators(array(array('ViewScript', array('viewScript' => 'form/support-setting.phtml', "isSaas" => $isSass)), array('File', array('viewScript' => 'form/support-setting.phtml', 'placement' => false))));
//Station name
$this->addElement('text', 'stationName', array('class' => 'input_text', 'label' => 'Station Name', 'required' => true, 'filters' => array('StringTrim'), 'validator' => array('NotEmpty'), 'value' => Application_Model_Preference::GetStationName(), 'decorators' => array('ViewHelper')));
// Phone number
$this->addElement('text', 'Phone', array('class' => 'input_text', 'label' => 'Phone:', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetPhone(), 'decorators' => array('ViewHelper')));
//Email
$this->addElement('text', 'Email', array('class' => 'input_text', 'label' => 'Email:', 'required' => false, 'filters' => array('StringTrim'), 'value' => Application_Model_Preference::GetEmail(), 'decorators' => array('ViewHelper')));
// Station Web Site
$this->addElement('text', 'StationWebSite', array('label' => 'Station Web Site:', 'required' => false, 'class' => 'input_text', 'value' => Application_Model_Preference::GetStationWebSite(), 'decorators' => array('ViewHelper')));
// county list dropdown
$this->addElement('select', 'Country', array('label' => 'Country:', 'required' => false, 'value' => Application_Model_Preference::GetStationCountry(), 'multiOptions' => $country_list, 'decorators' => array('ViewHelper')));
// Station city
$this->addElement('text', 'City', array('label' => 'City:', 'required' => false, 'class' => 'input_text', 'value' => Application_Model_Preference::GetStationCity(), 'decorators' => array('ViewHelper')));
// Station Description
$description = new Zend_Form_Element_Textarea('Description');
$description->class = 'input_text_area';
$description->setLabel('Station Description:')->setRequired(false)->setValue(Application_Model_Preference::GetStationDescription())->setDecorators(array('ViewHelper'))->setAttrib('ROWS', '2')->setAttrib('COLS', '58');
$this->addElement($description);
// Station Logo
$upload = new Zend_Form_Element_File('Logo');
$upload->setLabel('Station Logo:')->setRequired(false)->setDecorators(array('File'))->addValidator('Count', false, 1)->addValidator('Extension', false, 'jpg,jpeg,png,gif')->addFilter('ImageSize');
$upload->setAttrib('accept', 'image/*');
$this->addElement($upload);
if (!$isSass) {
//enable support feedback
$this->addElement('checkbox', 'SupportFeedback', array('label' => 'Send support feedback', 'required' => false, 'value' => Application_Model_Preference::GetSupportFeedback(), 'decorators' => array('ViewHelper')));
// checkbox for publicise
$checkboxPublicise = new Zend_Form_Element_Checkbox("Publicise");
$checkboxPublicise->setLabel('Promote my station on Sourcefabric.org')->setRequired(false)->setDecorators(array('ViewHelper'))->setValue(Application_Model_Preference::GetPublicise());
if (Application_Model_Preference::GetSupportFeedback() == '0') {
$checkboxPublicise->setAttrib("disabled", "disabled");
}
$this->addElement($checkboxPublicise);
// text area for sending detail
$this->addElement('textarea', 'SendInfo', array('class' => 'sending_textarea', 'required' => false, 'filters' => array('StringTrim'), 'readonly' => true, 'cols' => 61, 'rows' => 5, 'value' => Application_Model_Preference::GetSystemInfo(false, true), 'decorators' => array('ViewHelper')));
// checkbox for privacy policy
$checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy");
$checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's <a id=\"link_to_privacy\" href=\"http://www.sourcefabric.org/en/about/policy/\" onclick=\"window.open(this.href); return false;\">privacy policy</a>.")->setDecorators(array('ViewHelper'));
$this->addElement($checkboxPrivacy);
}
// submit button
$submit = new Zend_Form_Element_Submit("submit");
$submit->class = 'ui-button ui-state-default right-floated';
$submit->setIgnore(true)->setLabel("Save")->setDecorators(array('ViewHelper'));
$this->addElement($submit);
}
示例4: init
public function init()
{
$this->setAction('')->setMethod('post');
$filename = time() . rand(1000, 9999);
$ava = new Zend_Form_Element_File('ava');
$ava->setAttrib('width', 120);
$ava->setLabel('Upload avatar (75x75 px)')->setDestination('avatars');
$ava->addFilter('Rename', sprintf('ava%s.jpg', $filename, true));
$ava->addValidator('Size', false, '204800')->addValidator('Extension', false, 'jpg,png,gif')->addValidator('ImageSize', false, array('minwidth' => 1, 'minheight' => 1, 'maxwidth' => 75, 'maxheight' => 75));
$submit = new Zend_Form_Element_Submit('uploadavatar');
$submit->setLabel("Upload");
$this->addElements(array($ava, $submit));
return $this;
}
示例5: __construct
public function __construct($option = null)
{
parent::__construct($option);
$this->setName('Addphotos');
$this->setAttrib('class', 'input-group');
$image = new Zend_Form_Element_File('image');
$image->setLabel('Зураг оруулах:');
$image->addValidator('Size', false, 1024000000);
$image->addValidator('Extension', false, 'jpg,png,gif,pdf,zip,rar');
$image->setAttrib('class', "form-control");
$add = new Zend_Form_Element_Submit('add');
$add->setLabel('Хадгалах')->setAttrib('class', 'btn');
$this->addElement($image);
$this->addElement($add);
$this->setMethod('post');
}
示例6: init
public function init($photoId)
{
global $mySession;
$db = new Db();
$path = "";
$title = "";
$date = "";
$description = "";
$status = "";
$featuredstatus = "";
$phototype = "";
$featurepath = "";
if ($photoId != "") {
$photoData = $db->runQuery("select * from " . PHOTO . " where \tphoto_id='" . $photoId . "'");
$path = $photoData[0]['photo_path'];
$title = $photoData[0]['photo_title'];
$date = date('F d-Y, h:i:s a', strtotime($photoData[0]['video_date']));
$description = $photoData[0]['photo_description'];
$status = $photoData[0]['photo_status'];
$featuredstatus = $photoData[0]['featured_status'];
}
//->setValue($phototype);
$photo_path2 = new Zend_Form_Element_File('photo_path2');
$photo_path2->setAttrib("class", "textInput")->setDestination(SITE_ROOT . 'photo/')->addValidator('Extension', false, 'jpg,jpeg,png,gif');
$photo_path2->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Photo path required.'))->addDecorator('Errors', array('class' => 'error'));
$photo_title = new Zend_Form_Element_Text('photo_title');
$photo_title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Photo Title is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($title);
$up_date = new Zend_Form_Element_Text('up_date');
$up_date->setAttrib("class", "textInput")->setAttrib("disabled", "disabled")->setValue($date);
$photo_description = new Zend_Form_Element_Textarea('photo_description');
$photo_description->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Video description is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textarea_medium")->setValue($description);
$Option[0]['key'] = "1";
$Option[0]['value'] = "Active";
$Option[1]['key'] = "0";
$Option[1]['value'] = "Inactive";
$photo_status = new Zend_Form_Element_Radio('photo_status');
$photo_status->setRequired(true)->addMultiOptions($Option)->addValidator('NotEmpty', true, array('messages' => 'Please select status of photo.'))->addDecorator('Errors', array('class' => 'error'))->setValue($status);
//->setValue($featurepath);
$this->addElements(array($photo_path2, $photo_title, $up_date, $photo_description, $photo_status));
}
示例7: getFormElement
function getFormElement($v, $value = '')
{
$this->toTpl('hasForm', 1);
$v = $this->doQoolHook('front_pre_getformelement_element', $v);
$value = $this->doQoolHook('front_pre_getformelement_value', $value);
switch ($v['value']) {
case "editor":
$this->loadEditorBtns();
$this->toTpl("loadEditor", 1);
$this->toTpl("isEditor", 1);
$element = new Zend_Form_Element_Textarea($v['name']);
$element->setAttrib('class', 'editor span12');
if ($value != '') {
$element->setValue($value);
}
break;
case "fileinput":
$element = new Zend_Form_Element_File($v['name']);
$element->setAttrib('class', 'input-file');
break;
case "captcha":
$element = new Zend_Form_Element_Captcha($v['name'], array('label' => $this->t("Please verify you are a human"), 'captcha' => $config->site->captcha_adapter, 'captchaOptions' => array('captcha' => $config->site->captcha_adapter, 'wordLen' => 6, 'timeout' => 300)));
return $element;
break;
case "multifileinputs":
$element = new Zend_Form_Element_File($v['name']);
$element->setAttrib('class', 'input-file');
$element->setMultiFile(10);
break;
case "multifileinput":
$name = $v['name'] . "[]";
$element = new Zend_Form_Element_File($name);
$element->setAttrib('class', 'input-file');
$element->setAttrib('multiple', 'multiple');
$element->setMultiFileForQool(1);
$this->toTpl('filelist', true);
break;
case "checkbox":
$element = new Zend_Form_Element_Checkbox($v['name']);
$element->setAttrib('class', 'checkbox');
$element->setValue($value);
break;
case "editarea":
$this->toTpl('editarea', 1);
$element = new Zend_Form_Element_Textarea($v['name']);
$element->setAttrib('class', 'editarea span12');
$element->setAttrib('id', 'editarea');
$element->setAttrib('style', 'height:500px');
if ($value != '') {
$element->setValue($value);
}
break;
case "password":
$element = new Zend_Form_Element_Password($v['name']);
break;
case "textarea":
$element = new Zend_Form_Element_Textarea($v['name']);
$element->setAttrib('class', 'span9');
$element->setAttrib('style', 'height:80px');
if ($value != '') {
$element->setValue($value);
}
break;
case "hidden":
$element = new Zend_Form_Element_Hidden($v['name']);
$element->setValue($value);
$element->setDecorators(array("ViewHelper"));
break;
case "textinput":
$element = new Zend_Form_Element_Text($v['name']);
if ($value != '') {
$element->setValue($value);
}
break;
case "selectbox":
$element = new Zend_Form_Element_Select($v['name']);
if ($v['use_pool'] && method_exists($this, $v['use_pool'])) {
if ($v['pool_type'] != '0') {
$this->pool_type = $v['pool_type'];
}
if ($v['novalue']) {
$element->addMultiOption(0, $this->t('No Selection'));
}
foreach ($this->{$v}['use_pool']() as $ko => $vo) {
if ($v['noself'] && $vo['id'] == $v['noself']) {
} else {
$element->addMultiOption($vo['id'], $vo['title']);
}
}
if ($value != '') {
$element->setValue($value);
}
}
break;
case "multiselectbox":
$element = new Zend_Form_Element_Multiselect($v['name']);
if ($v['use_pool'] && method_exists($this, $v['use_pool'])) {
if ($v['pool_type'] != '0') {
$this->pool_type = $v['pool_type'];
}
//.........这里部分代码省略.........
示例8: __construct
public function __construct($option = null)
{
parent::__construct($option);
$this->setName('Bukh');
$this->setAttrib('class', 'input-group');
$obog = new Zend_Form_Element_Text('obog');
$obog->setAttrib('class', "form-control")->setAttrib('placeholder', "Бөхийн овог")->setRequired()->setLabel("Дүн.мн бөх бүртгэх хэсэг");
$ner = new Zend_Form_Element_Text('ner');
$ner->setAttrib('class', "form-control")->setAttrib('placeholder', "Бөхийн нэр")->setRequired();
$date = new Zend_Form_Element_Text('date');
$date->setAttrib('class', "form-control")->setAttrib('placeholder', "Бөхийн төрсөн он (он-сар-өдөр)")->setRequired();
$tsol = new Zend_Form_Element_Select("tsol");
//create obj
$tsol->setAttrib('class', "form-control")->setRequired()->setLabel("Та цолоо сонгоно уу?");
$db = Zend_Registry::get('db');
$sql = $db->quoteInto('select * from tsol', null);
$users = $db->query($sql)->fetchAll();
$first = NULL;
foreach ($users as $user) {
if ($first == NULL) {
$first = $user["id"];
}
$tsol->addMultiOption($user['id'], $user['name']);
}
$tsoldate = new Zend_Form_Element_Text('tsoldate');
$tsoldate->setAttrib('class', "form-control")->setAttrib('placeholder', "Цол авсан өдөр (он-сар-өдөр)")->setRequired();
$aimag = new Zend_Form_Element_Select('aimag');
//create obj
$aimag->setAttrib('class', "form-control")->setRequired()->setLabel("Та аймагаа сонгоно уу?");
$db = Zend_Registry::get('db');
$sql = $db->quoteInto('select * from aimag', null);
$users = $db->query($sql)->fetchAll();
$first = 0;
foreach ($users as $user) {
if ($first == 0) {
$first = $user['id'];
}
$aimag->addMultiOption($user['id'], $user['name']);
}
$sum = new Zend_Form_Element_Select("sum");
//create obj
$sum->setAttrib('class', "form-control")->setRequired()->setLabel("Та сумаа сонгоно уу?")->setregisterInArrayValidator(false);
$sql = $db->quoteInto('select * from sum WHERE aimagid = ' . $first, null);
$users = $db->query($sql)->fetchAll();
$userArray = array();
foreach ($users as $user) {
$sum->addMultiOption($user['id'], $user['name']);
}
$sponsor = new Zend_Form_Element_Text('sponsor');
$sponsor->setAttrib('class', "form-control")->setAttrib('placeholder', "Ивээн тэтгэгч байгууллага")->setRequired();
$add = new Zend_Form_Element_Submit('add');
$add->setLabel('Бөх бүртгэх')->setAttrib('class', 'btn');
$image = new Zend_Form_Element_File('image');
$image->setLabel('Зураг оруулах:');
$image->addValidator('Size', false, 10240000);
$image->addValidator('Extension', false, 'jpg,png,gif,pdf,zip,rar');
$image->setAttrib('class', "form-control");
$this->addElement($obog);
$this->addElement($ner);
$this->addElement($date);
$this->addElement($tsol);
$this->addElement($tsoldate);
$this->addElement($aimag);
$this->addElement($sum);
$this->addElement($sponsor);
$this->addElement($image);
$this->addElement($add);
$this->setMethod('post');
}
示例9: init
public function init()
{
$this->setName('mercaderia')->setAttrib('class', 'form-horizontal')->setAttrib('enctype', 'multipart/form-data');
// * * * * * * * * DATOS BASICOS DE LA MERCADERIA
$mer_id_mercaderia = new Zend_Form_Element_Hidden('mer_id_mercaderia');
$mer_id_mercaderia->addFilter('Int');
$fcp_id_familia_codigo_proveedor = new Zend_Form_Element_Select('fcp_id_familia_codigo_proveedor');
$fcp_id_familia_codigo_proveedor->setLabel('Cód./Nombre del proveedor:');
$filaDestinatario = new Application_Model_DbTable_Destinatario();
foreach ($filaDestinatario->fetchAll(null, "des_nombre ASC") as $destinatario) {
$fcp_id_familia_codigo_proveedor->addMultiOption($destinatario->des_id_destinatario, $destinatario->des_nombre);
}
$mer_codigo = new Zend_Form_Element_Text('mer_codigo');
$mer_codigo->setAttrib('placeholder', 'Código SMO')->setLabel('Código SMO:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$mer_articulo = new Zend_Form_Element_Text('mer_articulo');
$mer_articulo->setAttrib('placeholder', 'Cód. de Artículo FABRICANTE')->setLabel('Artículo:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$col_id_color = new Zend_Form_Element_Select('col_id_color');
$col_id_color->setLabel('Color de la mercadería:');
$filaColor = new Application_Model_DbTable_Color();
foreach ($filaColor->fetchAll(null, "col_nombre ASC") as $color) {
$col_id_color->addMultiOption($color->col_id_color, $color->col_nombre);
}
$tal_id_talla = new Zend_Form_Element_Select('tal_id_talla');
$tal_id_talla->setLabel('Rango de Tallas (Inicio):');
$tal_id_talla2 = new Zend_Form_Element_Select('tal_id_talla2');
$tal_id_talla2->setLabel('Rango de Tallas (Final):');
$filaTalla = new Application_Model_DbTable_Talla();
foreach ($filaTalla->fetchAll() as $talla) {
$tal_id_talla->addMultiOption($talla->tal_id_talla, $talla->tal_talla . ' (' . $talla->tal_tipo . ')');
$tal_id_talla2->addMultiOption($talla->tal_id_talla, $talla->tal_talla . ' (' . $talla->tal_tipo . ')');
}
// * * * * * * * DATOS DE LOGISTICA Y VENTA DE LA MERCADERIA
$mer_costo = new Zend_Form_Element_Text('mer_costo');
$mer_costo->setAttrib('placeholder', 'Costo de la mercadería')->setLabel('Costo:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$mer_tipo = new Zend_Form_Element_Select('mer_tipo');
$mer_tipo->setLabel('Tipo:');
$filaMercaderiatipo = new Application_Model_DbTable_Mercaderiatipo();
foreach ($filaMercaderiatipo->fetchAll(null, "mti_mer_tipo ASC") as $mercaderiatipo) {
$mer_tipo->addMultiOption($mercaderiatipo->mti_mer_tipo, $mercaderiatipo->mti_mer_tipo);
}
$mer_tamanno_tarea = new Zend_Form_Element_Text('mer_tamanno_tarea');
$mer_tamanno_tarea->setAttrib('placeholder', 'Tamaño de la Tarea')->setLabel('Tamaño de la Tarea:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
/* $mer_zona_bodega = new Zend_Form_Element_Text('mer_zona_bodega');
$mer_zona_bodega->setAttrib('placeholder','Nombre de Zona en Bodega')->setLabel('Zona en bodega:')
->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty'); */
$mer_prioridad_venta = new Zend_Form_Element_Select('mer_prioridad_venta');
$mer_prioridad_venta->setLabel('Prioridad de la venta:');
$mer_prioridad_venta->addMultiOption("1", "Prioridad Normal");
$mer_prioridad_venta->addMultiOption("2", "Prioridad Alta");
$mer_prioridad_venta->addMultiOption("3", "Prioridad Muy Alta");
$mer_temporada = new Zend_Form_Element_Select('mer_temporada');
$mer_temporada->setLabel('Temporada:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$mer_temporada->addMultiOption("TODA ESTACION", "Toda Estación");
$mer_temporada->addMultiOption("VERANO", "Verano");
$mer_temporada->addMultiOption("INVIERNO", "Invierno");
$mer_temporada->addMultiOption("COLEGIAL", "Colegial");
$mer_temporada->addMultiOption("FIESTAS PATRIAS", "Fiestas Patrias");
// * * * * * * * * * DATOS AVANZADOS
$mer_foto = new Zend_Form_Element_File('mer_foto');
$mer_foto->setAttrib('placeholder', 'Foto')->setLabel('Agregar foto:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty')->setDestination(APPLICATION_PATH . '/../public/img/mercaderia')->addValidator('Count', false, 1)->addValidator('Size', false, 1024000)->addValidator('Extension', false, 'jpg,jpeg,png,gif');
$mer_nombre = new Zend_Form_Element_Text('mer_nombre');
$mer_nombre->setAttrib('placeholder', 'Marca')->setLabel('Marca/Fábrica:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$mer_modelo = new Zend_Form_Element_Text('mer_modelo');
$mer_modelo->setAttrib('placeholder', 'Modelo de mercadería')->setLabel('Modelo:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$mer_descripcion = new Zend_Form_Element_Text('mer_descripcion');
$mer_descripcion->setAttrib('placeholder', 'Descripción')->setLabel('Descripción:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$mer_sexo = new Zend_Form_Element_Select('mer_sexo');
$mer_sexo->setLabel('Mercadería para:')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
$mer_sexo->addMultiOption("HOMBRE", "Hombre");
$mer_sexo->addMultiOption("MUJER", "Mujer");
$mer_sexo->addMultiOption("UNISEX", "Unisex");
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton');
$this->addElements(array($mer_id_mercaderia, $mer_codigo, $mer_descripcion, $fcp_id_familia_codigo_proveedor, $tal_id_talla, $tal_id_talla2, $mer_costo, $mer_tipo, $col_id_color, $mer_modelo, $mer_articulo, $mer_foto, $mer_tamanno_tarea, $mer_prioridad_venta, $mer_nombre, $mer_sexo, $mer_temporada, $submit));
// * * * * GRUPO DESPLIEGUE DATOS BASICOS
$this->addDisplayGroup(array('fcp_id_familia_codigo_proveedor', 'mer_codigo', 'mer_articulo', 'col_id_color', 'tal_id_talla', 'tal_id_talla2', 'mer_nombre'), 'datos1', array('legend' => 'Datos Básicos'));
$datos1 = $this->getDisplayGroup('datos1');
$datos1->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'div', 'class' => 'span4 pull-left'))));
// * * * * GRUPO DESPLIEGUE DATOS LOGISTICA Y VENTA
$this->addDisplayGroup(array('mer_costo', 'mer_tipo', 'mer_tamanno_tarea', 'mer_prioridad_venta', 'mer_temporada'), 'datos2', array('legend' => 'Datos Logística y Venta'));
$datos2 = $this->getDisplayGroup('datos2');
$datos2->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'div', 'class' => 'span4 pull-left'))));
// * * * * GRUPO DESPLIEGUE DATOS AVANZADOS
$this->addDisplayGroup(array('mer_foto', 'mer_modelo', 'mer_descripcion', 'mer_sexo'), 'datos3', array('legend' => 'Datos Avanzados'));
$datos3 = $this->getDisplayGroup('datos3');
$datos3->setDecorators(array('FormElements', 'Fieldset', array('HtmlTag', array('tag' => 'div', 'class' => 'span4'))));
}
示例10: init
public function init($videoId)
{
global $mySession;
$db = new Db();
$path = "";
$title = "";
$date = "";
$description = "";
$status = "";
$featuredstatus = "";
$featurepath = "";
$videotype = "";
if ($videoId != "") {
$videoData = $db->runQuery("select * from " . VIDEOGALLERY . " where \tvideo_id='" . $videoId . "'");
$type = $videoData[0]['video_type'];
$path = $videoData[0]['video_path'];
$title = $videoData[0]['video_title'];
$date = date('F d-Y, h:i:s a', strtotime($videoData[0]['date_uploaded']));
$description = $videoData[0]['video_description'];
$keyword = $videoData[0]['video_keyword'];
$status = $videoData[0]['video_status'];
$videotype = $photoData[0]['video_type'];
/*$featuredstatus =$videoData[0]['featured_status'];*/
$featurepath = $photoData[0]['featured_path'];
}
$Type[0]['key'] = "1";
$Type[0]['value'] = "URL from YouTube";
$Type[1]['key'] = "2";
$Type[1]['value'] = "Upload from computer";
$video_type = new Zend_Form_Element_Radio('video_type');
$video_type->addMultiOptions($Type)->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Video type required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib('onclick', 'changetype();');
$video_path1 = new Zend_Form_Element_Text('video_path1');
$video_path1->setAttrib("class", "textInput");
if ($_REQUEST['video_type'] == 1) {
$video_path1->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Video path required.'))->addDecorator('Errors', array('class' => 'error'));
}
$video_path2 = new Zend_Form_Element_File('video_path2');
$video_path2->setAttrib("class", "textInput")->setDestination(SITE_ROOT . 'images/videos/')->addValidator('Extension', false, 'flv');
if ($_REQUEST['video_type'] == 2) {
$video_path2->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Video path required.'))->addDecorator('Errors', array('class' => 'error'));
}
$video_title = new Zend_Form_Element_Text('video_title');
$video_title->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Video Title is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textInput")->setValue($title);
$up_date = new Zend_Form_Element_Text('up_date');
$up_date->setAttrib("class", "textInput")->setAttrib("disabled", "disabled")->setValue($date);
$video_description = new Zend_Form_Element_Textarea('video_description');
$video_description->setRequired(true)->addValidator('NotEmpty', true, array('messages' => 'Video description is required.'))->addDecorator('Errors', array('class' => 'error'))->setAttrib("class", "textarea_medium")->setValue($description);
$Option[0]['key'] = "1";
$Option[0]['value'] = "Active";
$Option[1]['key'] = "0";
$Option[1]['value'] = "Inactive";
$video_status = new Zend_Form_Element_Radio('video_status');
$video_status->setRequired(true)->addMultiOptions($Option)->addValidator('NotEmpty', true, array('messages' => 'Please select status of video.'))->addDecorator('Errors', array('class' => 'error'))->setValue($status);
$Option1[1]['key'] = "1";
$Option1[1]['value'] = "Featured";
$Option1[2]['key'] = "2";
$Option1[2]['value'] = "Not Featured";
/*$featured_status= new Zend_Form_Element_Radio('featured_status');
$featured_status->setRequired(true)
->addMultiOptions($Option1)
->addValidator('NotEmpty',true,array('messages' =>'Please select status of featured.'))
->addDecorator('Errors', array('class'=>'error'))
->setValue($featuredstatus);*/
$this->addElements(array($video_type, $video_path1, $video_path2, $video_title, $up_date, $video_description, $video_keyword, $video_status, $feature_path));
}