You are here

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

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

Implements upgrade_check_form().

1 call to EvaluationImplementation::upgradeCheckForm()
_upgrade_check_form in ./upgrade_check.module
Implements hook_form().

File

includes/EvaluationImplementation.php, line 54

Class

EvaluationImplementation

Namespace

Upgrade_check

Code

public static function upgradeCheckForm() {
  $form = array();
  $form['analyze'] = array(
    '#type' => 'fieldset',
    '#title' => t('Analyze'),
  );
  $text = 'Welcome to upgrade check per Drupal 8. ';
  $text .= 'Click on the link to get the upgrade score of your webresource.';
  $form['analyze']['description'] = array(
    '#type' => 'item',
    '#markup' => t('!text', array(
      '!text' => $text,
    )),
  );
  $conflict = self::upgradeCheckConflictModules();
  if (!empty($conflict)) {
    $textConflict = 'We have detected that you have conflict modules ';
    $textConflict .= 'enabled. Please disable @names.';
    drupal_set_message(t($textConflict, array(
      '@names' => $conflict,
    )), 'error');
  }
  $method = variable_get(self::UPGRADE_CHECK_PREFIX . self::UPGRADE_CHECK_DATA_METHOD, 'manual');
  $form['analyze'][self::UPGRADE_CHECK_DATA_METHOD] = array(
    '#type' => 'radios',
    '#title' => t('Data transfer method'),
    '#description' => t('Depending on the method selected, the method for data transfer for analysis will be changed.'),
    '#options' => array(
      'manual' => t('Manual'),
      'automatic' => t('Automatic'),
    ),
    '#disabled' => 'disabled',
    '#default_value' => !empty($method) ? $method : variable_get(self::UPGRADE_CHECK_DATA_METHOD, 'manual'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Analyze'),
  );
  return $form;
}