<?php 
 class Application_Model_Form_Table1New extends MyWeb_Form
{

    public function init()
    {
        $request = Zend_Controller_Front::getInstance()->getRequest();
        ZendX_JQuery::enableForm($this);	// zapnuti jQuery
        $getValue = $request->getParams();
        $translate = Zend_Registry::get('Zend_Translate');
        
        // nastaví atributy formuláře
        $this->setAction("new");
        $this->setMethod("post");
        $this->setAttrib("id", "form_table1_new");
        //nacteni config souboru s definovan7mi fomularovymi prvky
        $config = new Zend_Config_Ini(APPLICATION_PATH . "/forms/table1New.ini");
        $this->setConfig($config);
        
        
        //***************************************************************************
        // Nastaveni hidden elemetu
        
        
        
        
        //***************************************************************************
        $link = '<a href = "'."javascript:load0()".'">'.$translate->translate('Table3').'</a>';
        $element = $this->getElement('table3_id_table3Value');
        $element->setLabel($translate->translate('Table3'));
        $element->setDescription( $link );
        $element->setDecorators(	array('ViewHelper',array('Description', array('escape' => false, 'tag' => false)),
        array('HtmlTag', array('tag' => 'dd')),
        array('Label', array('tag' => 'dt')),
        'Errors')); 
        
        //*** vytvoreni hidden poli pro jmeno hodnoty a hodnotu
        $table3_id_table3InputName = new Zend_Form_Element_Hidden('table3_id_table3InputName');
        $table3_id_table3InputName->setValue(NULL);
        //$table3_id_table3InputName->setLabel('table3_id_table3InputName');
        $table3_id_table3InputValue = new Zend_Form_Element_Hidden('table3_id_table3InputValue');
        $table3_id_table3InputValue->setValue(NULL);
        //$table3_id_table3InputValue->setLabel('table3_id_table3InputValue');
        
        $table3_id_table3InputName1 = new Zend_Form_Element_Hidden('table3_id_table3InputName1');
        $table3_id_table3InputName1->setValue(NULL);
        //$table3_id_table3InputName1->setLabel('table3_id_table3InputName1');
        $table3_id_table3InputValue2 = new Zend_Form_Element_Hidden('table3_id_table3InputValue2');
        $table3_id_table3InputValue2->setValue(NULL);
        //$table3_id_table3InputValue2->setLabel('table3_id_table3InputValue2');
        
        // vytvoří formulářový prvek odesílací tlačítko
        $submitInsert = new Zend_Form_Element_Submit("send", array("label" => $translate->translate('New')));
        
        // přidá formulářové prvky do formuláře
        //$this->addElements(array());
        $this->addDisplayGroup(array(
        			'id_table1',
        			'table1_column1',
        			'table1_column2',
        			'table1_column3',
        			'table3_id_table3'
        			),'formRoleEdit',array('legend' => $translate->translate('NewTable1')));
        $this->addElements(array(
        			$submitInsert,
        			$table3_id_table3InputName,
        			$table3_id_table3InputValue,
        			$table3_id_table3InputName1,
        			$table3_id_table3InputValue2
        			));
        $this->addElements(array($submitInsert));
    }


}
