Beispiel #1
0
 public function init()
 {
     $seoFilter = new Core_Utils_SeoUrl();
     $objProj = new Admin_Model_Project();
     $obj = new Application_Model_DbTable_Banner();
     $primaryKey = $obj->getPrimaryKey();
     $this->setMethod('post');
     $this->setEnctype('multipart/form-data');
     $this->setAttrib('idbanner', $primaryKey);
     $this->setAction('/banner/new');
     $e = new Zend_Form_Element_Hidden($primaryKey);
     $this->addElement($e);
     $e = new Zend_Form_Element_Select('codproy');
     $e->setMultiOptions($objProj->getFetchPairsAllProjects());
     $this->addElement($e);
     $i = new Zend_Form_Element_File('nombre');
     $this->addElement($i);
     $this->getElement('nombre')->setDestination(ROOT_IMG_DINAMIC . '/banner/origin/')->addValidator('Size', false, 10024000)->addValidator('Extension', true, 'jpg,png,gif,jpeg')->setRequired(false);
     $e = new Zend_Form_Element_Text('titulo');
     $this->addElement($e);
     $e = new Zend_Form_Element_Textarea('descripcion');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('fechainicio');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('fechafin');
     $this->addElement($e);
     $e = new Zend_Form_Element_Checkbox('vchestado');
     $e->setValue(true);
     $this->addElement($e);
     foreach ($this->getElements() as $element) {
         $element->removeDecorator('Label');
         $element->removeDecorator('DtDdWrapper');
         $element->removeDecorator('HtmlTag');
     }
 }
Beispiel #2
0
 public function init()
 {
     $obj = new Application_Model_DbTable_Banner();
     $primaryKey = $obj->getPrimaryKey();
     $this->setMethod('post');
     $this->setEnctype('multipart/form-data');
     $this->setAttrib('idtCp', $primaryKey);
     $this->setAction('/cp/new');
     $e = new Zend_Form_Element_Hidden($primaryKey);
     $this->addElement($e);
     $e = new Zend_Form_Element_Select('posicion');
     $e->setMultiOptions(array(1 => 'BANNER 1', 2 => 'BANNER 2', 3 => 'BANNER 3', 4 => 'BANNER 4', 5 => 'BANNER 5', 6 => 'BANNER 6', 7 => 'BANNER 7', 8 => 'BANNER 8', 9 => 'BANNER 9', 10 => 'BANNER 10'));
     $this->addElement($e);
     $e = new Zend_Form_Element_Checkbox('estado');
     $e->setValue(true);
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('descripcion');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('enlace');
     $this->addElement($e);
     $e = new Zend_Form_Element_Text('alt');
     $this->addElement($e);
     $i = new Zend_Form_Element_File('avanzado');
     $this->addElement($i);
     $this->getElement('avanzado')->setDestination(ROOT_IMG_DINAMIC . '/banners/avanzado/')->addValidator('Size', false, 10024000)->addValidator('Extension', true, 'jpg,png,gif,jpeg')->setRequired(false);
     //
     //        $i = new Zend_Form_Element_Image('submitImage');
     //        $this->addElement($i);
     //        $this->getElement('submitImage')
     //                ->setImage(ROOT_IMG_DINAMIC . '/banners/avanzado/nxqbhjpgckomuzi.gif');
     //
     //
     $i = new Zend_Form_Element_File('basico128');
     $this->addElement($i);
     $this->getElement('basico128')->setDestination(ROOT_IMG_DINAMIC . '/banners/basico128/')->addValidator('Size', false, 10024000)->addValidator('Extension', true, 'jpg,png,gif,jpeg')->setRequired(false);
     $i = new Zend_Form_Element_File('basico240');
     $this->addElement($i);
     $this->getElement('basico240')->setDestination(ROOT_IMG_DINAMIC . '/banners/basico240/')->addValidator('Size', false, 10024000)->addValidator('Extension', true, 'jpg,png,gif,jpeg')->setRequired(false);
     $i = new Zend_Form_Element_File('basico360');
     $this->addElement($i);
     $this->getElement('basico360')->setDestination(ROOT_IMG_DINAMIC . '/banners/basico360/')->addValidator('Size', false, 10024000)->addValidator('Extension', true, 'jpg,png,gif,jpeg')->setRequired(false);
     foreach ($this->getElements() as $element) {
         $element->removeDecorator('Label');
         $element->removeDecorator('DtDdWrapper');
         $element->removeDecorator('HtmlTag');
     }
 }