function form_field($field_type, $field_name, $overridden_validators = array(), $additional_filters = array(), $overridden_error_msgs = array()) { $field = field_types($field_type); $required = array('required' => true); $field['validators'] = isset($field['validators']) ? array_merge($required, $field['validators']) : array(); $field['validators'] = isset($field['validators']) ? array_merge($field['validators'], $overridden_validators) : $overridden_validators; $field['filters'] = isset($field['filters']) ? array_merge_recursive($field['filters'], $additional_filters) : $additional_filters; $field['error_msgs'] = isset($field['error_msgs']) ? array_merge($field['error_msgs'], $overridden_error_msgs) : $overridden_error_msgs; $field['name'] = $field_name; return $field; }
echo form_input(array('class' => 'form-control', 'name' => 'value', 'value' => isset($setting->value) ? $setting->value : '')); ?> </div> <div class="field-row"> <?php echo form_label(lang('Field Group'), 'group_id'); echo form_dropdown('group_id', $group_A, '', 'class="form-control"'); ?> </div> <div class="field-row"> <?php echo form_label(lang('Type'), 'type'); $disabled = isset($setting->id) && $setting->id > 0 ? ' disabled="disabled" ' : ''; echo form_dropdown('type', field_types(true), isset($setting->type) ? $setting->type : 'text', 'class="form-control" id="settingFieldType"' . $disabled); ?> </div> <hr /> <div class="field-row" class=""> <h4 class="panel-title cp" id="optionToggle" data-toggle="#settingFieldOptionsWrapper"> <i class="fa fa-list-ul"></i> <?php __('Options'); ?> </h4> <br /> <div id="settingFieldOptionsWrapper" class="panel-body" data-field="<?php echo isset($setting->id) ? $setting->id : ''; ?> "> <?php
__('Use lowercase without space or special character'); ?> </small> </div> <div class="clearfix"></div> </div> <div class="field-row row-fluid"> <div class="col-md-4"> <?php echo form_label(lang('Type'), 'type'); ?> </div> <div class="col-md-8"> <?php $disabled = isset($field->id) && $field->id > 0 ? ' disabled="disabled" ' : ''; echo form_dropdown('type', field_types(), isset($field->type) ? $field->type : 'text', 'class="form-control" id="contentFieldType" ' . $disabled); ?> </div> <div class="clearfix"></div> </div> <div class="field-row row-fluid"> <div class="col-md-4"> <?php echo form_label(lang('Enabled'), 'enabled'); ?> </div> <div class="col-md-8"> <?php echo form_dropdown('enabled', array('0' => lang('No'), '1' => lang('Yes')), isset($field->enabled) ? $field->enabled : 1, 'class="form-control"'); ?>