Added the shortcode/view/model for registrationSelect
authorLaury GvR <laury@gaslightmedia.com>
Tue, 18 Jul 2017 15:00:52 +0000 (11:00 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 18 Jul 2017 15:00:52 +0000 (11:00 -0400)
models/front/registrations/registrationSelect.php [new file with mode: 0644]
setup/shortcodes.php
setup/validActions.php
views/front/registrations/registrationSelect.html [new file with mode: 0644]

diff --git a/models/front/registrations/registrationSelect.php b/models/front/registrations/registrationSelect.php
new file mode 100644 (file)
index 0000000..902a5b3
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
+
+ class GlmMembersFront_registrations_registrationSelect extends GlmDataRegistrationsRegEvent {
+    /**
+    * WordPress Database Object
+    *
+    * @var $wpdb
+    * @access public
+    */
+    public $wpdb;
+    /**
+    * Plugin Configuration Data
+    *
+    * @var $config
+    * @access public
+    */
+    public $config;
+    /**
+     * Constructor
+     *
+     * This contructor performs the work for this model. This model returns
+     * an array containing the following.
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * 'view'
+     *
+     * A suggested view name that the contoller should use instead of the
+     * default view for this model or false to indicate that the default view
+     * should be used.
+     *
+     * 'data'
+     *
+     * Data that the model is returning for use in merging with the view to
+     * produce output.
+     *
+     * @wpdb object WordPress database object
+     *
+     * @return array Array containing status, suggested view, and any data
+     */
+
+    public function modelAction($actionData = false)
+    {
+
+        // Get any provided option
+        if (isset($_REQUEST['option'])) {
+            $option = $_REQUEST['option'];
+        }
+
+        // Get account ID if supplied
+        if (isset($_REQUEST['account'])) {
+
+            // Make sure it's numeric
+            $this->accountID = ($_REQUEST['account'] - 0);
+
+            if ($this->accountID <= 0) {
+                $this->accountID = false;
+            }
+        }
+
+        $view = 'registrationSelect';
+
+        switch ( $option ) {
+
+        }
+
+        // Compile template data
+        $templateData = array(
+
+        );
+             // Return status, any suggested view, and any data to controller
+        return array(
+            'status'        => true,
+            'modelRedirect' => false,
+            'view'          => 'front/registrations/' . $view . '.html',
+            'data'          => $templateData
+        );
+
+    }
+ }
index 99300e7..ba79f89 100644 (file)
@@ -107,6 +107,16 @@ $glmMembersRegistrationsShortcodes = array(
             'member_only' => false,
         )
     ),
+    'glm-registration-select' => array(
+        'plugin'     => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+        'menu'       => 'registrations',
+        'action'     => 'registrationSelect',
+        'table'      => false,
+        'attributes' => array(
+            'id'         => false,
+            'member_only' => false,
+        )
+    ),
 );
 
 $glmMembersRegistrationsShortcodesDescription = '';
index 3bf8364..64ae648 100644 (file)
@@ -79,6 +79,7 @@ $glmMembersRegistrationsAddOnValidActions = array(
         'registrations' => array(
             'registrationSummary'           => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
             'registrationAccountSummary'    => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+            'registrationSelect'            => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
         )
     ),
 );
diff --git a/views/front/registrations/registrationSelect.html b/views/front/registrations/registrationSelect.html
new file mode 100644 (file)
index 0000000..e69de29