本文整理汇总了PHP中FrmForm::get_params方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmForm::get_params方法的具体用法?PHP FrmForm::get_params怎么用?PHP FrmForm::get_params使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrmForm
的用法示例。
在下文中一共展示了FrmForm::get_params方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_form_contents
public static function get_form_contents($form, $title, $description, $atts)
{
global $frm_vars;
$frm_settings = FrmAppHelper::get_settings();
$submit = isset($form->options['submit_value']) ? $form->options['submit_value'] : $frm_settings->submit_value;
$user_ID = get_current_user_id();
$params = FrmForm::get_params($form);
$message = $errors = '';
if ($params['posted_form_id'] == $form->id && $_POST) {
$errors = isset($frm_vars['created_entries'][$form->id]) ? $frm_vars['created_entries'][$form->id]['errors'] : array();
}
$include_form_tag = apply_filters('frm_include_form_tag', true, $form);
$fields = FrmFieldsHelper::get_form_fields($form->id, isset($errors) && !empty($errors));
if ($params['action'] != 'create' || $params['posted_form_id'] != $form->id || !$_POST) {
do_action('frm_display_form_action', $params, $fields, $form, $title, $description);
if (apply_filters('frm_continue_to_new', true, $form->id, $params['action'])) {
$values = FrmEntriesHelper::setup_new_vars($fields, $form);
include FrmAppHelper::plugin_path() . '/classes/views/frm-entries/new.php';
}
return;
}
if (!empty($errors)) {
$values = $fields ? FrmEntriesHelper::setup_new_vars($fields, $form) : array();
include FrmAppHelper::plugin_path() . '/classes/views/frm-entries/new.php';
return;
}
do_action('frm_validate_form_creation', $params, $fields, $form, $title, $description);
if (!apply_filters('frm_continue_to_create', true, $form->id)) {
return;
}
$values = FrmEntriesHelper::setup_new_vars($fields, $form, true);
$created = isset($frm_vars['created_entries']) && isset($frm_vars['created_entries'][$form->id]) ? $frm_vars['created_entries'][$form->id]['entry_id'] : 0;
$conf_method = apply_filters('frm_success_filter', 'message', $form, $form->options, 'create');
if ($created && is_numeric($created) && $conf_method != 'message') {
do_action('frm_success_action', $conf_method, $form, $form->options, $created);
do_action('frm_after_entry_processed', array('entry_id' => $created, 'form' => $form));
return;
}
if ($created && is_numeric($created)) {
$message = isset($form->options['success_msg']) ? $form->options['success_msg'] : $frm_settings->success_msg;
$class = 'frm_message';
} else {
$message = $frm_settings->failed_msg;
$class = 'frm_error_style';
}
$message = FrmFormsHelper::get_success_message(array('message' => $message, 'form' => $form, 'entry_id' => $created, 'class' => $class));
$message = apply_filters('frm_main_feedback', $message, $form, $created);
if (!isset($form->options['show_form']) || $form->options['show_form']) {
require FrmAppHelper::plugin_path() . '/classes/views/frm-entries/new.php';
} else {
global $frm_vars;
self::maybe_load_css($form, $values['custom_style'], $frm_vars['load_css']);
$include_extra_container = 'frm_forms' . FrmFormsHelper::get_form_style_class($values);
include FrmAppHelper::plugin_path() . '/classes/views/frm-entries/errors.php';
}
do_action('frm_after_entry_processed', array('entry_id' => $created, 'form' => $form));
}
示例2: get_params
public static function get_params($form = null)
{
_deprecated_function(__FUNCTION__, '2.0.9', 'FrmForm::get_params');
return FrmForm::get_params($form);
}
示例3: can_submit_form_now
/**
* @since 2.0.8
*/
public static function can_submit_form_now($errors, $values)
{
global $frm_vars;
$params = isset($frm_vars['form_params']) && is_array($frm_vars['form_params']) && isset($frm_vars['form_params'][$values['form_id']]) ? $frm_vars['form_params'][$values['form_id']] : FrmForm::get_params($values['form_id']);
$values['action'] = $params['action'];
if ($params['action'] != 'create') {
if (self::has_another_page($values['form_id'])) {
self::stop_submit_if_more_pages($values, $errors);
}
return $errors;
}
$form = FrmForm::getOne($values['form_id']);
if (isset($form->options['single_entry']) && $form->options['single_entry']) {
if (!self::user_can_submit_form($form)) {
$frmpro_settings = new FrmProSettings();
$k = is_numeric($form->options['single_entry_type']) ? 'field' . $form->options['single_entry_type'] : 'single_entry';
$errors[$k] = $frmpro_settings->already_submitted;
self::stop_form_submit();
return $errors;
}
}
global $wpdb;
$user_ID = get_current_user_id();
if (self::has_another_page($values['form_id'])) {
self::stop_submit_if_more_pages($values, $errors);
} else {
if ($form->editable && isset($form->options['single_entry']) && $form->options['single_entry'] && $form->options['single_entry_type'] == 'user' && $user_ID && !FrmAppHelper::is_admin()) {
$meta = FrmDb::get_var($wpdb->prefix . 'frm_items', array('user_id' => $user_ID, 'form_id' => $form->id));
if ($meta) {
$frmpro_settings = new FrmProSettings();
$errors['single_entry'] = $frmpro_settings->already_submitted;
self::stop_form_submit();
}
}
}
return $errors;
}