From 6fdabf52c0552c9938f7cf99e4100fb7bd48dc5f Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 22 Mar 2017 20:00:37 -0400 Subject: [PATCH] Add ajax model for Starline Footer Nav Setting up the footer nav ajax call. This is for the ticket site to get the footer navigation. --- models/admin/ajax/scheduleFooterNav.php | 90 +++++++++++++++++++++++++ setup/validActions.php | 1 + 2 files changed, 91 insertions(+) create mode 100644 models/admin/ajax/scheduleFooterNav.php diff --git a/models/admin/ajax/scheduleFooterNav.php b/models/admin/ajax/scheduleFooterNav.php new file mode 100644 index 0000000..7827e32 --- /dev/null +++ b/models/admin/ajax/scheduleFooterNav.php @@ -0,0 +1,90 @@ + + * @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_scheduleFooterNav +{ + + /** + * 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) + { + glm_theme_footer(); + exit; + } + +} diff --git a/setup/validActions.php b/setup/validActions.php index 7e747bf..79b7f0d 100644 --- a/setup/validActions.php +++ b/setup/validActions.php @@ -63,6 +63,7 @@ $glmMembersApisAddOnValidActions = array( 'schedule' => GLM_MEMBERS_APIS_PLUGIN_SLUG, 'scheduleDropdown' => GLM_MEMBERS_APIS_PLUGIN_SLUG, 'scheduleOffcanvas' => GLM_MEMBERS_APIS_PLUGIN_SLUG, + 'scheduleFooterNav' => GLM_MEMBERS_APIS_PLUGIN_SLUG, ), 'management' => array( 'apis' => GLM_MEMBERS_APIS_PLUGIN_SLUG, -- 2.17.1