From 076c5d12c87f11c69d28b126491a40403d0b5bab Mon Sep 17 00:00:00 2001 From: laury Date: Thu, 12 May 2016 12:56:59 -0400 Subject: [PATCH] Req.Pages and view file fixes --- controllers/admin.php | 21 +++------------------ css/front.css | 7 +++++-- models/admin/management/index.php | 2 +- models/front/members/list.php | 14 ++------------ setup/requiredPages.php | 22 +++++++++++----------- 5 files changed, 22 insertions(+), 44 deletions(-) diff --git a/controllers/admin.php b/controllers/admin.php index 0d7bb79c..556cecac 100644 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -234,11 +234,7 @@ class glmMembersAdmin extends GlmPluginSupport } $existingPost = get_post(get_option($trimmedName)); $testSlug = get_post_field( 'post_name', $existingPost); - //$existingSlug = $existingPost->post_name; - - $newSlug = str_replace(' ','-',strtolower($requiredPageInfo['name'])); - - //$existingSlug = $this->get_post_data($newSlug, 'post_name', 'post_name'); + $newSlug = sanitize_title($requiredPageInfo['name']); $existingSlug = $this->verify_post_slug($newSlug); @@ -249,14 +245,7 @@ class glmMembersAdmin extends GlmPluginSupport // then it's either the first time this plugin is run on an outdated site or somehow the ID was // deleted. Either way, replace the option value with whatever is the ID of the page matching // that slug. The slug is checked by translating the page title. - //$existingPage = get_post(url_to_postid(str_replace(' ','-',strtolower($requiredPageInfo['name'])))); - //$existingPage = get_post('members-detail'); - //echo '-- PROCESSING PAGE'.str_replace(' ','-',strtolower($requiredPageInfo['name'])); - - if ($newSlug == $existingSlug) { - //echo $existingSlug; - //echo 'DUPLICATE PAGE'.$existingSlug; - + if ($newSlug == $existingSlug) { $existingID = $this->get_post_id_by_slug($newSlug); update_option($trimmedName, $existingID); // Otherwise create a new page @@ -289,11 +278,7 @@ class glmMembersAdmin extends GlmPluginSupport } } } else { - -// echo " ((( slugpage ID: ".$existingID.")))"; -// echo " ((( testslug: ".$testSlug.")))"; -// echo " ((( existingslug: ".$existingSlug.")))"; -// echo '-- EXISTING PAGE '.$existingPost->ID.' - '.$existingPost->post_name; + // No page created } } diff --git a/css/front.css b/css/front.css index 304fb3e9..576ce320 100644 --- a/css/front.css +++ b/css/front.css @@ -129,7 +129,7 @@ } } .glm-member-db-list-grid-view #glm-member-list-filters-close { - background-color: grey; + background-color: rgba(0,0,0,0.25); height: 40px; line-height: 40px; color: white; @@ -160,6 +160,9 @@ padding-top: 50px; border-top: 0; } +#glm-member-list-filters-box .glm-member-search h3 { + color: black; +} .glm-member-db-list-grid-view .glm-member-search:before { background-color: lightgrey; content: ''; @@ -416,7 +419,7 @@ color: white; } #glm-member-detail-contact-info { - background-color: #2C296D; + background-color: #2c296d; padding: 15px; color: white; font-size: 18px; diff --git a/models/admin/management/index.php b/models/admin/management/index.php index 2c7ff611..e7ce21a6 100644 --- a/models/admin/management/index.php +++ b/models/admin/management/index.php @@ -130,7 +130,7 @@ class GlmMembersAdmin_management_index extends GlmDataSettingsGeneral //echo $pageName; $pageID = get_option(GLM_MEMBERS_PLUGIN_OPTION_PREFIX.$pageData['underscored_name']); $pageData['id'] = $pageID; - $pageData['slug'] = str_replace(' ','-',strtolower($pageData['name'])); + $pageData['slug'] = sanitize_title($pageData['name']);; echo get_the_title($pageID); //$pageData['name'] = single_post_title(get_post(get_option($pageID))); } diff --git a/models/front/members/list.php b/models/front/members/list.php index 0d1f797d..09c23bd2 100644 --- a/models/front/members/list.php +++ b/models/front/members/list.php @@ -432,23 +432,13 @@ class GlmMembersFront_members_list extends GlmDataMemberInfo $alphaList = $this->getAlphaList(' AND '.$where, $alphaSelected); } - - // Check whether search filters open by default - if ($this->config['settings']['list_show_search_filters_opened'] == 1) { - $filtersOpened = true; - } - - // Check whether map opens by default - if ($this->config['settings']['list_map_opened'] == 1) { - $mapOpened = true; - } /* * Check for which view file to use, else default to bars */ - $view = "front/members/index.html"; + $view = "front/members/list.html"; if (isset($actionData['request']['view']) && - strtolower($actionData['request']['view']) == "grid") { + strtolower($actionData['request']['view']) == "grid") { $view = "front/members/grid.html"; } diff --git a/setup/requiredPages.php b/setup/requiredPages.php index a3d3c047..b26434fb 100644 --- a/setup/requiredPages.php +++ b/setup/requiredPages.php @@ -33,18 +33,18 @@ * - 'associate' : this will make the page a child of the GLM Associate page * for management purposes * - * When in doubt just use 'associate' + * When in doubt just use '0' * */ $glmMembersRequiredPages = array( // These should be in GLM Associate - 'GLM Associate' => array( - 'name' => 'GLM Associate', - 'content' => '', - 'parent' => '0', - 'underscored_name' => 'glm_associate_id', - ), +// 'GLM Associate' => array( +// 'name' => 'GLM Associate', +// 'content' => '', +// 'parent' => '0', +// 'underscored_name' => 'glm_associate_id', +// ), // These should be in GLM Members 'Members Only' => array( 'name' => 'Members Only', @@ -56,13 +56,13 @@ $glmMembersRequiredPages = array( 'Members List' => array( 'name' => 'Members List', 'content' => '[glm-members-list]', - 'parent' => 'associate', + 'parent' => '0', 'underscored_name' => 'members_list_id', ), - 'Members Detail' => array( - 'name' => 'Members Detail', + 'Member Detail' => array( + 'name' => 'Member Detail', 'content' => '[glm-member-detail]', - 'parent' => 'associate', + 'parent' => '0', 'underscored_name' => 'member_detail_id', ) ); -- 2.17.1