From 1ac84d35602b3177a36b1794d7f47964ab2cdd41 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Thu, 9 Jun 2016 16:04:44 -0400 Subject: [PATCH] testing shortcode builder with new checkboxes --- classes/glmPluginSupport.php | 73 ++++++++++++++++++++++++------------ css/admin.css | 13 +++---- js/shortcodeBuilder.js | 3 +- 3 files changed, 54 insertions(+), 35 deletions(-) diff --git a/classes/glmPluginSupport.php b/classes/glmPluginSupport.php index 731086d8..0342faf2 100644 --- a/classes/glmPluginSupport.php +++ b/classes/glmPluginSupport.php @@ -664,11 +664,12 @@ return; // Off for now ** Need to make this switchable in management public function shortcode_builder_markup(){ require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataCategories.php'); + $listAttr = $this->config['addOns']['glm-member-db']['shortcodes']['glm-members-list']['attributes']; $detailAttr = $this->config['addOns']['glm-member-db']['shortcodes']['glm-member-detail']['attributes']; $glmcat = new GlmDataCategories($this->wpdb, $this->wpconfig); - $list = $glmcat->getList(); + $list = $glmcat->getListSortedParentChild(); // get the each addOn slugs to pass to the config array later $addOns = $this->config['addOns']; foreach($addOns as $addOn){ @@ -695,56 +696,78 @@ return; // Off for now ** Need to make this switchable in management echo ''; + echo ''; /* * Member DB Shortcode Attributes */ //dropdown for categories - echo ''; echo ''; foreach($list as $key=>$value){ - echo ''; + if( ! empty($value['parent']['name'])){ + echo ''; + } else { + echo ''; + } } echo ''; + + echo '
'; + foreach($list as $key=>$value){ + if( ! empty($value['parent']['name'])){ + echo ''; + } else { + echo ''; + } + } + echo '
'; // dropdown for blank start echo ''; // dropdown for views echo ''; // show list options 'scb' = shortcode builder acronym - echo '
'; - echo ''; - echo ''; - foreach($listAttr as $key=>$value){ - if($value != ''){ - echo ''; - } - } - echo '
'; +// echo '
'; +// echo ''; +// echo ''; +// foreach($listAttr as $key=>$value){ +// if($value != ''){ +// echo ''; +// } +// } +// echo '
'; // show detail options - echo '
'; - echo ''; - echo ''; - foreach($detailAttr as $key=>$value){ - if($value != ''){ - echo ''; - } - } - echo '
'; +// echo '
'; +// echo ''; +// echo ''; +// foreach($detailAttr as $key=>$value){ +// if($value != ''){ +// echo ''; +// } +// } +// echo '
'; // packaging addOn mark up if(file_exists(GLM_MEMBERS_PACKAGING_PLUGIN_PATH . "/setup/shortcodeBuilder.php")){ @@ -752,8 +775,8 @@ return; // Off for now ** Need to make this switchable in management } // list and detail buttons to open dialog for member db 'show' attr options - echo ''; - echo ''; + +// echo ''; echo ''; diff --git a/css/admin.css b/css/admin.css index 3682d560..2250c9ce 100644 --- a/css/admin.css +++ b/css/admin.css @@ -339,17 +339,14 @@ input[type=submit], input[type=file] { cursor: pointer; } .showLists, .showDetails{ - margin:0; - +/* margin:0; float:left; - - width:50%; + width:50%; */ } #showDetail > label, #showList > label{ - margin:0; - +/* margin:0; float:left; - - width:50%; + width:50%;*/ + display: block; } diff --git a/js/shortcodeBuilder.js b/js/shortcodeBuilder.js index 899fe17c..f8a3d702 100644 --- a/js/shortcodeBuilder.js +++ b/js/shortcodeBuilder.js @@ -31,12 +31,11 @@ jQuery(document).ready(function ($) { } // get the shortcode option name and hide / show necessary elements - shortcodeDropdown = $("#shortcodeDropdown option:selected").text(); + shortcodeDropdown = $("#shortcodeDropdown option:selected").val(); if(shortcodeDropdown === "glm-members-list"){ $("#listBtn").show(); $("#detailBtn").hide(); - $("#category-scDropdown").show(); $("#blank-start-scDropdown").show(); $("#id-scDropdown").hide(); $("#view-scDropdown").show(); -- 2.17.1