You are here

public static function EvaluationImplementation::upgradeCheckSettingsForm in Drupal 8 upgrade evaluation 7

Same name and namespace in other branches
  1. 6 includes/EvaluationImplementation.php \Upgrade_check\EvaluationImplementation::upgradeCheckSettingsForm()

Implements _upgrade_check_settings_form().

1 call to EvaluationImplementation::upgradeCheckSettingsForm()
_upgrade_check_settings_form in ./upgrade_check.module
Function download json.

File

includes/EvaluationImplementation.php, line 162

Class

EvaluationImplementation

Namespace

Upgrade_check

Code

public static function upgradeCheckSettingsForm() {
  $form[UPGRADE_CHECK_SETTINGS_FORM] = array(
    '#type' => 'fieldset',
    '#title' => t('Settings'),
  );
  $form[UPGRADE_CHECK_SETTINGS_FORM][UPGRADE_CHECK_REPLACE_ENTITY_NAME] = array(
    '#type' => 'radios',
    '#title' => t('Replace enity names. We care about protecting your personal information, so you can encode data: content type names, vocabulary term manes, field names, etc.'),
    '#options' => array(
      'no' => t('No'),
      'yes' => t('Yes'),
    ),
    '#default_value' => variable_get(UPGRADE_CHECK_REPLACE_ENTITY_NAME, 'no'),
  );
  $hash = variable_get(self::UPGRADE_CHECK_SALT_FIELD_NAME, md5(uniqid(rand())));
  $form[UPGRADE_CHECK_SETTINGS_FORM][self::UPGRADE_CHECK_SALT_FIELD_NAME] = array(
    '#type' => 'textfield',
    '#title' => t('Default salt'),
    '#description' => t('Automatic salt generation to encrypt real entity names.'),
    '#disabled' => 'disabled',
    '#default_value' => $hash,
    '#states' => array(
      'visible' => array(
        ':input[name="' . UPGRADE_CHECK_REPLACE_ENTITY_NAME . '"]' => array(
          'value' => 'yes',
        ),
      ),
    ),
  );
  return system_settings_form($form);
}