<?php 
 class Application_Model_Form_StateEdit extends MyWeb_Form
{

    public function init()
    {
        $root = 'index.php';
        $request = Zend_Controller_Front::getInstance()->getRequest();
        $getValue = $request->getParams();
        $path = explode($root, $request->getRequestUri());
        
        
        // nastaví atributy formuláře
        $this->setAction("edit");
        $this->setMethod("post");
        $this->setAttrib("id", "form_state_edit");
        //nacteni config souboru s definovan7mi fomularovymi prvky
        $config = new Zend_Config_Ini(APPLICATION_PATH . "/forms/stateEdit.ini");
        $this->setConfig($config);
        
        $state = $this->_model->fetchEntry(NULL);
        
        //***************************************************************************
        $url = new Zend_View_Helper_Url();
        
        $link = '<a href = "'."javascript:load0()".'">namestate</a>';
        $element = $this->getElement('NameState_id_NameStateValue');
        $element->setLabel('Namestate');
        $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')); 
        $element->setAttrib('disabled',"");
        
        
        
        $NameState_id_NameStateHiddenName1 = new Zend_Form_Element_Hidden('NameState_id_NameStateHiddenName1');
        $NameState_id_NameStateHiddenName1->setValue(NULL);
        
        $NameState_id_NameStateInputName1 = new Zend_Form_Element_Text('NameState_id_NameStateInputName1');
        $NameState_id_NameStateInputName1->setLabel('NameState_id_NameStateInputName1');
        $NameState_id_NameStateHiddenValue2 = new Zend_Form_Element_Hidden('NameState_id_NameStateHiddenValue2');
        $NameState_id_NameStateHiddenValue2->setValue(NULL);
        
        $NameState_id_NameStateInputValue2 = new Zend_Form_Element_Text('NameState_id_NameStateInputValue2');
        $NameState_id_NameStateInputValue2->setLabel('NameState_id_NameStateInputValue2');
        $NameState_id_NameStateHiddenName3 = new Zend_Form_Element_Hidden('NameState_id_NameStateHiddenName3');
        $NameState_id_NameStateHiddenName3->setValue(NULL);
        
        $NameState_id_NameStateInputName3 = new Zend_Form_Element_Text('NameState_id_NameStateInputName3');
        $NameState_id_NameStateInputName3->setLabel('NameState_id_NameStateInputName3');
        $NameState_id_NameStateHiddenValue4 = new Zend_Form_Element_Hidden('NameState_id_NameStateHiddenValue4');
        $NameState_id_NameStateHiddenValue4->setValue(NULL);
        
        $NameState_id_NameStateInputValue4 = new Zend_Form_Element_Text('NameState_id_NameStateInputValue4');
        $NameState_id_NameStateInputValue4->setLabel('NameState_id_NameStateInputValue4');
        
        //***************************************************************************
        $url = new Zend_View_Helper_Url();
        
        $link = '<a href = "'."javascript:load1()".'">tabledatabase</a>';
        $element = $this->getElement('TableDatabase_id_tableDatabaseValue');
        $element->setLabel('Tabledatabase');
        $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')); 
        $element->setAttrib('disabled',"");
        
        
        
        $TableDatabase_id_tableDatabaseHiddenName1 = new Zend_Form_Element_Hidden('TableDatabase_id_tableDatabaseHiddenName1');
        $TableDatabase_id_tableDatabaseHiddenName1->setValue(NULL);
        
        $TableDatabase_id_tableDatabaseInputName1 = new Zend_Form_Element_Text('TableDatabase_id_tableDatabaseInputName1');
        $TableDatabase_id_tableDatabaseInputName1->setLabel('TableDatabase_id_tableDatabaseInputName1');
        $TableDatabase_id_tableDatabaseHiddenValue2 = new Zend_Form_Element_Hidden('TableDatabase_id_tableDatabaseHiddenValue2');
        $TableDatabase_id_tableDatabaseHiddenValue2->setValue(NULL);
        
        $TableDatabase_id_tableDatabaseInputValue2 = new Zend_Form_Element_Text('TableDatabase_id_tableDatabaseInputValue2');
        $TableDatabase_id_tableDatabaseInputValue2->setLabel('TableDatabase_id_tableDatabaseInputValue2');
        $TableDatabase_id_tableDatabaseHiddenName3 = new Zend_Form_Element_Hidden('TableDatabase_id_tableDatabaseHiddenName3');
        $TableDatabase_id_tableDatabaseHiddenName3->setValue(NULL);
        
        $TableDatabase_id_tableDatabaseInputName3 = new Zend_Form_Element_Text('TableDatabase_id_tableDatabaseInputName3');
        $TableDatabase_id_tableDatabaseInputName3->setLabel('TableDatabase_id_tableDatabaseInputName3');
        $TableDatabase_id_tableDatabaseHiddenValue4 = new Zend_Form_Element_Hidden('TableDatabase_id_tableDatabaseHiddenValue4');
        $TableDatabase_id_tableDatabaseHiddenValue4->setValue(NULL);
        
        $TableDatabase_id_tableDatabaseInputValue4 = new Zend_Form_Element_Text('TableDatabase_id_tableDatabaseInputValue4');
        $TableDatabase_id_tableDatabaseInputValue4->setLabel('TableDatabase_id_tableDatabaseInputValue4');
        // vytvoří formulářový prvek odesílací tlačítko
        $submitInsert = new Zend_Form_Element_Submit("send", array("label" => "edit"));
        // přidá formulářové prvky do formuláře
        //$this->addElements(array($option_state,$hidden_role));
        $this->addDisplayGroup(array('id_state','state_state','NameState_id_NameState','TableDatabase_id_tableDatabase'),'formRoleEdit',array('legend' => 'Formular'));
        $this->addElements(array(	$submitInsert,$NameState_id_NameStateHiddenName1, $NameState_id_NameStateInputName1, $NameState_id_NameStateHiddenValue2, $NameState_id_NameStateInputValue2, $NameState_id_NameStateHiddenName3, $NameState_id_NameStateInputName3, $NameState_id_NameStateHiddenValue4, $NameState_id_NameStateInputValue4, $TableDatabase_id_tableDatabaseHiddenName1, $TableDatabase_id_tableDatabaseInputName1, $TableDatabase_id_tableDatabaseHiddenValue2, $TableDatabase_id_tableDatabaseInputValue2, $TableDatabase_id_tableDatabaseHiddenName3, $TableDatabase_id_tableDatabaseInputName3, $TableDatabase_id_tableDatabaseHiddenValue4, $TableDatabase_id_tableDatabaseInputValue4));
    }


}
