You are here

public function ShadowboxAutomaticSettingsForm::buildForm in Shadowbox 8

Implements \Drupal\Core\Form\FormInterface::buildForm().

Overrides ConfigFormBase::buildForm

File

lib/Drupal/shadowbox/Form/ShadowboxAutomaticSettingsForm.php, line 26
Contains \Drupal\shadowbox\Form\ShadowboxAutomaticSettingsForm.

Class

ShadowboxAutomaticSettingsForm
Configure automatic settings for this site.

Namespace

Drupal\shadowbox\Form

Code

public function buildForm(array $form, array &$form_state) {
  $config = $this
    ->config('shadowbox.automatic');
  $form['shadowbox_auto_enable_all_images'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable for all image links'),
    '#description' => t('Enable this option to automatically add the <code>rel="shadowbox"</code> attribute to all links pointing to an image file.'),
    '#default_value' => $config
      ->get('shadowbox_auto_enable_all_images'),
  );
  $form['shadowbox_auto_gallery'] = array(
    '#type' => 'checkbox',
    '#title' => t('Group images as a shadowbox gallery'),
    '#description' => t('Enable this options to open all images in a shadowbox gallery rather than individually.'),
    '#default_value' => $config
      ->get('shadowbox_auto_gallery'),
  );
  $form['shadowbox_enable_globally'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable shadowbox globally'),
    '#description' => t('Add shadowbox library on all nodes.'),
    '#default_value' => $config
      ->get('shadowbox_enable_globally'),
  );
  return parent::buildForm($form, $form_state);
}