Initialize the form

@access protected
@author Bertrand Chevrier, <bertrand.chevrier@tudor.lu>
@return mixed
506492
protected function initForm()
    {
    	(isset($this->options['name'])) ? $name = $this->options['name'] : $name = ''; 
    	if(empty($name)){
			$name = 'form_'.(count(self::$forms)+1);
		}
		unset($this->options['name']);
			
		$this->form = \tao_helpers_form_FormFactory::getForm($name, $this->options);
		
		//create action in toolbar
		$createElt = \tao_helpers_form_FormFactory::getElement('create', 'Free');
		$createElt->setValue('<button class="btn-info" type="submit" id="addButton">'.\tao_helpers_Icon::iconAdd().__('Create').'</button>');
		$this->form->setActions(array(), 'top');
		$this->form->setActions(array($createElt), 'bottom');
    }
212776
public function init()
    {
        if (!isset($this->options['id'])) {
            $this->options['id'] = $this->getId();
        }
        ob_start();
        ob_implicit_flush(false);

        $props = [
            'formId' => $this->id,
            'contentId' => $this->id . '-content',
            'action' => $this->action,
            'method' => $this->method,
            'layout' => $this->layout,
            'layoutCols' => $this->layoutCols,
        ];

        if (Yii::$app->has('frontendState')) {
            Yii::$app->frontendState->add('config.types.toRenderForm', [$this->id, $props]);
        } else {
            $jsArgs = [Json::encode($this->id), Json::encode($props)];
            \Yii::$app->view->registerJs('__appTypes.renderForm(' . implode(', ', $jsArgs) . ')', View::POS_END, $this->id . '-form');
        }
    }
420044
protected function Init()
    {
        $htmlCode = ContentHtmlCode::Schema()->ByContent($this->content);
        $this->code= $htmlCode->GetCode();
        return parent::Init();
    }
999695
protected function Init()
    {
        $sql = Access::SqlBuilder();
        $tbl = Membergroup::Schema()->Table();
        $order = $sql->OrderList($sql->OrderAsc($tbl->Field('Name')));
        $this->groups = Membergroup::Schema()->Fetch(false, null, $order);
        return parent::Init();
    }
847552
public function initialize()
    {
        $this->data = new stdClass();
        $this->data->holder = new stdClass();
        $this->data->holder->taxDocument = new stdClass();
    }
441256
protected function _prepareForm()
    {
        $model = $this->getModel();

        /** @var \Magento\Framework\Data\Form $form */
        $form = $this->_formFactory->create(
            ['data' => ['id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post']]
        );

        $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('General Information')]);

        if ($model->getId()) {
            $fieldset->addField('thesaurus_id', 'hidden', ['name' => 'thesaurus_id']);
        }

        if ($model->getType()) {
            $fieldset->addField('type', 'hidden', ['name' => 'type']);
        }

        $this->initBaseFields($fieldset);
        $this->initTypeFields($fieldset, $model);

        $form->setValues($model->getData());

        $form->setUseContainer(true);
        $this->setForm($form);

        return parent::_prepareForm();
    }
1302038
protected function Init()
    {
        $this->articles = array();
        $this->articleList = ContentArticleList::Schema()->ByContent($this->Content());
        $this->articlesTotal = 0;
        $this->InitArticles();
        return parent::Init();
    }
1277855
protected function InitForm()
    {
        $this->submit = $this->LoadElement();
        
        $this->AddNameField();
        $this->AddValueField();
        
        $this->AddCssIDField();
        $this->AddCssClassField();
        $this->AddTemplateField();
        $this->AddSubmit();
    }
688873
public function initCreate()
    {
        // setting itemCreate manually is possible.
        if (!$this->itemCreate) {
            $this->itemCreate = $this->menu->addItem($this->itemCreate ?: ['Add new', 'icon' => 'plus']);
            $this->itemCreate->on('click.atk_CRUD', new jsModal('Add new', $this->pageCreate, [$this->name.'_sort' => $this->getSortBy()]));
            $this->itemCreate->set('Add New '.$this->model->getModelCaption());
        }

        // setting callback for the page
        $this->pageCreate->set(function () {

            // formCreate may already be an object added inside pageCreate
            if (!is_object($this->formCreate) || !$this->formCreate->_initialized) {
                $this->formCreate = $this->pageCreate->add($this->formCreate ?: $this->formDefault);
            }

            // $form = $page->add($this->formCreate ?: ['Form', 'layout' => 'FormLayout/Columns']);
            $this->formCreate->setModel($this->model, $this->fieldsCreate ?: $this->fieldsDefault);

            if ($sortBy = $this->getSortBy()) {
                $this->formCreate->stickyGet($this->name.'_sort', $sortBy);
            }

            // set save handler with reload trigger
            // adds default submit hook if it is not already set for this form
            if (!$this->formCreate->hookHasCallbacks('submit')) {
                $this->formCreate->onSubmit(function ($form) {
                    $form->model->save();

                    return $this->jsSaveCreate();
                });
            }
        });
    }
666086
protected function initForm()
    {
		$this->form = \tao_helpers_form_FormFactory::getForm('roleDebug');
		
		$action = \tao_helpers_form_FormFactory::getElement('save', 'Free');
		$action->setValue('<button class="btn-info form-submiter" type="button" id="addButton"><span class="icon-tools"></span>'.__('Restrict').'</button>');
		
		
		$this->form->setActions(array(), 'top');
		$this->form->setActions(array($action), 'bottom');
    }
915452
public function init()
    {
        //klucz
        $this->addElement((new Element\Text('key'))
                ->setLabel('form.text.key.label')
                ->setRequired()
                ->addValidator(new \Mmi\Validator\NotEmpty));

        //zawartość
        $this->addElement((new Element\Textarea('content'))
                ->setLabel('form.text.content.label'));

        //submit
        $this->addElement((new Element\Submit('submit'))
                ->setLabel('form.text.submit.label'));
    }
355790
public function init()
    {
        // Get options
        $filter_slug = $this->currentPage;

        // Check sections
        if (!empty($this->options['sections']) && is_array($this->options['sections'])) {
            foreach ($this->options['sections'] as $sectionSlug => $sectionName) {
                if ($sectionSlug !== $this->currentSection) {
                    continue;
                }

                $filter_slug .= '-'.$this->currentSection;
                break;
            }
        }

        /**
         * Build page contents.
         *
         * @var     string  $currentPage
         * @param   array   $contents
         * @return  array   $contents
         */
        $this->fields = apply_filters('ol_zeus_adminpage_'.$filter_slug.'_contents', []);

        // Display main render
        $this->renderFields();
    }
1126542
protected function Init()
    {
        $select = ContentSelect::Schema()->ByContent($this->Content());
        $disableValidation = $select->GetDisableFrontendValidation();
        $this->label = $select->GetLabel();
        $this->name = $select->GetName();
        $this->required = $disableValidation ? false : $select->GetRequired();
        $this->value = $this->Value($this->name, $select->GetValue());
        $this->id = $this->CssID() ? $this->CssID(): $this->name;
        $list = new SelectListProvider($select);
        $this->options = $list->ToArray();
        $this->RealizeField($this->name);
        return parent::Init();
    }
767398
public function get_form() {
		$this->throws_if_locked( 'access' );

		$form = new Form( $this->get_form_config() );

		// Create the field object instance.
		foreach ( $this->prop( 'fields' ) as $args ) {
			$form->add( $this->get_field( $args )->initialize() );
		}

		// Automatically initialize the form if it is configured so.
		if ( $this->get_auto_initialize() ) {
			$form->initialize();
		}

		return $form;
	}
246176
protected function Init()
    {
        $this->container = new Container(Request::GetData('container'));
        $this->containerRights = new ContainerRights($this->container->GetUserGroupRights());
        $this->AddNameField();
        $this->AddUserGroupField();
        $this->AddSubmit();
        return parent::Init();
    }
1114370
public function initForm()
    {
        $this->form = new \tao_helpers_form_xhtml_Form('export');

        $this->form->setDecorators(array(
            'element'			=> new \tao_helpers_form_xhtml_TagWrapper(array('tag' => 'div')),
            'group'				=> new \tao_helpers_form_xhtml_TagWrapper(array('tag' => 'div', 'cssClass' => 'form-group')),
            'error'				=> new \tao_helpers_form_xhtml_TagWrapper(array('tag' => 'div', 'cssClass' => 'form-error ui-state-error ui-corner-all')),
            'actions-bottom'	=> new \tao_helpers_form_xhtml_TagWrapper(array('tag' => 'div', 'cssClass' => 'form-toolbar')),
            'actions-top'		=> new \tao_helpers_form_xhtml_TagWrapper(array('tag' => 'div', 'cssClass' => 'form-toolbar'))
        ));

        $hiddenClassElt = \tao_helpers_form_FormFactory::getElement('xml_desc', 'Hidden');
        $hiddenClassElt->setValue(null);
        $this->form->addElement($hiddenClassElt);
        $hiddenClassElt = \tao_helpers_form_FormFactory::getElement('exportInstance', 'Hidden');
        $hiddenClassElt->setValue(null);
        $this->form->addElement($hiddenClassElt);

        $exportElt = \tao_helpers_form_FormFactory::getElement('export', 'Free');
        $exportElt->setValue('<a href="#" class="form-submitter btn-success small"><span class="icon-export"></span> ' .__('Export metadata').'</a>');
        $this->form->setActions(array($exportElt), 'bottom');

    }
429249
public function init()
    {
        $this->registryTableExists();

        if (empty($this->registry[$this->section])) {

            $this->registry[$this->section] = $this->getContent();
        }

        return $this->registry[$this->section];
    }