Rename the ajax actions.
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 21 Mar 2017 13:55:05 +0000 (09:55 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 21 Mar 2017 13:55:05 +0000 (09:55 -0400)
renaming the actions so they're more unique.

models/admin/ajax/dropdown.php [deleted file]
models/admin/ajax/offcanvas.php [deleted file]
models/admin/ajax/scheduleDropdown.php [new file with mode: 0644]
models/admin/ajax/scheduleOffcanvas.php [new file with mode: 0644]
setup/validActions.php

diff --git a/models/admin/ajax/dropdown.php b/models/admin/ajax/dropdown.php
deleted file mode 100644 (file)
index f63e82b..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-
-/**
- * Gaslight Media Members Database
- * PDF Output by admin-ajax
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package  glmMembersDatabase
- * @author   Chuck Scott <cscott@gaslightmedia.com>
- * @license  http://www.gaslightmedia.com Gaslightmedia
- * @version  0.1
- */
-
-/**
- * Steve Note...
- *
- * You can get to this using the following URL.
- *
- *  {host}/wp-admin/admin-ajax.php?action=glm_members_admin_ajax&glm_action=pdfOutput&mystuff=THIS
- *
- * You should be able to do this as POST or GET and should be able to add and read additional parameters.
- * I added a "mystuff" parameter to the URL above and it does output from the code in the
- * modelAction() function below.
- *
- * To add another model under models/admin/ajax all you need to do is create it and add it to the
- * setup/validActions.php file.
- *
- */
-
-// Load Members data abstract
-// require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataImages.php';
-
-/**
- * This class performs the work of handling images passed to it via
- * an AJAX call that goes through the WorPress AJAX Handler.
- *
- */
-class GlmMembersAdmin_ajax_dropdown
-{
-
-    /**
-     * WordPress Database Object
-     *
-     * @var $wpdb
-     * @access public
-     */
-    public $wpdb;
-    /**
-     * Plugin Configuration Data
-     *
-     * @var $config
-     * @access public
-     */
-    public $config;
-
-    /**
-     * __construct
-     *
-     * @param mixed $wpdb   The main Word Press DB Object
-     * @param mixed $config The main Config
-     *
-     * @access public
-     * @return void
-     */
-    public function __construct($wpdb, $config)
-    {
-        $this->wpdb = $wpdb;
-        $this->config = $config;
-
-        //parent::__construct(false, false);
-
-    }
-
-    /**
-     * modelAction
-     *
-     * @param bool $actionData Action Data passed to the modelAction
-     *
-     * @access public
-     * @return void
-     */
-    public function modelAction($actionData = false)
-    {
-        get_template_part( 'parts/top-bar' );
-        exit;
-    }
-
-}
diff --git a/models/admin/ajax/offcanvas.php b/models/admin/ajax/offcanvas.php
deleted file mode 100644 (file)
index 277f8cd..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-
-/**
- * Gaslight Media Members Database
- * PDF Output by admin-ajax
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package  glmMembersDatabase
- * @author   Chuck Scott <cscott@gaslightmedia.com>
- * @license  http://www.gaslightmedia.com Gaslightmedia
- * @version  0.1
- */
-
-/**
- * Steve Note...
- *
- * You can get to this using the following URL.
- *
- *  {host}/wp-admin/admin-ajax.php?action=glm_members_admin_ajax&glm_action=pdfOutput&mystuff=THIS
- *
- * You should be able to do this as POST or GET and should be able to add and read additional parameters.
- * I added a "mystuff" parameter to the URL above and it does output from the code in the
- * modelAction() function below.
- *
- * To add another model under models/admin/ajax all you need to do is create it and add it to the
- * setup/validActions.php file.
- *
- */
-
-// Load Members data abstract
-// require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataImages.php';
-
-/**
- * This class performs the work of handling images passed to it via
- * an AJAX call that goes through the WorPress AJAX Handler.
- *
- */
-class GlmMembersAdmin_ajax_offcanvas
-{
-
-    /**
-     * WordPress Database Object
-     *
-     * @var $wpdb
-     * @access public
-     */
-    public $wpdb;
-    /**
-     * Plugin Configuration Data
-     *
-     * @var $config
-     * @access public
-     */
-    public $config;
-
-    /**
-     * __construct
-     *
-     * @param mixed $wpdb   The main Word Press DB Object
-     * @param mixed $config The main Config
-     *
-     * @access public
-     * @return void
-     */
-    public function __construct($wpdb, $config)
-    {
-        $this->wpdb = $wpdb;
-        $this->config = $config;
-
-        //parent::__construct(false, false);
-
-    }
-
-    /**
-     * modelAction
-     *
-     * @param bool $actionData Action Data passed to the modelAction
-     *
-     * @access public
-     * @return void
-     */
-    public function modelAction($actionData = false)
-    {
-        get_template_part( 'parts/off-canvas-menu' );
-        exit;
-    }
-
-}
diff --git a/models/admin/ajax/scheduleDropdown.php b/models/admin/ajax/scheduleDropdown.php
new file mode 100644 (file)
index 0000000..9d1c36e
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * PDF Output by admin-ajax
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @version  0.1
+ */
+
+/**
+ * Steve Note...
+ *
+ * You can get to this using the following URL.
+ *
+ *  {host}/wp-admin/admin-ajax.php?action=glm_members_admin_ajax&glm_action=pdfOutput&mystuff=THIS
+ *
+ * You should be able to do this as POST or GET and should be able to add and read additional parameters.
+ * I added a "mystuff" parameter to the URL above and it does output from the code in the
+ * modelAction() function below.
+ *
+ * To add another model under models/admin/ajax all you need to do is create it and add it to the
+ * setup/validActions.php file.
+ *
+ */
+
+// Load Members data abstract
+// require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataImages.php';
+
+/**
+ * This class performs the work of handling images passed to it via
+ * an AJAX call that goes through the WorPress AJAX Handler.
+ *
+ */
+class GlmMembersAdmin_ajax_scheduleDropdown
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+
+    /**
+     * __construct
+     *
+     * @param mixed $wpdb   The main Word Press DB Object
+     * @param mixed $config The main Config
+     *
+     * @access public
+     * @return void
+     */
+    public function __construct($wpdb, $config)
+    {
+        $this->wpdb = $wpdb;
+        $this->config = $config;
+
+        //parent::__construct(false, false);
+
+    }
+
+    /**
+     * modelAction
+     *
+     * @param bool $actionData Action Data passed to the modelAction
+     *
+     * @access public
+     * @return void
+     */
+    public function modelAction($actionData = false)
+    {
+        get_template_part( 'parts/top-bar' );
+        exit;
+    }
+
+}
diff --git a/models/admin/ajax/scheduleOffcanvas.php b/models/admin/ajax/scheduleOffcanvas.php
new file mode 100644 (file)
index 0000000..78e3ee1
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * PDF Output by admin-ajax
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @version  0.1
+ */
+
+/**
+ * Steve Note...
+ *
+ * You can get to this using the following URL.
+ *
+ *  {host}/wp-admin/admin-ajax.php?action=glm_members_admin_ajax&glm_action=pdfOutput&mystuff=THIS
+ *
+ * You should be able to do this as POST or GET and should be able to add and read additional parameters.
+ * I added a "mystuff" parameter to the URL above and it does output from the code in the
+ * modelAction() function below.
+ *
+ * To add another model under models/admin/ajax all you need to do is create it and add it to the
+ * setup/validActions.php file.
+ *
+ */
+
+// Load Members data abstract
+// require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataImages.php';
+
+/**
+ * This class performs the work of handling images passed to it via
+ * an AJAX call that goes through the WorPress AJAX Handler.
+ *
+ */
+class GlmMembersAdmin_ajax_scheduleOffcanvas
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+
+    /**
+     * __construct
+     *
+     * @param mixed $wpdb   The main Word Press DB Object
+     * @param mixed $config The main Config
+     *
+     * @access public
+     * @return void
+     */
+    public function __construct($wpdb, $config)
+    {
+        $this->wpdb = $wpdb;
+        $this->config = $config;
+
+        //parent::__construct(false, false);
+
+    }
+
+    /**
+     * modelAction
+     *
+     * @param bool $actionData Action Data passed to the modelAction
+     *
+     * @access public
+     * @return void
+     */
+    public function modelAction($actionData = false)
+    {
+        get_template_part( 'parts/off-canvas-menu' );
+        exit;
+    }
+
+}
index dd7ba87..be73b51 100644 (file)
@@ -61,8 +61,8 @@ $glmMembersApisAddOnValidActions = array(
     'adminActions' => array(
         'ajax' => array(
             'schedule'  => GLM_MEMBERS_APIS_PLUGIN_SLUG,
-            'dropdown'  => GLM_MEMBERS_APIS_PLUGIN_SLUG,
-            'offcanvas' => GLM_MEMBERS_APIS_PLUGIN_SLUG,
+            'scheduleDropdown'  => GLM_MEMBERS_APIS_PLUGIN_SLUG,
+            'scheduleOffcanvas' => GLM_MEMBERS_APIS_PLUGIN_SLUG,
         ),
         'management' => array(
             'apis' => GLM_MEMBERS_APIS_PLUGIN_SLUG,