当前位置: 首页>>代码示例>>PHP>>正文


PHP GFCommon::get_field_filter_settings方法代码示例

本文整理汇总了PHP中GFCommon::get_field_filter_settings方法的典型用法代码示例。如果您正苦于以下问题:PHP GFCommon::get_field_filter_settings方法的具体用法?PHP GFCommon::get_field_filter_settings怎么用?PHP GFCommon::get_field_filter_settings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GFCommon的用法示例。


在下文中一共展示了GFCommon::get_field_filter_settings方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: leads_page


//.........这里部分代码省略.........
        $sort_field = empty($_GET['sort']) ? 0 : $_GET['sort'];
        $sort_direction = empty($_GET['dir']) ? 'DESC' : $_GET['dir'];
        $sort_field_meta = RGFormsModel::get_field($form, $sort_field);
        $is_numeric = $sort_field_meta['type'] == 'number';
        $page_size = gf_apply_filters('gform_entry_page_size', $form_id, 20, $form_id);
        $first_item_index = $page_index * $page_size;
        if (!empty($sort_field)) {
            $sorting = array('key' => $_GET['sort'], 'direction' => $sort_direction, 'is_numeric' => $is_numeric);
        } else {
            $sorting = array();
        }
        $paging = array('offset' => $first_item_index, 'page_size' => $page_size);
        $total_count = 0;
        $leads = GFAPI::get_entries($form_id, $search_criteria, $sorting, $paging, $total_count);
        $summary = RGFormsModel::get_form_counts($form_id);
        $active_lead_count = $summary['total'];
        $unread_count = $summary['unread'];
        $starred_count = $summary['starred'];
        $spam_count = $summary['spam'];
        $trash_count = $summary['trash'];
        $columns = RGFormsModel::get_grid_columns($form_id, true);
        $search_qs = empty($search) ? '' : '&s=' . esc_attr(urlencode($search));
        $sort_qs = empty($sort_field) ? '' : '&sort=' . esc_attr($sort_field);
        $dir_qs = empty($sort_direction) ? '' : '&dir=' . esc_attr($sort_direction);
        $star_qs = $star !== null ? '&star=' . esc_attr($star) : '';
        $read_qs = $read !== null ? '&read=' . esc_attr($read) : '';
        $filter_qs = '&filter=' . esc_attr($filter);
        $search_field_id_qs = !isset($_GET['field_id']) ? '' : '&field_id=' . esc_attr($search_field_id);
        $search_operator_urlencoded = urlencode($search_operator);
        $search_operator_qs = empty($search_operator_urlencoded) ? '' : '&operator=' . esc_attr($search_operator_urlencoded);
        $display_total = ceil($total_count / $page_size);
        $page_links = paginate_links(array('base' => admin_url('admin.php') . "?page=gf_entries&view=entries&id={$form_id}&%_%" . $search_qs . $sort_qs . $dir_qs . $star_qs . $read_qs . $filter_qs . $search_field_id_qs . $search_operator_qs, 'format' => 'paged=%#%', 'prev_text' => esc_html__('«', 'gravityforms'), 'next_text' => esc_html__('»', 'gravityforms'), 'total' => $display_total, 'current' => $page_index + 1, 'show_all' => false));
        wp_print_styles(array('thickbox'));
        $field_filters = GFCommon::get_field_filter_settings($form);
        $init_field_id = empty($search_field_id) ? 0 : $search_field_id;
        $init_field_operator = empty($search_operator) ? 'contains' : $search_operator;
        $init_filter_vars = array('mode' => 'off', 'filters' => array(array('field' => $init_field_id, 'operator' => $init_field_operator, 'value' => $search)));
        $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min';
        ?>

		<script type="text/javascript">

		var messageTimeout = false,
			gformFieldFilters = <?php 
        echo json_encode($field_filters);
        ?>
,
			gformInitFilter = <?php 
        echo json_encode($init_filter_vars);
        ?>

				function ChangeColumns(columns) {
					jQuery("#action").val("change_columns");
					jQuery("#grid_columns").val(jQuery.toJSON(columns));
					tb_remove();
					jQuery("#lead_form")[0].submit();
				}

		function Search(sort_field_id, sort_direction, form_id, search, star, read, filter, field_id, operator) {
			var search_qs = search == "" ? "" : "&s=" + encodeURIComponent(search);
			var star_qs = star == "" ? "" : "&star=" + star;
			var read_qs = read == "" ? "" : "&read=" + read;
			var filter_qs = filter == "" ? "" : "&filter=" + filter;
			var field_id_qs = field_id == "" ? "" : "&field_id=" + field_id;
			var operator_qs = operator == "" ? "" : "&operator=" + operator;
开发者ID:kidaak,项目名称:gravityforms,代码行数:66,代码来源:entry_list.php

示例2: form_settings_fields

 /**
  * Add form settings page with schedule export options.
  *
  * TODO: Add default email address - admin email if empty?
  *
  * @since    1.0.0
  *
  */
 public function form_settings_fields($form)
 {
     if (!GFCommon::current_user_can_any('gravityforms_edit_forms')) {
         wp_die('You do not have permission to access this page');
     }
     //collect the form id from the schedule export settings page url for the current form
     $form_id = $_REQUEST['id'];
     $form = apply_filters("gform_form_export_page_{$form_id}", apply_filters('gform_form_export_page', $form));
     //collect filter settings TODO: these are currently not used.
     $filter_settings = GFCommon::get_field_filter_settings($form);
     $filter_settings_json = json_encode($filter_settings);
     //collect and add the default export fields
     $form = GFExport::add_default_export_fields($form);
     $form_fields = $form['fields'];
     $choices[] = array('label' => 'Select All', 'name' => '', 'default_value' => 1);
     //loop through the fields and format all the inputs in to an array to be rendered as checkboxes
     foreach ($form_fields as $field) {
         $inputs = $field->get_entry_inputs();
         if (is_array($inputs)) {
             foreach ($inputs as $input) {
                 $choices[] = array('label' => GFCommon::get_label($field, $input['id']), 'name' => $input['id'], 'default_value' => 1);
             }
         } else {
             if (!$field->displayOnly) {
                 $choices[] = array('label' => GFCommon::get_label($field), 'name' => $field->id, 'default_value' => 1);
             }
         }
     }
     $inputs = array(array('title' => "Scheduled Entries Export", 'description' => "The settings below will automatically export new entries and send them to the emails below based on the set time frame.", 'fields' => array(array('label' => "Activate the Schedule", 'type' => "checkbox", 'name' => "enabled", 'tooltip' => "Enabling the schedule based on the sets below. This runs off WP Cron.", 'choices' => array(array('label' => "", 'name' => "enabled"))), array('label' => "Time Frame", 'type' => "select", 'name' => "time_frame", 'tooltip' => "Set how frequently it the entries are exported and emailed", 'choices' => array(array('label' => "Hourly", 'value' => "hourly"), array('label' => "Twice Daily", 'value' => "twicedaily"), array('label' => "Daily", 'value' => "daily"), array('label' => "Weekly", 'value' => "weekly"), array('label' => "Monthly - Every 30 Days", 'value' => "monthly"))), array('type' => "text", 'name' => "email", 'label' => "Email Address", 'class' => "medium", 'tooltip' => "Enter a comma separated list of emails you would like to receive the exported entries file."), array('label' => "Form Fields", 'type' => "checkbox", 'name' => "fields", 'tooltip' => "Select the fields you would like to include in the export. Caution: Make sure you are not sending any sensitive information.", 'choices' => $choices))));
     return $inputs;
 }
开发者ID:jjozwiak,项目名称:gravityforms-csv-schedule-export,代码行数:39,代码来源:scheduled-export.php

示例3: results_page

        public function results_page($form_id, $page_title, $gf_page, $gf_view)
        {
            if (empty($form_id)) {
                $forms = RGFormsModel::get_forms();
                if (!empty($forms)) {
                    $form_id = $forms[0]->id;
                }
            }
            $form = GFFormsModel::get_form_meta($form_id);
            $form = gf_apply_filters(array('gform_form_pre_results', $form_id), $form);
            // set up filter vars
            $start_date = rgget('start');
            $end_date = rgget('end');
            $all_fields = $form['fields'];
            $filter_settings = GFCommon::get_field_filter_settings($form);
            $filter_settings = apply_filters('gform_filters_pre_results', $filter_settings, $form);
            $filter_settings = array_values($filter_settings);
            // reset the numeric keys in case some filters have been unset
            $filter_fields = rgget('f');
            $filter_operators = rgget('o');
            $filter_values = rgget('v');
            $filters = array();
            $init_vars = array();
            if (!empty($filter_fields)) {
                $init_vars['mode'] = rgget('mode');
                foreach ($filter_fields as $i => $filter_field) {
                    $filters[$i]['field'] = $filter_field;
                    $filters[$i]['operator'] = $filter_operators[$i];
                    $filters[$i]['value'] = $filter_values[$i];
                }
                $init_vars['filters'] = $filters;
            }
            ?>
			<script type="text/javascript">
				var gresultsFields = <?php 
            echo json_encode($all_fields);
            ?>
;
				var gresultsFilterSettings = <?php 
            echo json_encode($filter_settings);
            ?>
;
				var gresultsInitVars = <?php 
            echo json_encode($init_vars);
            ?>
;

				<?php 
            GFCommon::gf_global();
            ?>
				<?php 
            GFCommon::gf_vars();
            ?>
			</script>

			<link rel="stylesheet"
			      href="<?php 
            echo GFCommon::get_base_url();
            ?>
/css/admin.css?ver=<?php 
            echo GFCommon::$version;
            ?>
"
			      type="text/css"/>
			<div class="wrap gforms_edit_form <?php 
            echo GFCommon::get_browser_class();
            ?>
">

				<h2 class="gf_admin_page_title">
					<span><?php 
            echo empty($form_id) ? $page_title : $page_title . ' : ' . esc_html($form['title']);
            ?>
</span><span
						class="gf_admin_page_subtitle"><span
							class="gf_admin_page_formid">ID: <?php 
            echo $form['id'];
            ?>
</span><span
							class="gf_admin_page_formname"><?php 
            esc_html_e('Form Name', 'gravityforms');
            ?>
							: <?php 
            echo $form['title'];
            ?>
</span></span>
				</h2>
				<?php 
            RGForms::top_toolbar();
            ?>
				<?php 
            if (false === empty($all_fields)) {
                ?>

					<div id="poststuff" class="metabox-holder has-right-sidebar">
						<div id="side-info-column" class="inner-sidebar">
							<div id="gresults-results-filter" class="postbox">
								<h3 style="cursor: default;"><?php 
                echo $this->_search_title;
                ?>
//.........这里部分代码省略.........
开发者ID:arobbins,项目名称:davis,代码行数:101,代码来源:class-gf-results.php

示例4: select_export_form

 public static function select_export_form()
 {
     check_ajax_referer('rg_select_export_form', 'rg_select_export_form');
     $form_id = intval($_POST['form_id']);
     $form = RGFormsModel::get_form_meta($form_id);
     /**
      * Filters through the Form Export Page
      *
      * @param int $form_id The ID of the form to export
      * @param int $form The Form Object of the form to export
      */
     $form = gf_apply_filters('gform_form_export_page', $form_id, $form);
     $filter_settings = GFCommon::get_field_filter_settings($form);
     $filter_settings_json = json_encode($filter_settings);
     $fields = array();
     $form = GFExport::add_default_export_fields($form);
     if (is_array($form['fields'])) {
         /* @var GF_Field $field */
         foreach ($form['fields'] as $field) {
             $inputs = $field->get_entry_inputs();
             if (is_array($inputs)) {
                 foreach ($inputs as $input) {
                     $fields[] = array($input['id'], GFCommon::get_label($field, $input['id']));
                 }
             } else {
                 if (!$field->displayOnly) {
                     $fields[] = array($field->id, GFCommon::get_label($field));
                 }
             }
         }
     }
     $field_json = GFCommon::json_encode($fields);
     die("EndSelectExportForm({$field_json}, {$filter_settings_json});");
 }
开发者ID:kidaak,项目名称:gravityforms,代码行数:34,代码来源:gravityforms.php

示例5: results_page

        public function results_page($form_id, $page_title, $gf_page, $gf_view)
        {
            if (empty($form_id)) {
                $forms = RGFormsModel::get_forms();
                if (!empty($forms)) {
                    $form_id = $forms[0]->id;
                }
            }
            $form = GFFormsModel::get_form_meta($form_id);
            $form = apply_filters("gform_form_pre_results_{$form_id}", apply_filters("gform_form_pre_results", $form));
            // set up filter vars
            $start_date = rgget("start");
            $end_date = rgget("end");
            $all_fields = $form["fields"];
            $filter_settings = GFCommon::get_field_filter_settings($form);
            $filter_settings = apply_filters("gform_filters_pre_results", $filter_settings, $form);
            $filter_settings = array_values($filter_settings);
            // reset the numeric keys in case some filters have been unset
            $filter_fields = rgget("f");
            $filter_operators = rgget("o");
            $filter_values = rgget("v");
            $filters = array();
            $init_vars = array();
            if (!empty($filter_fields)) {
                $init_vars["mode"] = rgget("mode");
                foreach ($filter_fields as $i => $filter_field) {
                    $filters[$i]["field"] = $filter_field;
                    $filters[$i]["operator"] = $filter_operators[$i];
                    $filters[$i]["value"] = $filter_values[$i];
                }
                $init_vars["filters"] = $filters;
            }
            ?>
            <script type="text/javascript">
                var gresultsFields = <?php 
            echo json_encode($all_fields);
            ?>
;
                var gresultsFilterSettings = <?php 
            echo json_encode($filter_settings);
            ?>
;
                var gresultsInitVars = <?php 
            echo json_encode($init_vars);
            ?>
;

                <?php 
            GFCommon::gf_global();
            ?>
                <?php 
            GFCommon::gf_vars();
            ?>
            </script>

            <link rel="stylesheet"
                  href="<?php 
            echo GFCommon::get_base_url();
            ?>
/css/admin.css?ver=<?php 
            echo GFCommon::$version;
            ?>
"
                  type="text/css"/>
            <div class="wrap gforms_edit_form <?php 
            echo GFCommon::get_browser_class();
            ?>
">

                <div class="icon32" id="gravity-entry-icon"><br></div>

                <h2><?php 
            echo empty($form_id) ? $page_title : $page_title . " : " . esc_html($form["title"]);
            ?>
</h2>

                <?php 
            RGForms::top_toolbar();
            ?>
                <?php 
            if (false === empty($all_fields)) {
                ?>

                    <div id="poststuff" class="metabox-holder has-right-sidebar">
                        <div id="side-info-column" class="inner-sidebar">
                            <div id="gresults-results-filter" class="postbox">
                                <h3 style="cursor: default;"><?php 
                echo $this->_search_title;
                ?>
</h3>

                                <div id="gresults-results-filter-content">
                                    <form id="gresults-results-filter-form" action="" method="GET">
                                        <input type="hidden" id="gresults-page-slug" name="page"
                                               value="<?php 
                echo esc_attr($gf_page);
                ?>
">
                                        <input type="hidden" id="gresults-view-slug" name="view"
                                               value="<?php 
//.........这里部分代码省略.........
开发者ID:rushabhrakholiya,项目名称:TEST,代码行数:101,代码来源:class-gf-results.php

示例6: select_export_form

 public static function select_export_form()
 {
     check_ajax_referer("rg_select_export_form", "rg_select_export_form");
     $form_id = intval($_POST["form_id"]);
     $form = RGFormsModel::get_form_meta($form_id);
     $filter_settings = GFCommon::get_field_filter_settings($form);
     $filter_settings_json = json_encode($filter_settings);
     $fields = array();
     $form = GFExport::add_default_export_fields($form);
     if (is_array($form["fields"])) {
         foreach ($form["fields"] as $field) {
             if (is_array(rgar($field, "inputs"))) {
                 foreach ($field["inputs"] as $input) {
                     $fields[] = array($input["id"], GFCommon::get_label($field, $input["id"]));
                 }
             } else {
                 if (!rgar($field, "displayOnly")) {
                     $fields[] = array($field["id"], GFCommon::get_label($field));
                 }
             }
         }
     }
     $field_json = GFCommon::json_encode($fields);
     die("EndSelectExportForm({$field_json}, {$filter_settings_json});");
 }
开发者ID:danaiser,项目名称:hollandLawns,代码行数:25,代码来源:gravityforms.php

示例7: filters

    function filters()
    {
        $start_date = isset($_REQUEST['start-date']) ? sanitize_text_field($_REQUEST['start-date']) : null;
        $end_date = isset($_REQUEST['end-date']) ? sanitize_text_field($_REQUEST['end-date']) : null;
        $status = isset($_REQUEST['status']) ? $_REQUEST['status'] : '';
        $filter_form_id = empty($_REQUEST['form-id']) ? '' : absint($_REQUEST['form-id']);
        $filter_entry_id = empty($_REQUEST['entry-id']) ? '' : absint($_REQUEST['entry-id']);
        $field_filters = null;
        $forms = GFAPI::get_forms();
        foreach ($forms as $form) {
            $form_filters = GFCommon::get_field_filter_settings($form);
            $empty_filter = array('key' => '', 'text' => esc_html__('Fields', 'gravityforms'), 'operators' => array());
            array_unshift($form_filters, $empty_filter);
            $field_filters[$form['id']] = $form_filters;
        }
        $search_field_ids = isset($_REQUEST['f']) ? $_REQUEST['f'] : '';
        $search_field_id = $search_field_ids && is_array($search_field_ids) ? $search_field_ids[0] : '';
        $init_field_id = $search_field_id;
        $search_operators = isset($_REQUEST['o']) ? $_REQUEST['o'] : '';
        $search_operator = $search_operators && is_array($search_operators) ? $search_operators[0] : false;
        $init_field_operator = empty($search_operator) ? 'contains' : $search_operator;
        $values = isset($_REQUEST['v']) ? $_REQUEST['v'] : '';
        $value = $values && is_array($values) ? $values[0] : 0;
        $init_filter_vars = array('mode' => 'off', 'filters' => array(array('field' => $init_field_id, 'operator' => $init_field_operator, 'value' => $value)));
        ?>
		<div id="gravityflow-status-filters">

			<div id="gravityflow-status-date-filters">

				<input placeholder="ID" type="text" name="entry-id" id="entry-id" class="small-text"
				       value="<?php 
        echo $filter_entry_id;
        ?>
"/>
				<?php 
        if (empty($this->constraint_filters['start_date'])) {
            ?>
					<label for="start-date"><?php 
            esc_html_e('Start:', 'gravityflow');
            ?>
</label>
					<input type="text" id="start-date" name="start-date" class="datepicker medium-text ymd_dash"
					       value="<?php 
            echo $start_date;
            ?>
" placeholder="yyyy/mm/dd"/>
				<?php 
        }
        ?>

				<?php 
        if (empty($this->constraint_filters['start_date'])) {
            ?>
					<label for="end-date"><?php 
            esc_html_e('End:', 'gravityflow');
            ?>
</label>
					<input type="text" id="end-date" name="end-date" class="datepicker medium-text ymd_dash"
					       value="<?php 
            echo $end_date;
            ?>
" placeholder="yyyy/mm/dd"/>
				<?php 
        }
        ?>
				<?php 
        if (!empty($this->constraint_filters['form_id'])) {
            ?>
					<input type="hidden" name="form-id"
					       value="<?php 
            echo esc_attr($this->constraint_filters['form_id']);
            ?>
">
				<?php 
        } else {
            ?>
					<select id="gravityflow-form-select" name="form-id">
						<?php 
            $selected = selected('', $filter_form_id, false);
            printf('<option value="" %s >%s</option>', $selected, esc_html__('Workflow Form', 'gravityflow'));
            $forms = GFAPI::get_forms();
            foreach ($forms as $form) {
                $form_id = absint($form['id']);
                $steps = gravity_flow()->get_steps($form_id);
                if (!empty($steps)) {
                    $selected = selected($filter_form_id, $form_id, false);
                    printf('<option value="%d" %s>%s</option>', $form_id, $selected, esc_html($form['title']));
                }
            }
            ?>
					</select>
					<div id="entry_filters" style="display:inline-block;"></div>
				<?php 
        }
        ?>

				<input type="submit" class="button-secondary" value="<?php 
        esc_html_e('Apply', 'gravityflow');
        ?>
"/>
//.........这里部分代码省略.........
开发者ID:jakejackson1,项目名称:gravityflow,代码行数:101,代码来源:class-status.php

示例8: output_scripts

    /**
     * Output scripts
     */
    function output_scripts()
    {
        $form_id = $this->get_form_id();
        $form = $this->get_form();
        $search = stripslashes(rgget('s'));
        $orderby = empty($_GET['orderby']) ? 0 : $_GET['orderby'];
        $order = empty($_GET['order']) ? 'ASC' : strtoupper($_GET['order']);
        $filter = sanitize_text_field(rgget('filter '));
        $field_filters = GFCommon::get_field_filter_settings($form);
        $search_field_id = rgget('field_id');
        $search_operator = rgget('operator');
        $init_field_id = empty($search_field_id) ? 0 : $search_field_id;
        $init_field_operator = empty($search_operator) ? 'contains' : $search_operator;
        $init_filter_vars = array('mode' => 'off', 'filters' => array(array('field' => $init_field_id, 'operator' => $init_field_operator, 'value' => $search)));
        ?>

		<script type="text/javascript">

			var messageTimeout = false,
				gformFieldFilters = <?php 
        echo json_encode($field_filters);
        ?>
,
				gformInitFilter = <?php 
        echo json_encode($init_filter_vars);
        ?>
;

			function ChangeColumns(columns) {
				jQuery("#single_action").val("change_columns");
				jQuery("#grid_columns").val(jQuery.toJSON(columns));
				tb_remove();
				jQuery("#entry_list_form")[0].submit();
			}

			function Search(sort_field_id, sort_direction, form_id, search, filter, field_id, operator) {
				var search_qs = search == "" ? "" : "&s=" + encodeURIComponent(search);
				var filter_qs = filter == "" ? "" : "&filter=" + filter;
				var field_id_qs = field_id == "" ? "" : "&field_id=" + field_id;
				var operator_qs = operator == "" ? "" : "&operator=" + operator;

				var location = "?page=gf_entries&view=entries&id=" + form_id + "&orderby=" + sort_field_id + "&order=" + sort_direction + search_qs + filter_qs + field_id_qs + operator_qs;
				document.location = location;
			}

			function ToggleStar(img, lead_id, filter) {
				var is_starred = img.src.indexOf("star1.png") >= 0;
				if (is_starred)
					img.src = img.src.replace("star1.png", "star0.png");
				else
					img.src = img.src.replace("star0.png", "star1.png");

				jQuery("#entry_row_" + lead_id).toggleClass("entry_starred");
				//if viewing the starred entries, hide the row and adjust the paging counts
				if (filter == "star") {
					var title = jQuery("#entry_row_" + lead_id);
					title.css("display", 'none');
					UpdatePagingCounts(1);
				}

				UpdateCount("star_count", is_starred ? -1 : 1);

				UpdateEntryProperty(lead_id, "is_starred", is_starred ? 0 : 1);
			}

			function ToggleRead(entry_id, filter) {
				var title = jQuery("#entry_row_" + entry_id);
				var marking_read = title.hasClass("entry_unread");

				jQuery("#mark_read_" + entry_id).css("display", marking_read ? "none" : "inline");
				jQuery("#mark_unread_" + entry_id).css("display", marking_read ? "inline" : "none");
				jQuery("#is_unread_" + entry_id).css("display", marking_read ? "inline" : "none");
				title.toggleClass("entry_unread");
				//if viewing the unread entries, hide the row and adjust the paging counts
				if (filter == "unread") {
					title.css("display", "none");
					UpdatePagingCounts(1);
				}

				UpdateCount("unread_count", marking_read ? -1 : 1);
				UpdateEntryProperty(entry_id, "is_read", marking_read ? 1 : 0);
			}

			function UpdateEntryProperty(entry_id, name, value) {
				var mysack = new sack("<?php 
        echo admin_url('admin-ajax.php');
        ?>
");
				mysack.execute = 1;
				mysack.method = 'POST';
				mysack.setVar("action", "rg_update_lead_property");
				mysack.setVar("rg_update_lead_property", "<?php 
        echo wp_create_nonce('rg_update_lead_property');
        ?>
");
				mysack.setVar("lead_id", entry_id);
				mysack.setVar("name", name);
//.........这里部分代码省略.........
开发者ID:arobbins,项目名称:spellestate,代码行数:101,代码来源:entry_list.php

示例9: get_field_filters

 static function get_field_filters($post_id)
 {
     $form_id = gravityview_get_form_id($post_id);
     $form = gravityview_get_form($form_id);
     // Fixes issue on Views screen when deleting a view
     if (empty($form)) {
         return;
     }
     $field_filters = GFCommon::get_field_filter_settings($form);
     if ($approved_column = GravityView_Admin_ApproveEntries::get_approved_column($form)) {
         $approved_column = intval(floor($approved_column));
     }
     // Add currently logged in user option
     foreach ($field_filters as &$filter) {
         // Add negative match to approval column
         if ($approved_column && $filter['key'] === $approved_column) {
             $filter['operators'][] = 'isnot';
             continue;
         }
         // Gravity Forms already creates a "User" option.
         // We don't care about specific user, just the logged in status.
         if ($filter['key'] === 'created_by') {
             // Update the default label to be more descriptive
             $filter['text'] = esc_attr__('Created By', 'gravity-view-advanced-filter');
             $current_user_filters = array(array('text' => __('Logged-in User (disabled for Admins)', 'gravity-view-advanced-filter'), 'value' => 'created_by_or_admin'), array('text' => __('Logged-in User', 'gravity-view-advanced-filter'), 'value' => 'created_by'));
             foreach ($current_user_filters as $user_filter) {
                 // Add to the beginning on the value options
                 array_unshift($filter['values'], $user_filter);
             }
         }
     }
     $init_field_id = 0;
     $init_field_operator = "contains";
     $default_init_filter_vars = array("mode" => "all", "filters" => array(array("field" => $init_field_id, "operator" => $init_field_operator, "value" => '')));
     $view_filter_vars = self::get_view_filter_vars($post_id, true);
     $init_filter_vars = !empty($view_filter_vars) ? $view_filter_vars : $default_init_filter_vars;
     /**
      * allow field filters manipulation
      * @param array $field_filters configured filters
      */
     $field_filters = apply_filters('gravityview/adv_filter/field_filters', $field_filters, $post_id);
     return array('field_filters' => $field_filters, 'init_filter_vars' => $init_filter_vars);
 }
开发者ID:hansstam,项目名称:makerfaire,代码行数:43,代码来源:advanced-filter.php

示例10: scripts

 public function scripts()
 {
     $form_id = absint(rgget('id'));
     $form = GFAPI::get_form($form_id);
     $routing_fields = !empty($form) ? GFCommon::get_field_filter_settings($form) : array();
     $input_fields = array();
     if (is_array($form['fields'])) {
         foreach ($form['fields'] as $field) {
             /* @var GF_Field $field */
             $input_fields[] = array('key' => absint($field->id), 'text' => esc_html__($field->get_field_label(false, null)));
         }
     }
     $users = is_admin() ? $this->get_users_as_choices() : array();
     $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || isset($_GET['gform_debug']) ? '' : '.min';
     $scripts = array(array('handle' => 'gravityflow_form_editor_js', 'src' => $this->get_base_url() . "/js/form-editor{$min}.js", 'version' => $this->_version, 'enqueue' => array(array('admin_page' => array('form_editor'))), 'strings' => array('user' => array('defaults' => array('label' => esc_html__('User', 'gravityflow'))), 'role' => array('defaults' => array('label' => esc_html__('Role', 'gravityflow'))))), array('handle' => 'gravityflow_multi_select', 'src' => $this->get_base_url() . "/js/multi-select{$min}.js", 'deps' => array('jquery'), 'version' => $this->_version, 'enqueue' => array(array('query' => 'page=gf_edit_forms&view=settings&subview=gravityflow&fid=_notempty_'), array('query' => 'page=gf_edit_forms&view=settings&subview=gravityflow&fid=0'))), array('handle' => 'gf_routing_setting', 'src' => $this->get_base_url() . "/js/routing-setting{$min}.js", 'deps' => array('jquery'), 'version' => $this->_version, 'enqueue' => array(array('query' => 'page=gf_edit_forms&view=settings&subview=gravityflow&fid=_notempty_'), array('query' => 'page=gf_edit_forms&view=settings&subview=gravityflow&fid=0')), 'strings' => array('accounts' => $users, 'fields' => $routing_fields, 'input_fields' => $input_fields)), array('handle' => 'gravityflow_form_settings_js', 'src' => $this->get_base_url() . "/js/form-settings{$min}.js", 'deps' => array('jquery', 'jquery-ui-core', 'jquery-ui-tabs', 'jquery-ui-datepicker', 'gform_datepicker_init', 'gf_routing_setting'), 'version' => $this->_version, 'enqueue' => array(array('query' => 'page=gf_edit_forms&view=settings&subview=gravityflow&fid=_notempty_'), array('query' => 'page=gf_edit_forms&view=settings&subview=gravityflow&fid=0')), 'strings' => array('feedId' => absint(rgget('fid')), 'formId' => absint(rgget('id')))), array('handle' => 'gravityflow_feed_list', 'src' => $this->get_base_url() . "/js/feed-list{$min}.js", 'deps' => array('jquery', 'jquery-ui-sortable'), 'version' => $this->_version, 'enqueue' => array(array('query' => 'page=gf_edit_forms&view=settings&subview=gravityflow'))), array('handle' => 'gravityflow_entry_detail', 'src' => $this->get_base_url() . "/js/entry-detail{$min}.js", 'version' => $this->_version, 'deps' => array('jquery', 'sack', 'gform_conditional_logic'), 'enqueue' => array(array('query' => 'page=gravityflow-inbox'))), array('handle' => 'gravityflow_status_list', 'src' => $this->get_base_url() . "/js/status-list{$min}.js", 'deps' => array('jquery', 'gform_field_filter'), 'version' => $this->_version, 'enqueue' => array(array('query' => 'page=gravityflow-status')), 'strings' => array('ajaxurl' => admin_url('admin-ajax.php'))), array('handle' => 'google_charts', 'src' => 'https://www.google.com/jsapi', 'version' => $this->_version, 'enqueue' => array(array('query' => 'page=gravityflow-reports'))), array('handle' => 'gravityflow_reports', 'src' => $this->get_base_url() . "/js/reports{$min}.js", 'version' => $this->_version, 'deps' => array('jquery', 'google_charts'), 'enqueue' => array(array('query' => 'page=gravityflow-reports'))));
     return array_merge(parent::scripts(), $scripts);
 }
开发者ID:jakejackson1,项目名称:gravityflow,代码行数:17,代码来源:class-gravity-flow.php


注:本文中的GFCommon::get_field_filter_settings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。