adding shortcodes , models, actions and views for registrationSummary and accountSummary
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 17 Jul 2017 19:09:51 +0000 (15:09 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 17 Jul 2017 19:09:51 +0000 (15:09 -0400)
created the model files, view files, shortcodes and actions to hook up the registrationSummary
and accountSummary parts of the front end. Tested that the files are hooked up properly by echoing
a string

models/front/registrations/registrationAccountSummary.php [new file with mode: 0644]
models/front/registrations/registrationSummary.php [new file with mode: 0644]
setup/shortcodes.php
setup/validActions.php
views/front/registrations/registrationAccountSummary.html [new file with mode: 0644]
views/front/registrations/registrationSummary.html [new file with mode: 0644]

diff --git a/models/front/registrations/registrationAccountSummary.php b/models/front/registrations/registrationAccountSummary.php
new file mode 100644 (file)
index 0000000..bfaef29
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataAccount.php';
+ class GlmMembersFront_registrations_registrationAccountSummary extends GlmDataRegistrationsAccount {
+    /**
+    * WordPress Database Object
+    *
+    * @var $wpdb
+    * @access public
+    */
+    public $wpdb;
+    /**
+    * Plugin Configuration Data
+    *
+    * @var $config
+    * @access public
+    */
+    public $config;
+    
+    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 = 'registrationAccountSummary';
+
+        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
+        );
+
+    }
+ }
diff --git a/models/front/registrations/registrationSummary.php b/models/front/registrations/registrationSummary.php
new file mode 100644 (file)
index 0000000..5b9a0dd
--- /dev/null
@@ -0,0 +1,58 @@
+<?php
+ require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataRegEvent.php';
+ class GlmMembersFront_registrations_registrationSummary extends GlmDataRegistrationsRegEvent {
+    /**
+    * WordPress Database Object
+    *
+    * @var $wpdb
+    * @access public
+    */
+    public $wpdb;
+    /**
+    * Plugin Configuration Data
+    *
+    * @var $config
+    * @access public
+    */
+    public $config;
+    
+    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 = 'registrationSummary';
+
+        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 69d2b5d..99300e7 100644 (file)
  */
 
 $glmMembersRegistrationsShortcodes = array(
+    'glm-registration-summary' => array(
+        'plugin'     => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+        'menu'       => 'registrations',
+        'action'     => 'registrationSummary',
+        'table'      => false,
+        'attributes' => array(
+            'id'         => false,
+            'member_only' => false,
+        )
+    ),
+    'glm-registration-account-summary' => array(
+        'plugin'     => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+        'menu'       => 'registrations',
+        'action'     => 'registrationAccountSummary',
+        'table'      => false,
+        'attributes' => array(
+            'id'         => false,
+            'member_only' => false,
+        )
+    ),
 );
 
 $glmMembersRegistrationsShortcodesDescription = '';
index 6913195..3bf8364 100644 (file)
@@ -76,7 +76,11 @@ $glmMembersRegistrationsAddOnValidActions = array(
         ),
     ),
     'frontActions' => array(
-    )
+        'registrations' => array(
+            'registrationSummary'           => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+            'registrationAccountSummary'    => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG,
+        )
+    ),
 );
 
 ?>
diff --git a/views/front/registrations/registrationAccountSummary.html b/views/front/registrations/registrationAccountSummary.html
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/views/front/registrations/registrationSummary.html b/views/front/registrations/registrationSummary.html
new file mode 100644 (file)
index 0000000..e69de29