@param Fieldset $fieldset
@param boolean  $groupActions

@return HtmlElement
10382
protected function renderFieldset(Fieldset $fieldset, $groupActions = false)
    {
        $fieldsetElement = new HtmlElement('fieldset');
        $id              = $fieldset->getAttribute('id') ? : $fieldset->getName();
        $parent          = $this->getElement();

        $fieldsetElement->addAttribute('id', $id);

        /**
         * This changes the scope of the current element,
         * so that the child elements (the ones that are about to be rendered),
         * will be set on the fieldset.
         * Then change it back again so that the fieldset will be added to the form.
         */
        $this
            ->setElement($fieldsetElement)
            ->renderElements($fieldset, $groupActions)
            ->setElement($parent);

        return $fieldsetElement;
    }
987179
public function getActionsToModule(Module $module, GroupInterface $group)
    {
        $htmlReturn = '';

        $doctrine = $this->container->get('doctrine');

        $actions = $doctrine
            ->getRepository(
                $this->container->getParameter('bacon_acl.entities.module_actions')
            )->findBy(['module' => $module])
        ;

        $checkeds = $this->proccessHasChecked($group);

        foreach ($actions as $action) {

            $checked = '';

            if (in_array($action->getId(), $checkeds)) {
                $checked = 'checked';
            }

            $htmlReturn .= '
                <div class="checkbox">
                    <label style="padding-left: 18px">
                        <input type="checkbox" value="'. $action->getId() .'" name="actions_name['.$action->getId().']" '.$checked.' />
                        '. $action->getName() .'
                    </label>
                </div>
            ';
        }

        return $htmlReturn;
    }
1279274
public function getGroupActionCollection()
	{
		if (!$this->group_action_collection) {
			$this->group_action_collection = new GroupAction\GroupActionCollection($this);
		}

		return $this->group_action_collection;
	}
692810
private function addSortFields(Fieldset $fieldset)
    {
        $sortFieldsOptions = [
            ['value' => '_first', 'label' => __("First")],
            ['value' => '_last',  'label' => __("Last")],
        ];

        $fieldset->addField(
            'sort_order_asc_missing',
            'select',
            [
                'name'   => 'sort_order_asc_missing',
                'label'  => __('Sort products without value when sorting ASC'),
                'values' => $sortFieldsOptions,
                'note'   => __('How the products which are missing values for this attribute should be treated when using it to sort.'),
            ],
            'used_for_sortby'
        );

        $fieldset->addField(
            'sort_order_desc_missing',
            'select',
            [
                'name'   => 'sort_order_desc_missing',
                'label'  => __('Sort products without value when sorting DESC'),
                'values' => $sortFieldsOptions,
                'note'   => __('How the products which are missing values for this attribute should be treated when using it to sort.'),
            ],
            'sort_order_asc_missing'
        );

        return $this;
    }
305373
public function addField($field, $fieldset = null, $group = null)
    {
        $field = FieldHelper::create($field);

        $fieldset = $fieldset ?: $this->wrap['fieldset'];
        $group = $group ?: $this->wrap['group'];

        if ($fieldset) {
            $field->setFieldset($fieldset);
        }

        if ($group) {
            $field->setGroup($group);
        }

        $group = $field->getGroup();
        $fieldset = $field->getFieldset();

        if ($group && !in_array($group, $this->groups)) {
            $this->groups[] = $group;
        }

        if ($fieldset && !in_array($fieldset, $this->fieldsets)) {
            $this->fieldsets[] = $fieldset;
        }

        $field->setControl($this->control)
            ->setForm($this);

        $this->fields[$field->getName(true)] = $field;

        return $field;
    }
380465
public function getGroupAction($groupActions = null) {
		if (!$this->_controller->request->is('post')) {
			return false;
		}

		$action = $this->_controller->request->data('FilterGroup.action');
		if (empty($action) || (!empty($groupActions) && !is_array($groupActions))) {
			return false;
		}

		if (empty($groupActions)) {
			return $action;
		} elseif (in_array($action, $groupActions)) {
			return $action;
		} else {
			return false;
		}
	}
1278762
public function checkboxGroup($name, $options, $selected = null, $htmlOptions = [], $template = '<input><label>', $separator = '<br />')
    {
        if (is_null($selected)) {
            $selected = $this->getArrayValue($_POST, $name);
            if (is_null($selected)) {
                $selected = $this->getArrayValue($_GET, $name);
            }
        }
        $r = array();
        foreach ($options as $value => $label) {
            $r[] = $this->checkbox($name . '[]', $label, $value, is_array($selected) ? in_array($value, $selected) : $selected == $value, $htmlOptions, $template);
        }
        return implode($separator, $r);
    }
1351233
protected function renderDescription($text, $isFieldset = false)
    {
        $output = '';

        // Help text.
        if (!empty($text)) {
            // Allow for links in the help text, so no filtering anymore.
            $wrapperType = $isFieldset ? 'fieldsetDescription' : 'description';
            $output .= $this->getWrapper($wrapperType);
            $output .= $text;
            $output .= $this->getWrapperEnd($wrapperType);
        }

        return $output;
    }
854162
protected function setupFieldset(Fieldset $fieldset, Rule $rule)
    {
        $fieldset->control('input:text', 'value')
                ->value($rule->getValue())
                ->label(trans('antares/ban_management::label.rule.value'))
                ->help(trans('antares/ban_management::label.rule.wildcard_tip'));

        $fieldset->control('input:text', 'expired_at')
                ->value($rule->getExpirationDate() ? $rule->getExpirationDate()->toDateString() : '')
                ->attributes([
                    'class' => 'datepicker-expired_at',
                ])
                ->label(trans('antares/ban_management::label.rule.expiration_date'));

        $fieldset->control('input:hidden', 'enabled')->value(0);
        $fieldset->control('input:hidden', 'trusted')->value(0);

        $fieldset->control('input:checkbox', 'enabled')
                ->attributes($rule->isEnabled() ? ['checked'] : [])
                ->value(1)
                ->label(trans('antares/ban_management::label.rule.enabled'));

        $fieldset->control('input:checkbox', 'trusted')
                ->attributes($rule->isTrusted() ? ['checked'] : [])
                ->value(1)
                ->label(trans('antares/ban_management::label.rule.trusted'))
                ->help(trans('antares/ban_management::label.rule.trusted_tip'));

        $fieldset->control('input:text', 'internal_reason')
                ->value($rule->getInternalReason())
                ->label(trans('antares/ban_management::label.rule.note'));


        $fieldset->control('input:textarea', 'reason')
                ->value($rule->getReason())
                ->label(trans('antares/ban_management::label.rule.reason'));


        $fieldset->control('button', 'button')
                ->attributes(['type' => 'submit', 'class' => 'btn btn-primary'])
                ->value(trans('antares/foundation::label.save_changes'));

        $fieldset->control('button', 'cancel')
                ->field(function() {
                    return app('html')->link(handles('antares::ban_management/rules'), trans('antares/foundation::label.cancel'), ['class' => 'btn btn--md btn--default mdl-button mdl-js-button']);
                });
    }
63166
public function processGroupAction($groupAction = null, $conditions = null) {
		if (($groupAction === false) || empty($conditions)) {
			return null;
		}

		$result = false;
		switch ($groupAction) {
			case 'group-data-del':
				$result = $this->deleteAll($conditions, false);
				break;
		}

		return $result;
	}
1025984
private function initBaseFields($fieldset)
    {
        $fieldset->addField(
            'name',
            'text',
            [
                'name'     => 'name',
                'label'    => __('Thesaurus Name'),
                'title'    => __('Thesaurus Name'),
                'required' => true,
            ]
        );

        $fieldset->addField(
            'is_active',
            'select',
            [
                'name'     => 'is_active',
                'label'    => __('Active'),
                'title'    => __('Active'),
                'values'   => $this->booleanSource->toOptionArray(),
            ]
        );

        if (!$this->_storeManager->isSingleStoreMode()) {
            $field = $fieldset->addField(
                'store_id',
                'multiselect',
                [
                    'name'     => 'stores[]',
                    'label'    => __('Store'),
                    'title'    => __('Store'),
                    'values'   => $this->systemStore->getStoreValuesForForm(false, true),
                    'required' => true,
                ]
            );
            $renderer = $this->getLayout()->createBlock(
                'Magento\Backend\Block\Store\Switcher\Form\Renderer\Fieldset\Element'
            );

            $field->setRenderer($renderer);
        }

        return $this;
    }
489971
protected function userForm(Fieldset $fieldset, Fluent $model): void
    {
        $fieldset->control('input:email', 'email')
            ->label(\trans('orchestra/foundation::label.users.email'));

        $fieldset->control('password', 'password')
            ->label(\trans('orchestra/foundation::label.users.password'));

        $fieldset->control('text', 'fullname')
            ->label(\trans('orchestra/foundation::label.users.fullname'))
            ->value('Administrator');
    }
1201357
public function getField($groupKey, $fieldKey)
    {
        foreach ($this->parts as $part) {
            if ($part->getKey() !== $groupKey) {
                continue;
            }
            
            foreach ($part->getParts() as $field) {
                if ($field->getKey() !== $fieldKey) {
                    continue;
                }
                
                return $field;
            }
        }
        
        return false;
    }
976435
protected function transformFieldset(Fieldset $fieldset)
    {
        $controls = [];

        foreach ($fieldset->controls() as $control) {
            $type = $control->get('type');

            if (!in_array($type, self::$protectedTypes)) {
                $controls[] = $this->transformControlField($control);
            }
        }

        $this->fieldsets[] = [
            'name'     => $fieldset->getName(),
            'controls' => $controls,
        ];
    }
123583
public function wrap($fieldset, $group, \Closure $handler)
    {
        $bakFieldset = $this->wrap['fieldset'];
        $bakGroup = $this->wrap['group'];

        if ($fieldset !== null) {
            $this->wrap['fieldset'] = $fieldset;
        }

        if ($group !== null) {
            $this->wrap['group'] = $group;
        }

        $handler($this);

        if ($fieldset !== null) {
            $this->wrap['fieldset'] = $bakFieldset;
        }

        if ($group !== null) {
            $this->wrap['group'] = $bakGroup;
        }

        return $this;
    }
605376
public function set_parent(Fieldset $fieldset)
	{
		if ( ! empty($this->fieldset_parent))
		{
			throw new \RuntimeException('Fieldset already has a parent, belongs to "'.$this->parent()->name.'".');
		}

		$children = $fieldset->children();
		while ($child = array_shift($children))
		{
			if ($child === $this)
			{
				throw new \RuntimeException('Circular reference detected, adding a Fieldset that\'s already a child as a parent.');
			}
			$children = array_merge($child->children(), $children);
		}

		$this->fieldset_parent = $fieldset;
		$fieldset->add_child($this);
		return $this;
	}
1026290
protected function add_child(Fieldset $fieldset)
	{
		if (is_null($fieldset->fieldset_tag))
		{
			$fieldset->fieldset_tag = 'fieldset';
		}

		$this->fieldset_children[$fieldset->name] = $fieldset;
		return $this;
	}