You are here

public function UserRole::settingForm in Fasttoggle 8.2

Return the sitewide form element for this setting.

Return value

array Form element for this setting.

Overrides SettingTrait::settingForm

File

src/Plugin/Setting/UserRole.php, line 122
Fasttoggle User Status

Class

UserRole
Abstract interface for settings. Plugin strings are used for quick filtering without the need to instantiate the class.

Namespace

Drupal\fasttoggle\Plugin\Setting

Code

public function settingForm($config, $attribute) {
  $sitewide_access = $config
    ->get($attribute);
  if (is_null($sitewide_access)) {
    $sitewide_access = $this->default;
  }
  $fieldArray = [
    '#type' => 'checkbox',
    '#default_value' => $sitewide_access,
    '#title' => $this
      ->attributeDescription($attribute),
    '#weight' => $this->attributeWeight,
  ];
  return $fieldArray;
}