本文整理汇总了PHP中CF7DBPlugin::getAdminUrlPrefix方法的典型用法代码示例。如果您正苦于以下问题:PHP CF7DBPlugin::getAdminUrlPrefix方法的具体用法?PHP CF7DBPlugin::getAdminUrlPrefix怎么用?PHP CF7DBPlugin::getAdminUrlPrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CF7DBPlugin
的用法示例。
在下文中一共展示了CF7DBPlugin::getAdminUrlPrefix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: outputJavascript
//.........这里部分代码省略.........
break;
case '[cfdb-export-link]':
enc = jQuery('#enc_cntl').val();
scElements.push(getValue('enc', enc, scValidationErrors));
scUrlElements.push(getValueUrl('enc', enc));
if (['CSVUTF8BOM', 'CSVUTF8', 'CSVSJIS'].indexOf(enc) > -1) {
delim = jQuery('#export_link_csv_delim').val();
if (delim != ',') {
scElements.push(getValue('delimiter', delim, scValidationErrors));
scUrlElements.push(getValueUrl('delimiter', delim));
}
}
scElements.push(getValue('urlonly', jQuery('#urlonly_cntl').val(), scValidationErrors));
scElements.push(getValue('linktext', jQuery('#linktext_cntl').val(), scValidationErrors));
if (!jQuery('#header_cntl').is(':checked')) {
scElements.push('header="false"');
scUrlElements.push(getValueUrl('header', 'false'));
}
val = jQuery('#headers_cntl').val();
scElements.push(getValue('headers', val, scValidationErrors));
scUrlElements.push(getValueUrl('headers', val));
scText = join(scElements) + ']';
break;
default:
scText = shortcode;
break;
}
var urlBase = '<?php
echo $this->plugin->getAdminUrlPrefix('admin-ajax.php');
?>
action=cfdb-export&';
if (shortcode) {
// Output short code text
var scUrl = urlBase + join(scUrlElements, '&');
jQuery('#shortcode_result_text').html('<a target="_cfdb_sc_results" href="' + scUrl + '">' + scText + '</a>');
// Output short code errors
jQuery('#shortcode_validations_text').html(scValidationErrors.join('<br/>'));
}
else {
// Don't report errors
jQuery('#shortcode_validations_text').html('');
}
// Export link or Google Spreadsheet function call
var exportSelection = jQuery('#export_cntl').val();
if (exportSelection) {
if (exportSelection != 'GLD') {
exportUrlElements.push(getValueUrl('enc', exportSelection));
}
if (exportSelection == 'RSS') {
exportUrlElements.push(getValueUrl('itemtitle', jQuery('#add_itemtitle').val()));
} else {
if (!jQuery('#header_cntl').is(':checked')) {
exportUrlElements.push(getValueUrl('header', 'false'));
pushNameValue("header", "false", googleScriptElements, googleScriptValidationErrors);
}
val = jQuery('#headers_cntl').val();
exportUrlElements.push(getValueUrl('headers', val, scValidationErrors));
pushNameValue("headers", val, googleScriptElements, googleScriptValidationErrors);
示例2: display
/**
* @param $plugin CF7DBPlugin
* @return void
*/
function display(&$plugin)
{
if ($plugin == null) {
$plugin = new CF7DBPlugin();
}
$forms = $plugin->getForms();
$importUrl = $plugin->getAdminUrlPrefix('admin-ajax.php') . 'action=cfdb-importcsv';
$renameUrl = $plugin->getAdminUrlPrefix('admin-ajax.php') . 'action=cfdb-renameform';
$clenaupUrl = $plugin->getAdminUrlPrefix('admin-ajax.php') . 'action=cfdb-cleanup';
?>
<h2><?php
echo htmlspecialchars(__('Import CSV File into Form', 'contact-form-7-to-database-extension'));
?>
</h2>
<form enctype="multipart/form-data" action="<?php
echo $importUrl;
?>
" method="post">
<table>
<tbody>
<tr>
<td><label for="file"><?php
echo htmlspecialchars(__('File', 'contact-form-7-to-database-extension'));
?>
</label></td>
<td><input type="file" name="file" id="file" size="50"></td>
</tr>
<tr>
<td><input type="radio" name="into" id="new" value="new" checked> <?php
echo htmlspecialchars(__('New Form', 'contact-form-7-to-database-extension'));
?>
</td>
<td><input type="text" name="newformname" id="newformname" size="50"/></td>
</tr>
<tr>
<td><input type="radio" name="into" id="existing" value="into"> <?php
echo htmlspecialchars(__('Existing Form', 'contact-form-7-to-database-extension'));
?>
</td>
<td>
<select name="form" id="form">
<option value=""></option>
<?php
foreach ($forms as $formName) {
echo "<option value=\"{$formName}\">{$formName}</option>";
}
?>
</select>
</td>
</tr>
</tbody>
</table>
<input type="submit" name="<?php
echo htmlspecialchars(__('Import', 'contact-form-7-to-database-extension'));
?>
" id="importsubmit" value="import">
</form>
<script type="text/javascript">
jQuery('#file').change(function () {
var val = jQuery(this).val();
val = val.substring(val.lastIndexOf('/') + 1);
val = val.substring(val.lastIndexOf('\\') + 1);
val = val.replace(/\.([^\.])*$/, "");
jQuery('#newformname').val(val);
});
</script>
<form enctype="multipart/form-data" action="<?php
echo $renameUrl;
?>
" method="post">
<h2><?php
echo htmlspecialchars(__('Rename Form', 'contact-form-7-to-database-extension'));
?>
</h2>
<select name="form" id="form">
<option value=""></option>
<?php
foreach ($forms as $formName) {
echo "<option value=\"{$formName}\">{$formName}</option>";
}
?>
</select>
<td><input type="text" name="newformname" id="renameformname" size="10"/></td>
<input type="submit" name="rename" id="renamesubmit" value="<?php
echo htmlspecialchars(__('Rename', 'contact-form-7-to-database-extension'));
?>
">
</form>
<h2><?php
echo htmlspecialchars(__('Backup Form to CSV File', 'contact-form-7-to-database-extension'));
?>
</h2>
<ul>
<li><?php
//.........这里部分代码省略.........