本文整理汇总了PHP中FrmField::no_save_fields方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmField::no_save_fields方法的具体用法?PHP FrmField::no_save_fields怎么用?PHP FrmField::no_save_fields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmField
的用法示例。
在下文中一共展示了FrmField::no_save_fields方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
public static function show()
{
FrmAppHelper::permission_check('frm_view_reports');
remove_action('frm_form_action_reports', 'FrmStatisticsController::list_reports');
add_filter('frm_form_stop_action_reports', '__return_true');
global $wpdb;
$form = false;
if (isset($_REQUEST['form'])) {
$form = FrmForm::getOne($_REQUEST['form']);
}
if (!$form) {
require FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-statistics/select.php';
return;
}
$exclude_types = FrmField::no_save_fields();
$exclude_types = array_merge($exclude_types, array('rte', 'textarea', 'file', 'grid', 'signature', 'form', 'table'));
$fields = FrmField::getAll(array('fi.form_id' => (int) $form->id, 'fi.type not' => $exclude_types), 'field_order');
$js = '';
$data = array();
$colors = '#21759B,#EF8C08,#C6C6C6';
$data['time'] = self::get_daily_entries($form, array('is3d' => true, 'colors' => $colors, 'bg_color' => 'transparent'));
$data['month'] = self::get_daily_entries($form, array('is3d' => true, 'colors' => $colors, 'bg_color' => 'transparent', 'width' => '100%'), 'MONTH');
foreach ($fields as $field) {
$this_data = self::graph_shortcode(array('id' => $field->id, 'field' => $field, 'is3d' => true, 'min' => 0, 'colors' => $colors, 'width' => 650, 'bg_color' => 'transparent'));
if (strpos($this_data, 'frm_no_data_graph') === false) {
$data[$field->id] = $this_data;
}
unset($field, $this_data);
}
$entries = FrmDb::get_col($wpdb->prefix . 'frm_items', array('form_id' => $form->id), 'created_at');
// trigger the scripts to load
global $frm_vars;
$frm_vars['forms_loaded'][] = true;
include FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-statistics/show.php';
}
示例2: migrate_to_6
private function migrate_to_6()
{
global $wpdb;
$no_save = array_merge(FrmField::no_save_fields(), array('form', 'hidden', 'user_id'));
$fields = FrmDb::get_results($this->fields, array('type NOT' => $no_save), 'id, field_options');
$default_html = <<<DEFAULT_HTML
<div id="frm_field_[id]_container" class="form-field [required_class] [error_class]">
<label class="frm_pos_[label_position]">[field_name]
<span class="frm_required">[required_label]</span>
</label>
[input]
[if description]<div class="frm_description">[description]</div>[/if description]
</div>
DEFAULT_HTML;
$old_default_html = <<<DEFAULT_HTML
<div id="frm_field_[id]_container" class="form-field [required_class] [error_class]">
<label class="frm_pos_[label_position]">[field_name]
<span class="frm_required">[required_label]</span>
</label>
[input]
[if description]<p class="frm_description">[description]</p>[/if description]
</div>
DEFAULT_HTML;
$new_default_html = FrmFieldsHelper::get_default_html('text');
foreach ($fields as $field) {
$field->field_options = maybe_unserialize($field->field_options);
if (!FrmField::is_option_empty($field, 'custom_html') || $field->field_options['custom_html'] == $default_html || $field->field_options['custom_html'] == $old_default_html) {
$field->field_options['custom_html'] = $new_default_html;
$wpdb->update($this->fields, array('field_options' => maybe_serialize($field->field_options)), array('id' => $field->id));
}
unset($field);
}
unset($default_html, $old_default_html, $fields);
}
示例3: search_box
public function search_box($text, $input_id)
{
if (!$this->has_items() && !isset($_REQUEST['s'])) {
return;
}
if (isset($this->params['form'])) {
$form = FrmForm::getOne($this->params['form']);
} else {
$form = FrmForm::get_published_forms(array(), 1);
}
if ($form) {
$field_list = FrmField::getAll(array('fi.form_id' => $form->id, 'fi.type not' => FrmField::no_save_fields()), 'field_order');
}
$fid = isset($_REQUEST['fid']) ? esc_attr(stripslashes($_REQUEST['fid'])) : '';
$input_id = $input_id . '-search-input';
$search_str = isset($_REQUEST['s']) ? esc_attr(stripslashes($_REQUEST['s'])) : '';
foreach (array('orderby', 'order') as $get_var) {
if (!empty($_REQUEST[$get_var])) {
echo '<input type="hidden" name="' . esc_attr($get_var) . '" value="' . esc_attr($_REQUEST[$get_var]) . '" />';
}
}
?>
<div class="search-box frm_sidebar">
<label class="screen-reader-text" for="<?php
echo esc_attr($input_id);
?>
"><?php
echo esc_attr($text);
?>
:</label>
<input type="text" id="<?php
echo esc_attr($input_id);
?>
" name="s" value="<?php
echo esc_attr($search_str);
?>
" />
<?php
if (isset($field_list) && !empty($field_list)) {
?>
<select name="fid" class="hide-if-js">
<option value="">— <?php
_e('All Fields', 'formidable');
?>
—</option>
<option value="created_at" <?php
selected($fid, 'created_at');
?>
><?php
_e('Entry creation date', 'formidable');
?>
</option>
<option value="id" <?php
selected($fid, 'id');
?>
><?php
_e('Entry ID', 'formidable');
?>
</option>
<?php
foreach ($field_list as $f) {
?>
<option value="<?php
echo $f->type == 'user_id' ? 'user_id' : $f->id;
?>
" <?php
selected($fid, $f->id);
?>
><?php
echo FrmAppHelper::truncate($f->name, 30);
?>
</option>
<?php
}
?>
</select>
<div class="button dropdown hide-if-no-js">
<a href="#" id="frm-fid-search" class="frm-dropdown-toggle" data-toggle="dropdown"><?php
_e('Search', 'formidable');
?>
<b class="caret"></b></a>
<ul class="frm-dropdown-menu pull-right" id="frm-fid-search-menu" role="menu" aria-labelledby="frm-fid-search">
<li><a href="#" id="fid-">— <?php
_e('All Fields', 'formidable');
?>
—</a></li>
<li><a href="#" id="fid-created_at"><?php
_e('Entry creation date', 'formidable');
?>
</a></li>
<li><a href="#" id="fid-id"><?php
_e('Entry ID', 'formidable');
?>
</a></li>
<?php
foreach ($field_list as $f) {
?>
<li><a href="#" id="fid-<?php
echo $f->type == 'user_id' ? 'user_id' : $f->id;
//.........这里部分代码省略.........
示例4: array
$repeat_field = $f->id;
}
if (FrmField::is_no_save_field($f->type)) {
continue;
}
if ($f->type == 'data' && (!isset($f->field_options['data_type']) || $f->field_options['data_type'] == 'data' || $f->field_options['data_type'] == '')) {
continue;
}
FrmAppHelper::insert_opt_html(array('id' => $f->id, 'key' => $f->field_key, 'name' => $f->name, 'type' => $f->type));
if ($f->type == 'data') {
//get all fields from linked form
if (isset($f->field_options['form_select']) && is_numeric($f->field_options['form_select'])) {
$linked_form = FrmDb::get_var($wpdb->prefix . 'frm_fields', array('id' => $f->field_options['form_select']), 'form_id');
if (!in_array($linked_form, $linked_forms)) {
$linked_forms[] = $linked_form;
$linked_fields = FrmField::getAll(array('fi.type not' => FrmField::no_save_fields(), 'fi.form_id' => $linked_form));
$ldfe = '';
if ($linked_fields) {
foreach ($linked_fields as $linked_field) {
FrmAppHelper::insert_opt_html(array('id' => $f->id . ' show=' . $linked_field->id, 'key' => $f->field_key . ' show=' . $linked_field->field_key, 'name' => $linked_field->name, 'type' => $linked_field->type));
$ldfe = $linked_field->id;
unset($linked_field);
}
}
}
}
$dfe = $f->id;
}
unset($f);
}
}
示例5: no_save_fields
public static function no_save_fields()
{
_deprecated_function(__FUNCTION__, '2.0.9', 'FrmField::no_save_fields');
return FrmField::no_save_fields();
}
示例6: get_fields_for_csv_export
/**
* Get the fields that should be included in the CSV export
*
* @since 2.0.19
*
* @param int $form_id
* @param object $form
* @return array $csv_fields
*/
private static function get_fields_for_csv_export($form_id, $form)
{
// Phase frm_csv_field_ids out by 2.01.05
$csv_field_ids = apply_filters('frm_csv_field_ids', '', $form_id, array('form' => $form));
if ($csv_field_ids) {
_deprecated_function('The frm_csv_field_ids filter', '2.0.19', 'the frm_csv_columns filter');
$where = array('fi.type not' => FrmField::no_save_fields());
$where[] = array('or' => 1, 'fi.form_id' => $form->id, 'fr.parent_form_id' => $form->id);
if (!is_array($csv_field_ids)) {
$csv_field_ids = explode(',', $csv_field_ids);
}
if (!empty($csv_field_ids)) {
$where['fi.id'] = $csv_field_ids;
}
$csv_fields = FrmField::getAll($where, 'field_order');
} else {
$csv_fields = FrmField::get_all_for_form($form_id, '', 'include', 'include');
$no_export_fields = FrmField::no_save_fields();
foreach ($csv_fields as $k => $f) {
if (in_array($f->type, $no_export_fields)) {
unset($csv_fields[$k]);
}
}
}
return $csv_fields;
}
示例7: include_logic_row
public static function include_logic_row($atts)
{
$defaults = array('meta_name' => '', 'condition' => array('hide_field' => '', 'hide_field_cond' => '==', 'hide_opt' => ''), 'key' => '', 'type' => 'form', 'form_id' => 0, 'id' => '', 'name' => '', 'names' => array(), 'showlast' => '', 'onchange' => '', 'exclude_fields' => array_merge(FrmField::no_save_fields(), array('file', 'rte', 'date')));
$atts = wp_parse_args($atts, $defaults);
if (empty($atts['id'])) {
$atts['id'] = 'frm_logic_' . $atts['key'] . '_' . $atts['meta_name'];
}
if (empty($atts['name'])) {
$atts['name'] = 'frm_form_action[' . $atts['key'] . '][post_content][conditions][' . $atts['meta_name'] . ']';
}
if (empty($atts['names'])) {
$atts['names'] = array('hide_field' => $atts['name'] . '[hide_field]', 'hide_field_cond' => $atts['name'] . '[hide_field_cond]', 'hide_opt' => $atts['name'] . '[hide_opt]');
}
if ($atts['onchange'] == '') {
$atts['onchange'] = "frmGetFieldValues(this.value,'" . $atts['key'] . "','" . $atts['meta_name'] . "','" . (isset($atts['field']['type']) ? $atts['field']['type'] : '') . "','" . $atts['names']['hide_opt'] . "')";
}
$form_fields = FrmField::get_all_for_form($atts['form_id']);
extract($atts);
include FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-forms/_logic_row.php';
}
示例8: get_shortcode_select
public static function get_shortcode_select($form_id, $target_id = 'content', $type = 'all')
{
$field_list = array();
$exclude = FrmField::no_save_fields();
if (is_numeric($form_id)) {
if ($type == 'field_opt') {
$exclude[] = 'data';
$exclude[] = 'checkbox';
}
$field_list = FrmField::get_all_for_form($form_id, '', 'include');
}
$linked_forms = array();
?>
<select class="frm_shortcode_select frm_insert_val" data-target="<?php
echo esc_attr($target_id);
?>
">
<option value="">— <?php
_e('Select a value to insert into the box below', 'formidable');
?>
—</option>
<?php
if ($type != 'field_opt' && $type != 'calc') {
?>
<option value="id"><?php
_e('Entry ID', 'formidable');
?>
</option>
<option value="key"><?php
_e('Entry Key', 'formidable');
?>
</option>
<option value="post_id"><?php
_e('Post ID', 'formidable');
?>
</option>
<option value="ip"><?php
_e('User IP', 'formidable');
?>
</option>
<option value="created-at"><?php
_e('Entry creation date', 'formidable');
?>
</option>
<option value="updated-at"><?php
_e('Entry update date', 'formidable');
?>
</option>
<optgroup label="<?php
esc_attr_e('Form Fields', 'formidable');
?>
">
<?php
}
if (!empty($field_list)) {
foreach ($field_list as $field) {
if (in_array($field->type, $exclude)) {
continue;
}
if ($type != 'calc' && FrmProField::is_list_field($field)) {
continue;
}
?>
<option value="<?php
echo esc_attr($field->id);
?>
"><?php
echo $field_name = esc_html(FrmAppHelper::truncate($field->name, 60));
?>
(<?php
_e('ID', 'formidable');
?>
)</option>
<option value="<?php
echo esc_attr($field->field_key);
?>
"><?php
echo $field_name;
?>
(<?php
_e('Key', 'formidable');
?>
)</option>
<?php
if ($field->type == 'file' && $type != 'field_opt' && $type != 'calc') {
?>
<option class="frm_subopt" value="<?php
echo esc_attr($field->field_key);
?>
size=thumbnail"><?php
_e('Thumbnail', 'formidable');
?>
</option>
<option class="frm_subopt" value="<?php
echo esc_attr($field->field_key);
?>
size=medium"><?php
_e('Medium', 'formidable');
?>
//.........这里部分代码省略.........
示例9: csv
public static function csv($form_id = false, $search = '', $fid = '')
{
FrmAppHelper::permission_check('frm_view_entries');
if (!$form_id) {
$form_id = FrmAppHelper::get_param('form', '', 'get', 'sanitize_text_field');
$search = FrmAppHelper::get_param(isset($_REQUEST['s']) ? 's' : 'search', '', 'get', 'sanitize_text_field');
$fid = FrmAppHelper::get_param('fid', '', 'get', 'sanitize_text_field');
}
if (!ini_get('safe_mode')) {
set_time_limit(0);
//Remove time limit to execute this function
$mem_limit = str_replace('M', '', ini_get('memory_limit'));
if ((int) $mem_limit < 256) {
ini_set('memory_limit', '256M');
}
}
global $wpdb;
$form = FrmForm::getOne($form_id);
$form_id = $form->id;
$where = array('fi.type not' => FrmField::no_save_fields());
$where[] = array('or' => 1, 'fi.form_id' => $form->id, 'fr.parent_form_id' => $form->id);
$csv_fields = apply_filters('frm_csv_field_ids', '', $form_id, array('form' => $form));
if ($csv_fields) {
if (!is_array($csv_fields)) {
$csv_fields = explode(',', $csv_fields);
}
if (!empty($csv_fields)) {
$where['fi.id'] = $csv_fields;
}
}
$form_cols = FrmField::getAll($where, 'field_order');
$item_id = FrmAppHelper::get_param('item_id', false, 'get', 'sanitize_text_field');
if (!empty($item_id)) {
$item_id = explode(',', $item_id);
}
$query = array('form_id' => $form_id);
if ($item_id) {
$query['id'] = $item_id;
}
if (!empty($search) && !$item_id) {
$query = FrmProEntriesHelper::get_search_str($query, $search, $form_id, $fid);
}
/**
* Allows the query to be changed for fetching the entry ids to include in the export
*
* $query is the array of options to be filtered. It includes form_id, and maybe id (array of entry ids),
* and the search query. This should return an array, but it can be handled as a string as well.
*/
$query = apply_filters('frm_csv_where', $query, compact('form_id'));
$entry_ids = FrmDb::get_col($wpdb->prefix . 'frm_items it', $query);
unset($query);
if (empty($entry_ids)) {
esc_html_e('There are no entries for that form.', 'formidable');
} else {
FrmProCSVExportHelper::generate_csv(compact('form', 'entry_ids', 'form_cols'));
}
wp_die();
}
示例10: _get_field_count
function _get_field_count($form_key)
{
// Get all fields in form
$all_fields = $this->get_all_fields_for_form_key($form_key);
$field_count = count($all_fields);
// Remove excluded field types from field count
$exclude_fields = FrmField::no_save_fields();
foreach ($all_fields as $f) {
if (in_array($f->type, $exclude_fields)) {
$field_count--;
}
}
return $field_count;
}
示例11: get_dynamic_widget_opts
public static function get_dynamic_widget_opts()
{
check_ajax_referer('frm_ajax', 'nonce');
$form_id = get_post_meta((int) $_POST['display_id'], 'frm_form_id', true);
if (!$form_id) {
wp_die();
}
$fields = FrmField::getAll(array('fi.type not' => FrmField::no_save_fields(), 'fi.form_id' => $form_id), 'field_order');
$options = array('titleValues' => array(), 'catValues' => array());
foreach ($fields as $field) {
$options['titleValues'][$field->id] = $field->name;
if ($field->type == 'select' || $field->type == 'radio') {
$options['catValues'][$field->id] = $field->name;
}
unset($field);
}
echo json_encode($options);
wp_die();
}
示例12: _postmeta_row
public static function _postmeta_row()
{
check_ajax_referer('frm_ajax', 'nonce');
global $wpdb;
$custom_data = array('meta_name' => $_POST['meta_name'], 'field_id' => '');
$action_key = (int) $_POST['action_key'];
$action_control = FrmFormActionsController::get_form_actions('wppost');
$action_control->_set($action_key);
$values = array();
if (isset($_POST['form_id'])) {
$values['fields'] = FrmField::getAll(array('fi.form_id' => (int) $_POST['form_id'], 'fi.type not' => FrmField::no_save_fields()), 'field_order');
}
$echo = false;
$limit = (int) apply_filters('postmeta_form_limit', 40);
$cf_keys = $wpdb->get_col('SELECT meta_key FROM ' . $wpdb->postmeta . ' GROUP BY meta_key ORDER BY meta_key LIMIT ' . (int) $limit);
if (!is_array($cf_keys)) {
$cf_keys = array();
}
if (!in_array('_thumbnail_id', $cf_keys)) {
$cf_keys[] = '_thumbnail_id';
}
if (!empty($cf_keys)) {
natcasesort($cf_keys);
}
include FrmAppHelper::plugin_path() . '/pro/classes/views/frmpro-form-actions/_custom_field_row.php';
wp_die();
}
示例13: _e
?>
><?php
_e('any', 'formidable');
?>
</option>
<option value="all" <?php
selected($form_action->post_content['conditions']['any_all'], 'all');
?>
><?php
_e('all', 'formidable');
?>
</option>
</select>
<?php
_e('of the following match', 'formidable');
?>
:
</p>
<?php
foreach ($form_action->post_content['conditions'] as $meta_name => $condition) {
if (!is_numeric($meta_name)) {
continue;
}
FrmProFormsController::include_logic_row(array('meta_name' => $meta_name, 'condition' => $condition, 'key' => $action_key, 'form_id' => $values['id'], 'name' => $action_control->get_field_name('conditions') . '[' . $meta_name . ']', 'exclude_fields' => FrmField::no_save_fields()));
unset($meta_name, $condition);
}
?>
</div>
</div>
示例14: form
function form($instance)
{
$pages = get_posts(array('post_type' => 'page', 'post_status' => 'publish', 'numberposts' => 999, 'order_by' => 'post_title', 'order' => 'ASC'));
$displays = FrmProDisplay::getAll(array('meta_key' => 'frm_show_count', 'meta_value' => 'dynamic'));
//Defaults
$instance = wp_parse_args((array) $instance, array('title' => false, 'display_id' => false, 'post_id' => false, 'title_id' => false, 'cat_list' => false, 'cat_name' => false, 'cat_count' => false, 'cat_id' => false, 'limit' => false));
if ($instance['display_id']) {
$selected_display = FrmProDisplay::getOne($instance['display_id']);
if ($selected_display) {
$selected_form_id = get_post_meta($selected_display->ID, 'frm_form_id', true);
$title_opts = FrmField::getAll(array('fi.form_id' => (int) $selected_form_id, 'type not' => FrmField::no_save_fields()), 'field_order');
$instance['display_id'] = $selected_display->ID;
}
}
?>
<p><label for="<?php
echo $this->get_field_id('title');
?>
"><?php
_e('Title', 'formidable');
?>
:</label>
<input type="text" class="widefat" id="<?php
echo $this->get_field_id('title');
?>
" name="<?php
echo $this->get_field_name('title');
?>
" value="<?php
echo esc_attr(stripslashes($instance['title']));
?>
" /></p>
<p><label for="<?php
echo $this->get_field_id('display_id');
?>
"><?php
_e('Use Settings from View', 'formidable');
?>
:</label>
<select name="<?php
echo $this->get_field_name('display_id');
?>
" id="<?php
echo $this->get_field_id('display_id');
?>
" class="widefat frm_list_items_display_id">
<option value=""> </option>
<?php
foreach ($displays as $display) {
echo '<option value="' . esc_attr($display->ID) . '" ' . selected($instance['display_id'], $display->ID, false) . '>' . FrmAppHelper::kses($display->post_title) . '</option>';
}
?>
</select>
</p>
<p class="description"><?php
_e('Views with a "Both (Dynamic)" format will show here.', 'formidable');
?>
</p>
<p><label for="<?php
echo $this->get_field_id('post_id');
?>
"><?php
_e('Page if not specified in View settings', 'formidable');
?>
:</label>
<select name="<?php
echo $this->get_field_name('post_id');
?>
" id="<?php
echo $this->get_field_id('post_id');
?>
" class="widefat">
<option value=""> </option>
<?php
foreach ($pages as $page) {
echo '<option value="' . esc_attr($page->ID) . '" ' . selected($instance['post_id'], $page->ID, false) . '>' . $page->post_title . '</option>';
}
?>
</select>
</p>
<p><label for="<?php
echo $this->get_field_id('title_id');
?>
"><?php
_e('Title Field', 'formidable');
?>
:</label>
<select name="<?php
echo $this->get_field_name('title_id');
?>
" id="<?php
echo $this->get_field_id('title_id');
?>
" class="widefat frm_list_items_title_id">
<option value=""> </option>
<?php
if (isset($title_opts) && $title_opts) {
//.........这里部分代码省略.........