本文整理汇总了PHP中CF7DBPlugin::getForms方法的典型用法代码示例。如果您正苦于以下问题:PHP CF7DBPlugin::getForms方法的具体用法?PHP CF7DBPlugin::getForms怎么用?PHP CF7DBPlugin::getForms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CF7DBPlugin
的用法示例。
在下文中一共展示了CF7DBPlugin::getForms方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* @param $plugin CF7DBPlugin
* @return void
*/
function display(&$plugin)
{
if ($plugin == null) {
$plugin = new CF7DBPlugin();
}
$forms = $plugin->getForms();
$importUrl = admin_url('admin-ajax.php') . '?action=cfdb-importcsv';
?>
<h2><?php
_e('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
_e('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
_e('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
_e('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
_e('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>
<h2><?php
_e('Backup Form to CSV File', 'contact-form-7-to-database-extension');
?>
</h2>
<ul>
<li><?php
_e('Backup a form into a CSV file that can be re-imported without loss of data.', 'contact-form-7-to-database-extension');
?>
</li>
<li><?php
_e('Limitation: this will not export file uploads.', 'contact-form-7-to-database-extension');
?>
</li>
<li><?php
_e('Limitation: extremely large numbers of records in your form may cause the export operation on your server to run out of memory, thereby not giving you all the rows.', 'contact-form-7-to-database-extension');
?>
</li>
</ul>
<form method="get" action="<?php
echo $plugin->getPluginDirUrl();
?>
export.php">
<input type="hidden" name="enc" value="CSV"/>
<input type="hidden" name="bak" value="true"/>
<select name="form">
<option value=""></option>
<?php
foreach ($forms as $formName) {
echo "<option value=\"{$formName}\">{$formName}</option>";
}
//.........这里部分代码省略.........