From: Steve Sutton Date: Thu, 25 Feb 2016 16:07:08 +0000 (-0500) Subject: Adding more data arrays for the templates X-Git-Tag: v1.0.0^2~189 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=47e5f97491679aafe4ef6d084327437a63d28a41;p=WP-Plugins%2Fglm-member-db-events.git Adding more data arrays for the templates --- diff --git a/models/front/events/list.php b/models/front/events/list.php index 75ac343..a46af87 100644 --- a/models/front/events/list.php +++ b/models/front/events/list.php @@ -1,14 +1,38 @@ + * @license PHP Version 3.0 {@link http://www.php.net/license/3_0.txt} + */ class GlmMembersFront_events_list extends GlmDataEvents { public $wpdb; 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; @@ -17,6 +41,171 @@ class GlmMembersFront_events_list extends GlmDataEvents parent::__construct(false, false); } + private function getCategories() + { + return array( + array( + 'id' => 1, + 'name' => 'Arts & Crafts' + ), + array( + 'id' => 2, + 'name' => 'Arts/Cultural/Live Theatre' + ), + array( + 'id' => 3, + 'name' => 'Beer/Wine Focus' + ), + array( + 'id' => 4, + 'name' => 'Concerts/Live Music' + ), + array( + 'id' => 5, + 'name' => 'Educational' + ), + array( + 'id' => 6, + 'name' => 'Festivals/Fairs/Parades' + ), + array( + 'id' => 7, + 'name' => 'Outdoor/Nature' + ), + array( + 'id' => 8, + 'name' => 'Special Event' + ), + array( + 'id' => 9, + 'name' => 'Sports' + ), + ); + } + + private function getModelEventsData() + { + return array( + array( + 'title' => '20th Annual Garage Sale Art fair', + 'starting' => '02/27/2016', + 'ending' => '02/27/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Arts & Crafts' + ), + array( + 'title' => 'ARTbreak: Talk: The Art of Collaboration with artists Vicki VanAmeyden and Ginger Owen', + 'starting' => '03/01/2016', + 'ending' => '03/01/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Arts & Crafts' + ), + array( + 'title' => 'Easter Craft & Vendor Show', + 'starting' => '03/26/2016', + 'ending' => '03/26/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Arts & Crafts' + ), + array( + 'title' => 'Henderson Castle Tours', + 'starting' => '05/11/2016', + 'ending' => '05/11/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Arts/Cultural/Live Theatre' + ), + array( + 'title' => 'Colour Correction: British and American Screenprints, 1967-75', + 'starting' => '06/11/2015', + 'ending' => '06/10/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Arts/Cultural/Live Theatre' + ), + array( + 'title' => 'Suspended! Sculpture from ArtPrize 2015', + 'starting' => '12/12/2016', + 'ending' => '12/13/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Arts/Cultural/Live Theatre' + ), + array( + 'title' => '"Tasting on the Town"', + 'starting' => '04/21/2016', + 'ending' => '04/21/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Beer/Wine Focus' + ), + array( + 'title' => 'Patrick Henry Beer Collectibles Show', + 'starting' => '05/14/2016', + 'ending' => '05/14/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Beer/Wine Focus' + ), + array( + 'title' => '"Tasting on the Town"', + 'starting' => '05/20/2016', + 'ending' => '05/20/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Beer/Wine Focus' + ), + array( + 'title' => 'Owl Prowl: Barred Owls', + 'starting' => '02/25/2016', + 'ending' => '02/25/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Outdoor/Nature' + ), + array( + 'title' => 'Owls of Michigan', + 'starting' => '02/28/2016', + 'ending' => '02/28/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Outdoor/Nature' + ), + array( + 'title' => 'Bird Sanctuary Resource Center Re-Opening', + 'starting' => '02/29/2016', + 'ending' => '02/29/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Outdoor/Nature' + ), + array( + 'title' => 'Lead Day Hike', + 'starting' => '02/29/2016', + 'ending' => '02/29/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Outdoor/Nature' + ), + array( + 'title' => 'Project Snowstorm: Snowy Owls in Michigan', + 'starting' => '03/01/2016', + 'ending' => '03/01/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Outdoor/Nature' + ) + ); + } + + private function getModelEventData() + { + return array( + 'title' => 'Owr Prowl: Barred Owls', + 'starting' => '02/25/2016', + 'ending' => '02/25/2016', + 'description' => '

Test event description text here!

', + 'category' => 'Outdoor/Nature' + ); + } + + /** + * modelAction + * + * @param bool $actionData Action Data passed to the modelAction + * + * @access public + * @return void + */ public function modelAction($actionData = false) { $action = ''; @@ -32,65 +221,27 @@ class GlmMembersFront_events_list extends GlmDataEvents switch ($action) { case 'event-detail': - $eventData = array( - 'title' => 'Owr Prowl: Barred Owls', - 'starting' => '02/25/2016', - 'ending' => '02/25/2016', - 'description' => '

Test event description text here!

', - 'category' => 'Outdoor/Nature' - ); + $event = $this->getModelEventData(); break; case 'event-list': - $events = array( - array( - 'title' => 'Owr Prowl: Barred Owls', - 'starting' => '02/25/2016', - 'ending' => '02/25/2016', - 'description' => '

Test event description text here!

', - 'category' => 'Outdoor/Nature' - ), - array( - 'title' => 'Owls of Michigan', - 'starting' => '02/28/2016', - 'ending' => '02/28/2016', - 'description' => '

Test event description text here!

', - 'category' => 'Outdoor/Nature' - ), - array( - 'title' => 'Bird Sanctuary Resource Center Re-Opening', - 'starting' => '02/29/2016', - 'ending' => '02/29/2016', - 'description' => '

Test event description text here!

', - 'category' => 'Outdoor/Nature' - ), - array( - 'title' => 'Lead Day Hike', - 'starting' => '02/29/2016', - 'ending' => '02/29/2016', - 'description' => '

Test event description text here!

', - 'category' => 'Outdoor/Nature' - ), - array( - 'title' => 'Project Snowstorm: Snowy Owls in Michigan', - 'starting' => '03/01/2016', - 'ending' => '03/01/2016', - 'description' => '

Test event description text here!

', - 'category' => 'Outdoor/Nature' - ), - ); + $events = $this->getModelEventsData(); $view = 'list.html'; break; default: - + // for the dashboard need to get list of event categories and + // filter out the events + $events = $this->getModelEventsData(); $view = 'dashboard.html'; break; } + $categories = $this->getCategories(); // Compile template data $templateData = array( 'siteBaseUrl' => GLM_MEMBERS_SITE_BASE_URL, + 'categories' => $categories, 'events' => $events, 'event' => $event );