From: Steve Sutton Date: Wed, 10 Jul 2019 20:52:00 +0000 (-0400) Subject: Updating ui elements X-Git-Tag: v2.12.7^2~19 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=ef23ed5fabafef5ec23564f0dc7da90d48bcd427;p=WP-Plugins%2Fglm-member-db.git Updating ui elements Updating elements taking care of notices. Now have: text checkbox multicheckboxes multiselect select image --- diff --git a/views/ui/f6/checkbox.html b/views/ui/f6/checkbox.html index 8d8e16c7..45d53e84 100644 --- a/views/ui/f6/checkbox.html +++ b/views/ui/f6/checkbox.html @@ -24,7 +24,7 @@ name="{$ui.field}"{if $ui.value} checked{/if}> - {if $ui.dataError}{$ui.dataErrror}{/if} + {if isset($ui.dataError)}{$ui.dataError}{/if} {if isset($ui.helpText)}

{$ui.helpText}

{/if} {if isset($ui.errorText)}{$ui.errorText}{/if} diff --git a/views/ui/f6/editor.html b/views/ui/f6/editor.html index 331ef0bb..c30a571b 100644 --- a/views/ui/f6/editor.html +++ b/views/ui/f6/editor.html @@ -1,5 +1,5 @@ {* - Foundation 6 Text Area Input Field + Foundation 6 Editor All parameters are required. Do not list parameters if they're false. (We're not checking for false) If supplying field data (formData) from the data abstract, supply a @@ -7,63 +7,45 @@ "required" will be supplied by the abstract rather than in a parameter in this array. - {$fieldData = [ - 'data' => array Data from data abstract if using that, + {$ui = [ + 'value' => string Value of the element 'field' => string Name of field that holds the data if not using data abstract, 'label' => string Label text for this field, - 'placeholder' => string Placeholder string, + 'height' => integer Height in px, + 'media' => boolean Enable Media Button, + 'quicktags' => boolean Enable Quicktags, 'required' => boolean True if required, - 'maxWidth' => string Size of input field using standard style notation ('900px', '15rem', ...), 'helpText' => string Help text for this input, - 'errortext' => string Error text that appears when the field doesn't validate + 'errortext' => string Error text that appears when the field doesn't validate, + 'dataError' => string Error from data Abstract Class ]} *} -{if (!isset($fieldData.data) && !isset($fieldData.field)) || !isset($fieldData.label)} -
-
- Field Error: Required field information not supplied! -
+
+
+ + {if isset($ui.value) && $ui.value} + {$textAreaContent = $ui.value|escape:quotes} + {else} + {$textAreaContent = ''} + {/if} + {$textAreaName = $ui.field} + {if isset($ui.height)} {$height = $ui.height} {else} {$height = 100} {/if} + {if isset($ui.media)} {$media_buttons = $ui.media} {else} {$media_buttons = false} {/if} + {if isset($ui.quicktags)} {$quicktags = $ui.quicktags} {else} {$quicktags = false} {/if} + {wp_editor( + $textAreaContent, + $textAreaName, + json_decode('{ + "textarea_name": $textAreaContent, + "media_buttons": false, + "quicktags": false, + "editor_height": $height + }', true) + )} +
+ {if $ui.dataError}{$ui.dataError}{/if} + {if isset($ui.helpText)}

{$ui.helpText}

{/if} + {if isset($ui.errorText)}{$ui.errorText}{/if}
-{else} - {if isset(${$fieldData.data})} {* If using data abstract *} -
-
- -
-
- - {if $data.fieldFail.$field}{$data.fieldFail.$field}{/if} -
-
- {else} {* Using simple field *} -
- -
- {/if} -{/if} +
diff --git a/views/ui/f6/f6-image.html b/views/ui/f6/f6-image.html deleted file mode 100644 index b7b28fa9..00000000 --- a/views/ui/f6/f6-image.html +++ /dev/null @@ -1,31 +0,0 @@ -{* Foundation 6 Image *} -{* setup $data *} -{* setup $field *} -{* setup $fieldLabel *} -
-
- -
-
-
- {if $data.fieldData.$field} -
-
-
- -
-
-
-
- Delete {$fieldLabel}
- {$data.fieldData.$field} -
-
-
- {/if} -
New {$fieldLabel}
-
- {if $data.fieldFail.$field}

{$data.fieldFail.$field}

{/if} -
-
-
diff --git a/views/ui/f6/image.html b/views/ui/f6/image.html new file mode 100644 index 00000000..81b2887f --- /dev/null +++ b/views/ui/f6/image.html @@ -0,0 +1,50 @@ +{* + Foundation 6 Image Field + All parameters are required. + Do not list parameters if they're false. (We're not checking for false) + If supplying field data (formData) from the data abstract, supply a + name of that in the "field" parameter. Also then certain parameters like + "required" will be supplied by the abstract rather than in a parameter in + this array. + + {$ui = [ + 'value' => string Value of the element + 'field' => string Name of field that holds the data if not using data abstract, + 'label' => string Label text for this field, + 'required' => boolean True if required, + 'helpText' => string Help text for this input, + 'errortext' => string Error text that appears when the field doesn't validate, + 'dataError' => string Error from data Abstract Class + ]} +*} +
+
+ +
+ {if $ui.value} +
+
+ +
+
+
+
+ Delete {$ui.label}
+ {$ui.value} +
+
+ {/if} +
+ New {$ui.label} + + +
+
+
+
+ {if $ui.dataError}{$ui.dataError}{/if} + {if isset($ui.helpText)}

{$ui.helpText}

{/if} + {if isset($ui.errorText)}{$ui.errorText}{/if} +
+
+
diff --git a/views/ui/f6/multicheckboxes.html b/views/ui/f6/multicheckboxes.html index 7a1d08c5..9f406225 100644 --- a/views/ui/f6/multicheckboxes.html +++ b/views/ui/f6/multicheckboxes.html @@ -10,6 +10,7 @@ {$ui = [ 'field' => string Name of field that holds the data if not using data abstract, 'label' => string Label text for this field, + 'value' => string Value for this field, 'list' => array Array of list key=value pairs value=>label 'required' => boolean True if required, 'helpText' => string Help text for this input, @@ -33,7 +34,7 @@ {/foreach} {/if} - {if $ui.dataError}{$ui.dataErrror}{/if} + {if $ui.dataError}{$ui.dataError}{/if} {if isset($ui.helpText)}

{$ui.helpText}

{/if} {if isset($ui.errorText)}{$ui.errorText}{/if}
diff --git a/views/ui/f6/multiselect.html b/views/ui/f6/multiselect.html new file mode 100644 index 00000000..de0ec271 --- /dev/null +++ b/views/ui/f6/multiselect.html @@ -0,0 +1,46 @@ +{* + Foundation 6 Select Field + All parameters are required. + Do not list parameters if they're false. (We're not checking for false) + If supplying field data (formData) from the data abstract, supply a + name of that in the "field" parameter. Also then certain parameters like + "required" will be supplied by the abstract rather than in a parameter in + this array. + + {$ui = [ + 'value' => string Value of the element + 'field' => string Name of field that holds the data if not using data abstract, + 'label' => string Label text for this field, + 'l_label' => string Field name to use for the option textNode + 'l_value' => string Field name to use for the option value + 'l_blank' => string Add empty option + 'l_size' => integer select size, + 'required' => boolean True if required, + 'helpText' => string Help text for this input, + 'errortext' => string Error text that appears when the field doesn't validate, + 'dataError' => string Error from data Abstract Class + ]} +*} +
+
+ + + + {if isset($ui.dataError)}{$ui.dataError}{/if} + {if isset($ui.helpText)}

{$ui.helpText}

{/if} + {if isset($ui.errorText)}{$ui.errorText}{/if} + +
+
diff --git a/views/ui/f6/select.html b/views/ui/f6/select.html index 99247be2..2e26b109 100644 --- a/views/ui/f6/select.html +++ b/views/ui/f6/select.html @@ -31,13 +31,17 @@ {if $ui.l_blank}{/if} {foreach $ui.list as $v} - + {if isset($ui.l_value) && isset($ui.l_label)} + + {else} + + {/if} {/foreach} - {if $ui.dataError}{$ui.dataErrror}{/if} - {if isset($ui.helpText)}

{$ui.helpText}

{/if} - {if isset($ui.errorText)}{$ui.errorText}{/if} + {if isset($ui.dataError) && $ui.dataError}{$ui.dataError}{/if} + {if isset($ui.helpText)}

{$ui.helpText}

{/if} + {if isset($ui.errorText)}{$ui.errorText}{/if} diff --git a/views/ui/f6/text.html b/views/ui/f6/text.html index c28d3f73..fdabd98a 100644 --- a/views/ui/f6/text.html +++ b/views/ui/f6/text.html @@ -22,32 +22,24 @@ ]} *} -{if !isset($ui.field) || !isset($ui.label)} -
-
- Field Error: Required field information not supplied! -
+
+
+ + + {if isset($ui.dataError) && $ui.dataError}{$ui.dataError}{/if} + {if isset($ui.helpText)}

{$ui.helpText}

{/if} + {if isset($ui.errorText)}{$ui.errorText}{/if}
-{else} -
-
- - - {if $ui.dataError}{$ui.dataErrror}{/if} - {if isset($ui.helpText)}

{$ui.helpText}

{/if} - {if isset($ui.errorText)}{$ui.errorText}{/if} -
-
-{/if} +