本文整理汇总了PHP中GFCommon::gf_vars方法的典型用法代码示例。如果您正苦于以下问题:PHP GFCommon::gf_vars方法的具体用法?PHP GFCommon::gf_vars怎么用?PHP GFCommon::gf_vars使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GFCommon
的用法示例。
在下文中一共展示了GFCommon::gf_vars方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: forms_page
public static function forms_page($form_id)
{
global $wpdb;
if (!GFCommon::ensure_wp_version()) {
return;
}
$update_result = '';
if (rgpost('operation') == 'trash') {
check_admin_referer('gforms_trash_form', 'gforms_trash_form');
GFFormsModel::trash_form($form_id);
?>
<script type="text/javascript">
jQuery(document).ready(
function () {
document.location.href = '?page=gf_edit_forms';
}
);
</script>
<?php
exit;
} else {
if (!rgempty('gform_meta')) {
check_admin_referer("gforms_update_form_{$form_id}", 'gforms_update_form');
$update_result = self::save_form_info($form_id, rgpost('gform_meta', false));
}
}
require_once GFCommon::get_base_path() . '/currency.php';
wp_print_styles(array('thickbox'));
/* @var GF_Field_Address $gf_address_field */
$gf_address_field = GF_Fields::get('address');
?>
<link rel="stylesheet" href="<?php
echo GFCommon::get_base_url();
?>
/css/admin.css?ver=<?php
echo GFCommon::$version;
?>
" type="text/css" />
<script type="text/javascript">
<?php
GFCommon::gf_global();
?>
<?php
GFCommon::gf_vars();
?>
</script>
<script type="text/javascript">
function has_entry(fieldNumber) {
var submitted_fields = [<?php
echo RGFormsModel::get_submitted_fields($form_id);
?>
];
for (var i = 0; i < submitted_fields.length; i++) {
if (submitted_fields[i] == fieldNumber)
return true;
}
return false;
}
function InsertPostImageVariable(element_id, callback) {
var variable = jQuery('#' + element_id + '_image_size_select').attr("variable");
var size = jQuery('#' + element_id + '_image_size_select').val();
if (size) {
variable = "{" + variable + ":" + size + "}";
InsertVariable(element_id, callback, variable);
jQuery('#' + element_id + '_image_size_select').hide();
jQuery('#' + element_id + '_image_size_select')[0].selectedIndex = 0;
}
}
function InsertPostContentVariable(element_id, callback) {
var variable = jQuery('#' + element_id + '_variable_select').val();
var regex = /{([^{]*?: *(\d+\.?\d*).*?)}/;
matches = regex.exec(variable);
if (!matches) {
InsertVariable(element_id, callback);
return;
}
variable = matches[1];
field_id = matches[2];
for (var i = 0; i < form["fields"].length; i++) {
if (form["fields"][i]["id"] == field_id) {
if (form["fields"][i]["type"] == "post_image") {
jQuery('#' + element_id + '_image_size_select').attr("variable", variable);
jQuery('#' + element_id + '_image_size_select').show();
return;
}
}
}
InsertVariable(element_id, callback);
}
//.........这里部分代码省略.........
示例2: 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;
?>
//.........这里部分代码省略.........
示例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 = 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
//.........这里部分代码省略.........
示例4: export_lead_page
public static function export_lead_page()
{
if (!GFCommon::current_user_can_any('gravityforms_export_entries')) {
wp_die('You do not have permission to access this page');
}
self::page_header(__('Export Entries', 'gravityforms'));
?>
<script type="text/javascript">
var gfSpinner;
<?php
GFCommon::gf_global();
?>
<?php
GFCommon::gf_vars();
?>
function SelectExportForm(formId) {
if (!formId)
return;
gfSpinner = new gfAjaxSpinner(jQuery('select#export_form'), gf_vars.baseUrl + '/images/spinner.gif', 'position: relative; top: 2px; left: 5px;');
var mysack = new sack("<?php
echo admin_url('admin-ajax.php');
?>
");
mysack.execute = 1;
mysack.method = 'POST';
mysack.setVar("action", "rg_select_export_form");
mysack.setVar("rg_select_export_form", "<?php
echo wp_create_nonce('rg_select_export_form');
?>
");
mysack.setVar("form_id", formId);
mysack.onError = function () {
alert(<?php
echo json_encode(__('Ajax error while selecting a form', 'gravityforms'));
?>
)
};
mysack.runAJAX();
return true;
}
function EndSelectExportForm(aryFields, filterSettings) {
gfSpinner.destroy();
if (aryFields.length == 0) {
jQuery("#export_field_container, #export_date_container, #export_submit_container").hide()
return;
}
var fieldList = "<li><input id='select_all' type='checkbox' onclick=\"jQuery('.gform_export_field').attr('checked', this.checked); jQuery('#gform_export_check_all').html(this.checked ? '<strong><?php
echo esc_js(__('Deselect All', 'gravityforms'));
?>
</strong>' : '<strong><?php
echo esc_js(__('Select All', 'gravityforms'));
?>
</strong>'); \"> <label id='gform_export_check_all' for='select_all'><strong><?php
esc_html_e('Select All', 'gravityforms');
?>
</strong></label></li>";
for (var i = 0; i < aryFields.length; i++) {
fieldList += "<li><input type='checkbox' id='export_field_" + i + "' name='export_field[]' value='" + aryFields[i][0] + "' class='gform_export_field'> <label for='export_field_" + i + "'>" + aryFields[i][1] + "</label></li>";
}
jQuery("#export_field_list").html(fieldList);
jQuery("#export_date_start, #export_date_end").datepicker({dateFormat: 'yy-mm-dd', changeMonth: true, changeYear: true});
jQuery("#export_field_container, #export_filter_container, #export_date_container, #export_submit_container").hide().show();
gf_vars.filterAndAny = <?php
echo json_encode(esc_html__('Export entries if {0} of the following match:', 'gravityforms'));
?>
;
jQuery("#export_filters").gfFilterUI(filterSettings);
}
jQuery(document).ready(function () {
jQuery("#gform_export").submit(function () {
if (jQuery(".gform_export_field:checked").length == 0) {
alert(<?php
echo json_encode(__('Please select the fields to be exported', 'gravityforms'));
?>
);
return false;
}
});
});
</script>
<p class="textleft"><?php
esc_html_e('Select a form below to export entries. Once you have selected a form you may select the fields you would like to export and then define optional filters for field values and the date range. When you click the download button below, Gravity Forms will create a CSV file for you to save to your computer.', 'gravityforms');
?>
//.........这里部分代码省略.........
示例5: render_merge_tags_scripts
/**
* Generate the script tags necessary for the Gravity Forms Merge Tag picker to work.
*
* @param mixed $curr_form Form ID
* @return null|string Merge tags html; NULL if $curr_form isn't defined.
*/
public static function render_merge_tags_scripts($curr_form)
{
if (empty($curr_form)) {
return NULL;
}
$form = gravityview_get_form($curr_form);
$get_id_backup = isset($_GET['id']) ? $_GET['id'] : NULL;
if (isset($form['id'])) {
$form_script = 'var form = ' . GFCommon::json_encode($form) . ';';
// The `gf_vars()` method needs a $_GET[id] variable set with the form ID.
$_GET['id'] = $form['id'];
} else {
$form_script = 'var form = new Form();';
}
$output = '<script type="text/javascript" data-gv-merge-tags="1">' . $form_script . "\n" . GFCommon::gf_vars(false) . '</script>';
// Restore previous $_GET setting
$_GET['id'] = $get_id_backup;
return $output;
}
示例6: feed_list_page
public function feed_list_page($form = null)
{
$action = $this->get_bulk_action();
if ($action) {
check_admin_referer('feed_list', 'feed_list');
$this->process_bulk_action($action);
}
$single_action = rgpost('single_action');
if (!empty($single_action)) {
check_admin_referer('feed_list', 'feed_list');
$this->process_single_action($single_action);
}
?>
<h3><span><?php
echo $this->feed_list_title();
?>
</span></h3>
<form id="gform-settings" action="" method="post">
<?php
$feed_list = $this->get_feed_table($form);
$feed_list->prepare_items();
$feed_list->display();
?>
<!--Needed to save state after bulk operations-->
<input type="hidden" value="gf_edit_forms" name="page">
<input type="hidden" value="settings" name="view">
<input type="hidden" value="<?php
echo $this->_slug;
?>
" name="subview">
<input type="hidden" value="<?php
echo rgar($form, 'id');
?>
" name="id">
<input id="single_action" type="hidden" value="" name="single_action">
<input id="single_action_argument" type="hidden" value="" name="single_action_argument">
<?php
wp_nonce_field('feed_list', 'feed_list');
?>
</form>
<script type="text/javascript">
<?php
GFCommon::gf_vars();
?>
</script>
<?php
}
示例7: feed_list_page
public function feed_list_page($form = null)
{
$action = $this->get_bulk_action();
if ($action) {
check_admin_referer("feed_list", "feed_list");
$this->process_bulk_action($action);
}
$single_action = rgpost("single_action");
if (!empty($single_action)) {
check_admin_referer("feed_list", "feed_list");
$this->process_single_action($single_action);
}
$columns = $this->feed_list_columns();
$column_value_callback = array($this, "get_column_value");
$feeds = $this->get_feeds(rgar($form, "id"));
$bulk_actions = $this->get_bulk_actions();
$action_links = $this->get_action_links();
?>
<h3><span><?php
echo $this->feed_list_title();
?>
</span></h3>
<?php
$feed_list = new GFAddOnFeedsTable($feeds, $this->_slug, $columns, $bulk_actions, $action_links, $column_value_callback);
$feed_list->prepare_items();
$feed_list->display();
?>
<!--Needed to save state after bulk operations-->
<input type="hidden" value="gf_edit_forms" name="page">
<input type="hidden" value="settings" name="view">
<input type="hidden" value="<?php
echo $this->_slug;
?>
" name="subview">
<input type="hidden" value="<?php
echo rgar($form, "id");
?>
" name="id">
<input id="single_action" type="hidden" value="" name="single_action">
<input id="single_action_argument" type="hidden" value="" name="single_action_argument">
<?php
wp_nonce_field("feed_list", "feed_list");
?>
<script type="text/javascript">
<?php
GFCommon::gf_vars();
?>
</script>
<?php
}
示例8: confirmations_edit_page
public static function confirmations_edit_page($form_id, $confirmation_id)
{
$form = apply_filters("gform_admin_pre_render_{$form_id}", apply_filters("gform_admin_pre_render", GFFormsModel::get_form_meta($form_id)));
$confirmation = self::handle_confirmation_edit_submission(rgar($form["confirmations"], $confirmation_id), $form);
$confirmation_ui_settings = self::get_confirmation_ui_settings($confirmation);
self::page_header(__('Confirmations', 'gravityforms'));
?>
<script type="text/javascript">
<?php
GFCommon::gf_vars();
?>
var confirmation = <?php
echo $confirmation ? json_encode($confirmation) : 'new ConfirmationObj()';
?>
;
var form = <?php
echo json_encode($form);
?>
;
jQuery(document).ready(function($){
SetConfirmationConditionalLogic();
<?php
if (!rgar($confirmation, 'isDefault')) {
?>
ToggleConditionalLogic(true, 'confirmation');
<?php
}
?>
ToggleConfirmation();
});
</script>
<style type="text/css">
#confirmation_action_type { display: none; }
</style>
<div id="confirmation-editor">
<form id="confirmation_edit_form" method="post">
<table class="form-table gforms_form_settings">
<?php
array_map(array(__CLASS__, 'output'), $confirmation_ui_settings);
?>
</table>
<?php
//DEPRECATED SINCE 1.7 - use gform_confirmation_ui_settings instead
do_action("gform_confirmation_settings", 100, $form_id);
do_action("gform_confirmation_settings", 200, $form_id);
?>
<input type="hidden" id="confirmation_id" name="confirmation_id" value="<?php
echo $confirmation_id;
?>
" />
<input type="hidden" id="form_id" name="form_id" value="<?php
echo $form_id;
?>
" />
<input type="hidden" id="is_default" name="is_default" value="<?php
echo rgget("isDefault", $confirmation);
?>
" />
<input type="hidden" id="conditional_logic" name="conditional_logic" value='<?php
echo json_encode(rgget('conditionalLogic', $confirmation));
?>
' />
<p class="submit">
<input type="submit" name="save" value="<?php
_e('Save Confirmation', 'gravityforms');
?>
" onclick="StashConditionalLogic(event);" class="button-primary">
</p>
<?php
wp_nonce_field('gform_confirmation_edit', 'gform_confirmation_edit');
?>
</form>
</div> <!-- / confirmation-editor -->
<?php
self::page_footer();
}
示例9: notification_edit_page
public static function notification_edit_page($form_id, $notification_id)
{
if (!rgempty("gform_notification_id")) {
$notification_id = rgpost("gform_notification_id");
}
$form = RGFormsModel::get_form_meta($form_id);
$notification = !$notification_id ? array() : self::get_notification($form, $notification_id);
// added second condition to account for new notifications with errors as notification ID will
// be available in $_POST but the notification has not actually been saved yet
$is_new_notification = empty($notification_id) || empty($notification);
$is_valid = true;
$is_update = false;
if (rgpost("save")) {
check_admin_referer('gforms_save_notification', 'gforms_save_notification');
$is_update = true;
if ($is_new_notification) {
$notification_id = uniqid();
$notification["id"] = $notification_id;
}
$notification["name"] = rgpost("gform_notification_name");
$notification["event"] = rgpost("gform_notification_event");
$notification["to"] = rgpost("gform_notification_to_type") == "field" ? rgpost("gform_notification_to_field") : rgpost("gform_notification_to_email");
$notification["toType"] = rgpost("gform_notification_to_type");
$notification["bcc"] = rgpost("gform_notification_bcc");
$notification["subject"] = rgpost("gform_notification_subject");
$notification["message"] = rgpost("gform_notification_message");
$notification["from"] = rgpost("gform_notification_from");
$notification["fromName"] = rgpost("gform_notification_from_name");
$notification["replyTo"] = rgpost("gform_notification_reply_to");
$notification["routing"] = !rgempty("gform_routing_meta") ? GFCommon::json_decode(rgpost("gform_routing_meta"), true) : null;
$notification["conditionalLogic"] = !rgempty("gform_conditional_logic_meta") ? GFCommon::json_decode(rgpost("gform_conditional_logic_meta"), true) : null;
$notification["disableAutoformat"] = rgpost("gform_notification_disable_autoformat");
$notification = apply_filters('gform_pre_notification_save', apply_filters("gform_pre_notification_save{$form['id']}", $notification, $form), $form);
//validating input...
$is_valid = self::validate_notification();
if ($is_valid) {
//input valid, updating...
//emptying notification email if it is supposed to be disabled
if ($_POST["gform_notification_to_type"] == "routing") {
$notification["to"] = "";
} else {
$notification["routing"] = null;
}
$form["notifications"][$notification_id] = $notification;
RGFormsModel::save_form_notifications($form_id, $form['notifications']);
}
}
if ($is_update && $is_valid) {
GFCommon::add_message(sprintf(__('Notification saved successfully. %sBack to notifications.%s', 'gravityforms'), '<a href="' . remove_query_arg('nid') . '">', '</a>'));
} else {
if ($is_update && !$is_valid) {
GFCommon::add_error_message(__('Notification could not be updated. Please enter all required information below.', 'gravityforms'));
}
}
// moved page header loading here so the admin messages can be set upon saving and available for the header to print out
GFFormSettings::page_header(__('Notifications', 'gravityforms'));
$notification_ui_settings = self::get_notification_ui_settings($notification);
?>
<link rel="stylesheet" href="<?php
echo GFCommon::get_base_url();
?>
/css/admin.css?ver=<?php
echo GFCommon::$version;
?>
" />
<script type="text/javascript">
<?php
GFCommon::gf_vars();
?>
var gform_has_unsaved_changes = false;
jQuery(document).ready(function(){
jQuery("#entry_form input, #entry_form textarea, #entry_form select").change(function(){
gform_has_unsaved_changes = true;
});
window.onbeforeunload = function(){
if (gform_has_unsaved_changes){
return "You have unsaved changes.";
}
}
ToggleConditionalLogic(true, 'notification');
if(jQuery(document).on){
jQuery(document).on('change', '.gfield_routing_value_dropdown', function(){
SetRoutingValueDropDown(jQuery(this));
});
}
else{
jQuery('.gfield_routing_value_dropdown').live('change', function(){
SetRoutingValueDropDown(jQuery(this));
});
}
});
<?php
if (empty($form["notifications"])) {
//.........这里部分代码省略.........
示例10: export_lead_page
public static function export_lead_page()
{
self::page_header(__('Export Entries'));
?>
<script type="text/javascript">
var gfSpinner;
<?php
GFCommon::gf_global();
?>
<?php
GFCommon::gf_vars();
?>
function SelectExportForm(formId){
if(!formId)
return;
gfSpinner = new gfAjaxSpinner(jQuery('select#export_form'), gf_vars.baseUrl + '/images/spinner.gif', 'position: relative; top: 2px; left: 5px;');
var mysack = new sack("<?php
echo admin_url("admin-ajax.php");
?>
" );
mysack.execute = 1;
mysack.method = 'POST';
mysack.setVar( "action", "rg_select_export_form" );
mysack.setVar( "rg_select_export_form", "<?php
echo wp_create_nonce("rg_select_export_form");
?>
" );
mysack.setVar( "form_id", formId);
mysack.onError = function() { alert('<?php
echo esc_js(__("Ajax error while selecting a form", "gravityforms"));
?>
' )};
mysack.runAJAX();
return true;
}
function EndSelectExportForm(aryFields){
gfSpinner.destroy();
if(aryFields.length == 0)
{
jQuery("#export_field_container, #export_date_container, #export_submit_container").hide()
return;
}
var fieldList = "<li><input id='select_all' type='checkbox' onclick=\"jQuery('.gform_export_field').attr('checked', this.checked); jQuery('#gform_export_check_all').html(this.checked ? '<strong><?php
_e("Deselect All", "gravityforms");
?>
</strong>' : '<strong><?php
_e("Select All", "gravityforms");
?>
</strong>'); \"> <label id='gform_export_check_all' for='select_all'><strong><?php
_e("Select All", "gravityforms");
?>
</strong></label></li>";
for(var i=0; i<aryFields.length; i++){
fieldList += "<li><input type='checkbox' id='export_field_" + i + "' name='export_field[]' value='" + aryFields[i][0] + "' class='gform_export_field'> <label for='export_field_" + i + "'>" + aryFields[i][1] + "</label></li>";
}
jQuery("#export_field_list").html(fieldList);
jQuery("#export_date_start, #export_date_end").datepicker({dateFormat: 'yy-mm-dd', changeMonth: true, changeYear: true});
jQuery("#export_field_container, #export_date_container, #export_submit_container").hide().show();
}
</script>
<p class="textleft"><?php
_e("Select a form below to export entries. Once you have selected a form you may select the fields you would like to export and an optional date range. When you click the download button below, Gravity Forms will create a CSV file for you to save to your computer.", "gravityforms");
?>
</p>
<div class="hr-divider"></div>
<form method="post" style="margin-top:10px;">
<?php
echo wp_nonce_field("rg_start_export", "rg_start_export_nonce");
?>
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="export_form"><?php
_e("Select A Form", "gravityforms");
?>
</label> <?php
gform_tooltip("export_select_form");
?>
</th>
<td>
<select id="export_form" name="export_form" onchange="SelectExportForm(jQuery(this).val());">
<option value=""><?php
_e("Select a form", "gravityforms");
?>
</option>
//.........这里部分代码省略.........
示例11: gf_apply_filters
$js_form = gf_apply_filters(array('gform_admin_pre_render', $form_id), $js_form);
}
?>
<?php
}
?>
</select>
<?php
if (isset($js_form)) {
$_GET['id'] = $form_id;
printf('<script type="text/javascript">
var form = %s;
%s
</script>', json_encode($js_form), GFCommon::gf_vars(false));
}
?>
</td>
</tr>
<tr>
<th scope="row">
<label for="_pronamic_pay_gf_config_id">
<?php
esc_html_e('Configuration', 'pronamic_ideal');
?>
</label>
<span class="dashicons dashicons-editor-help pronamic-pay-tip" data-tip="<?php
esc_attr_e('Gateway configuration, created via <strong>iDEAL » Configurations</strong>.', 'pronamic_ideal');
示例12: leads_page
//.........这里部分代码省略.........
var get_params = function(search_string) {
var parse = function(params, pairs) {
var pair = pairs[0];
var parts = pair.split('=');
var key = decodeURIComponent(parts[0]);
var value = decodeURIComponent(parts.slice(1).join('='));
//is key an array?
if(key.indexOf('[') > -1){
//yes, remove the [x] part
var newparts = key.split('[');
key = decodeURIComponent(newparts[0]);
}
// Handle multiple parameters of the same name
if (typeof params[key] === "undefined") {
params[key] = value;
} else {
params[key] = [].concat(params[key], value);
}
return pairs.length == 1 ? params : parse(params, pairs.slice(1))
}
// Get rid of leading ?
return search_string.length == 0 ? {} : parse({}, search_string.substr(1).split('&'));
}
var params = get_params(location.search);
<?php
GFCommon::gf_global();
?>
<?php
GFCommon::gf_vars();
?>
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 faire = "&faire="+jQuery('#faire').val();
var star_qs = star == "" ? "" : "&star=" + star;
var read_qs = read == "" ? "" : "&read=" + read;
var filter_qs = filter == "" ? "" : "&filter=" + filter;
//add to filter array
var filterField="";
//first, check if there are other filters set in the url
// if there are, be sure to include them
if(params['filterField'] != undefined){
if(jQuery.isArray(params['filterField'])){
//if the paramater filterField is an array, loop thru all to add
var arrayLength = params['filterField'].length;
for (var i = 0; i < arrayLength; i++) {
示例13: form_list_page
public static function form_list_page()
{
global $wpdb;
if (!GFCommon::ensure_wp_version()) {
return;
}
echo GFCommon::get_remote_message();
$action = RGForms::post("action");
$bulk_action = RGForms::post("bulk_action");
$bulk_action = !empty($bulk_action) ? $bulk_action : RGForms::post("bulk_action2");
if ($action == "delete") {
check_admin_referer('gforms_update_forms', 'gforms_update_forms');
$form_id = RGForms::post("action_argument");
RGFormsModel::delete_form($form_id);
$message = __('Form deleted.', 'gravityforms');
} else {
if ($action == "duplicate") {
check_admin_referer('gforms_update_forms', 'gforms_update_forms');
$form_id = RGForms::post("action_argument");
RGFormsModel::duplicate_form($form_id);
$message = __('Form duplicated.', 'gravityforms');
}
}
if ($bulk_action) {
check_admin_referer('gforms_update_forms', 'gforms_update_forms');
$form_ids = is_array(rgpost('form')) ? rgpost('form') : array();
$form_count = count($form_ids);
switch ($bulk_action) {
case 'delete':
RGFormsModel::delete_forms($form_ids);
$message = _n('%s form deleted.', '%s forms deleted.', $form_count, 'gravityforms');
break;
case 'reset_views':
foreach ($form_ids as $form_id) {
RGFormsModel::delete_views($form_id);
}
$message = _n('Views for %s form have been reset.', 'Views for %s forms have been reset.', $form_count, 'gravityforms');
break;
case 'delete_entries':
foreach ($form_ids as $form_id) {
RGFormsModel::delete_leads_by_form($form_id);
}
$message = _n('Entries for %s form have been deleted.', 'Entries for %s forms have been deleted.', $form_count, 'gravityforms');
break;
case 'activate':
foreach ($form_ids as $form_id) {
RGFormsModel::update_form_active($form_id, 1);
}
$message = _n('%s form has been marked as active.', '%s forms have been marked as active.', $form_count, 'gravityforms');
break;
case 'deactivate':
foreach ($form_ids as $form_id) {
RGFormsModel::update_form_active($form_id, 0);
}
$message = _n('%s form has been marked as inactive.', '%s forms have been marked as inactive.', $form_count, 'gravityforms');
break;
}
if (isset($message)) {
$message = sprintf($message, $form_count);
}
}
$active = RGForms::get("active") == "" ? null : RGForms::get("active");
$forms = RGFormsModel::get_forms($active, "title");
$form_count = RGFormsModel::get_form_count();
// - new form modal - //
wp_print_styles(array('thickbox'));
?>
<script type="text/javascript" src="<?php
echo GFCommon::get_base_url() . '/js/form_admin.js';
?>
"></script>
<script type="text/javascript">
<?php
GFCommon::gf_vars();
?>
jQuery(document).ready(function($) {
<?php
if (rgget('page') == 'gf_new_form') {
?>
loadNewFormModal();
<?php
}
?>
$('.gf_form_action_has_submenu').hover(function(){
var l = jQuery(this).offset().left;
jQuery(this).find('.gf_submenu')
.toggle()
.offset({ left: l });
}, function(){
jQuery(this).find('.gf_submenu').hide();
});
});
//.........这里部分代码省略.........