Defines the task parameters to be stored for later use.

@param tao_helpers_form_Form $form
@return array
179563
public function getTaskParameters(tao_helpers_form_Form $form)
    {
        return array_merge(
            $form->getValues(),
            [
                'property_mapping' => $form->getValues('property_mapping'),
                'ranged_property' => $form->getValues('ranged_property')
            ],
            $this->getDefaultTaskParameters($form)
        );
    }
1049877
protected function getConditionBuilder(Form $form)
    {
        $builderClosure = $form->getConfig()->getAttribute('filter_condition_builder');

        $builder = new ConditionBuilder();

        if ($builderClosure instanceof \Closure) {
            $builderClosure($builder);
        } else {
            $this->buildDefaultConditionNode($form, $builder->root('AND'));
        }

        return $builder;
    }
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');
    }
3214
public function initForm()
    {
        $this->form = tao_helpers_form_FormFactory::getForm('passwordRecoveryForm');

        $connectElt = tao_helpers_form_FormFactory::getElement('recovery', 'Submit');
        $connectElt->setValue(__('Email'));
        $connectElt->setAttribute('class', 'btn-success small');
        $this->form->setActions(array($connectElt), 'bottom');
    }
847168
public static function getValidationGroups(FormInterface $form)
    {
        $cfg = $form->getConfig();

        if ($cfg->hasOption('jquery_validation_groups')) {
            $groups = $cfg->getOption('jquery_validation_groups');
        } else {
            $groups = $cfg->getOption('validation_groups');
        }

        # Is the default validation group used
        if ($groups === null) {
            return array(Constraint::DEFAULT_GROUP);
        }

        # Is the validation suppressed
        if ($groups === false) {
            return array();
        }

        # Is a unsupported group used
        if (!is_string($groups) && is_callable($groups)) {
            throw new UnsupportedException('Callable validation_groups are not supported. Disable jquery_validation or set jquery_validation_groups');
        }

        return (array) $groups;
    }
87766
public static function populateForm(Form $form)
	{
		if (static::$builder === null)
		{
			static::setBuilder(new V1Model);

			static::$builder->setWrapperElement(null);
		}

		$elements = static::$builder->generate(get_called_class());

		return $form->setContents($elements);
	}
294109
public function form(Form $form)
    {
        $tag = new Tag('form');
        $tag->setAttribute('action', $form->getAction());
        $tag->setAttribute('accept', $form->getAccept());
        $tag->setAttribute('accept-charset', $form->getAcceptCharset());
        $tag->setAttribute('enctype', $form->getEnctype());
        $tag->setAttribute('method', $form->getMethod());
        $tag->setAttribute('target', $form->getTarget());

        $html = $this->parseTag($tag, $form);

        $fields = $form->getFieldsByClass('HiddenField');

        if (sizeof($fields) > 0) {
            $html .= '<ins>' . PHP_EOL;

            foreach ($fields as $field) {
                // hidden fields
                $tag = new Tag('input');
                $tag->setAttribute('type', 'hidden');

                $html .= $this->parseTag($tag, $field) . PHP_EOL;
            }
            $html .= '</ins>' . PHP_EOL;
        }

        return $html;
    }
360211
public function setForm($form)
    {
        // Associate Fields with Form:
        
        $this->honeypot->setForm($form);
        $this->timestamp->setForm($form);
        
        // Call Parent Method:
        
        return parent::setForm($form);
    }
1178050
public function define(Form $form)
    {
        $this->namespaces = new PriorityQueue();
        $this->namespaces->insert('Windwalker\Form\Field', PriorityQueue::NORMAL);

        $this->bootTraits($this);

        $this->form = $form;

        $this->doDefine($form);
    }
929549
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);


        $this->form->setActions(\tao_helpers_form_FormFactory::getCommonActions(), 'bottom');
    }
1043270
protected function resetPasswordFirstStep($form)
    {
        $loginMail = $form->getSubmitValue('form_login');
        $password  = $form->getSubmitValue('form_password');

        try {
            $this->passwordResetter->initiatePasswordResetProcess($loginMail, $password);
        } catch (Exception $ex) {
            Log::debug($ex);

            return array($ex->getMessage());
        }

        return null;
    }
705423
public function getState(Form $form)
    {
        $state = [
            'id' => $form->FormName(),
            'fields' => [],
            'messages' => [],
            'notifyUnsavedChanges' => $form->getNotifyUnsavedChanges(),
        ];

        // flattened nested fields are returned, rather than only top level fields.
        $state['fields'] = array_merge(
            $this->getFieldStates($form->Fields()),
            $this->getFieldStates($form->Actions())
        );

        if ($message = $form->getSchemaMessage()) {
            $state['messages'][] = $message;
        }

        return $state;
    }
1175166
public function getErrorMessages(Form $form)
    {
        $errors = '';

        foreach ($form->getErrors() as $key => $error) {
            $errors .= $error->getMessage().', ';
        }

        /** @var Form $child */
        foreach ($form->all() as $child) {
            if (!$child->isValid()) {
                $fieldName = $child->getConfig()->getOption('label', null);

                if (empty($fieldName)) {
                    $fieldName = $child->getName();
                }

                $errors .= sprintf("[%s] %s, ", $fieldName, $this->getErrorMessages($child));
            }
        }

        return rtrim($errors, ', ');
    }
216185
public function form($form = null)
    {
        if (func_num_args() === 1) {
            $form = $form ?: [];
            $this->_form = $form;
            $this->set($form);
            return $this;
        }
        return $this->_form;
    }
331689
public function submit(Form $form)
    {
        return $this->request($form->getUri(), $form->getMethod(), $form->getPhpValues(), $form->getPhpFiles());
    }
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');

    }
1137404
public function setForm($Form)
    {
        if (! is_object($Form) || ! $Form instanceof Helpers\Form) {
            throw new \InvalidArgumentException(
                'The Form Object must be a valid Helpers\Form Object'
            );
        }
        $this->Form = $Form;

        return true;
    }