You are here

class SettingsForm in Forward 8

Same name and namespace in other branches
  1. 8.3 src/Form/SettingsForm.php \Drupal\forward\Form\SettingsForm
  2. 8.2 src/Form/SettingsForm.php \Drupal\forward\Form\SettingsForm
  3. 4.x src/Form/SettingsForm.php \Drupal\forward\Form\SettingsForm
  4. 4.0.x src/Form/SettingsForm.php \Drupal\forward\Form\SettingsForm

Configure settings for this module.

Hierarchy

Expanded class hierarchy of SettingsForm

1 string reference to 'SettingsForm'
forward.routing.yml in ./forward.routing.yml
forward.routing.yml

File

src/Form/SettingsForm.php, line 17

Namespace

Drupal\forward\Form
View source
class SettingsForm extends ConfigFormBase {

  /**
   * The entity type manager.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * The entity type bundle information manager.
   *
   * @var \Drupal\Core\Entity\EntityTypeBundleInfo
   */
  protected $bundleInfoManager;

  /**
   * The file system service.
   *
   * @var \Drupal\Core\File\FileSystem
   */
  protected $fileSystem;

  /**
   * Constructs a Forward settings form.
   *
   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
   *   The factory for configuration objects.
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface
   *   The entity type manager.
   * @param \Drupal\Core\Entity\EntityTypeBundleInfo
   *   The entity type bundle information manager.
   * @param \Drupal\Core\File\FileSystem
   *   The file system service.
   */
  public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, EntityTypeBundleInfo $bundle_info, FileSystem $file_system) {
    parent::__construct($config_factory);
    $this->entityTypeManager = $entity_type_manager;
    $this->bundleInfoManager = $bundle_info;
    $this->fileSystem = $file_system;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static($container
      ->get('config.factory'), $container
      ->get('entity_type.manager'), $container
      ->get('entity_type.bundle.info'), $container
      ->get('file_system'));
  }

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'forward_settings_form';
  }

  /**
   * {@inheritdoc}
   */
  protected function getEditableConfigNames() {
    return [
      'forward.settings',
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $forward_config = $this
      ->config('forward.settings');
    $settings = $forward_config
      ->get();

    // Entity Types
    $form['forward_entities'] = array(
      '#type' => 'fieldset',
      '#title' => $this
        ->t('Entity Types'),
      '#collapsible' => TRUE,
      '#collapsed' => FALSE,
    );
    $entity_types = $this->entityTypeManager
      ->getDefinitions();
    $options = array();
    $defaults = array();
    foreach ($entity_types as $type => $info) {
      if (is_a($info, 'Drupal\\Core\\Entity\\ContentEntityType')) {

        // Filter some entity types out
        if (!in_array($type, array(
          'block_content',
          'contact_message',
          'file',
          'menu_link_content',
          'node',
          'shortcut',
        ))) {
          $options[$type] = $info
            ->getLabel();
          if (!empty($settings['forward_entity_' . $type])) {
            $defaults[] = $type;
          }
        }
      }
    }
    $form['forward_entities']['forward_entity_types'] = array(
      '#type' => 'checkboxes',
      '#title' => $this
        ->t('Entity types'),
      '#options' => $options,
      '#default_value' => $defaults,
      '#description' => t('Choose entity types to show Forward on.'),
    );

    // Bundles
    foreach ($entity_types as $type => $info) {
      if (is_a($info, 'Drupal\\Core\\Entity\\ContentEntityType')) {
        if (!empty($settings['forward_entity_' . $type]) || $type == 'node') {
          $bundles = $this->bundleInfoManager
            ->getBundleInfo($type);
          if (count($bundles) == 1) {
            foreach ($bundles as $bundle => $bundle_info) {
              $form['forward_entities']['forward_' . $type . '_types'] = array(
                '#type' => 'hidden',
                '#value' => $bundle,
              );
            }
          }
          else {
            $options = array();
            $defaults = array();
            foreach ($bundles as $bundle => $bundle_info) {
              $options[$bundle] = $bundle_info['label'];
              if (!empty($settings['forward_' . $type . '_' . $bundle])) {
                $defaults[] = $bundle;
              }
            }
            $form['forward_entities']['forward_' . $type . '_types'] = array(
              '#type' => 'checkboxes',
              '#title' => $this
                ->t($info
                ->getLabel() . ' bundles'),
              '#options' => $options,
              '#default_value' => $defaults,
              '#description' => $this
                ->t('Choose @type bundles to show Forward on.', array(
                '@type' => $info
                  ->getLowercaseLabel(),
              )),
            );
          }
        }
      }
    }

    // View Modes
    $modes = array(
      'full' => t('Full entity'),
      'teaser' => t('Teaser'),
    );
    $options = array();
    $defaults = array();
    foreach ($modes as $mode => $info) {
      $options[$mode] = $info;
      if ($settings['forward_view_' . $mode]) {
        $defaults[] = $mode;
      }
    }
    $form['forward_entities']['forward_view_modes'] = array(
      '#type' => 'checkboxes',
      '#title' => $this
        ->t('View modes'),
      '#options' => $options,
      '#default_value' => $defaults,
      '#description' => $this
        ->t('Choose view modes to show Forward on.'),
    );

    // Interface
    $form['forward_interface'] = array(
      '#type' => 'details',
      '#title' => $this
        ->t('Interface'),
      '#open' => FALSE,
    );
    $form['forward_interface']['forward_interface_type'] = array(
      '#type' => 'select',
      '#title' => $this
        ->t('Interface type'),
      '#default_value' => $settings['forward_interface_type'],
      '#options' => array(
        'link' => t('Link to separate page'),
        'form' => t('Display inline form'),
      ),
      '#description' => $this
        ->t('Choose how the Forward form is reached from the displayed entity. Inline forms are displayed within a collapsible fieldset on the entity being forwarded.'),
    );
    $form['forward_interface']['forward_interface_title'] = array(
      '#type' => 'textfield',
      '#title' => $this
        ->t('Title of interface element'),
      '#default_value' => $settings['forward_interface_title'],
      '#description' => $this
        ->t('Set the text of the link or fieldset title. Replacement tokens may be used.'),
      '#required' => TRUE,
    );
    $form['forward_interface']['forward_interface_weight'] = array(
      '#type' => 'number',
      '#title' => $this
        ->t('Weight'),
      '#default_value' => $settings['forward_interface_weight'],
      '#description' => $this
        ->t('Set the weight of the link or inline form for positioning.'),
      '#required' => TRUE,
    );
    $form['forward_interface']['forward_link_options'] = array(
      '#type' => 'fieldset',
      '#title' => $this
        ->t('Link Options'),
      '#states' => array(
        'visible' => array(
          ':input[name=forward_interface_type]' => array(
            'value' => 'link',
          ),
        ),
      ),
    );
    $form['forward_interface']['forward_link_options']['forward_link_inline'] = array(
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Place the link inline with other node links'),
      '#default_value' => $settings['forward_link_inline'],
      '#description' => $this
        ->t('Place inline with links like "Read more" and "Add comment". If not placed inline, or the entity is not a node, the link is added to the content area.'),
    );
    $form['forward_interface']['forward_link_options']['forward_link_title'] = array(
      '#type' => 'textfield',
      '#title' => $this
        ->t('Page title'),
      '#default_value' => $settings['forward_link_title'],
      '#maxlength' => 255,
      '#description' => $this
        ->t('Page title for the Forward form page.'),
      '#required' => TRUE,
    );
    $form['forward_interface']['forward_link_options']['forward_link_style'] = array(
      '#type' => 'radios',
      '#title' => $this
        ->t('Style'),
      '#default_value' => $settings['forward_link_style'],
      '#options' => array(
        0 => $this
          ->t('Text only'),
        1 => t('Icon only'),
        2 => t('Icon and text'),
      ),
      '#description' => $this
        ->t('Select the visual style of the link.'),
    );
    $form['forward_interface']['forward_link_options']['forward_link_icon'] = array(
      '#type' => 'textfield',
      '#title' => $this
        ->t('Path to custom icon'),
      '#default_value' => $settings['forward_link_icon'],
      '#description' => $this
        ->t('The path to your custom link icon instead of the default icon. Example: sites/default/files/icon.png'),
    );
    $form['forward_interface']['forward_link_options']['forward_link_noindex'] = array(
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Generate a noindex meta tag on the forward page') . ' (name="robots", content="noindex, nofollow")',
      '#default_value' => $settings['forward_link_noindex'],
    );
    $form['forward_interface']['forward_link_options']['forward_link_nofollow'] = array(
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Generate a nofollow tag on the forward link (rel="nofollow")'),
      '#default_value' => $settings['forward_link_nofollow'],
    );

    // Forward Form
    $form['forward_form'] = array(
      '#type' => 'details',
      '#title' => $this
        ->t('Forward Form'),
      '#open' => FALSE,
    );
    $form['forward_form']['forward_form_instructions'] = array(
      '#type' => 'textarea',
      '#title' => $this
        ->t('Instructions'),
      '#default_value' => $settings['forward_form_instructions'],
      '#rows' => 5,
      '#description' => $this
        ->t('The instructions to display above the form.  Replacement tokens may be used.  This field may contain HTML.'),
    );
    $form['forward_form']['form_display_options'] = array(
      '#type' => 'fieldset',
      '#title' => $this
        ->t('Form Fields'),
    );
    $form['forward_form']['form_display_options']['forward_form_display_page'] = array(
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Display a link to the page being forwarded'),
      '#default_value' => $settings['forward_form_display_page'],
    );
    $form['forward_form']['form_display_options']['forward_form_display_subject'] = array(
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Display the email message subject'),
      '#default_value' => $settings['forward_form_display_subject'],
    );
    $form['forward_form']['form_display_options']['forward_form_display_body'] = array(
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Display the email introductory message text'),
      '#default_value' => $settings['forward_form_display_body'],
    );
    $form['forward_form']['personal_messages'] = array(
      '#type' => 'fieldset',
      '#title' => $this
        ->t('Personal Message Field'),
    );
    $form['forward_form']['personal_messages']['forward_personal_message'] = array(
      '#type' => 'select',
      '#title' => $this
        ->t('Personal message'),
      '#options' => array(
        0 => 'Hidden',
        1 => 'Optional',
        2 => 'Required',
      ),
      '#default_value' => $settings['forward_personal_message'],
      '#description' => $this
        ->t('Choose whether the personal message field on the form will be hidden, optional or required.'),
    );
    $form['forward_form']['personal_messages']['forward_personal_message_filter'] = array(
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Allow HTML in personal messages'),
      '#return_value' => 1,
      '#default_value' => $settings['forward_personal_message_filter'],
      '#description' => $this
        ->t('Filter XSS and all tags not allowed below from the personal message.  Otherwise any HTML in the message will be converted to plain text.'),
      '#states' => array(
        'invisible' => array(
          ':input[name=forward_personal_message]' => array(
            'value' => 0,
          ),
        ),
      ),
    );
    $form['forward_form']['personal_messages']['forward_personal_message_tags'] = array(
      '#type' => 'textfield',
      '#title' => $this
        ->t('Allowed HTML tags'),
      '#default_value' => $settings['forward_personal_message_tags'],
      '#description' => $this
        ->t('List of tags (separated by commas) that will be allowed if HTML is enabled above.  Defaults to: p,br,em,strong,cite,code,ul,ol,li,dl,dt,dd'),
      '#states' => array(
        'invisible' => array(
          ':input[name=forward_personal_message]' => array(
            'value' => 0,
          ),
        ),
      ),
    );
    $form['forward_form']['forward_form_confirmation'] = array(
      '#type' => 'textarea',
      '#title' => $this
        ->t('Confirmation message'),
      '#default_value' => $settings['forward_form_confirmation'],
      '#rows' => 5,
      '#description' => $this
        ->t('The thank you message displayed after the user successfully submits the form.  Replacement tokens may be used.'),
    );

    // Defaults for Message to Recipient
    $form['forward_email_defaults'] = array(
      '#type' => 'details',
      '#title' => $this
        ->t('Forward Email'),
      '#open' => FALSE,
    );
    $form['forward_email_defaults']['forward_email_logo'] = array(
      '#type' => 'textfield',
      '#title' => $this
        ->t('Path to custom logo'),
      '#default_value' => $settings['forward_email_logo'],
      '#maxlength' => 256,
      '#description' => $this
        ->t('The path to the logo you would like to use instead of the site default logo. Example: sites/default/files/logo.png'),
      '#required' => FALSE,
    );
    $form['forward_email_defaults']['forward_email_from_address'] = array(
      '#type' => 'email',
      '#title' => $this
        ->t('From address'),
      '#default_value' => $settings['forward_email_from_address'],
      '#maxlength' => 254,
      '#required' => TRUE,
    );
    $form['forward_email_defaults']['forward_email_subject'] = array(
      '#type' => 'textfield',
      '#title' => $this
        ->t('Subject line'),
      '#default_value' => $settings['forward_email_subject'],
      '#maxlength' => 256,
      '#description' => $this
        ->t('Email subject line. Replacement tokens may be used.'),
      '#required' => TRUE,
    );
    $form['forward_email_defaults']['forward_email_message'] = array(
      '#type' => 'textarea',
      '#title' => $this
        ->t('Introductory message text'),
      '#default_value' => $settings['forward_email_message'],
      '#rows' => 5,
      '#description' => $this
        ->t('Introductory text that appears above the entity being forwarded. Replacement tokens may be used. The sender may be able to add their own personal message after this.  This field may contain HTML.'),
    );

    // Post processing filters
    $filter_options = array();
    $filter_options[''] = t('- None -');
    foreach (filter_formats($this
      ->currentUser()) as $key => $format) {
      $filter_options[$key] = $format
        ->label();
    }
    if (count($filter_options) > 1) {
      $form['forward_filter_options'] = array(
        '#type' => 'details',
        '#title' => $this
          ->t('Filter'),
        '#open' => FALSE,
      );
      $form['forward_filter_options']['forward_filter_format'] = array(
        '#type' => 'select',
        '#title' => t('Filter format'),
        '#default_value' => $settings['forward_filter_format'],
        '#options' => $filter_options,
        '#description' => $this
          ->t('Select a filter to apply to the email message body. A filter with <a href="http://drupal.org/project/pathologic">Pathologic</a> assigned to it will convert relative links to absolute links. &nbsp;<a href="http://drupal.org/project/modules">More filters</a>.'),
      );
    }

    // Access Control
    $form['forward_access_control'] = array(
      '#type' => 'details',
      '#title' => $this
        ->t('Access Control'),
      '#open' => FALSE,
      '#description' => $this
        ->t('The email build process normally uses anonymous visitor permissions to render the entity being forwarded.  This is appropriate for most sites.  If you bypass anonymous access control, and the person doing the forward is logged in, the permissions of the logged in account are used instead.  Bypassing anonymous access control creates a potential security risk because privileged information could be sent to people who are not authorized to view it.'),
    );
    $form['forward_access_control']['forward_bypass_access_control'] = array(
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Bypass anonymous access control'),
      '#default_value' => $settings['forward_bypass_access_control'],
      '#description' => $this
        ->t('<em>Warning: selecting this option has security implications.</em>'),
    );

    // Flood Control
    $form['forward_flood_control_options'] = array(
      '#type' => 'details',
      '#title' => $this
        ->t('Flood Control'),
      '#open' => FALSE,
    );
    $form['forward_flood_control_options']['forward_flood_control_limit'] = array(
      '#type' => 'select',
      '#title' => $this
        ->t('Flood control limit'),
      '#default_value' => $settings['forward_flood_control_limit'],
      '#options' => array(
        '1' => '1',
        '5' => '5',
        '10' => '10',
        '15' => '15',
        '20' => '20',
        '25' => '25',
        '30' => '30',
        '35' => '35',
        '40' => '40',
        '50' => '50',
      ),
      '#description' => $this
        ->t('How many times a user can use the form in a one hour period. This will help prevent the forward module from being used for spamming.'),
    );
    $form['forward_flood_control_options']['forward_flood_control_error'] = array(
      '#type' => 'textarea',
      '#title' => $this
        ->t('Flood control error'),
      '#default_value' => $settings['forward_flood_control_error'],
      '#rows' => 5,
      '#description' => $this
        ->t('This text appears if a user exceeds the flood control limit.  The value of the flood control limit setting will appear in place of @number in the message presented to users.'),
    );
    return parent::buildForm($form, $form_state);
  }

  /**
   * {@inheritdoc}
   */
  public function validateForm(array &$form, FormStateInterface $form_state) {

    // Validate link icon path if provided
    if ($form_state
      ->getValue('forward_link_icon')) {
      $image = File::create();
      $image
        ->setFileUri($form_state
        ->getValue('forward_link_icon'));
      $image
        ->setFilename($this->fileSystem
        ->basename($image
        ->getFileUri()));
      $errors = file_validate_is_image($image);
      if (count($errors)) {
        $form_state
          ->setErrorByName('forward_link_icon', $this
          ->t("The link icon path '@path' is invalid.", array(
          '@path' => $form_state
            ->getValue('forward_link_icon'),
        )));
      }
    }
    parent::validateForm($form, $form_state);
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {

    // Save entity types and bundles
    $values = $form_state
      ->getValue('forward_entity_types');
    $values['node'] = TRUE;
    $entity_types = $this->entityTypeManager
      ->getDefinitions();
    foreach ($entity_types as $type => $info) {
      if (is_a($info, 'Drupal\\Core\\Entity\\ContentEntityType')) {
        if (!empty($values[$type])) {
          $this
            ->config('forward.settings')
            ->set('forward_entity_' . $type, TRUE);
        }
        else {
          $this
            ->config('forward.settings')
            ->set('forward_entity_' . $type, FALSE);
        }
        $bundles = $this->bundleInfoManager
          ->getBundleInfo($type);
        foreach ($bundles as $bundle => $bundle_info) {
          $bundle_values = $form_state
            ->getValue('forward_' . $type . '_types');
          if (!empty($values[$type]) && !empty($bundle_values[$bundle])) {
            $this
              ->config('forward.settings')
              ->set('forward_' . $type . '_' . $bundle, TRUE);
          }
          else {
            $this
              ->config('forward.settings')
              ->set('forward_' . $type . '_' . $bundle, FALSE);
          }

          // If only one bundle, it gets the same setting as its type
          if (count($bundles) == 1) {
            $this
              ->config('forward.settings')
              ->set('forward_' . $type . '_' . $bundle, $this
              ->config('forward.settings')
              ->get('forward_entity_' . $type));
          }
        }
      }
    }

    // Save view modes
    $modes = array(
      'full',
      'teaser',
    );
    $values = $form_state
      ->getValue('forward_view_modes');
    foreach ($modes as $mode) {
      if (!empty($values[$mode])) {
        $this
          ->config('forward.settings')
          ->set('forward_view_' . $mode, TRUE);
      }
      else {
        $this
          ->config('forward.settings')
          ->set('forward_view_' . $mode, FALSE);
      }
    }

    // Save all other settings
    $this
      ->config('forward.settings')
      ->set('forward_interface_type', $form_state
      ->getValue('forward_interface_type'))
      ->set('forward_interface_title', $form_state
      ->getValue('forward_interface_title'))
      ->set('forward_interface_weight', $form_state
      ->getValue('forward_interface_weight'))
      ->set('forward_link_inline', $form_state
      ->getValue('forward_link_inline'))
      ->set('forward_link_title', $form_state
      ->getValue('forward_link_title'))
      ->set('forward_link_style', $form_state
      ->getValue('forward_link_style'))
      ->set('forward_link_icon', $form_state
      ->getValue('forward_link_icon'))
      ->set('forward_link_noindex', $form_state
      ->getValue('forward_link_noindex'))
      ->set('forward_link_nofollow', $form_state
      ->getValue('forward_link_nofollow'))
      ->set('forward_form_instructions', $form_state
      ->getValue('forward_form_instructions'))
      ->set('forward_form_display_page', $form_state
      ->getValue('forward_form_display_page'))
      ->set('forward_form_display_subject', $form_state
      ->getValue('forward_form_display_subject'))
      ->set('forward_form_display_body', $form_state
      ->getValue('forward_form_display_body'))
      ->set('forward_form_confirmation', $form_state
      ->getValue('forward_form_confirmation'))
      ->set('forward_personal_message', $form_state
      ->getValue('forward_personal_message'))
      ->set('forward_personal_message_filter', $form_state
      ->getValue('forward_personal_message_filter'))
      ->set('forward_personal_message_tags', $form_state
      ->getValue('forward_personal_message_tags'))
      ->set('forward_email_logo', $form_state
      ->getValue('forward_email_logo'))
      ->set('forward_email_from_address', $form_state
      ->getValue('forward_email_from_address'))
      ->set('forward_email_subject', $form_state
      ->getValue('forward_email_subject'))
      ->set('forward_email_message', $form_state
      ->getValue('forward_email_message'))
      ->set('forward_filter_format', $form_state
      ->getValue('forward_filter_format'))
      ->set('forward_bypass_access_control', $form_state
      ->getValue('forward_bypass_access_control'))
      ->set('forward_flood_control_limit', $form_state
      ->getValue('forward_flood_control_limit'))
      ->set('forward_flood_control_error', $form_state
      ->getValue('forward_flood_control_error'))
      ->save();
    parent::submitForm($form, $form_state);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigFormBaseTrait::config protected function Retrieves a configuration object.
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
FormBase::$configFactory protected property The config factory. 1
FormBase::$requestStack protected property The request stack. 1
FormBase::$routeMatch protected property The route match.
FormBase::configFactory protected function Gets the config factory for this form. 1
FormBase::container private function Returns the service container.
FormBase::currentUser protected function Gets the current user.
FormBase::getRequest protected function Gets the request object.
FormBase::getRouteMatch protected function Gets the route match.
FormBase::logger protected function Gets the logger for a specific channel.
FormBase::redirect protected function Returns a redirect response object for the specified route. Overrides UrlGeneratorTrait::redirect
FormBase::resetConfigFactory public function Resets the configuration factory.
FormBase::setConfigFactory public function Sets the config factory for this form.
FormBase::setRequestStack public function Sets the request stack object to use.
LinkGeneratorTrait::$linkGenerator protected property The link generator. 1
LinkGeneratorTrait::getLinkGenerator Deprecated protected function Returns the link generator.
LinkGeneratorTrait::l Deprecated protected function Renders a link to a route given a route name and its parameters.
LinkGeneratorTrait::setLinkGenerator Deprecated public function Sets the link generator service.
LoggerChannelTrait::$loggerFactory protected property The logger channel factory service.
LoggerChannelTrait::getLogger protected function Gets the logger for a specific channel.
LoggerChannelTrait::setLoggerFactory public function Injects the logger channel factory.
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
RedirectDestinationTrait::$redirectDestination protected property The redirect destination service. 1
RedirectDestinationTrait::getDestinationArray protected function Prepares a 'destination' URL query parameter for use with \Drupal\Core\Url.
RedirectDestinationTrait::getRedirectDestination protected function Returns the redirect destination service.
RedirectDestinationTrait::setRedirectDestination public function Sets the redirect destination service.
SettingsForm::$bundleInfoManager protected property The entity type bundle information manager.
SettingsForm::$entityTypeManager protected property The entity type manager.
SettingsForm::$fileSystem protected property The file system service.
SettingsForm::buildForm public function Form constructor. Overrides ConfigFormBase::buildForm
SettingsForm::create public static function Instantiates a new instance of this class. Overrides ConfigFormBase::create
SettingsForm::getEditableConfigNames protected function Gets the configuration names that will be editable. Overrides ConfigFormBaseTrait::getEditableConfigNames
SettingsForm::getFormId public function Returns a unique string identifying the form. Overrides FormInterface::getFormId
SettingsForm::submitForm public function Form submission handler. Overrides ConfigFormBase::submitForm
SettingsForm::validateForm public function Form validation handler. Overrides FormBase::validateForm
SettingsForm::__construct public function Constructs a Forward settings form. Overrides ConfigFormBase::__construct
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
UrlGeneratorTrait::$urlGenerator protected property The url generator.
UrlGeneratorTrait::getUrlGenerator Deprecated protected function Returns the URL generator service.
UrlGeneratorTrait::setUrlGenerator Deprecated public function Sets the URL generator service.
UrlGeneratorTrait::url Deprecated protected function Generates a URL or path for a specific route based on the given parameters.