Quellcode durchsuchen

Added a proper admin interface for the chado installer

spficklin vor 14 Jahren
Ursprung
Commit
e69b52457e
2 geänderte Dateien mit 22 neuen und 3 gelöschten Zeilen
  1. 19 1
      tripal_core/chado_install.php
  2. 3 2
      tripal_core/tripal_core.module

+ 19 - 1
tripal_core/chado_install.php

@@ -1,8 +1,26 @@
 <?php
 <?php
+
+/*************************************************************************
+*
+*/
+function tripal_core_chado_v1_11_load_form (){
+   $form['description'] = array(
+       '#type' => 'item',
+       '#value' => t("Click the submit button below to install Chado into the Drupal database. <br><font color=\"red\">WARNING:</font> use this only for a new chado installation or reinstall completely.  This will erase any data currently in the chado database.  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 this option will intall chado but it will not be usable.  The external database specified in the settings.php file takes precedence."),
+       '#weight' => 1,
+   );
+   $form['button'] = array(
+      '#type' => 'submit',
+      '#value' => t('Install Chado'),
+      '#weight' => 2,
+   );
+   return $form;
+}
 /*************************************************************************
 /*************************************************************************
 *
 *
 */
 */
-function tripal_core_install_job (){
+function tripal_core_chado_v1_11_load_form_submit ($form, &$form_state){
    global $user;
    global $user;
 
 
    $args = array();
    $args = array();

+ 3 - 2
tripal_core/tripal_core.module

@@ -114,10 +114,11 @@ function tripal_core_menu() {
      'access arguments' => array('access administration pages'),
      'access arguments' => array('access administration pages'),
      'type' => MENU_CALLBACK | MENU_LINKS_TO_PARENT 
      'type' => MENU_CALLBACK | MENU_LINKS_TO_PARENT 
    );
    );
-   $items['admin/tripal/chado_install'] = array(
+   $items['admin/tripal/chado_1_11_install'] = array(
      'title' => 'Install Chado v1.11',
      'title' => 'Install Chado v1.11',
      'description' => 'Installs Chado version 1.11 inside the current Drupal database',
      'description' => 'Installs Chado version 1.11 inside the current Drupal database',
-     'page callback' => 'tripal_core_install_job',
+     'page callback' => 'drupal_get_form',
+     'page arguments' => array('tripal_core_chado_v1_11_load_form'),
      'access arguments' => array('access administration pages'),
      'access arguments' => array('access administration pages'),
      'type' => MENU_NORMAL_ITEM,
      'type' => MENU_NORMAL_ITEM,
    );
    );