creating new memberManagement ajax model
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 28 Dec 2018 17:34:11 +0000 (12:34 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 28 Dec 2018 17:34:11 +0000 (12:34 -0500)
models/admin/ajax/adminSearch.php
models/admin/ajax/memberEdit.php [deleted file]
models/admin/ajax/memberManagement.php [new file with mode: 0644]
setup/validActions.php
views/admin/manageDashboard/index.html

index 48adaa6..add6988 100644 (file)
  * @license  http://www.gaslightmedia.com Gaslightmedia
  * @version  0.1
  */
-
+require_once GLM_MEMBERS_PLUGIN_PATH . '/controllers/admin.php';
 /**
  *
  * This class exports the currently selected members list
  * to a printable HTML file, to a CSV file, or otherwise.
  */
-class GlmMembersAdmin_ajax_adminSearch
+class GlmMembersAdmin_ajax_adminSearch extends glmMembersAdmin
 {
 
     /**
@@ -88,7 +88,8 @@ class GlmMembersAdmin_ajax_adminSearch
         $limit = 20;
 
         $status = $this->config['status_numb']['Active'];
-        $list   = apply_filters('glm-member-db-admin-search', '');
+        // $list   = apply_filters('glm-member-db-admin-search', '');
+        $list  = $this->controller( 'manageDashboard', 'members', false, true, true);
      
         
         $return = array(
diff --git a/models/admin/ajax/memberEdit.php b/models/admin/ajax/memberEdit.php
deleted file mode 100644 (file)
index 0a0260c..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-
-/**
- * Gaslight Media Members Database
- * Members List Export by AJAX
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @entity  glmMembersDatabase
- * @author   Chuck Scott <cscott@gaslightmedia.com>
- * @license  http://www.gaslightmedia.com Gaslightmedia
- * @version  0.1
- */
-require_once GLM_MEMBERS_PLUGIN_PATH . '/controllers/admin.php';
-/**
- *
- * This class exports the currently selected members list
- * to a printable HTML file, to a CSV file, or otherwise.
- */
-class GlmMembersAdmin_ajax_memberEdit extends glmMembersAdmin
-{
-
-    /**
-     * WordPress Database Object
-     *
-     * @var $wpdb
-     * @access public
-     */
-    public $wpdb;
-    /**
-     * Plugin Configuration Data
-     *
-     * @var $config
-     * @access public
-     */
-    public $config;
-
-    /**
-     * Constructor
-     *
-     * This constructor sets up this model. At this time that only includes
-     * storing away the WordPress data object.
-     *
-     * @return object Class object
-     *
-     */
-    public function __construct ($wpdb, $config)
-    {
-
-        // Save WordPress Database object
-        $this->wpdb = $wpdb;
-
-        // Save plugin configuration object
-        $this->config = $config;
-
-        //parent::__construct(false, false);
-
-    }
-
-    /**
-     * Perform Model Action
-     *
-     * This modelAction takes an AJAX image upload and stores the image in the
-     * media/images directory of the plugin.
-     *
-     * This model action does not return, it simply does it's work then calls die();
-     *
-     * @param $actionData
-     *
-     * Echos JSON string as response and does not return
-     */
-    public function modelAction ($actionData = false)
-    {
-        global $wpdb;
-        $memberID = $_REQUEST['memberID'];
-        $editData = $this->controller( 'member', 'index', array("memberID" => $memberID), true, true);
-
-        $return = array(
-            "test"          => $sql,
-            'searchData'    => $editData       // Where our events list will go
-        );
-
-        header('Content-type:application/json;charset=utf-8', true);
-        echo json_encode($return);
-        wp_die();
-    }
-}
diff --git a/models/admin/ajax/memberManagement.php b/models/admin/ajax/memberManagement.php
new file mode 100644 (file)
index 0000000..e2a6bca
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * Members List Export by AJAX
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @entity  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @version  0.1
+ */
+require_once GLM_MEMBERS_PLUGIN_PATH . '/controllers/admin.php';
+/**
+ *
+ * This class exports the currently selected members list
+ * to a printable HTML file, to a CSV file, or otherwise.
+ */
+class GlmMembersAdmin_ajax_memberManagement extends glmMembersAdmin
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+
+    /**
+     * Constructor
+     *
+     * This constructor sets up this model. At this time that only includes
+     * storing away the WordPress data object.
+     *
+     * @return object Class object
+     *
+     */
+    public function __construct ($wpdb, $config)
+    {
+
+        // Save WordPress Database object
+        $this->wpdb = $wpdb;
+
+        // Save plugin configuration object
+        $this->config = $config;
+
+        //parent::__construct(false, false);
+
+    }
+
+    /**
+     * Perform Model Action
+     *
+     * This modelAction takes an AJAX image upload and stores the image in the
+     * media/images directory of the plugin.
+     *
+     * This model action does not return, it simply does it's work then calls die();
+     *
+     * @param $actionData
+     *
+     * Echos JSON string as response and does not return
+     */
+    public function modelAction ($actionData = false)
+    {
+        global $wpdb;
+        $memberID = $_REQUEST['memberID'];
+        $editData = $this->controller( 'member', 'index', array("memberID" => $memberID), true, true);
+
+        $return = array(
+            "test"          => $sql,
+            'searchData'    => $editData       // Where our events list will go
+        );
+
+        header('Content-type:application/json;charset=utf-8', true);
+        echo json_encode($return);
+        wp_die();
+    }
+}
index 8b12d5b..760e1ff 100644 (file)
@@ -50,7 +50,7 @@ $glmMembersValidActions = array(
             'countiesMapData'     => 'glm-member-db',
             'glmTextSearch'         => 'glm-member-db',
             'adminSearch'           => 'glm-member-db',
-            'memberEdit'           => 'glm-member-db',
+            'memberManagement'      => 'glm-member-db',
         ),
         'manageDashboard' => array(
             'members' => 'glm-member-db',
index f7f03fe..5a5990c 100644 (file)
             $(".edit-screen").html('');
             var editData = {
                 action      : 'glm_members_admin_ajax',
-                glm_action  : 'memberEdit',
+                glm_action  : 'memberManagement',
                 form_action : 'index',
                 view        : "index",
                 option      : 'index',