/** * {@inheritdoc} */ public function buildForm(array $form, array &$form_state) { $config = $this->configFactory->get('fullcalendar.settings'); $form['path'] = array('#type' => 'textfield', '#title' => t('Path to FullCalendar'), '#default_value' => $config->get('path'), '#description' => t('Enter the path relative to Drupal root where the FullCalendar plugin directory is located.')); $form['compression'] = array('#type' => 'radios', '#title' => t('Choose FullCalendar compression level'), '#options' => array('min' => t('Production (Minified)'), 'none' => t('Development (Uncompressed code)')), '#default_value' => $config->get('compression')); return parent::buildForm($form, $form_state); }
/** * {@inheritdoc} */ public function buildForm(array $form, array &$form_state) { // See foobar.settings.yml. $config = $this->configFactory->get('foobar.settings'); $form = parent::buildForm($form, $form_state); $form['foo'] = array('#type' => 'textfield', '#title' => t('Foo'), '#default_value' => $config->get('foo'), '#required' => TRUE); return $form; }
/** * {@inheritdoc} */ public function buildForm(array $form, array &$form_state) { $config = $this->configFactory->get('fullcalendar_options.settings'); $form['fullcalendar_options'] = array('#type' => 'details', '#title' => t('Options'), '#description' => t('Each setting can be exposed for all views.')); foreach ($this->options as $key => $info) { $form['fullcalendar_options'][$key] = array('#type' => 'checkbox', '#default_value' => $config->get($key)) + $info; } return parent::buildForm($form, $form_state); }