Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function buildConfig(Config $config, BootstrapConfigModel $model)
 {
     $config->set('form.default-horizontal', (bool) $model->form_default_horizontal);
     $config->set('form.default-submit-btn', $model->form_default_submit_btn);
     $config->set('form.horizontal', array('label' => $model->form_horizontal_label, 'control' => $model->form_horizontal_control, 'offset' => $model->form_horizontal_offset));
     if ($model->form_styled_select) {
         $config->merge(array('enabled' => true, 'class' => $model->form_styled_select_class, 'style' => $model->form_styled_select_style, 'size' => $model->form_styled_select_size, 'search-threshold' => $model->form_styled_select_threshold, 'selected-text-format' => $model->form_styled_select_format), 'form.styled-select');
     } else {
         $config->set('form.styled-select.enabled', false);
     }
     if ($model->form_styled_upload) {
         $config->merge(array('enabled' => true, 'class' => $model->form_styled_upload_class, 'position' => $model->form_styled_upload_position), 'form.styled-upload');
     } else {
         $config->set('form.styled-upload.enabled', false);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function buildConfig(Config $config, BootstrapConfigModel $model)
 {
     $key = 'icons.sets.' . $model->name;
     if ($model->delete) {
         $config->remove($key);
         return;
     }
     $theme = $model->getRelated('pid');
     $value = array('label' => $model->name . ($theme ? ' (' . $theme->name . ')' : ''), 'stylesheet' => $this->getStylesheets($model), 'template' => $model->icons_template, 'path' => $model->icons_path);
     $config->set($key, $value);
 }
 /**
  * Generate the form.
  *
  * @param Config $config Bootstrap config.
  *
  * @return string
  */
 private function generateForm($config)
 {
     $config->set('runtime.modal-footer', '');
     $content = $this->getForm($this->form);
     $this->formButtons = $config->get('runtime.modal-footer');
     $config->set('runtime.modal-footer', false);
     // render style select if it is used
     // @codingStandardsIgnoreStart
     // TODO move this to an event or hook
     // @codingStandardsIgnoreEnd
     if ($this->isAjax && $config->get('form.styleSelect.enabled')) {
         $content .= sprintf('<script>jQuery(\'.%s\').selectpicker(\'render\');</script>', $config->get('form.styleSelect.class'));
     }
     return $content;
 }
 /**
  * {@inheritdoc}
  */
 public function buildConfig(Config $config, BootstrapConfigModel $model)
 {
     $config->set('dropdown.toggle', $model->dropdown_toggle);
     $config->set('dropdown.formless', deserialize($model->dropdown_formless, true));
 }
Exemple #5
0
 /**
  * {@inheritdoc}
  */
 public function buildConfig(Config $config, BootstrapConfigModel $model)
 {
     $config->set('modal.dismiss', (bool) $model->modal_dismiss)->set('modal.adjustForm', (bool) $model->modal_adjustForm);
 }
 /**
  * {@inheritdoc}
  */
 public function set($key, $value)
 {
     return $this->local->set($key, $value);
 }