本文整理汇总了PHP中CF7DBPlugin::getFormFieldsAjaxUrlBase方法的典型用法代码示例。如果您正苦于以下问题:PHP CF7DBPlugin::getFormFieldsAjaxUrlBase方法的具体用法?PHP CF7DBPlugin::getFormFieldsAjaxUrlBase怎么用?PHP CF7DBPlugin::getFormFieldsAjaxUrlBase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CF7DBPlugin
的用法示例。
在下文中一共展示了CF7DBPlugin::getFormFieldsAjaxUrlBase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: outputJavascript
//.........这里部分代码省略.........
?>
");
}
if (exportUrl.length > 255) {
exportValidationErrors.push("<?php
echo htmlspecialchars(__('Because the generated URL would be too long, you must use this alternative function and add its script to your Google Spreadsheet', 'contact-form-7-to-database-extension'));
?>
");
jQuery('#label_gld_script').show();
jQuery('#label_gld_function').hide();
jQuery('#export_result_text').html(formName ?
("=cfdbdata(\"" + googleScriptElements.join("\", \"") + "\")") :
"");
} else {
jQuery('#export_result_text').html(formName ?
("<a target='_cfdb_exp_results' href='" + exportUrl + "'>=IMPORTDATA(\"" + exportUrl + "\")</a>") :
"");
}
} else {
jQuery('#export_result_text').html(formName ? ('<a target="_cfdb_exp_results" href="' + exportUrl + '">' + exportUrl + '</a>') : '');
}
// Output export errors
jQuery('#export_validations_text').html(exportValidationErrors.join('<br/>'));
} else {
jQuery('#export_result_text').html('');
// Don't report errors
jQuery('#export_validations_text').html('');
}
}
var getFormFieldsUrlBase = '<?php
echo $this->plugin->getFormFieldsAjaxUrlBase();
?>
';
function getFormFields() {
jQuery('[id^=add]').attr('disabled', 'disabled');
jQuery('[id^=btn]').attr('disabled', 'disabled');
var formName = jQuery('#form_name_cntl').val();
var url = getFormFieldsUrlBase + encodeURIComponent(formName);
jQuery.ajax({
dataType: "json",
url: url,
async: false,
success: function (json) {
var optionsHtml = '<option value=""></option>';
jQuery(json).each(function () {
optionsHtml += '<option value="' + this + '">' + this + '</option>';
});
optionsHtml += '<option value="$_POST(param)">$_POST(param)</option>';
optionsHtml += '<option value="$_GET(param)">$_GET(param)</option>';
optionsHtml += '<option value="$_COOKIE(param)">$_COOKIE(param)</option>';
jQuery('[id^=add]').html(optionsHtml).removeAttr('disabled');
jQuery('[id^=btn]').removeAttr('disabled');
}
});
}
function validateSubmitTime() {
var url = "<?php
echo $this->plugin->getValidateSubmitTimeAjaxUrlBase();
?>
" + jQuery('#filter_val').val();
jQuery.get(url, function (data) {
alert(data);
示例2: setup
/**
* @param CF7DBPlugin $plugin
* @return void
*/
public function setup($plugin)
{
?>
<div id="AddColumnDialog" style="display:none; background-color:#EEEEEE;">
<input id="addColumnName" type="text" size="25" value=""/><br/>
<input type="button" value="<?php
_e('Cancel', 'contact-form-7-to-database-extension');
?>
"
onclick="jQuery('#AddColumnDialog').dialog('close');"/>
<input id="addColumnOkButton" type="button" value=""
onclick="addColumn();"/>
</div>
<div id="DeleteColumnDialog" style="display:none; background-color:#EEEEEE;">
<select id="deleteColumnSelect"></select><br/>
<input type="button" value="<?php
_e('Cancel', 'contact-form-7-to-database-extension');
?>
"
onclick="jQuery('#DeleteColumnDialog').dialog('close');"/>
<input id="deleteColumnOkButton" type="button" value=""
onclick="deleteColumn();"/>
</div>
<script type="text/javascript" language="Javascript">
jQuery('#edit_controls').html(
'<input id="edit_cb" type="checkbox" onclick="oTable.fnDraw();"/> <label for="edit_cb">' +
jQuery('#edit_controls > a').text() + '</label>' +
' ' +
'<input id="addColumnButton" type="button" value="">' +
' ' +
'<input id="deleteColumnButton" type="button" value="">'
);
jQuery('#addColumnOkButton').val(addColumnLabelText);
jQuery('#addColumnButton').val(addColumnLabelText).click(
function() {
jQuery("#AddColumnDialog").dialog({ autoOpen: false, title: addColumnLabelText });
jQuery("#AddColumnDialog").dialog('open');
jQuery("#addColumnName").focus();
});
jQuery('#deleteColumnOkButton').val(deleteColumnLabelText);
jQuery('#deleteColumnButton').val(deleteColumnLabelText).click(
function() {
jQuery("#DeleteColumnDialog").dialog({ autoOpen: false, title: deleteColumnLabelText });
jQuery("#DeleteColumnDialog").dialog('open');
var url = '<?php
echo $plugin->getFormFieldsAjaxUrlBase();
?>
' + encodeURIComponent('<?php
echo $_REQUEST['form_name'];
?>
');
jQuery.getJSON(url, function(json) {
var optionsHtml = '';
jQuery(json).each(function() {
if (this != 'Submitted' && this != 'submit_time') { // can't delete submit_time
optionsHtml += '<option value="' + this + '">' + this + '</option>';
}
});
jQuery('#deleteColumnSelect').html(optionsHtml).focus();
});
} );
function addColumn() {
jQuery('#addColumnOkButton').attr('disabled', 'disabled');
var formName = '<?php
echo $_REQUEST['form_name'];
?>
';
var colName = jQuery('#addColumnName').val();
jQuery.ajax({
cache: false,
type: 'POST',
url: '<?php
echo admin_url('admin-ajax.php') . '?action=cfdb-addColumn';
?>
',
data: { form_name : formName, column_name : colName},
success: function(data, textStatus, jqXHR) {
jQuery('#AddColumnDialog').dialog('close');
location.reload();
},
error: function(jqXHR, textStatus, errorThrown) {
alert('Error ' + textStatus + ': ' + textStatus);
jQuery('#addColumnOkButton').removeAttr('disabled');
}
});
}
function deleteColumn() {
jQuery('#deleteColumnOkButton').attr('disabled', 'disabled');
var formName = '<?php
echo $_REQUEST['form_name'];
?>
';
var colName = jQuery('#deleteColumnSelect').val();
jQuery.ajax({
//.........这里部分代码省略.........