Ejemplo n.º 1
0
    private static function draw_term_childs_checkbox($terms, $mdf_parent_id = 0, $selected_ids = array(), $hide, $tax_name = 0, $is_ajax = true, $hide_string_ids = '', $widget_options = array())
    {
        if (!empty($terms)) {
            $show_tax_all_childs = (int) self::get_setting('show_tax_all_childs');
            ?>
            <ul class="mdf_taxonomy_check_list">

                <?php 
            foreach ($terms as $term_id => $term) {
                ?>
                    <?php 
                //do not output hidden terms
                if (in_array($term_id, $hide)) {
                    continue;
                }
                ?>
                    <li>

                        <?php 
                $tax_count = -1;
                $tax_count_strting = "";
                $show_option = true;
                if ($widget_options['taxonomies_options_show_count'] == 'true' or $widget_options['taxonomies_options_show_count'] == 1) {
                    $tax_count = self::get_tax_count($term, $tax_name, $widget_options, 'checkbox');
                    $tax_count_strting = ' (' . $tax_count . ')';
                    if ($widget_options['taxonomies_options_post_recount_dyn'] == 'true' or $widget_options['taxonomies_options_post_recount_dyn'] == 1) {
                        if ($widget_options['taxonomies_options_hide_terms_0'] == 'true' or $widget_options['taxonomies_options_hide_terms_0'] == 1) {
                            if (!$tax_count) {
                                $show_option = false;
                            }
                        }
                    }
                }
                $childs_ids = array();
                if ($show_option) {
                    $childs_ids = get_term_children($term_id, $tax_name);
                }
                $unique_id = uniqid();
                ?>

                        <?php 
                if ($show_option) {
                    ?>


                            <input <?php 
                    if ($tax_count == 0 and ($widget_options['taxonomies_options_show_count'] == 'true' or $widget_options['taxonomies_options_show_count'] == 1)) {
                        ?>
disabled<?php 
                    }
                    ?>
 type="checkbox" name="mdf[taxonomy][checkbox][<?php 
                    echo $tax_name;
                    ?>
][]" class="mdf_taxonomy_checkbox <?php 
                    if (!empty($childs_ids)) {
                        ?>
mdf_has_childs<?php 
                    }
                    ?>
" value="<?php 
                    echo $term_id;
                    ?>
" <?php 
                    if (in_array($term_id, $selected_ids)) {
                        ?>
checked<?php 
                    }
                    ?>
 data-tax-name="<?php 
                    echo $tax_name;
                    ?>
" data-hide="<?php 
                    echo $hide_string_ids;
                    ?>
" id="tax_check_<?php 
                    echo $term_id;
                    ?>
_<?php 
                    echo $unique_id;
                    ?>
" />&nbsp;<label <?php 
                    if (in_array($term_id, $selected_ids)) {
                        ?>
class="mdf_taxonomy_checked"<?php 
                    }
                    ?>
 for="tax_check_<?php 
                    echo $term_id;
                    ?>
_<?php 
                    echo $unique_id;
                    ?>
"><?php 
                    _e($term['name']);
                    echo $tax_count_strting;
                    ?>
</label>

                            <?php 
                    if ($show_tax_all_childs or (array_intersect($childs_ids, $selected_ids) or !empty($childs_ids) and in_array($term_id, $selected_ids))) {
                        ?>
                                <div class="mdf_taxonomy_child_container" style="display: block;">
                                    <?php 
                        $terms = self::get_terms($tax_name, true, false, 0, $term_id);
                        self::draw_term_childs_checkbox($terms, $term_id, $selected_ids, $hide, $tax_name, $is_ajax, $hide_string_ids, $widget_options);
                        ?>
                                </div>
                            <?php 
                    } else {
                        ?>
                                <div class="mdf_taxonomy_child_container">
                                    <?php 
                        MetaDataFilterHtml::draw_tax_loader();
                        ?>
                                </div>
                            <?php 
                    }
                    ?>

                        <?php 
                }
                ?>

                    </li>
                <?php 
            }
            ?>
            </ul>

            <?php 
        }
        if ($is_ajax) {
            exit;
        }
    }
Ejemplo n.º 2
0
?>
";
    var mdf_lang_cancel = "<?php 
_e("Cancel", 'meta-data-filter');
?>
";
    var mdf_lang_close = "<?php 
_e("Close", 'meta-data-filter');
?>
";
    var mdf_lang_apply = "<?php 
_e("Apply", 'meta-data-filter');
?>
";
    var mdf_tax_loader = '<?php 
MetaDataFilterHtml::draw_tax_loader();
?>
';
    var mdf_week_first_day =<?php 
echo get_option('start_of_week');
?>
;
    var mdf_calendar_date_format = "<?php 
echo (isset($settings['calendar_date_format']) and !empty($settings['calendar_date_format'])) ? $settings['calendar_date_format'] : 'mm/dd/yy';
?>
";
    var mdf_site_url = "<?php 
echo site_url();
?>
";
    var mdf_plugin_url = "<?php