Updating elements
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 22 Jul 2019 19:50:41 +0000 (15:50 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 22 Jul 2019 19:50:41 +0000 (15:50 -0400)
adding submit
fixing php notices

views/ui/f6/form-start.html
views/ui/f6/multicheckboxes.html
views/ui/f6/submit.html [new file with mode: 0644]

index 669693d..f8a39a0 100644 (file)
@@ -11,6 +11,6 @@
     id="{$ui.id}"
     action="{$ui.action}"
     method="{$ui.method}"
-    {if $ui.file}enctype="multipart/form-data"{/if}
+    {if !empty($ui.file)}enctype="multipart/form-data"{/if}
     data-abide novalidate data-validate-on-blur="true">
 
index e7533e5..e5b2803 100644 (file)
@@ -22,7 +22,7 @@
     <label>{$ui.label}</label>
     {if isset($ui.list) && $ui.list}
         {foreach $ui.list as $checkbox => $checkboxLabel}
-            <label class="{if $ui.reouired} glm-required{/if}">
+            <label class="{if !empty($ui.reouired)}glm-required{/if}">
                 <input
                     type="checkbox"
                     id="{$checkbox}"
@@ -33,7 +33,7 @@
         {/foreach}
     {/if}
 
-    {if $ui.dataError}<span class="form-error is-visible">{$ui.dataError}</span>{/if}
-    {if isset($ui.helpText)}<p class="help-text" id="{$field}_HelpText">{$ui.helpText}</p>{/if}
-    {if isset($ui.errorText)}<span id="{$field}_ErrorText" class="form-error">{$ui.errorText}</span>{/if}
+    {if !empty($ui.dataError)}<span class="form-error is-visible">{$ui.dataError}</span>{/if}
+    {if !empty($ui.helpText)}<p class="help-text" id="{$ui.field}_HelpText">{$ui.helpText}</p>{/if}
+    {if !empty($ui.errorText)}<span id="{$ui.field}_ErrorText" class="form-error">{$ui.errorText}</span>{/if}
 </div>
diff --git a/views/ui/f6/submit.html b/views/ui/f6/submit.html
new file mode 100644 (file)
index 0000000..9c08345
--- /dev/null
@@ -0,0 +1,24 @@
+{*
+    Foundation 6 Submit Button
+
+    Button Colors:
+    primary   = blue
+    secondary = grey
+    success   = green
+    alert     = red
+    warning   = yellow
+
+    {$ui = [
+        'id'    => string   Optional    The id for button,
+        'type'  => string   Optional    Type for button,
+        'label' => string   Required    Name of the Button Label,
+        'class' => string   Default     Primary class (primary, secondary, alert, success, warning)
+    ]}
+*}
+<button
+    {if !empty($ui.type)}type="{$ui.type}"{/if}
+    {if !empty($ui.id)}id="{$ui.id}"{/if}
+    class="button {$ui.class|default:'primary'}"
+    >
+    {$ui.label}
+</button>