public static function enqueue_jquery_css()
 {
     $theme_css = FrmStylesController::get_style_val('theme_css');
     if ($theme_css != -1) {
         wp_enqueue_style('jquery-theme', self::jquery_css_url($theme_css), array(), FrmAppHelper::plugin_version());
     }
 }
Пример #2
0
 public static function create($field_data)
 {
     if ($field_data['field_options']['label'] != 'none') {
         $field_data['field_options']['label'] = '';
     }
     $defaults = array('number' => array('maxnum' => 9999999), 'date' => array('max' => '10'), 'phone' => array('size' => '115px'), 'rte' => array('max' => 7), 'end_divider' => array('format' => 'both'));
     if (isset($defaults[$field_data['type']])) {
         $field_data['field_options'] = array_merge($field_data['field_options'], $defaults[$field_data['type']]);
         return $field_data;
     }
     switch ($field_data['type']) {
         case 'scale':
             $field_data['options'] = serialize(range(1, 10));
             $field_data['field_options']['minnum'] = 1;
             $field_data['field_options']['maxnum'] = 10;
             break;
         case 'select':
             $width = FrmStylesController::get_style_val('auto_width', $field_data['form_id']);
             $field_data['field_options']['size'] = $width;
             break;
         case 'user_id':
             $field_data['name'] = __('User ID', 'formidable');
             break;
         case 'divider':
             $field_data['field_options']['label'] = 'top';
             if (isset($field_data['field_options']['repeat']) && $field_data['field_options']['repeat']) {
                 // create the repeatable form
                 $field_data['field_options']['form_select'] = self::create_repeat_form(0, array('parent_form_id' => $field_data['form_id'], 'field_name' => $field_data['name']));
             }
             break;
         case 'break':
             $field_data['name'] = __('Next', 'formidable');
             break;
     }
     return $field_data;
 }
Пример #3
0
 public static function before_replace_shortcodes($html, $field)
 {
     $is_radio = self::is_radio($field);
     $is_checkbox = self::is_checkbox($field);
     if (isset($field['align']) && ($is_radio || $is_checkbox)) {
         $required_class = '[required_class]';
         $radio_align = $is_radio && $field['align'] != FrmStylesController::get_style_val('radio_align', $field['form_id']);
         $check_align = $is_checkbox && $field['align'] != FrmStylesController::get_style_val('check_align', $field['form_id']);
         if ($radio_align || $check_align) {
             $required_class .= $field['align'] == 'inline' ? ' horizontal_radio' : ' vertical_radio';
             $html = str_replace('[required_class]', $required_class, $html);
         }
     }
     if (isset($field['classes']) && strpos($field['classes'], 'frm_grid') !== false) {
         $opt_count = count($field['options']) + 1;
         $html = str_replace('[required_class]', '[required_class] frm_grid_' . $opt_count, $html);
         if (strpos($html, ' horizontal_radio')) {
             $html = str_replace(' horizontal_radio', ' vertical_radio', $html);
         }
         unset($opt_count);
     }
     if ($field['type'] == 'html' && isset($field['classes'])) {
         $html = str_replace('frm_form_field', 'frm_form_field ' . $field['classes'], $html);
     }
     return $html;
 }
 /**
  * Alternate Row Color for Default HTML
  * @return string
  */
 public static function change_row_color()
 {
     global $frm_email_col;
     $bg_color = 'bg_color';
     if ($frm_email_col) {
         $bg_color .= '_active';
         $frm_email_col = false;
     } else {
         $frm_email_col = true;
     }
     $bg_color = FrmStylesController::get_style_val($bg_color);
     $alt_color = 'background-color:#' . $bg_color . ';';
     return $alt_color;
 }
Пример #5
0
 public static function &label_position($position, $field, $form)
 {
     if ($position && $position != '') {
         return $position;
     }
     $style_pos = FrmStylesController::get_style_val('position', $form);
     $position = $style_pos == 'none' ? 'top' : ($style_pos == 'no_label' ? 'none' : $style_pos);
     return $position;
 }
Пример #6
0
                                    } else {
                                        ?>
<textarea name="<?php 
                                        echo esc_attr($field_name);
                                        ?>
" id="<?php 
                                        echo esc_attr($html_id);
                                        ?>
" style="height:<?php 
                                        echo $field['max'] ? (int) $field['max'] * 17 : 125;
                                        ?>
px;<?php 
                                        if (!$field['size']) {
                                            ?>
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