FrmFieldsHelper::include_other_input(array('other_opt' => $other_opt, 'read_only' => $read_only, 'checked' => $checked, 'name' => $other_args['name'], 'value' => $other_args['value'], 'field' => $field, 'html_id' => $html_id, 'opt_key' => $opt_key));
                        unset($other_opt, $other_args);
                        ?>
</div>
<?php 
                    }
                }
            }
        } else {
            if ($field['type'] == 'select') {
                include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/front-end/dropdown-field.php';
            } else {
                if ($field['type'] == 'checkbox') {
                    $checked_values = $field['value'];
                    $read_only = false;
                    if (FrmField::is_read_only($field) && !FrmAppHelper::is_admin()) {
                        $read_only = true;
                        if ($checked_values) {
                            foreach ((array) $checked_values as $checked_value) {
                                ?>
<input type="hidden" value="<?php 
                                echo esc_attr($checked_value);
                                ?>
" name="<?php 
                                echo esc_attr($field_name);
                                ?>
[]" />
<?php 
                            }
                        } else {
                            ?>
 public static function is_read_only($field)
 {
     _deprecated_function(__FUNCTION__, '2.0.9', 'FrmField::is_read_only');
     return FrmField::is_read_only($field);
 }
 public static function add_field_class($class, $field)
 {
     if ($field['type'] == 'scale' && FrmField::is_option_true($field, 'star')) {
         $class .= ' star';
     } else {
         if ($field['type'] == 'date') {
             $class .= ' frm_date';
         } else {
             if ($field['type'] == 'file' && FrmField::is_option_true($field, 'multiple')) {
                 $class .= ' frm_multiple_file';
             }
         }
     }
     // Hide the "No files selected" text if files are selected
     if ($field['type'] == 'file' && !FrmField::is_option_empty($field, 'value')) {
         $class .= ' frm_transparent';
     }
     if (!FrmAppHelper::is_admin() && FrmField::is_option_true($field, 'autocom') && ($field['type'] == 'select' || $field['type'] == 'data' && isset($field['data_type']) && $field['data_type'] == 'select') && !empty($field['options']) && !FrmField::is_read_only($field)) {
         global $frm_vars;
         $frm_vars['chosen_loaded'] = true;
         $class .= ' frm_chzn';
         $style = FrmStylesController::get_form_style($field['form_id']);
         if ($style && 'rtl' == $style->post_content['direction']) {
             $class .= ' chosen-rtl';
         }
     }
     return $class;
 }
Beispiel #4
0
<?php

// Check if field is read only
$disabled = FrmField::is_read_only($field) && !FrmAppHelper::is_admin() ? ' disabled="disabled"' : '';
// Dynamic Dropdowns
if ($field['data_type'] == 'select') {
    if (!empty($field['options'])) {
        ?>
<select <?php 
        echo $disabled;
        ?>
 name="<?php 
        echo esc_attr($field_name);
        ?>
" id="<?php 
        echo esc_attr($html_id);
        ?>
" <?php 
        do_action('frm_field_input_html', $field);
        ?>
>
<?php 
        if ($field['options']) {
            foreach ($field['options'] as $opt_key => $opt) {
                $selected = $field['value'] == $opt_key || in_array($opt_key, (array) $field['value']) ? ' selected="selected"' : '';
                ?>
<option value="<?php 
                echo esc_attr($opt_key);
                ?>
"<?php 
                echo $selected;
Beispiel #5
0
width:<?php 
                                            echo FrmStylesController::get_style_val('field_width');
                                        }
                                        ?>
" <?php 
                                        do_action('frm_field_input_html', $field);
                                        ?>
><?php 
                                        echo FrmAppHelper::esc_textarea($field['value']);
                                        ?>
</textarea>
<?php 
                                    }
                                } else {
                                    if ($field['type'] == 'file') {
                                        if (FrmField::is_read_only($field)) {
                                            // Read only file upload field shows the entry without an upload button
                                            foreach ((array) maybe_unserialize($field['value']) as $media_id) {
                                                if (!is_numeric($media_id)) {
                                                    continue;
                                                }
                                                ?>
<input type="hidden" name="<?php 
                                                echo esc_attr($field_name);
                                                if (FrmField::is_option_true($field, 'multiple')) {
                                                    echo '[]';
                                                }
                                                ?>
" value="<?php 
                                                echo esc_attr($media_id);
                                                ?>
<?php

$read_only = false;
if (isset($field['post_field']) && $field['post_field'] == 'post_category' && FrmAppHelper::pro_is_installed()) {
    echo FrmProPost::get_category_dropdown($field, array('location' => 'front', 'name' => $field_name, 'id' => $html_id));
} else {
    if (FrmAppHelper::pro_is_installed() && FrmField::is_read_only($field)) {
        $read_only = true;
        echo FrmProDropdownFieldsController::get_hidden_fields_with_readonly_values($field, $field_name, $html_id);
        ?>
		<select <?php 
        do_action('frm_field_input_html', $field);
        ?>
> <?php 
    } else {
        ?>
		<select name="<?php 
        echo esc_attr($field_name);
        ?>
" id="<?php 
        echo esc_attr($html_id);
        ?>
" <?php 
        do_action('frm_field_input_html', $field);
        ?>
>
	<?php 
    }
    $other_opt = $other_checked = false;
    foreach ($field['options'] as $opt_key => $opt) {
        $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field);