public static function dropdown_categories($args)
 {
     $defaults = array('field' => false, 'name' => false, 'show_option_all' => ' ');
     $args = wp_parse_args($args, $defaults);
     if (!$args['field']) {
         return;
     }
     if (!$args['name']) {
         $args['name'] = 'item_meta[' . $args['field']['id'] . ']';
     }
     $id = self::get_html_id($args['field']);
     $class = $args['field']['type'];
     $exclude = is_array($args['field']['exclude_cat']) ? implode(',', $args['field']['exclude_cat']) : $args['field']['exclude_cat'];
     $exclude = apply_filters('frm_exclude_cats', $exclude, $args['field']);
     if (is_array($args['field']['value'])) {
         if (!empty($exclude)) {
             $args['field']['value'] = array_diff($args['field']['value'], explode(',', $exclude));
         }
         $selected = reset($args['field']['value']);
     } else {
         $selected = $args['field']['value'];
     }
     $tax_atts = array('show_option_all' => $args['show_option_all'], 'hierarchical' => 1, 'name' => $args['name'], 'id' => $id, 'exclude' => $exclude, 'class' => $class, 'selected' => $selected, 'hide_empty' => false, 'echo' => 0, 'orderby' => 'name');
     $tax_atts = apply_filters('frm_dropdown_cat', $tax_atts, $args['field']);
     if (FrmAppHelper::pro_is_installed()) {
         $post_type = FrmProFormsHelper::post_type($args['field']['form_id']);
         $tax_atts['taxonomy'] = FrmProAppHelper::get_custom_taxonomy($post_type, $args['field']);
         if (!$tax_atts['taxonomy']) {
             return;
         }
         // If field type is dropdown (not Dynamic), exclude children when parent is excluded
         if ($args['field']['type'] != 'data' && is_taxonomy_hierarchical($tax_atts['taxonomy'])) {
             $tax_atts['exclude_tree'] = $exclude;
         }
     }
     $dropdown = wp_dropdown_categories($tax_atts);
     $add_html = FrmFieldsController::input_html($args['field'], false);
     if (FrmAppHelper::pro_is_installed()) {
         $add_html .= FrmProFieldsController::input_html($args['field'], false);
     }
     $dropdown = str_replace("<select name='" . esc_attr($args['name']) . "' id='" . esc_attr($id) . "' class='" . esc_attr($class) . "'", "<select name='" . esc_attr($args['name']) . "' id='" . esc_attr($id) . "' " . $add_html, $dropdown);
     if (is_array($args['field']['value'])) {
         $skip = true;
         foreach ($args['field']['value'] as $v) {
             if ($skip) {
                 $skip = false;
                 continue;
             }
             $dropdown = str_replace(' value="' . esc_attr($v) . '"', ' value="' . esc_attr($v) . '" selected="selected"', $dropdown);
             unset($v);
         }
     }
     return $dropdown;
 }
Example #2
0
 public static function dropdown_categories($args)
 {
     global $frm_vars;
     $defaults = array('field' => false, 'name' => false, 'show_option_all' => ' ');
     extract(wp_parse_args($args, $defaults));
     if (!$field) {
         return;
     }
     if (!$name) {
         $name = "item_meta[{$field['id']}]";
     }
     $id = 'field_' . $field['field_key'];
     $class = $field['type'];
     $exclude = is_array($field['exclude_cat']) ? implode(',', $field['exclude_cat']) : $field['exclude_cat'];
     $exclude = apply_filters('frm_exclude_cats', $exclude, $field);
     if (is_array($field['value'])) {
         if (!empty($exclude)) {
             $field['value'] = array_diff($field['value'], explode(',', $exclude));
         }
         $selected = reset($field['value']);
     } else {
         $selected = $field['value'];
     }
     $args = array('show_option_all' => $show_option_all, 'hierarchical' => 1, 'name' => $name, 'id' => $id, 'exclude' => $exclude, 'class' => $class, 'selected' => $selected, 'hide_empty' => false, 'echo' => 0, 'orderby' => 'name');
     $args = apply_filters('frm_dropdown_cat', $args, $field);
     if (class_exists('FrmProFormsHelper')) {
         $post_type = FrmProFormsHelper::post_type($field['form_id']);
         $args['taxonomy'] = FrmProAppHelper::get_custom_taxonomy($post_type, $field);
         if (!$args['taxonomy']) {
             return;
         }
         if (is_taxonomy_hierarchical($args['taxonomy'])) {
             $args['exclude_tree'] = $exclude;
         }
     }
     $dropdown = wp_dropdown_categories($args);
     $add_html = FrmFieldsController::input_html($field, false);
     if ($frm_vars['pro_is_installed']) {
         $add_html .= FrmProFieldsController::input_html($field, false);
     }
     $dropdown = str_replace("<select name='{$name}' id='{$id}' class='{$class}'", "<select name='{$name}' id='{$id}' " . $add_html, $dropdown);
     if (is_array($field['value'])) {
         $skip = true;
         foreach ($field['value'] as $v) {
             if ($skip) {
                 $skip = false;
                 continue;
             }
             $dropdown = str_replace(' value="' . $v . '"', ' value="' . $v . '" selected="selected"', $dropdown);
             unset($v);
         }
     }
     return $dropdown;
 }
Example #3
0
require $frm_path . '/pro/classes/models/FrmProForm.php';
require $frm_path . '/pro/classes/models/FrmProNotification.php';
global $frmpro_display;
$frmpro_display = new FrmProDisplay();
$obj = new FrmProNotification();
// Instansiate Controllers
require $frm_path . '/pro/classes/controllers/FrmProAppController.php';
require $frm_path . '/pro/classes/controllers/FrmProDisplaysController.php';
require $frm_path . '/pro/classes/controllers/FrmProEntriesController.php';
require $frm_path . '/pro/classes/controllers/FrmProFieldsController.php';
require $frm_path . '/pro/classes/controllers/FrmProFormsController.php';
require $frm_path . '/pro/classes/controllers/FrmProStatisticsController.php';
FrmProAppController::load_hooks();
FrmProDisplaysController::load_hooks();
FrmProEntriesController::load_hooks();
FrmProFieldsController::load_hooks();
FrmProFormsController::load_hooks();
FrmProStatisticsController::load_hooks();
FrmProSettingsController::load_hooks();
if (is_admin()) {
    require $frm_path . '/pro/classes/controllers/FrmProXMLController.php';
    FrmProXMLController::load_hooks();
}
if (is_multisite()) {
    //Models
    require $frm_path . '/pro/classes/models/FrmProCopy.php';
    $obj = new FrmProCopy();
    //Add options to copy forms and displays
    require $frm_path . '/pro/classes/controllers/FrmProCopiesController.php';
    FrmProCopiesController::load_hooks();
}
Example #4
0
 function dropdown_categories($args)
 {
     global $frmpro_is_installed;
     $defaults = array('field' => false, 'name' => false);
     extract(wp_parse_args($args, $defaults));
     if (!$field) {
         return;
     }
     if (!$name) {
         $name = "item_meta[{$field['id']}]";
     }
     $id = 'field_' . $field['field_key'];
     $class = $field['type'];
     $selected = is_array($field['value']) ? reset($field['value']) : $field['value'];
     $exclude = is_array($field['exclude_cat']) ? implode(',', $field['exclude_cat']) : $field['exclude_cat'];
     $exclude = apply_filters('frm_exclude_cats', $exclude, $field);
     $args = array('show_option_all' => ' ', 'hierarchical' => 1, 'name' => $name, 'id' => $id, 'exclude' => $exclude, 'class' => $class, 'selected' => $selected, 'hide_empty' => false, 'echo' => 0, 'orderby' => 'name');
     if (class_exists('FrmProForm')) {
         $post_type = FrmProForm::post_type($field['form_id']);
         if (function_exists('get_object_taxonomies')) {
             $args['taxonomy'] = FrmProAppHelper::get_custom_taxonomy($post_type, $field);
             if (!$args['taxonomy']) {
                 return;
             }
         }
     }
     $dropdown = wp_dropdown_categories($args);
     $add_html = FrmFieldsController::input_html($field, false);
     if ($frmpro_is_installed) {
         $add_html .= FrmProFieldsController::input_html($field, false);
     }
     $dropdown = str_replace("<select name='{$name}' id='{$id}' class='{$class}'", "<select name='{$name}' id='{$id}' " . $add_html, $dropdown);
     return $dropdown;
 }
Example #5
0
        <div class="subform_section subform_<?php 
                                                    echo $subfield->type;
                                                    ?>
">
            <?php 
                                                    if ($subfield->type != 'break') {
                                                        ?>
            <label class="frm_primary_label"><?php 
                                                        echo $subfield->name;
                                                        ?>
</label>
            <?php 
                                                    }
                                                    ?>
            <?php 
                                                    FrmProFieldsController::show($subfield, 'embed');
                                                    ?>
            <div class="clear"></div>
        </div>
<?php 
                                                }
                                            }
                                        } else {
                                            if ('end_divider' == $field['type']) {
                                                ?>

<span class="show_repeat_sec repeat_icon_links repeat_format<?php 
                                                echo $field['format'];
                                                ?>
">
    <a href="javascript:void(0)" class="frm_remove_form_row <?php