From: Steve Sutton Date: Fri, 2 Nov 2018 20:32:12 +0000 (-0400) Subject: Work on Interactive map X-Git-Tag: v2.11.0^2~64 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=6bc06091c9fa3f67b93f737f143a9f6c89d723b2;p=WP-Plugins%2Fglm-member-db.git Work on Interactive map Bringing in Uptra's interactive maps. --- diff --git a/assets/bullet_arrow_down.png b/assets/bullet_arrow_down.png new file mode 100755 index 00000000..9b23c06d Binary files /dev/null and b/assets/bullet_arrow_down.png differ diff --git a/assets/bullet_arrow_downOn.png b/assets/bullet_arrow_downOn.png new file mode 100755 index 00000000..bd2854e5 Binary files /dev/null and b/assets/bullet_arrow_downOn.png differ diff --git a/assets/mapLegend.gif b/assets/mapLegend.gif new file mode 100755 index 00000000..ce2f3f18 Binary files /dev/null and b/assets/mapLegend.gif differ diff --git a/assets/upOff.png b/assets/upOff.png new file mode 100755 index 00000000..0d6d96f7 Binary files /dev/null and b/assets/upOff.png differ diff --git a/assets/upOn.png b/assets/upOn.png new file mode 100755 index 00000000..c7a39b83 Binary files /dev/null and b/assets/upOn.png differ diff --git a/js/LeafletAwesomeMarkers/images/markers-matte.png b/js/LeafletAwesomeMarkers/images/markers-matte.png new file mode 100644 index 00000000..17825866 Binary files /dev/null and b/js/LeafletAwesomeMarkers/images/markers-matte.png differ diff --git a/js/LeafletAwesomeMarkers/images/markers-matte@2x.png b/js/LeafletAwesomeMarkers/images/markers-matte@2x.png new file mode 100644 index 00000000..c981244d Binary files /dev/null and b/js/LeafletAwesomeMarkers/images/markers-matte@2x.png differ diff --git a/js/LeafletAwesomeMarkers/images/markers-plain.png b/js/LeafletAwesomeMarkers/images/markers-plain.png new file mode 100644 index 00000000..763f3589 Binary files /dev/null and b/js/LeafletAwesomeMarkers/images/markers-plain.png differ diff --git a/js/LeafletAwesomeMarkers/images/markers-shadow.png b/js/LeafletAwesomeMarkers/images/markers-shadow.png new file mode 100644 index 00000000..33cf9550 Binary files /dev/null and b/js/LeafletAwesomeMarkers/images/markers-shadow.png differ diff --git a/js/LeafletAwesomeMarkers/images/markers-shadow@2x.png b/js/LeafletAwesomeMarkers/images/markers-shadow@2x.png new file mode 100644 index 00000000..1116503f Binary files /dev/null and b/js/LeafletAwesomeMarkers/images/markers-shadow@2x.png differ diff --git a/js/LeafletAwesomeMarkers/images/markers-soft.png b/js/LeafletAwesomeMarkers/images/markers-soft.png new file mode 100644 index 00000000..9ee4c348 Binary files /dev/null and b/js/LeafletAwesomeMarkers/images/markers-soft.png differ diff --git a/js/LeafletAwesomeMarkers/images/markers-soft@2x.png b/js/LeafletAwesomeMarkers/images/markers-soft@2x.png new file mode 100644 index 00000000..540ce637 Binary files /dev/null and b/js/LeafletAwesomeMarkers/images/markers-soft@2x.png differ diff --git a/js/LeafletAwesomeMarkers/leaflet.awesome-markers.css b/js/LeafletAwesomeMarkers/leaflet.awesome-markers.css new file mode 100644 index 00000000..588a99c8 --- /dev/null +++ b/js/LeafletAwesomeMarkers/leaflet.awesome-markers.css @@ -0,0 +1,124 @@ +/* +Author: L. Voogdt +License: MIT +Version: 1.0 +*/ + +/* Marker setup */ +.awesome-marker { + background: url('images/markers-soft.png') no-repeat 0 0; + width: 35px; + height: 46px; + position:absolute; + left:0; + top:0; + display: block; + text-align: center; +} + +.awesome-marker-shadow { + background: url('images/markers-shadow.png') no-repeat 0 0; + width: 36px; + height: 16px; +} + +/* Retina displays */ +@media (min--moz-device-pixel-ratio: 1.5),(-o-min-device-pixel-ratio: 3/2), +(-webkit-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5),(min-resolution: 1.5dppx) { + .awesome-marker { + background-image: url('images/markers-soft@2x.png'); + background-size: 720px 46px; + } + .awesome-marker-shadow { + background-image: url('images/markers-shadow@2x.png'); + background-size: 35px 16px; + } +} + +.awesome-marker i { + color: #333; + margin-top: 10px; + display: inline-block; + font-size: 14px; +} + +.awesome-marker .icon-white { + color: #fff; +} + +/* Colors */ +.awesome-marker-icon-red { + background-position: 0 0; +} + +.awesome-marker-icon-darkred { + background-position: -180px 0; +} + +.awesome-marker-icon-lightred { + background-position: -360px 0; +} + +.awesome-marker-icon-orange { + background-position: -36px 0; +} + +.awesome-marker-icon-beige { + background-position: -396px 0; +} + +.awesome-marker-icon-green { + background-position: -72px 0; +} + +.awesome-marker-icon-darkgreen { + background-position: -252px 0; +} + +.awesome-marker-icon-lightgreen { + background-position: -432px 0; +} + +.awesome-marker-icon-blue { + background-position: -108px 0; +} + +.awesome-marker-icon-darkblue { + background-position: -216px 0; +} + +.awesome-marker-icon-lightblue { + background-position: -468px 0; +} + +.awesome-marker-icon-purple { + background-position: -144px 0; +} + +.awesome-marker-icon-darkpurple { + background-position: -288px 0; +} + +.awesome-marker-icon-pink { + background-position: -504px 0; +} + +.awesome-marker-icon-cadetblue { + background-position: -324px 0; +} + +.awesome-marker-icon-white { + background-position: -574px 0; +} + +.awesome-marker-icon-gray { + background-position: -648px 0; +} + +.awesome-marker-icon-lightgray { + background-position: -612px 0; +} + +.awesome-marker-icon-black { + background-position: -682px 0; +} diff --git a/js/LeafletAwesomeMarkers/leaflet.awesome-markers.min.js b/js/LeafletAwesomeMarkers/leaflet.awesome-markers.min.js new file mode 100644 index 00000000..376e57e6 --- /dev/null +++ b/js/LeafletAwesomeMarkers/leaflet.awesome-markers.min.js @@ -0,0 +1,7 @@ +/* + Leaflet.AwesomeMarkers, a plugin that adds colorful iconic markers for Leaflet, based on the Font Awesome icons + (c) 2012-2013, Lennard Voogdt + + http://leafletjs.com + https://github.com/lvoogdt +*//*global L*/(function(e,t,n){"use strict";L.AwesomeMarkers={};L.AwesomeMarkers.version="2.0.1";L.AwesomeMarkers.Icon=L.Icon.extend({options:{iconSize:[35,45],iconAnchor:[17,42],popupAnchor:[1,-32],shadowAnchor:[10,12],shadowSize:[36,16],className:"awesome-marker",prefix:"glyphicon",spinClass:"fa-spin",icon:"home",markerColor:"blue",iconColor:"white"},initialize:function(e){e=L.Util.setOptions(this,e)},createIcon:function(){var e=t.createElement("div"),n=this.options;n.icon&&(e.innerHTML=this._createInner());n.bgPos&&(e.style.backgroundPosition=-n.bgPos.x+"px "+ -n.bgPos.y+"px");this._setIconStyles(e,"icon-"+n.markerColor);return e},_createInner:function(){var e,t="",n="",r="",i=this.options;i.icon.slice(0,i.prefix.length+1)===i.prefix+"-"?e=i.icon:e=i.prefix+"-"+i.icon;i.spin&&typeof i.spinClass=="string"&&(t=i.spinClass);i.iconColor&&(i.iconColor==="white"||i.iconColor==="black"?n="icon-"+i.iconColor:r="style='color: "+i.iconColor+"' ");return""},_setIconStyles:function(e,t){var n=this.options,r=L.point(n[t==="shadow"?"shadowSize":"iconSize"]),i;t==="shadow"?i=L.point(n.shadowAnchor||n.iconAnchor):i=L.point(n.iconAnchor);!i&&r&&(i=r.divideBy(2,!0));e.className="awesome-marker-"+t+" "+n.className;if(i){e.style.marginLeft=-i.x+"px";e.style.marginTop=-i.y+"px"}if(r){e.style.width=r.x+"px";e.style.height=r.y+"px"}},createShadow:function(){var e=t.createElement("div");this._setIconStyles(e,"shadow");return e}});L.AwesomeMarkers.icon=function(e){return new L.AwesomeMarkers.Icon(e)}})(this,document); diff --git a/js/leaflet-area-map.js b/js/leaflet-area-map.js new file mode 100644 index 00000000..f3f503e6 --- /dev/null +++ b/js/leaflet-area-map.js @@ -0,0 +1,298 @@ +var GlmMap = { + _map: null, + _latLngBounds: null, + _infoWindow: null, + _allMarkers: [], + // change speed 'slow' is 600 and 'fast' is 200 + _catDivSpeed: 180, + _defZoom: 8, + leafletTileServer: 'https://maps.gaslightmedia.com/08172018-c1feaf327f962d6c7c98b52003d1fa82/' + '{z}/{x}/{y}.png', + leafletMinZoom: 3, + leafletMaxZoom: 19, + clusterRadiusMax: 40, + markerGroup: '', + markerAreaGroup: '', + + init: function() + { + GlmMap.leafletMap = L.map('LeafletMapContainer').setView([46.225453, -87.011719], GlmMap._defZoom); + GlmMap.markerGroup = L.featureGroup({ + maxClusterRadius: GlmMap.clusterRadiusMax + }); + GlmMap.markerAreaGroup = L.featureGroup({ + maxClusterRadius: GlmMap.clusterRadiusMax + }); + + // Loading features + var loadingControl = L.Control.loading({ + separate: true, + delayIndicator: 500 + }); + GlmMap.leafletMap.addControl(loadingControl); + + // Init Map + L.tileLayer(GlmMap.leafletTileServer, { + attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA, Imagery © Gaslight Media', + minZoom: GlmMap.leafletMinZoom, + maxZoom: GlmMap.leafletMaxZoom, + id: 'nothot' + }).addTo(GlmMap.leafletMap); + + jQuery.each(glm_memberCats, function(i, category_id){ + // attach action to top of tab + jQuery("#cat-main-open-" + category_id).click(function(){ + jQuery("#cat-main-" + category_id).slideToggle(GlmMap._catDivSpeed); + }); + // attach action to bottom of tab + jQuery("#cat-main-close-" + category_id).click(function(){ + jQuery("#cat-main-" + category_id).slideUp(GlmMap._catDivSpeed); + }); + }); + jQuery("#memLocHdr").click(function (){ + GlmMap._showLocations(); + }); + jQuery("input[name^='category']").click(function (){ + GlmMap._clearMarkers(); + GlmMap._getCategoryValues(); + GlmMap._setActiveCatDiv(); + }); + jQuery(".mapCity a").click(function (){ + GlmMap._hideLocations(); + var params = "?city_id=" + jQuery(this).attr('rel'); + jQuery.get(glm_base_url + "member-city-google-map/" + params, GlmMap._centerCity, 'xml'); + return false; + }); + jQuery(".mapCounty a").click(function (){ + GlmMap._hideLocations(); + var params = "?region=" + jQuery(this).attr('rel'); + jQuery.get(glm_base_url + "member-city-google-map/" + params, GlmMap._centerCounty, 'xml'); + return false; + }); + }, + + _showLocations: function(){ + jQuery("#mapCities").show(); + jQuery("#mapCounties").show(); +// jQuery("#memberLocations").slideToggle(GlmMap._catDivSpeed); + jQuery("#memberLocations").show(); + jQuery("#memberLocations").animate({ + left: '5', + height: '520', + width: '966', + duration: '1' + }, GlmMap._catDivSpeed, function(){ + // done + }); + }, + + _hideLocations: function(){ + + jQuery("#memberLocations").animate({ + left: '980', + height: '0', + width: '0', + duration: '10' + }, GlmMap._catDivSpeed, function(){ + jQuery("#mapCities").hide(); + jQuery("#mapCounties").hide(); + }); + }, + + _getCategoryValues: function(){ + var values = jQuery("#category-form").serialize(); + // jQuery.get(glm_base_url + 'member-area-google-map/?' + values, GlmMap._loadData, 'xml'); + jQuery.ajax({ + url: glm_ajax_url + '?action=glm_members_admin_ajax&glm_action=membersMapData&' + values, + cache: false, + dataType: 'json', + success: function( mapData ){ + console.log( 'mapData: ', mapData ); + GlmMap._loadData( mapData ) + } + }); + }, + + _setActiveCatDiv: function() { + jQuery.each(glm_memberCats, function (i, category_id){ + jQuery("#cat-" + category_id).removeClass('highlightBox'); + var counter = jQuery("#cat-" + category_id).find("input:checked"); + if (counter.length > 0) { + jQuery("#cat-" + category_id).addClass('highlightBox'); + } + }); + }, + + _clearMarkers: function(){ + GlmMap.markerGroup.clearLayers(); + }, + + _loadData: function(markers) + { + var colorMarker = ''; + // var markers = data.documentElement.getElementsByTagName("marker"); + for (i = 0; i < markers.length; i++) { + var name = markers[i].member_name; + var street = markers[i].addr1; + var city = markers[i].city; + var state = markers[i].state; + var zip = markers[i].zip; + var lat = markers[i].lat; + var lng = markers[i].lon; + var directions = '';//markers[i].; + var phone = markers[i].phone; + var clickThru = markers[i].url; + var website = markers[i].url; + var logoPath = '';//markers[i].; + var logo = '';//markers[i].getAttribute('logo'); + var logoWidth = '';//markers[i].getAttribute('logoWidth'); + var logoHeight = '';//markers[i].getAttribute('logoHeight'); + var hasTripPlanner = '';//markers[i].getAttribute('hasTripPlanner'); + var addToPlannerUrl = '';//markers[i].getAttribute('addToPlannerUrl'); + var viewPlannerUrl = '';//markers[i].getAttribute('viewPlannerUrl'); + var plannerText = '';//markers[i].getAttribute('plannerText'); + var moreInfoUrl = '';//markers[i].getAttribute('moreInfoUrl'); + var markerColor = markers[i].color;//getAttribute('iconUrl'); + + var html = ''; + if (street == null) { + street = ''; + } + if (city == null) { + city = ''; + } + if (state == null) { + state = ''; + } + if (zip == null) { + zip = ''; + } + html += ''; + html += '
' + name + '
' + + street + '
' + city + ', ' + state + ' ' + zip; + + if (phone != '' && phone != null) { + html += '
' + phone; + } + if (website != '' && website != null) { + html += '
' + 'Website'; + } + + html += '
'; + if (moreInfoUrl) { + html += 'More Info'; + html += ' - '; + } + if (addToPlannerUrl != '' && hasTripPlanner) { + html += '' + + ''+plannerText+'' + + 'View Planner' + + ''; + html += ' - '; + } + + html += 'Get Directions'; + + defaultMarker = L.AwesomeMarkers.icon({ + prefix: 'fa', + icon: 'dot-circle', + markerColor: 'blue', + }); + + if ( markerColor ) { + colorMarker = L.AwesomeMarkers.icon({ + prefix: 'fa', + icon: 'dot-circle', + markerColor: markerColor, + }); + var leafletMarker = L.marker([lat, lng], { title: name, icon: colorMarker }) + .bindPopup( html ) + .addTo(GlmMap.markerGroup); + } else { + var leafletMarker = L.marker([lat, lng], { title: name, icon: defaultMarker }) + .bindPopup( html ) + .addTo(GlmMap.markerGroup); + } + + } + + GlmMap.leafletMap.addLayer(GlmMap.markerGroup); + + // Get outer bounds of all markers in the Feature Group + GlmMap.leafletMap.fitBounds(GlmMap.markerGroup.getBounds()); + + // When a marker is clicked, display the pop-up near the center of the map. + GlmMap.leafletMap.on('popupopen', function(e) { + var px = GlmMap.leafletMap.project(e.popup._latlng); + px.y -= e.popup._container.clientHeight/2; + GlmMap.leafletMap.panTo(GlmMap.leafletMap.unproject(px),{ animate: true }); + }); + }, + + _loadCityData: function(data) + { + var markers = data.documentElement.getElementsByTagName("marker"); + for (i = 0; i < markers.length; i++) { + var name = markers[i].getAttribute('city_name'); + var lat = markers[i].getAttribute('lat'); + var lng = markers[i].getAttribute('lng'); + + var point = new google.maps.LatLng( + parseFloat(lat), + parseFloat(lng) + ); + + var marker = new google.maps.Marker({ + title: name, + map: GlmMap._map, + position: point + }); + + GlmMap._allMarkers.push(marker); + } + + }, + + _centerCity: function(data) { + GlmMap.markerAreaGroup.clearLayers(); + var markers = data.documentElement.getElementsByTagName("marker"); + for (i = 0; i < markers.length; i++) { + var lat = markers[i].getAttribute('lat'); + var lng = markers[i].getAttribute('lng'); + var leafletMarker = L.marker([lat, lng], { title: name }) + .addTo(GlmMap.markerAreaGroup); + } + GlmMap.leafletMap.fitBounds(GlmMap.markerAreaGroup.getBounds()); + GlmMap.leafletMap.setZoom(13); + }, + + _centerCounty: function(data) { + GlmMap.markerAreaGroup.clearLayers(); + var markers = data.documentElement.getElementsByTagName("marker"); + for (i = 0; i < markers.length; i++) { + var lat = markers[i].getAttribute('lat'); + var lng = markers[i].getAttribute('lng'); + var leafletMarker = L.marker([lat, lng], { title: name }) + .addTo(GlmMap.markerAreaGroup); + } + GlmMap.leafletMap.fitBounds(GlmMap.markerAreaGroup.getBounds()); + }, + + _bindInfoWindow: function(marker, map, infoWindow, html) + { + google.maps.event.addListener(marker, 'click', function() { + infoWindow.setContent(html); + infoWindow.open(map, marker); + + jQuery(".addToPlanner a:first").live('click', function() { + if (jQuery(this).text() == 'Add To Planner') { + jQuery.get(jQuery(this).attr('href')); + jQuery(".addToPlanner a:first").hide(); + jQuery(".addToPlanner a:last").show(); + return false; + } + }); + }); + } +}; + +jQuery(document).ready(GlmMap.init); diff --git a/models/admin/ajax/membersMapData.php b/models/admin/ajax/membersMapData.php new file mode 100644 index 00000000..bbbcf460 --- /dev/null +++ b/models/admin/ajax/membersMapData.php @@ -0,0 +1,139 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @version 0.1 + */ + +// Load Members data abstract +require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMemberInfo.php'; + +/* + * This class performs the work of handling images passed to it via + * an AJAX call that goes through the WorPress AJAX Handler. + * + */ +class GlmMembersAdmin_ajax_membersMapData extends GlmDataMemberInfo +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + + /* + * Constructor + * + * This contructor sets up this model. At this time that only includes + * storing away the WordPress data object. + * + * @return object Class object + * + */ + public function __construct ($wpdb, $config) + { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + // Run constructor for members data class + parent::__construct(false, false); + + } + + /* + * Perform Model Action + * + * This modelAction takes an AJAX image upload and stores the image in the + * media/images directory of the plugin. + * + * This model action does not return, it simply does it's work then calls die(); + * + * @param $_REQUEST['id'] File Library ID + */ + public function modelAction ( $actionData = false ) + { + $jsonMemberData = array(); + + $colorArray = array( + 791 => 'red', // attractions + 792 => 'darkred', // dining + 793 => 'green', // Places to stay + 794 => 'cadetblue', // recreation + 795 => 'purple', // services + 796 => 'orange', // shopping + 797 => 'darkgreen', // transportation + ); + + trigger_error( print_r( $_REQUEST, true ), E_USER_NOTICE ); + + if ( isset( $_REQUEST['values'] ) ) { + trigger_error( print_r( $_REQUEST['values'], true ), E_USER_NOTICE ); + } + + $categories = $_REQUEST['category']; + + if ( !$categories ) { + echo json_encode( $jsonMemberData ); + exit; + } + + $where = "T.id IN ( + SELECT member_info + FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "category_member_info + WHERE category IN ( " . implode( ',', $categories ) . " ) + )"; + + $jsonMemberData = $this->getSimpleMemberInfoList($where, true); + + // Go through the member data and setup the marker colors depending on the category + foreach ( $jsonMemberData as $key => &$memberInfo ) { + $cats = $this->wpdb->get_results( + $this->wpdb->prepare( + "SELECT * + FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "categories + WHERE id IN ( + SELECT category + FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "category_member_info + WHERE member_info = %d ) ", + $memberInfo['id'] + ), + ARRAY_A + ); + if ( count( $cats ) > 1 || count( $cats ) == 0 ) { + $memberInfo['color'] = 'blue'; + } else if ( count( $cats ) == 1 ) { + $memberInfo['color'] = $colorArray[$cats[0]['parent']]; + } + } + + + header( 'Content-type: application/json' ); + echo json_encode( $jsonMemberData ); + + exit; + + } + +} diff --git a/models/front/members/interactivemap.php b/models/front/members/interactivemap.php new file mode 100644 index 00000000..6452954b --- /dev/null +++ b/models/front/members/interactivemap.php @@ -0,0 +1,186 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @version 0.1 + */ + + +// Load Members data abstract +// require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMemberInfo.php'; + +/* + * This class performs the work for the default action of the "Members" menu + * option, which is to display the members dashboard. + * + */ +class GlmMembersFront_members_interactivemap //extends GlmDataMemberInfo +{ + + /** + * WordPress Database Object + * + * @var $wpdb + * @access public + */ + public $wpdb; + /** + * Plugin Configuration Data + * + * @var $config + * @access public + */ + public $config; + + /* + * Constructor + * + * This contructor sets up this model. At this time that only includes + * storing away the WordPress data object. + * + * @return object Class object + * + */ + public function __construct ($wpdb, $config) + { + + // Save WordPress Database object + $this->wpdb = $wpdb; + + // Save plugin configuration object + $this->config = $config; + + // Run constructor for members data class + // parent::__construct(false, false); + + } + + /* + * Perform Model Action + * + * This method does the work for this model and returns any resulting data + * + * @return array Status and data array + * + * 'status' + * + * True if successful and false if there was a fatal failure. + * + * 'menuItemRedirect' + * + * If not false, provides a menu item the controller should + * execute after this one. Normally if this is used, there would also be a + * modelRedirect value supplied as well. + * + * 'modelRedirect' + * + * If not false, provides an action the controller should execute after + * this one. + * + * '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. + * + */ + public function modelAction ( $actionData = false ) + { + $settings = array(); + $success = true; + + // Need Member Categories (with active members) + // Need Cities (with active members) + // Need Regions (with active members) + + $templateData = array( + 'jsUrl' => GLM_MEMBERS_PLUGIN_JS_URL, + 'categories' => $this->getMemberCategories(), + + ); + // echo '
$categories: ' . print_r( $this->getMemberCategories(), true ) . '
'; + + // Return status, suggested view, and data to controller - also return any modified settings + return array( + 'status' => $success, + 'menuItemRedirect' => false, + 'modelRedirect' => false, + 'view' => "front/members/interactivemap.html", + 'data' => $templateData, + 'settings' => $settings + ); + + } + + public function getMemberCategories() + { + $categories = array( + 793 => array( + 'name' => 'Places To Stay', + 'subCats' => $this->getSubCategories( 793 ), + ), + 791 => array( + 'name' => 'Attractions', + 'subCats' => $this->getSubCategories( 791 ), + ), + 794 => array( + 'name' => 'Recreation', + 'subCats' => $this->getSubCategories( 794 ), + ), + 792 => array( + 'name' => 'Dining', + 'subCats' => $this->getSubCategories( 792 ), + ), + 796 => array( + 'name' => 'Shopping', + 'subCats' => $this->getSubCategories( 796 ), + ), + 795 => array( + 'name' => 'Services', + 'subCats' => $this->getSubCategories( 795 ), + ), + 797 => array( + 'name' => 'Transportation', + 'subCats' => $this->getSubCategories( 797 ), + ), + ); + return $categories; + } + + public function getSubCategories( $id ) + { + $categories = array(); + require_once GLM_MEMBERS_PLUGIN_CLASS_PATH . '/data/dataCategories.php'; + $Categories = new GlmDataCategories( $this->wpdb, $this->config ); + + $where = " T.parent = $id "; + $order = " T.parent, T.name "; + $categories = $Categories->getList( $where, $order ); + + + return $categories; + } + + public function getRegions() + { + } + + public function getCities() + { + } + + +} diff --git a/setup/shortcodes.php b/setup/shortcodes.php index 8b43e7a9..f0fcca22 100644 --- a/setup/shortcodes.php +++ b/setup/shortcodes.php @@ -198,7 +198,16 @@ if ( isset( $config['settings'] ) && $config['settings']['enable_members'] ) { 'attributes' => array ( 'number' => 1 ) - ) + ), + 'glm-member-interactive-map' => array( + 'plugin' => GLM_MEMBERS_PLUGIN_SLUG, + 'menu' => 'members', + 'action' => 'interactivemap', + 'table' => false, + 'attributes' => array( + 'client' => 'uptra', + ), + ), ); $glmMembersShortcodes = apply_filters( 'glm-custom-fields-shortcodes', $glmMembersShortcodes ); diff --git a/setup/validActions.php b/setup/validActions.php index c9d93a05..6d92f879 100644 --- a/setup/validActions.php +++ b/setup/validActions.php @@ -33,40 +33,41 @@ $glmMembersValidActions = array( 'adminActions' => array( 'ajax' => array( - 'imageUpload' => 'glm-member-db', - 'fileUpload' => 'glm-member-db', - 'newOldMemberIdsCsv' => 'glm-member-db', - 'membersListExport' => 'glm-member-db', - 'memberClickThrough' => 'glm-member-db', - 'memberDetailClick' => 'glm-member-db', - 'memberGraphs' => 'glm-member-db', - 'fileLibraryUpload' => 'glm-member-db', - 'fileLibraryDownload' => 'glm-member-db', - 'fileLibraryDelete' => 'glm-member-db', - 'fileLibraryUpdate' => 'glm-member-db', - 'glmCron' => 'glm-member-db' + 'imageUpload' => 'glm-member-db', + 'fileUpload' => 'glm-member-db', + 'newOldMemberIdsCsv' => 'glm-member-db', + 'membersListExport' => 'glm-member-db', + 'memberClickThrough' => 'glm-member-db', + 'memberDetailClick' => 'glm-member-db', + 'memberGraphs' => 'glm-member-db', + 'fileLibraryUpload' => 'glm-member-db', + 'fileLibraryDownload' => 'glm-member-db', + 'fileLibraryDelete' => 'glm-member-db', + 'fileLibraryUpdate' => 'glm-member-db', + 'glmCron' => 'glm-member-db', + 'membersMapData' => 'glm-member-db', ), 'dashboard' => array( 'index' => 'glm-member-db', - 'members' => 'glm-member-db' + 'members' => 'glm-member-db', ), 'dashboardWidget' => array( - 'index' => 'glm-member-db' + 'index' => 'glm-member-db', ), 'fileLibrary' => array( - 'index' => 'glm-member-db' + 'index' => 'glm-member-db', ), 'members' => array( 'index' => 'glm-member-db', // member list 'list' => 'glm-member-db', 'reports' => 'glm-member-db', - 'other' => 'glm-member-db' + 'other' => 'glm-member-db', ), 'member' => array( 'index' => 'glm-member-db', // Member Dashboard 'memberInfo' => 'glm-member-db', 'memberEdit' => 'glm-member-db', - 'locations' => 'glm-member-db' + 'locations' => 'glm-member-db', ), 'settings' => array( 'index' => 'glm-member-db', // Member Types @@ -74,7 +75,7 @@ $glmMembersValidActions = array( 'cities' => 'glm-member-db', 'regions' => 'glm-member-db', 'counties' => 'glm-member-db', - 'amenities' => 'glm-member-db' + 'amenities' => 'glm-member-db', ), 'management' => array( 'index' => 'glm-member-db', // General Options @@ -85,31 +86,32 @@ $glmMembersValidActions = array( 'import' => 'glm-member-db', 'addons' => 'glm-member-db', 'hooks' => 'glm-member-db', - 'cron' => 'glm-member-db' + 'cron' => 'glm-member-db', ), 'shortcodes' => array( - 'index' => 'glm-member-db' + 'index' => 'glm-member-db', ), 'error' => array( 'index' => 'glm-member-db', - 'badAction' => 'glm-member-db' + 'badAction' => 'glm-member-db', ), 'pages' => array( - 'shortcode' => 'glm-member-db' + 'shortcode' => 'glm-member-db', ), 'import' => array( - 'index' => 'glm-member-db' + 'index' => 'glm-member-db', ) ), 'frontActions' => array( 'members' => array( - 'list' => 'glm-member-db', - 'detail' => 'glm-member-db', - 'featured' => 'glm-member-db' + 'list' => 'glm-member-db', + 'detail' => 'glm-member-db', + 'featured' => 'glm-member-db', + 'interactivemap' => 'glm-member-db', ), 'error' => array( 'index' => 'glm-member-db', - 'badAction' => 'glm-member-db' + 'badAction' => 'glm-member-db', ) ), ); diff --git a/views/front/members/interactivemap.html b/views/front/members/interactivemap.html new file mode 100644 index 00000000..5d71f289 --- /dev/null +++ b/views/front/members/interactivemap.html @@ -0,0 +1,469 @@ +{literal} + +{/literal} + +
+ + + + + + + + + + + + +
+ {* Member Map *} +
+
+
+
    + {foreach $categories as $category_id => $catData} +
  • +
    {$catData.name}
    +
    + {foreach $catData.subCats as $subCatData} + + {/foreach} +
    Close
    +
    +
  • + {/foreach} +
+
+
+ Zoom to Cities and Counties +
+ +
+
+
+ Counties: + +
+
+ Cities: + +
+
+
+
+ +
+ +
+