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

diff --git a/models/front/registrations/registrationCheckout.php b/models/front/registrations/registrationCheckout.php
new file mode 100644 (file)
index 0000000..658eeab
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
+
+ class GlmMembersFront_registrations_registrationCheckout 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 = 'registrationCheckout';
+
+        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 ba79f89..499f741 100644 (file)
@@ -117,6 +117,16 @@ $glmMembersRegistrationsShortcodes = array(
             'member_only' => false,
         )
     ),
+    'glm-registration-checkout' => array(
+        'plugin'     => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+        'menu'       => 'registrations',
+        'action'     => 'registrationCheckout',
+        'table'      => false,
+        'attributes' => array(
+            'id'         => false,
+            'member_only' => false,
+        )
+    ),
 );
 
 $glmMembersRegistrationsShortcodesDescription = '';
diff --git a/views/front/registrations/registrationCheckout.html b/views/front/registrations/registrationCheckout.html
new file mode 100644 (file)
index 0000000..e69de29