Ejemplo n.º 1
0
 protected function managementForm($widgetData = array())
 {
     $form = new \Ip\Form();
     $form->setEnvironment('admin');
     $form->addField(new \Ip\Form\Field\Hidden(array('name' => 'aa', 'value' => 'Block.checkForm', 'validator' => array("Required"))));
     $fieldset = new \Ip\Form\Fieldset();
     $fieldset->addField(new \Ip\Form\Field\Color(array('label' => __('Text Color', 'Block'), 'name' => 'color', 'validator' => array("Required"), 'value' => isset($widgetData['color']) ? $widgetData['color'] : ipGetThemeOption('ipTextColor', '000000'))));
     $form->addFieldset($fieldset);
     $fieldset = new \Ip\Form\Fieldset("Background");
     $fieldset->addField(new \Ip\Form\Field\Color(array('label' => __('Background color', 'Block'), 'name' => 'background_color', 'validator' => array("Required"), 'value' => isset($widgetData['background_color']) ? $widgetData['background_color'] : 'dedede')));
     $fieldset->addField(new \Ip\Form\Field\Number(array('label' => __('Background color transparency in percent', 'Block'), 'name' => 'transparency', 'validator' => array("Required"), 'value' => isset($widgetData['transparency']) ? $widgetData['transparency'] : 0)));
     $fieldset->addField(new \Ip\Form\Field\Checkbox(array('label' => __('Background image', 'Block'), 'name' => 'show_background_image', 'validator' => array("Required"), 'value' => isset($widgetData['show_background_image']) ? $widgetData['show_background_image'] : false)));
     $fieldset->addField(new \Ip\Form\Field\Hidden(array('name' => 'background_image', 'value' => isset($widgetData['background_image']) ? $widgetData['background_image'] : null)));
     $fieldset->addField(new \Ip\Form\Field\Info(array('html' => ' <div class="ipsEditScreen"></div>')));
     $form->addFieldset($fieldset);
     $fieldset = new \Ip\Form\Fieldset("Advanced");
     $fieldset->addField(new \Ip\Form\Field\Checkbox(array('label' => __('Fixed background', 'Block'), 'name' => 'fixed_background', 'validator' => array("Required"), 'value' => isset($widgetData['fixed_background']) ? $widgetData['fixed_background'] : false, 'hint' => __('Fixed background image will be fixed to viewport causing parallax effect.', 'Block'))));
     $fieldset->addField(new \Ip\Form\Field\Checkbox(array('label' => __('Blur background image', 'Block'), 'name' => 'blur_background_image', 'validator' => array("Required"), 'value' => isset($widgetData['blur_background_image']) ? $widgetData['blur_background_image'] : false)));
     $fieldset->addField(new \Ip\Form\Field\Number(array('label' => __('Blur radius(pixels)', 'Block'), 'name' => 'blur_radius', 'validator' => array("Required"), 'value' => isset($widgetData['blur_radius']) ? $widgetData['blur_radius'] : 5)));
     $fieldset->addField(new \Ip\Form\Field\Checkbox(array('label' => __('Text shadow', 'Block'), 'name' => 'text_shadow', 'validator' => array("Required"), 'value' => isset($widgetData['text_shadow']) ? $widgetData['text_shadow'] : false)));
     $values = array(array('cover', 'Cover'), array('contain', 'Contain'), array('auto', 'Auto'), array('100% auto', 'Fit width'), array('auto 100%', 'Fit height'));
     $fieldset->addField(new \Ip\Form\Field\Select(array('label' => __('Background size', 'Block'), 'name' => 'background_size', 'values' => $values, 'value' => isset($widgetData['background_size']) ? $widgetData['background_size'] : 'cover', 'hint' => __('Cover: Scale the background image to be as large as possible so that the background area is completely covered by the background image. Some parts of the background image may not be in view within the background positioning area. Contain: Scale the image to the largest size such that both its width and its height can fit inside the content area. Auto: The background-image contains its width and height. Fit width: will scale image to match width. Fit height: will scale image to match height.', 'Block'))));
     $fieldset->addField(new \Ip\Form\Field\Checkbox(array('label' => __('Background repeat', 'Block'), 'name' => 'background_repeat', 'validator' => array("Required"), 'value' => isset($widgetData['background_repeat']) ? $widgetData['background_repeat'] : true)));
     $fieldset->addField(new \Ip\Form\Field\Number(array('label' => __('Image width', 'Block'), 'hint' => __('If you want to optimize background image you can change the size of it. Beware that big images slows down page load speed, but small images will look bad if background is big. You can try to change size, repeat and blur to improve quality of lower resolution images.', 'Block'), 'name' => 'width', 'validator' => array("Required"), 'value' => isset($widgetData['width']) ? $widgetData['width'] : 960)));
     $fieldset->addField(new \Ip\Form\Field\Number(array('label' => __('Image height', 'Block'), 'name' => 'height', 'validator' => array("Required"), 'value' => isset($widgetData['height']) ? $widgetData['height'] : 640)));
     $form->addFieldset($fieldset);
     return $form;
 }
Ejemplo n.º 2
0
 public static function pagePropertiesForm($pageId)
 {
     $page = new \Ip\Page($pageId);
     $form = new \Ip\Form();
     $form->setEnvironment(\Ip\Form::ENVIRONMENT_ADMIN);
     $field = new \Ip\Form\Field\Hidden(array('name' => 'aa', 'value' => 'Pages.updatePage'));
     $form->addField($field);
     $field = new \Ip\Form\Field\Hidden(array('name' => 'pageId', 'value' => $pageId));
     $form->addField($field);
     $field = new \Ip\Form\Field\Text(array('name' => 'title', 'label' => __('Title', 'Ip-admin', false), 'value' => $page->getTitle()));
     $form->addField($field);
     $field = new \Ip\Form\Field\Text(array('name' => 'urlPath', 'label' => __('URL path', 'Ip-admin', false), 'value' => $page->getUrlPath()));
     $form->addField($field);
     $field = new \Ip\Form\Field\Checkbox(array('name' => 'isVisible', 'label' => __('Visible', 'Ip-admin', false), 'value' => $page->isVisible()));
     $form->addField($field);
     $layouts = \Ip\Internal\Design\Service::getLayouts();
     $options = array();
     foreach ($layouts as $layout) {
         $options[] = array($layout, $layout);
     }
     $field = new \Ip\Form\Field\Select(array('name' => 'layout', 'label' => __('Layout', 'Ip-admin', false), 'values' => $options, 'value' => $page->getLayout()));
     $form->addField($field);
     $fieldset = new \Ip\Form\Fieldset(__('Seo', 'Ip-admin', false));
     $form->addFieldset($fieldset);
     $field = new \Ip\Form\Field\Text(array('name' => 'metaTitle', 'label' => __('Meta title', 'Ip-admin', false), 'value' => $page->getMetaTitle()));
     $form->addField($field);
     $field = new \Ip\Form\Field\Text(array('name' => 'keywords', 'label' => __('Keywords', 'Ip-admin', false), 'value' => $page->getKeywords()));
     $form->addField($field);
     $field = new \Ip\Form\Field\Textarea(array('name' => 'description', 'label' => __('Description', 'Ip-admin', false), 'value' => $page->getDescription()));
     $form->addField($field);
     $fieldset = new \Ip\Form\Fieldset(__('Other', 'Ip-admin', false));
     $form->addFieldset($fieldset);
     $field = new \Ip\Form\Field\Url(array('name' => 'redirectUrl', 'label' => __('Redirect', 'Ip-admin', false), 'value' => $page->getRedirectUrl()));
     $form->addField($field);
     $field = new \Ip\Form\Field\Checkbox(array('name' => 'isDisabled', 'label' => __('Disabled', 'Ip-admin', false), 'value' => $page->isDisabled(), 'note' => __('Won\'t be clickable in menu if selected.', 'Ip-admin', false)));
     $form->addField($field);
     $field = new \Ip\Form\Field\Checkbox(array('name' => 'isSecured', 'label' => __('Secured', 'Ip-admin', false), 'value' => $page->isSecured(), 'note' => __('Won\'t be accessible to view even knowing the URL.', 'Ip-admin', false)));
     $form->addField($field);
     $field = new \Ip\Form\Field\Checkbox(array('name' => 'isBlank', 'label' => __('Open in new window', 'Ip-admin', false), 'value' => $page->isBlank()));
     $form->addField($field);
     $field = new \Ip\Form\Field\Text(array('name' => 'alias', 'label' => __('Alias (used in code)', 'Ip-admin', false), 'value' => $page->getAlias()));
     $form->addField($field);
     $field = new \Ip\Form\Field\Text(array('name' => 'createdAt', 'label' => __('Created on', 'Ip-admin', false), 'value' => date('Y-m-d', strtotime($page->getCreatedAt()))));
     $form->addField($field);
     $field = new \Ip\Form\Field\Text(array('name' => 'updatedAt', 'label' => __('Updated on', 'Ip-admin', false), 'value' => date('Y-m-d', strtotime($page->getUpdatedAt()))));
     $form->addField($field);
     $form = ipFilter('ipPagePropertiesForm', $form, array('pageId' => $pageId));
     return $form;
 }
Ejemplo n.º 3
0
 public function adminHtmlSnippet()
 {
     $form = new \Ip\Form();
     $yesNo = array(array(0, __('No', 'AsdBlog')), array(1, __('Yes', 'AsdBlog')));
     $default[] = array(0, __('Current page subpages', 'AsdBlog'));
     $results = array_merge($default, Model::getPagesList());
     $form->addField(new \Ip\Form\Field\Hidden(array('name' => 'data[blog][pageId]', 'value' => ipContent()->getCurrentPage()->getId())));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[blog][place]', 'label' => __('Blog posts source', 'AsdBlog'), 'values' => $results)));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[blog][parent]', 'label' => __('Make parent page act like post category', 'AsdBlog'), 'values' => $yesNo, 'note' => __('One level depth only', 'AsdBlog'))));
     $form->addFieldset(new \Ip\Form\Fieldset(__('Pagination', 'AsdBlog')));
     $paginationTypes = array(array(3, __('Show pagination', 'AsdBlog')), array(1, __('Show page numbers only', 'AsdBlog')), array(2, __('Show Prev/Next links only', 'AsdBlog')), array(0, __('Do not show pagination', 'AsdBlog')));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[blog][pagination][type]', 'label' => __('Type', 'AsdBlog'), 'values' => $paginationTypes)));
     $form->addField(new \Ip\Form\Field\Text(array('name' => 'data[blog][pagination][limit]', 'label' => __('Post limit per page', 'AsdBlog'), 'value' => ipGetOption('AsdBlog.postLimit'))));
     $form->addFieldset(new \Ip\Form\Fieldset(__('Options', 'AsdBlog')));
     $orderTypes = array(array(0, __('By date DESC', 'AsdBlog')), array(1, __('By date ASC', 'AsdBlog')), array(2, __('By page position DESC', 'AsdBlog')), array(3, __('By page position ASC', 'AsdBlog')));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[blog][options][order]', 'label' => __('Order by', 'AsdBlog'), 'values' => $orderTypes)));
     $form->addField(new \Ip\Form\Field\Text(array('name' => 'data[blog][options][introlimit]', 'label' => __('Intro limit (if seperator is not placed)', 'AsdBlog'), 'value' => ipGetOption('AsdBlog.introLimit'))));
     $form->addField(new \Ip\Form\Field\Text(array('name' => 'data[blog][options][allowedtags]', 'label' => __('Allowed tags', 'AsdBlog'), 'note' => 'All other will be stripped', 'value' => ipGetOption('AsdBlog.allowedTags'))));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[blog][options][readmore]', 'label' => __('Show read more link?', 'AsdBlog'), 'values' => $yesNo, 'value' => ipGetOption('AsdBlog.showReadMore') == 'Yes' ? 1 : 0)));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[blog][options][titlelink]', 'label' => __('Show title as link to post?', 'AsdBlog'), 'values' => $yesNo, 'value' => ipGetOption('AsdBlog.addTitlelink') == 'Yes' ? 1 : 0)));
     $form->addField(new \Ip\Form\Field\Text(array('name' => 'data[blog][options][blockname]', 'label' => __('Post block name', 'AsdBlog'), 'value' => ipGetOption('AsdBlog.blockName'))));
     $yesNoUpBot = array(array(0, __('No', 'AsdBlog')), array(1, __('Yes, top', 'AsdBlog')), array(2, __('Yes, bottom', 'AsdBlog')));
     $form->addFieldset(new \Ip\Form\Fieldset(__('Post aditional information', 'AsdBlog')));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[blog][info][date]', 'label' => __('Show post date', 'AsdBlog'), 'values' => $yesNoUpBot, 'value' => ipGetOption('AsdBlog.showDate') == 'Yes' ? 1 : 0)));
     //This functionality will be added later
     // $form->addField(new \Ip\Form\Field\Select(
     //     array(
     //         'name' => 'data[blog][info][time]',
     //         'label' => __( 'Show post time', 'AsdBlog' ),
     //         'values' => $yesNoUpBot,
     //         'value' => ipGetOption( 'AsdBlog.showTime' ) == 'Yes' ? 1 : 0
     //     )
     // ));
     //This functionality will be added later
     // $form->addField(new \Ip\Form\Field\Select(
     //     array(
     //         'name' => 'data[blog][info][author]',
     //         'label' => __( 'Show author name', 'AsdBlog' ),
     //         'values' => $yesNoUpBot,
     //     )
     // ));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[blog][info][category]', 'label' => __('Show category name', 'AsdBlog'), 'values' => $yesNoUpBot)));
     $form->addFieldset(new \Ip\Form\Fieldset(__('Image options', 'AsdBlog')));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[blog][image][enable]', 'label' => __('Enable image', 'AsdBlog'), 'values' => $yesNo, 'note' => __('First image of post will be displayed', 'AsdBlog'))));
     $form->addField(new \Ip\Form\Field\Text(array('name' => 'data[blog][image][width]', 'label' => __('Image width', 'AsdBlog'), 'value' => ipGetOption('AsdBlog.imageWidth'))));
     $form->addField(new \Ip\Form\Field\Text(array('name' => 'data[blog][image][height]', 'label' => __('Image height', 'AsdBlog'), 'value' => ipGetOption('AsdBlog.imageHeight'))));
     return ipView('snippet/edit.php', array('form' => $form))->render();
 }
Ejemplo n.º 4
0
 /**
  * Creates the widgets edit form
  *
  * @return \Ip\Form
  * @throws \Ip\Exception
  */
 public static function editForm()
 {
     $form = new \Ip\Form();
     $form->setEnvironment(\Ip\Form::ENVIRONMENT_ADMIN);
     $form->addFieldset(new \Ip\Form\Fieldset(__('Source data', 'DataTableWidget-admin', false)));
     $field = new SingleFile(array('name' => 'sourceFile', 'label' => __('File', 'DataTableWidget-admin', false) . ':'));
     $form->addField($field);
     $form->addFieldset(new \Ip\Form\Fieldset(__('View', 'DataTableWidget-admin', false)));
     $tableTypes = TableType::getAllAsArray();
     $values = array();
     foreach ($tableTypes as $tableType) {
         $values[] = array($tableType['id'], $tableType['name']);
     }
     $field = new \Ip\Form\Field\Select(array('name' => 'tableTypeId', 'label' => __('Table type', 'DataTableWidget-admin', false) . ':', 'values' => $values));
     $field->addValidator('Required');
     $form->addField($field);
     return $form;
 }
Ejemplo n.º 5
0
 public function adminHtmlSnippet()
 {
     $form = new \Ip\Form();
     $results = Model::getMenusList();
     $yesNo = array(array(0, __('No', 'AsdMenuWidget')), array(1, __('Yes', 'AsdMenuWidget')));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[menu][name]', 'label' => __('Menu name', 'AsdMenuWidget'), 'values' => $results)));
     $visibilityOptions = array(array(0, __('All pages', 'AsdMenuWidget')), array(1, __('Parent page and its childrens', 'AsdMenuWidget')), array(2, __('Current page only', 'AsdMenuWidget')));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[menu][visibility]', 'label' => __('Visibility', 'AsdMenuWidget'), 'values' => $visibilityOptions)));
     $form->addField(new \Ip\Form\Field\Hidden(array('name' => 'data[menu][pageId]', 'value' => ipContent()->getCurrentPage()->getId())));
     $form->addFieldset(new \Ip\Form\Fieldset(__('Options', 'AsdMenuWidget')));
     $form->addField(new \Ip\Form\Field\Text(array('name' => 'data[menu][class]', 'label' => __('Class name', 'AsdMenuWidget'), 'value' => 'menu')));
     $form->addField(new \Ip\Form\Field\Text(array('name' => 'data[menu][parent]', 'label' => __('Parent class name', 'AsdMenuWidget'), 'value' => 'parent')));
     $form->addField(new \Ip\Form\Field\Text(array('name' => 'data[menu][active]', 'label' => __('Active class name', 'AsdMenuWidget'), 'value' => 'active')));
     $form->addField(new \Ip\Form\Field\Text(array('name' => 'data[menu][depth]', 'label' => __('Depth', 'AsdMenuWidget'), 'value' => '0', 'note' => __('empty or 0 value shows all menu levels', 'AsdMenuWidget'))));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[menu][nochild]', 'label' => __('Hide inactive menu child elements', 'AsdMenuWidget'), 'values' => $yesNo)));
     $form->addFieldset(new \Ip\Form\Fieldset('Icon options'));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[icon][enable]', 'label' => __('Enable icons', 'AsdMenuWidget'), 'values' => $yesNo)));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[icon][text]', 'label' => __('Show text', 'AsdMenuWidget'), 'values' => $yesNo)));
     $form->addField(new \Ip\Form\Field\Select(array('name' => 'data[icon][empty]', 'label' => __('Show empty image', 'AsdMenuWidget'), 'note' => __('If no image chosen, shows transparent image.', 'AsdMenuWidget'), 'values' => $yesNo)));
     $form->addField(new \Ip\Form\Field\Text(array('name' => 'data[icon][width]', 'label' => __('Icon width', 'AsdMenuWidget'), 'value' => '50')));
     $form->addField(new \Ip\Form\Field\Text(array('name' => 'data[icon][height]', 'label' => __('Icon height', 'AsdMenuWidget'), 'value' => '50')));
     return ipView('snippet/edit.php', array('form' => $form))->render();
 }
Ejemplo n.º 6
0
 private static function createBaseForm($isSpecificColumnRequired)
 {
     $form = new \Ip\Form();
     $form->setEnvironment(\Ip\Form::ENVIRONMENT_ADMIN);
     // GENERAL
     $form->addFieldset(new \Ip\Form\Fieldset(__('General', 'Ip-admin', false)));
     $field = new \Ip\Form\Field\Text(array('name' => 'name', 'label' => __('Name', 'Ip-admin', false)));
     $field->addValidator("Required");
     $field->addAttribute('ng-model', 'editTableType.name');
     $form->addField($field);
     $languages = array();
     foreach (ipContent()->getLanguages() as $language) {
         $languages[] = array(intval($language->getId()), $language->getTitle());
     }
     $field = new \Ip\Form\Field\Select(array('name' => 'language', 'label' => __('Target language', 'DataTableWidget-admin', false), 'values' => $languages));
     $field->addValidator("Required");
     $form->addField($field);
     // DISPLAY OPTIONS
     $form->addFieldset(new \Ip\Form\Fieldset(__('Display options', 'DataTableWidget-admin', false)));
     $columnOptionsValues = array();
     foreach (TableType::getColumnOptions() as $key => $tableOption) {
         $columnOptionsValues[] = array($key, $tableOption['name']);
     }
     $field = new \Ip\Form\Field\Radio(array('name' => 'columnOption', 'label' => __('Columns and headings', 'DataTableWidget-admin', false), 'values' => $columnOptionsValues));
     $field->addAttribute('ng-model', 'editTableType.columnOption');
     $field->addAttribute('ng-change', 'selectedColumnOptionChanged()');
     $form->addField($field);
     $field = new SpecificColumn();
     $field->removeAttribute('id');
     if ($isSpecificColumnRequired) {
         $field->addValidator("Required");
     }
     $field->setLayout(\Ip\Form\Field::LAYOUT_NO_LABEL);
     $form->addField($field);
     return $form;
 }
Ejemplo n.º 7
0
 /**
  *
  *
  * @param int $widgetId
  * @param array $data
  * @return \Ip\Form
  */
 protected function createForm($widgetId, $data)
 {
     $form = new \Ip\Form();
     $form->setEnvironment(\Ip\Form::ENVIRONMENT_PUBLIC);
     if (empty($data['fields']) || !is_array($data['fields'])) {
         $data['fields'] = array();
     }
     foreach ($data['fields'] as $fieldKey => $field) {
         if (!isset($field['type']) || !isset($field['label'])) {
             continue;
         }
         if ($field['type'] == 'Fieldset') {
             $label = empty($field['label']) ? '' : $field['label'];
             $form->addFieldset(new \Ip\Form\Fieldset($label));
             continue;
         }
         if (!isset($field['options'])) {
             $field['options'] = array();
         }
         if (!isset($field['options']) || !is_array($field['options'])) {
             $field['options'] = array();
         }
         if (!isset($field['required'])) {
             $field['required'] = false;
         }
         $fieldType = Model::getFieldType($field['type']);
         if ($fieldType) {
             $fieldData = array('label' => $field['label'], 'name' => 'ipForm_field_' . $fieldKey, 'required' => $field['required'], 'options' => $field['options']);
             try {
                 $newField = $fieldType->createField($fieldData);
                 $form->addField($newField);
             } catch (\Ip\Exception\Content $e) {
                 ipLog()->error('FormWidget.failedAddField: Widget failed to add field.', array('widget' => 'Form', 'exception' => $e, 'fieldData' => $fieldData));
             }
         }
     }
     //special variable to post to widget controller
     $field = new \Ip\Form\Field\Hidden(array('name' => 'sa', 'value' => 'Content.widgetPost'));
     $form->addField($field);
     $field = new \Ip\Form\Field\Hidden(array('name' => 'widgetId', 'value' => $widgetId));
     $form->addField($field);
     //antispam
     $field = new \Ip\Form\Field\Antispam(array('name' => 'checkField'));
     $form->addField($field);
     //submit
     if (!empty($data['buttonText'])) {
         $value = $data['buttonText'];
     } else {
         $value = __('Send', 'Ip', false);
     }
     $field = new \Ip\Form\Field\Submit(array('value' => $value));
     $form->addField($field);
     return $form;
 }
Ejemplo n.º 8
0
 public function searchForm($searchVariables)
 {
     $form = new \Ip\Form();
     $form->setMethod('get');
     $form->addAttribute('autocomplete', 'off');
     $form->removeCsrfCheck();
     foreach ($this->subgridConfig->fields() as $key => $fieldData) {
         if (isset($fieldData['allowSearch']) && !$fieldData['allowSearch']) {
             continue;
         }
         if (!empty($fieldData['type']) && $fieldData['type'] == 'Tab') {
             //tabs (fieldsets)
             $title = '';
             if (!empty($fieldData['label'])) {
                 $title = $fieldData['label'];
             }
             if ($key == 0) {
                 $fieldsets = $form->getFieldsets();
                 $fieldset = $fieldsets[0];
                 $fieldset->setLabel($title);
             } else {
                 $fieldset = new \Ip\Form\Fieldset($title);
                 $form->addFieldset($fieldset);
             }
             $fieldset->addAttribute('id', 'autoGridTabId' . rand(0, 100000000000));
             if ($key == 0) {
                 $fieldset->addAttribute('class', 'tab-pane active');
             } else {
                 $fieldset->addAttribute('class', 'tab-pane');
             }
         } else {
             $fieldObject = $this->subgridConfig->fieldObject($fieldData);
             $field = $fieldObject->searchField($searchVariables);
             if ($field) {
                 $form->addField($field);
             }
         }
     }
     $field = new \Ip\Form\Field\Hidden(array('name' => 'method', 'value' => 'search'));
     $form->addField($field);
     $field = new \Ip\Form\Field\HiddenSubmit();
     $form->addField($field);
     if (count($form->getFieldsets()) > 1) {
         $form->addClass('tab-content');
     }
     return $form;
 }