From 463e05b89a0380bfc858e1943d824ce95b6a8135 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Mon, 11 Dec 2017 11:20:07 -0500 Subject: [PATCH] changing the account header layout and removing the widget adding cart widget data to the account headers using a shortcode --- css/front.css | 10 +- models/front/registrations/cartLinkWidget.php | 7 +- setup/frontHooks.php | 2 +- setup/shortcodes.php | 1 + views/front/registrations/accountHeader.html | 109 ++++++++++++++++++ views/front/registrations/registration.html | 3 +- 6 files changed, 126 insertions(+), 6 deletions(-) create mode 100644 views/front/registrations/accountHeader.html diff --git a/css/front.css b/css/front.css index 3b1f303..01ce393 100644 --- a/css/front.css +++ b/css/front.css @@ -335,8 +335,14 @@ span.glm-error { #glm-reg-widget { display: inline-block; } - - +#glm-header-reg-widget{ + display: inline-block; + float: left; + margin-right: 5px; +} +#glm-header-reg-widget a{ + text-decoration: none; +} /*{{{ Media Queries */ @media (min-width: 64.063em) { diff --git a/models/front/registrations/cartLinkWidget.php b/models/front/registrations/cartLinkWidget.php index 4772923..d322db9 100644 --- a/models/front/registrations/cartLinkWidget.php +++ b/models/front/registrations/cartLinkWidget.php @@ -81,6 +81,8 @@ class GlmMembersFront_registrations_cartLinkWidget $haveCart = false; + $viewAttr = isset($actionData['request']['view']) ? $actionData['request']['view'] : false; + $cartData = apply_filters('glm_members_registrations_cart_summary_data', false, false); if (is_array($cartData) && $cartData['id']) { @@ -91,10 +93,11 @@ class GlmMembersFront_registrations_cartLinkWidget $templateData = $cartData; $templateData['haveCart'] = $haveCart; $templateData['assetUrl'] = GLM_MEMBERS_REGISTRATIONS_PLUGIN_ASSETS_URL; + $templateData['regUrl'] = GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/'; // echo "
".print_r($templateData,1)."
"; - if($view){ - $view = "accountHeader"; + if($viewAttr){ + $view = $viewAttr; }else{ $view = 'cartLinkWidget'; } diff --git a/setup/frontHooks.php b/setup/frontHooks.php index c91f18a..f241572 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -72,5 +72,5 @@ add_filter( ); add_filter( 'glm_members_registrations_header', function($view ){ - + echo do_shortcode( '[glm-members-registrations-cart-link-widget view="accountHeader"]' ); },10,1); \ No newline at end of file diff --git a/setup/shortcodes.php b/setup/shortcodes.php index 216eb26..e69fed3 100644 --- a/setup/shortcodes.php +++ b/setup/shortcodes.php @@ -113,6 +113,7 @@ $glmMembersRegistrationsShortcodes = array( 'action' => 'cartLinkWidget', 'table' => false, 'attributes' => array( + 'view' => false ) ) diff --git a/views/front/registrations/accountHeader.html b/views/front/registrations/accountHeader.html new file mode 100644 index 0000000..29d556e --- /dev/null +++ b/views/front/registrations/accountHeader.html @@ -0,0 +1,109 @@ +
+
+
+ {if $haveCart} + + + + {else} + + {/if} + {if $haveOtherRequests} + + + +
+
+ + + + + + {foreach $regRequests as $rr} + + + + + + + + + {/foreach} + +
IDDate createdDate last updatedEventsRegistrantsSelected
+ {$rr.id} + {$rr.date_created.datetime}{$rr.last_update.datetime}{$rr.numb_events}{$rr.numb_registrants} + {if $rr.id == $id} + Yes + {/if} +
+
+
+ {/if} +
+ {if $loggedIn} + Logged in as {$loggedIn.fname} {$loggedIn.lname} + Logout + {else} + Login + Create an Account + {/if} +
+ {if $page != 'register'} + Register for Another Event + {/if} + {if $page != 'cart'} + Return to Cart + {/if} +   + +
+ \ No newline at end of file diff --git a/views/front/registrations/registration.html b/views/front/registrations/registration.html index b4248c4..83548ad 100644 --- a/views/front/registrations/registration.html +++ b/views/front/registrations/registration.html @@ -268,7 +268,8 @@ {/literal}

{$terms.reg_term_registrations_name}

- {include file='front/registrations/header.html'} + + {apply_filters('glm_members_registrations_header', 'accountHeader')} {if $reg_bulletin}
-- 2.17.1