本文整理汇总了PHP中GFFormDisplay::get_input_mask_init_script方法的典型用法代码示例。如果您正苦于以下问题:PHP GFFormDisplay::get_input_mask_init_script方法的具体用法?PHP GFFormDisplay::get_input_mask_init_script怎么用?PHP GFFormDisplay::get_input_mask_init_script使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFFormDisplay
的用法示例。
在下文中一共展示了GFFormDisplay::get_input_mask_init_script方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialise_form_edit
public static function initialise_form_edit()
{
/*
* If we aren't editing our form, don't do anything
*/
if (empty($_GET['action']) || empty($_GET['lid']) || !is_user_logged_in()) {
return false;
}
$lid = isset($_GET['lid']) ? (int) $_GET['lid'] : 0;
self::$lead = $lead = GFAPI::get_entry($lid);
self::$form = $form = GFAPI::get_form(self::$lead['form_id']);
if (!self::check_user_permission(self::$lead)) {
return false;
}
self::$allowed_edit = true;
if (!class_exists('GFFormDisplay')) {
require_once GFCommon::get_base_path() . "/form_display.php";
}
$field_values = RGForms::post("gform_field_values");
/*
* Include appropriate css/javascript here...
*/
GFFormDisplay::enqueue_form_scripts($form, false);
GFFormDisplay::add_init_script($form["id"], "conditional_logic", GFFormDisplay::ON_PAGE_RENDER, self::get_conditional_logic($form, $field_values));
GFFormDisplay::add_init_script($form["id"], "pricing", GFFormDisplay::ON_PAGE_RENDER, GFFormDisplay::get_pricing_init_script($form));
$chosen_script = GFFormDisplay::get_chosen_init_script($form);
GFFormDisplay::add_init_script($form["id"], "chosen", GFFormDisplay::ON_PAGE_RENDER, $chosen_script);
GFFormDisplay::add_init_script($form["id"], "chosen", GFFormDisplay::ON_CONDITIONAL_LOGIC, $chosen_script);
GFFormDisplay::add_init_script($form['id'], 'input_mask', GFFormDisplay::ON_PAGE_RENDER, GFFormDisplay::get_input_mask_init_script($form));
GFFormDisplay::add_init_script($form['id'], 'calculation', GFFormDisplay::ON_PAGE_RENDER, GFFormDisplay::get_calculations_init_script($form));
GFFormDisplay::add_init_script($form['id'], 'currency_format', GFFormDisplay::ON_PAGE_RENDER, GFFormDisplay::get_currency_format_init_script($form));
return true;
}
示例2: register_form_init_scripts
/**
* Enqueue and retrieve all inline scripts that should be executed when the form is rendered.
* Use add_init_script() function to enqueue scripts.
*
* @param array $form
* @param array $field_values
* @param bool $is_ajax
*/
public static function register_form_init_scripts($form, $field_values = array(), $conditional_logic_enabled = true)
{
$is_ajax = false;
// adding conditional logic script if conditional logic is configured for this form.
// get_conditional_logic also adds the chosen script for the enhanced dropdown option.
// if this form does not have conditional logic, add chosen script separately
if ($conditional_logic_enabled && GFFormDisplay::has_conditional_logic($form)) {
GFFormDisplay::add_init_script($form['id'], 'number_formats', GFFormDisplay::ON_PAGE_RENDER, GFFormDisplay::get_number_formats_script($form));
GFFormDisplay::add_init_script($form['id'], 'conditional_logic', GFFormDisplay::ON_PAGE_RENDER, self::get_conditional_logic($form, $field_values));
}
//adding currency config if there are any product fields in the form
if (self::has_price_field($form)) {
GFFormDisplay::add_init_script($form['id'], 'pricing', GFFormDisplay::ON_PAGE_RENDER, GFFormDisplay::get_pricing_init_script($form));
}
if (self::has_password_strength($form)) {
$password_script = GFFormDisplay::get_password_strength_init_script($form);
GFFormDisplay::add_init_script($form['id'], 'password', GFFormDisplay::ON_PAGE_RENDER, $password_script);
}
if (self::has_enhanced_dropdown($form)) {
$chosen_script = GFFormDisplay::get_chosen_init_script($form);
GFFormDisplay::add_init_script($form['id'], 'chosen', GFFormDisplay::ON_PAGE_RENDER, $chosen_script);
GFFormDisplay::add_init_script($form['id'], 'chosen', GFFormDisplay::ON_CONDITIONAL_LOGIC, $chosen_script);
}
if (self::has_character_counter($form)) {
GFFormDisplay::add_init_script($form['id'], 'character_counter', GFFormDisplay::ON_PAGE_RENDER, GFFormDisplay::get_counter_init_script($form));
}
if (GFFormDisplay::has_input_mask($form)) {
GFFormDisplay::add_init_script($form['id'], 'input_mask', GFFormDisplay::ON_PAGE_RENDER, GFFormDisplay::get_input_mask_init_script($form));
}
if (GFFormDisplay::has_calculation_field($form)) {
GFFormDisplay::add_init_script($form['id'], 'number_formats', GFFormDisplay::ON_PAGE_RENDER, GFFormDisplay::get_number_formats_script($form));
GFFormDisplay::add_init_script($form['id'], 'calculation', GFFormDisplay::ON_PAGE_RENDER, GFFormDisplay::get_calculations_init_script($form));
}
if (self::has_currency_format_number_field($form)) {
GFFormDisplay::add_init_script($form['id'], 'currency_format', GFFormDisplay::ON_PAGE_RENDER, GFFormDisplay::get_currency_format_init_script($form));
}
if (self::has_currency_copy_values_option($form)) {
GFFormDisplay::add_init_script($form['id'], 'copy_values', GFFormDisplay::ON_PAGE_RENDER, GFFormDisplay::get_copy_values_init_script($form));
}
if (self::has_placeholder($form)) {
GFFormDisplay::add_init_script($form['id'], 'placeholders', GFFormDisplay::ON_PAGE_RENDER, GFFormDisplay::get_placeholders_init_script($form));
}
if (isset($form['fields']) && is_array($form['fields'])) {
foreach ($form['fields'] as $field) {
/* @var GF_Field $field */
if (is_subclass_of($field, 'GF_Field')) {
$field->register_form_init_scripts($form);
}
}
}
gf_do_action(array('gform_register_init_scripts', $form['id']), $form, $field_values, $is_ajax);
}