From ebd5814bbbe49203dfbea58e0f7beb08a8bfc2b5 Mon Sep 17 00:00:00 2001
From: Tim Steiner <tsteiner2@unl.edu>
Date: Fri, 24 Sep 2010 21:01:35 +0000
Subject: [PATCH] Slight clean up of the way migration and site creation forms
 are called.  Make the output from migration tool look cleaner using drupal's
 status messages.

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@187 20a16fea-79d4-4915-8869-1ea9d5ebf173
---
 sites/all/modules/unl/unl.module            |  6 ++++--
 sites/all/modules/unl/unl_migration.php     | 10 +---------
 sites/all/modules/unl/unl_site_creation.php |  6 ------
 3 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/sites/all/modules/unl/unl.module b/sites/all/modules/unl/unl.module
index 26cee511..50f8ead8 100644
--- a/sites/all/modules/unl/unl.module
+++ b/sites/all/modules/unl/unl.module
@@ -85,7 +85,8 @@ function unl_menu()
         'title' => 'UNL Migration Tool',
         'description' => 'Migrate a static UNL template page into drupal',
         'access arguments' => array('unl migration'),
-        'page callback' => 'unl_migration_page',
+        'page callback' => 'drupal_get_form',
+        'page arguments' => array('unl_migration'),
         'type' => MENU_LOCAL_TASK,
         'file' => 'unl_migration.php'
     );
@@ -94,7 +95,8 @@ function unl_menu()
         'title' => 'UNL Site Creation Tool',
         'description' => 'Create a new UNL Drupal site',
         'access arguments' => array('unl site creation'),
-        'page callback' => 'unl_site_creation_page',
+        'page callback' => 'drupal_get_form',
+        'page arguments' => array('unl_site_creation'),
         'type' => MENU_LOCAL_TASK,
         'file' => 'unl_site_creation.php'
     );
diff --git a/sites/all/modules/unl/unl_migration.php b/sites/all/modules/unl/unl_migration.php
index 61798278..9b42bd24 100644
--- a/sites/all/modules/unl/unl_migration.php
+++ b/sites/all/modules/unl/unl_migration.php
@@ -1,11 +1,5 @@
 <?php
 
-function unl_migration_page()
-{
-    return drupal_get_form('unl_migration');
-}
-
-
 function unl_migration($form, &$form_state)
 {
     $form['root'] = array(
@@ -157,9 +151,6 @@ class Unl_Migration_Tool
         }
         
         $this->_createMenu();
-        
-        print_r($this->_log);
-        exit;
     }
     
     private function _addSitePath($path)
@@ -668,6 +659,7 @@ class Unl_Migration_Tool
     private function _log($message)
     {
         $this->_log[] = $message;
+        drupal_set_message($message, 'status');
     }
 }
 
diff --git a/sites/all/modules/unl/unl_site_creation.php b/sites/all/modules/unl/unl_site_creation.php
index 0d61a540..2a779ffc 100644
--- a/sites/all/modules/unl/unl_site_creation.php
+++ b/sites/all/modules/unl/unl_site_creation.php
@@ -2,12 +2,6 @@
 
 require_once DRUPAL_ROOT . '/includes/install.core.inc';
 
-function unl_site_creation_page()
-{
-    return drupal_get_form('unl_site_creation');
-}
-
-
 function unl_site_creation($form, &$form_state)
 {
     $form['root'] = array(
-- 
GitLab