Copy the image button into main import screen
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 27 Apr 2016 16:03:29 +0000 (12:03 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 27 Apr 2016 16:03:29 +0000 (12:03 -0400)
Also keep the options for the images and image url so they can be done
separately.

models/admin/management/import.php
models/admin/management/import/memberImages.php
views/admin/management/import.html

index 7fb2321..a66442d 100644 (file)
@@ -93,7 +93,13 @@ class GlmMembersAdmin_management_import
     public function modelAction ($actionData = false)
     {
 
-        $templateData = array();
+        $templateData = array('haveImageArray' => false);
+
+        $imageBaseURL = get_option( 'glm-member-db-import-imageurl', false );
+        $image        = get_option( 'glm-member-db-import-image', false );
+        if ($imageBaseURL && $image ) {
+            $templateData['haveImageArray'] = true;
+        }
 
         $requestedView = false;
         $failure = false;
@@ -142,6 +148,7 @@ class GlmMembersAdmin_management_import
 
         }
 
+
         // Return status, suggested view, and data to controller
         return array(
             'status' => true,
index 069beb1..e6ee321 100644 (file)
@@ -13,8 +13,8 @@ $refTable = $this->config['ref_type_table'][$refType];
 $imageBaseURL = get_option( 'glm-member-db-import-imageurl', false );
 $image = get_option( 'glm-member-db-import-image', false );
 
-delete_option( 'glm-member-db-import-imageurl', false );
-delete_option( 'glm-member-db-import-image', false );
+//delete_option( 'glm-member-db-import-imageurl', false );
+//delete_option( 'glm-member-db-import-image', false );
 
 // If we have image URLs
 if ($image != false) {
index 79fe65d..27c3102 100644 (file)
         
     </form>
             
+    {if $haveImageArray}
+    <form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data">
+        <input type="hidden" name="glm_action" value="import">
+        <input type="hidden" name="option" value="images">
+        <p><span class="glm-notice">WARNING:</span> This process may take a very long time!<br>Do not interrupt or re-submit this page.</p>
+        <input type="submit" value="Import Images" class="button button-primary">
+    </form>
+    {/if}
     
 {include file='admin/footer.html'}