本文整理汇总了PHP中FrmAppHelper::doing_ajax方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmAppHelper::doing_ajax方法的具体用法?PHP FrmAppHelper::doing_ajax怎么用?PHP FrmAppHelper::doing_ajax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmAppHelper
的用法示例。
在下文中一共展示了FrmAppHelper::doing_ajax方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_field
public static function show_field($field, $form, $parent_form_id)
{
global $frm_vars;
if (!empty($field['hide_field'])) {
$first = reset($field['hide_field']);
if (is_numeric($first)) {
if (!isset($frm_vars['hidden_fields'])) {
$frm_vars['hidden_fields'] = array();
}
$frm_vars['hidden_fields'][] = $field;
}
}
if ($field['use_calc'] && $field['calc']) {
$ajax = isset($form->options['ajax_submit']) && $form->options['ajax_submit'] ? true : false;
if ($ajax && FrmAppHelper::doing_ajax()) {
return;
}
global $frm_vars;
if (!isset($frm_vars['calc_fields'])) {
$frm_vars['calc_fields'] = array();
}
$frm_vars['calc_fields'][$field['field_key']] = array('calc' => $field['calc'], 'calc_dec' => $field['calc_dec'], 'form_id' => $form->id, 'field_id' => $field['id'], 'parent_form_id' => $parent_form_id);
}
}
示例2: admin_init
/**
* Check for database update and trigger js loading
*
* @since 2.0.1
*/
public static function admin_init()
{
if (!FrmAppHelper::doing_ajax() && self::needs_update()) {
self::network_upgrade_site();
}
$action = FrmAppHelper::simple_get('action', 'sanitize_title');
if (!FrmAppHelper::doing_ajax() || $action == 'frm_import_choices') {
// don't continue during ajax calls
self::admin_js();
}
}
示例3: set_ajax_field_globals
/**
* When a form is loaded with ajax, we need all the info for
* the fields included in the footer with the first page
*/
private static function set_ajax_field_globals($f)
{
global $frm_vars;
$ajax_now = !FrmAppHelper::doing_ajax();
switch ($f->type) {
case 'date':
if (!FrmField::is_read_only($f)) {
if (!isset($frm_vars['datepicker_loaded']) || !is_array($frm_vars['datepicker_loaded'])) {
$frm_vars['datepicker_loaded'] = array();
}
$frm_vars['datepicker_loaded']['field_' . $f->field_key] = $ajax_now;
}
break;
case 'time':
if (isset($f->field_options['unique']) && $f->field_options['unique']) {
if (!isset($frm_vars['timepicker_loaded'])) {
$frm_vars['timepicker_loaded'] = array();
}
$frm_vars['timepicker_loaded']['field_' . $f->field_key] = $ajax_now;
}
break;
case 'phone':
if (isset($f->field_options['format']) && !empty($f->field_options['format']) && strpos($f->field_options['format'], '^') !== 0) {
global $frm_input_masks;
$frm_input_masks[] = $ajax_now;
}
break;
}
}
示例4: send_email
public static function send_email()
{
if (current_user_can('frm_view_forms') || current_user_can('frm_edit_forms') || current_user_can('frm_edit_entries')) {
if (FrmAppHelper::doing_ajax()) {
check_ajax_referer('frm_ajax', 'nonce');
}
$entry_id = FrmAppHelper::get_param('entry_id', '', 'get', 'absint');
$form_id = FrmAppHelper::get_param('form_id', '', 'get', 'absint');
printf(__('Resent to %s', 'formidable'), '');
add_filter('frm_echo_emails', '__return_true');
FrmFormActionsController::trigger_actions('create', $form_id, $entry_id, 'email');
} else {
_e('Resent to No one! You do not have permission', 'formidable');
}
wp_die();
}
示例5: apply_filters
$e_args['textarea_rows'] = $field['max'];
}
$e_args = apply_filters('frm_rte_options', $e_args, $field);
if ($field['size']) {
?>
<style type="text/css">#wp-field_<?php
echo esc_attr($field['field_key']);
?>
-wrap{width:<?php
echo esc_attr($field['size']) . (is_numeric($field['size']) ? 'px' : '');
?>
;}</style><?php
}
wp_editor(str_replace('"', '"', $field['value']), $html_id, $e_args);
// If submitting with Ajax or on preview page and tinymce is not loaded yet, load it now
if ((FrmAppHelper::doing_ajax() || FrmAppHelper::is_preview_page()) && (!isset($frm_vars['tinymce_loaded']) || !$frm_vars['tinymce_loaded'])) {
add_action('wp_print_footer_scripts', '_WP_Editors::editor_js', 50);
add_action('wp_print_footer_scripts', '_WP_Editors::enqueue_scripts', 1);
$frm_vars['tinymce_loaded'] = true;
}
unset($e_args);
} else {
?>
<textarea name="<?php
echo esc_attr($field_name);
?>
" id="<?php
echo esc_attr($html_id);
?>
" style="height:<?php
echo $field['max'] ? (int) $field['max'] * 17 : 125;