From 0386eb0e59ada0fc228145812ea51a635d1497ba Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 13 Nov 2018 09:56:55 -0500 Subject: [PATCH] pages now associate with the links on the map --- models/front/map/display.php | 19 ++++++++++++++++--- views/front/map/display.html | 31 +++++++++++++++++++++++++------ 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/models/front/map/display.php b/models/front/map/display.php index e254248..8bdc7ba 100644 --- a/models/front/map/display.php +++ b/models/front/map/display.php @@ -101,14 +101,27 @@ class GlmMembersFront_map_display extends GlmDataMapSettings { $sql = "SELECT * FROM " . GLM_MEMBERS_COUNTY_MAP_PLUGIN_DB_PREFIX . 'areas'; $areas = $this->wpdb->get_results($sql); + $args = array( + 'sort_order' => 'asc', + 'sort_column' => 'post_title', + 'hierarchical' => 0, + 'post_type' => 'page', + 'post_status' => 'publish' + ); + $results = get_pages($args); + foreach($results as $page){ + $pages[$page->ID]['name'] = $page->post_title; + $pages[$page->ID]['url'] = get_permalink($page->ID); + } wp_enqueue_style('admin-css', GLM_MEMBERS_COUNTY_MAP_PLUGIN_URL . 'css/front.min.css'); // Compile template data $templateData = array( - 'assets' => GLM_MEMBERS_COUNTY_MAP_PLUGIN_URL . 'assets/', - 'areas' => $areas + 'assets' => GLM_MEMBERS_COUNTY_MAP_PLUGIN_URL . 'assets/', + 'areas' => $areas, + 'pages' => $pages ); - + // Return status, any suggested view, and any data to controller return array( 'status' => true, diff --git a/views/front/map/display.html b/views/front/map/display.html index 7cef206..65a3197 100644 --- a/views/front/map/display.html +++ b/views/front/map/display.html @@ -9,6 +9,7 @@ \ No newline at end of file + + \ No newline at end of file -- 2.17.1