From e00c1e37220c1f859866a4de6d684c752389b46f Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 12 Jul 2019 15:44:59 -0400 Subject: [PATCH] More updates on Foundation setup for ui elements Remove the grid-x grid-margin-x div wrapper from each element. Fixing editor issue with the json_decode (wasn't working) Use smarty array setup instead. --- views/ui/f6/checkbox.html | 42 +++++++++++++++++++--------- views/ui/f6/editor.html | 53 +++++++++++++++++------------------- views/ui/f6/image.html | 49 ++++++++++++++++----------------- views/ui/f6/multiselect.html | 39 ++++++++++++++------------ views/ui/f6/select.html | 38 ++++++++++++-------------- views/ui/f6/text.html | 38 ++++++++++++-------------- 6 files changed, 135 insertions(+), 124 deletions(-) diff --git a/views/ui/f6/checkbox.html b/views/ui/f6/checkbox.html index 45d53e84..6236f4d7 100644 --- a/views/ui/f6/checkbox.html +++ b/views/ui/f6/checkbox.html @@ -8,25 +8,41 @@ '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, + 'active' => string Text for active state + 'inactive' => string text for inactive state '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} + {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 c30a571b..4204c434 100644 --- a/views/ui/f6/editor.html +++ b/views/ui/f6/editor.html @@ -13,7 +13,6 @@ 'label' => string Label text for this field, 'height' => integer Height in px, 'media' => boolean Enable Media Button, - 'quicktags' => boolean Enable Quicktags, 'required' => boolean True if required, 'helpText' => string Help text for this input, 'errortext' => string Error text that appears when the field doesn't validate, @@ -21,31 +20,29 @@ ]} *} -
-
- - {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} -
+
+ + {if isset($ui.value) && $ui.value} + {$textAreaContent = $ui.value} + {else} + {$textAreaContent = ''} + {/if} + {$textAreaName = $ui.field} + {if isset($ui.height)} {$height = $ui.height} {else} {$height = 250} {/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} + {$settings = [ + 'textarea_name' => $textAreaName, + 'editor_height' => $height, + 'media_buttons' => $media_buttons + ]} + {wp_editor( + $textAreaContent, + $textAreaName, + $settings + )} +
+ {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/image.html b/views/ui/f6/image.html index 81b2887f..59bf9c90 100644 --- a/views/ui/f6/image.html +++ b/views/ui/f6/image.html @@ -11,40 +11,39 @@ '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, + 'button' => string Text for the Button '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 $ui.value} +
+
+
- {/if} -
- New {$ui.label} - -
-
-
+
+
+ Delete {$ui.label}
+ {$ui.value} +
+
+ {/if}
- {if $ui.dataError}{$ui.dataError}{/if} - {if isset($ui.helpText)}

{$ui.helpText}

{/if} - {if isset($ui.errorText)}{$ui.errorText}{/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/multiselect.html b/views/ui/f6/multiselect.html index de0ec271..790d58db 100644 --- a/views/ui/f6/multiselect.html +++ b/views/ui/f6/multiselect.html @@ -21,26 +21,29 @@ 'dataError' => string Error from data Abstract Class ]} *} -
-
- - - {if $ui.l_blank}{/if} + {if $ui.l_blank}{/if} - {foreach $ui.list as $v} - - {/foreach} - - {if isset($ui.dataError)}{$ui.dataError}{/if} - {if isset($ui.helpText)}

{$ui.helpText}

{/if} - {if isset($ui.errorText)}{$ui.errorText}{/if} + {foreach $ui.list as $k => $v} + {if isset($ui.l_value) && isset($ui.l_label)} + + {else} + + {/if} + {/foreach} + + + {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 ba45c1f3..144d0ddd 100644 --- a/views/ui/f6/select.html +++ b/views/ui/f6/select.html @@ -20,28 +20,26 @@ 'dataError' => string Error from data Abstract Class ]} *} -
-
- - - {if $ui.l_blank}{/if} + {if $ui.l_blank}{/if} - {foreach $ui.list as $k => $v} - {if isset($ui.l_value) && isset($ui.l_label)} - - {else} - - {/if} - {/foreach} - + {foreach $ui.list as $k => $v} + {if isset($ui.l_value) && isset($ui.l_label)} + + {else} + + {/if} + {/foreach} + - {if isset($ui.dataError) && $ui.dataError}{$ui.dataError}{/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 fdabd98a..99833c57 100644 --- a/views/ui/f6/text.html +++ b/views/ui/f6/text.html @@ -22,24 +22,22 @@ ]} *} -
-
- - - {if isset($ui.dataError) && $ui.dataError}{$ui.dataError}{/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}
-- 2.17.1