function tripal_core_chado_load_form

2.x tripal_core.chado_install.inc tripal_core_chado_load_form($form, $form_state)
1.x chado_install.inc tripal_core_chado_load_form()

Load Chado Schema Form

Related topics

1 string reference to 'tripal_core_chado_load_form'
tripal_core_menu in tripal_core/tripal_core.module
Implements hook_menu(). Defines all menu items needed by Tripal Core

File

tripal_core/includes/chado_install.inc, line 13
Functions to install chado schema through Drupal

Code

function tripal_core_chado_load_form() {

  // we want to force the version of Chado to be set properly
  $real_version = tripal_core_set_chado_version();

  // get the effective version.  Pass true as second argument
  // to warn the user if the current version is not compatible
  $version = tripal_core_get_chado_version(FALSE, TRUE);

  $form['current_version'] = array(
    '#type' => 'item',
    '#title' => t("Current installed version of Chado"),
    '#value' => $real_version,
  );

  $form['action_to_do'] = array(
    '#type' => 'radios',
    '#title' => 'Installation/Upgrade Action',
    '#options' => array(
      'Install Chado v1.2' => t('New Install of Chado v1.2 (erases all existing Chado data if Chado already exists)'),
      'Upgrade Chado v1.11 to v1.2' => t('Upgrade existing Chado v1.11 to v1.2 (no data is lost)'),
      'Install Chado v1.11' => t('New Install of Chado v1.11 (erases all existing Chado data if Chado already exists)')
    ),
    '#description' => t('Select an action to perform'),
    '#required' => TRUE
  );

  $form['description'] = array(
    '#type' => 'item',
    '#value' => t("<font color=\"red\">WARNING:</font> A new install of Chado v1.2 or v1.11 "
      . "will install Chado within the Drupal database in a \"chado\" schema. If the \"chado\" schema already exists it will "
      . "be overwritten and all data will be lost.  You may choose to update an existing Chado v1.11 if it was installed with a previous "
      . "version of Tripal (e.g. v0.3b or v0.3.1). The update will not erase any data. "
      . "If you are using chado in a database external to the "
      . "Drupal database with a 'chado' entry in the 'settings.php' \$db_url argument "
      . "then Chado will be installed but will not be used .  The external "
      . "database specified in the settings.php file takes precedence."),
  );

  $form['button'] = array(
    '#type' => 'submit',
    '#value' => t('Install/Upgrade Chado'),
    '#weight' => 2,
  );

  return $form;
}