function test_create()
 {
     $form_id = $this->factory->form->get_id_by_key('contact-db12');
     $field_types = array_merge(FrmField::field_selection(), FrmField::pro_field_selection());
     foreach ($field_types as $field_type => $field_info) {
         $field_id = $this->factory->field->create(array('type' => $field_type, 'form_id' => $form_id));
         $this->assertTrue(is_numeric($field_id));
         $this->assertTrue($field_id > 0);
     }
 }
 public static function change_type($type)
 {
     $type_switch = array('scale' => 'radio', '10radio' => 'radio', 'rte' => 'textarea', 'website' => 'url');
     if (isset($type_switch[$type])) {
         $type = $type_switch[$type];
     }
     $frm_field_selection = FrmField::field_selection();
     $types = array_keys($frm_field_selection);
     if (!in_array($type, $types) && $type != 'captcha') {
         $type = 'text';
     }
     return $type;
 }
 private static function get_edit_vars($id, $errors = array(), $message = '', $create_link = false)
 {
     global $frm_vars;
     $form = FrmForm::getOne($id);
     if (!$form) {
         wp_die(__('You are trying to edit a form that does not exist.', 'formidable'));
     }
     if ($form->parent_form_id) {
         wp_die(sprintf(__('You are trying to edit a child form. Please edit from %1$shere%2$s', 'formidable'), '<a href="' . esc_url(admin_url('admin.php') . '?page=formidable&frm_action=edit&id=' . $form->parent_form_id) . '">', '</a>'));
     }
     $frm_field_selection = FrmField::field_selection();
     $fields = FrmField::get_all_for_form($form->id);
     // Automatically add end section fields if they don't exist (2.0 migration)
     $reset_fields = false;
     FrmFormsHelper::auto_add_end_section_fields($form, $fields, $reset_fields);
     if ($reset_fields) {
         $fields = FrmField::get_all_for_form($form->id, '', 'exclude');
     }
     unset($end_section_values, $last_order, $open, $reset_fields);
     $values = FrmAppHelper::setup_edit_vars($form, 'forms', $fields, true);
     $edit_message = __('Form was Successfully Updated', 'formidable');
     if ($form->is_template && $message == $edit_message) {
         $message = __('Template was Successfully Updated', 'formidable');
     }
     $all_templates = FrmForm::getAll(array('is_template' => 1), 'name');
     if ($form->default_template) {
         wp_die(__('That template cannot be edited', 'formidable'));
     } else {
         if (defined('DOING_AJAX')) {
             wp_die();
         } else {
             if ($create_link) {
                 require FrmAppHelper::plugin_path() . '/classes/views/frm-forms/new.php';
             } else {
                 require FrmAppHelper::plugin_path() . '/classes/views/frm-forms/edit.php';
             }
         }
     }
 }
 public static function field_selection()
 {
     _deprecated_function(__FUNCTION__, '2.0.9', 'FrmField::field_selection');
     return FrmField::field_selection();
 }
" />
<span class="frm_hidden_fdata frm_hidden"><?php 
    echo htmlspecialchars(json_encode($field));
    ?>
</span>
</li>
<?php 
    return;
}
$frm_settings = FrmAppHelper::get_settings();
if (!isset($frm_all_field_selection)) {
    if (isset($frm_field_selection) && isset($pro_field_selection)) {
        $frm_all_field_selection = array_merge($frm_field_selection, $pro_field_selection);
    } else {
        $pro_field_selection = FrmField::pro_field_selection();
        $frm_all_field_selection = array_merge(FrmField::field_selection(), $pro_field_selection);
    }
}
$disabled_fields = FrmAppHelper::pro_is_installed() ? array() : $pro_field_selection;
if (!isset($ajax)) {
    $li_classes .= ' ui-state-default widgets-holder-wrap';
    ?>
<li id="frm_field_id_<?php 
    echo esc_attr($field['id']);
    ?>
" class="<?php 
    echo esc_attr($li_classes);
    ?>
" data-fid="<?php 
    echo esc_attr($field['id']);
    ?>