function form_group($element, $name = '') { $out = '<div class="form-group'; $out .= field_error($name) . '">'; $out .= $element; $out .= errors_msg($name); $out .= '</div>'; return $out; }
</td> </tr> <tr> <td class="name">Password:</td> <td class="value"> <input <?php echo field_error('admin_password'); ?> type="password" tabindex="16" name="admin_password" value="" /> </td> </tr> <tr> <td class="name">Re-Password:</td> <td class="value"> <input <?php echo field_error('admin_repassword'); ?> type="password" tabindex="17" name="admin_repassword" value="" /> </td> </tr> </tbody> </table> <?php } ?> <table> <tbody> <tr valign="top"> <td><strong>Please note: </strong></td> </tr> <tr valign="top">
type="password" name="admin_repassword" <?php if (isset($_SESSION['admin_repassword'])) { echo ' value = "' . $_SESSION['admin_repassword'] . '"'; } ?> /> </div> </div> <div class="four wide column"></div> <div class="two wide column"></div> <div class="four wide column">Email:</div> <div class="six wide column"> <div class="ui fluid input"> <input <?php echo field_error('admin_email'); ?> type="email" name="admin_email" <?php if (isset($_SESSION['admin_email'])) { echo ' value = "' . $_SESSION['admin_email'] . '"'; } ?> /> </div> </div> <div class="four wide column"></div> </div> <div class="ui red message lepton_message"> <div class="header">Please note:</div> <ul class="list">
}); Form::macro('radioStack', function ($name, $label = NULL, array $options, $checked = NULL, $attributes = []) { $out = $label ? '<label for="' . $name . '">' . $label . '</label>' : ''; $values = array_keys($options); foreach ($values as $value) { $out .= '<div class="radio">'; $out .= '<label>'; $out .= Form::radio($name, $value, $checked ? $checked == $value : old($name) == $value, $attributes) . $options[$value]; $out .= '</label>'; $out .= '</div>'; } return form_group($out, $name); }); Form::macro('checkboxField', function ($name, $label = NULL, $value = 1, $checked = NULL, $attributes = []) { $out = '<div class="checkbox'; $out .= field_error($name) . '">'; $out .= '<label>'; $out .= Form::checkbox($name, $value, $checked ? $checked : old($name), $attributes) . $label; $out .= '</div>'; return $out; }); Form::macro('delete', function ($route, $id, $text = '', $tooltip = false, $icon = true) { $model = explode('.', $route); $model = ucfirst(substr($model[1], 0, -1)); $tooltip = $tooltip ? $tooltip : 'Deletar ' . $model; $out = Form::open(['route' => [$route . '.destroy', $id], 'method' => 'DELETE', 'data-id' => $id, 'style' => 'display: inline-block']); $out .= '<button data-toggle="tooltip" data-placement="top" data-original-title="' . $tooltip . '" type="submit" data-id="' . $id . '" class="btn btn-danger btn-sm ' . ($icon ? 'btn-fw' : '') . '">'; $out .= $icon ? '<i class="fa fa-times"></i> ' . $text : $text; $out .= '</button>'; $out .= Form::close(); return $out;