本文整理汇总了PHP中CF7DBPlugin::saveFormData方法的典型用法代码示例。如果您正苦于以下问题:PHP CF7DBPlugin::saveFormData方法的具体用法?PHP CF7DBPlugin::saveFormData怎么用?PHP CF7DBPlugin::saveFormData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CF7DBPlugin
的用法示例。
在下文中一共展示了CF7DBPlugin::saveFormData方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveFormData
public function saveFormData($form_id)
{
try {
$title = get_the_title($form_id);
$converter = new CFDBPostDataConverter();
$converter->addExcludeField('post_nonce_field');
$converter->addExcludeField('form-type');
$converter->addExcludeField('fms-ajax');
$converter->addExcludeField('action');
$data = $converter->convert($title);
// CFDBPostDataConverter won't capture files how they are organized here
if (is_array($_FILES) && !empty($_FILES)) {
foreach ($_FILES as $key => $file) {
if (is_array($file['tmp_name'])) {
for ($idx = 0; $idx < count($file['tmp_name']); ++$idx) {
if (is_uploaded_file($file['tmp_name'][$idx])) {
$fileKey = $idx > 0 ? $key . $idx : $key;
$data->posted_data[$fileKey] = $file['name'][$idx];
$data->uploaded_files[$fileKey] = $file['tmp_name'][$idx];
}
}
}
}
}
return $this->plugin->saveFormData($data);
} catch (Exception $ex) {
$this->plugin->getErrorLog()->logException($ex);
}
return true;
}
示例2: saveFormData
/**
* @param $form_data
* @return bool
*/
public function saveFormData($form_data) {
try {
$data = $this->convertData($form_data);
return $this->plugin->saveFormData($data);
} catch (Exception $ex) {
$this->plugin->getErrorLog()->logException($ex);
}
return true;
}
示例3: saveFormData
/**
* @param $dataForms array
* @param $postID array
* @param $post array
* @param $submissionsData array
* @param $dataContentEmail array
* @param $nameFileByIdentifier array
* @param $requiredField array
* @param $fileAttach array
* @return bool
*/
public function saveFormData($dataForms, $postID, $post, $submissionsData, $dataContentEmail, $nameFileByIdentifier, $requiredField, $fileAttach)
{
try {
$data = $this->convertData($dataForms, $postID, $post, $submissionsData, $dataContentEmail, $nameFileByIdentifier, $requiredField, $fileAttach);
return $this->plugin->saveFormData($data);
} catch (Exception $ex) {
$this->plugin->getErrorLog()->logException($ex);
}
return true;
}
示例4: saveFormData
/**
* @param $post_id int
* @param $all_values array
* @param $extra_values array
* @return object
*/
public function saveFormData($post_id, $all_values, $extra_values)
{
try {
$data = $this->convertData($post_id, $all_values);
return $this->plugin->saveFormData($data);
} catch (Exception $ex) {
$this->plugin->getErrorLog()->logException($ex);
}
return true;
}
示例5: saveVssfFormData
/**
* Very Simple Signup Form
* @param $form_data
* @return bool
*/
public function saveVssfFormData($form_data)
{
try {
$title = 'Very Simple Signup Form';
$data = $this->convertData($form_data, $title);
return $this->plugin->saveFormData($data);
} catch (Exception $ex) {
$this->plugin->getErrorLog()->logException($ex);
}
return true;
}
示例6: saveFormData
/**
* @param $form array
* @param $referrer array
* @param $process_id string
* @return bool
*/
public function saveFormData($form, $referrer, $process_id)
{
try {
// debug
// $this->plugin->getErrorLog()->log('$form: ' . print_r($form, true));
// $this->plugin->getErrorLog()->log('$referrer: ' . print_r($referrer, true));
// $this->plugin->getErrorLog()->log('$process_id: ' . print_r($process_id, true));
// global $processed_data;
// $this->plugin->getErrorLog()->log('$processed_data: ' . print_r($processed_data, true));
$data = $this->convertData($form);
return $this->plugin->saveFormData($data);
} catch (Exception $ex) {
$this->plugin->getErrorLog()->logException($ex);
}
return true;
}
示例7: saveFormData
/**
* @param $form array
* @param $referrer array
* @param $process_id string
* @param int $entry_id
* @return bool
*/
public function saveFormData($form, $referrer, $process_id, $entry_id)
{
if (!class_exists('Caldera_Forms')) {
// Caldera not installed
return true;
}
try {
// debug
// $this->plugin->getErrorLog()->log('$form: ' . print_r($form, true));
// $this->plugin->getErrorLog()->log('$referrer: ' . print_r($referrer, true));
// $this->plugin->getErrorLog()->log('$process_id: ' . print_r($process_id, true));
// $this->plugin->getErrorLog()->log('$entry_id: ' . print_r($entry_id, true));
$data = $this->convertData($form, $entry_id);
return $this->plugin->saveFormData($data);
} catch (Exception $ex) {
$this->plugin->getErrorLog()->logException($ex);
}
return true;
}
示例8: ajax_action_submit_contact_form
function ajax_action_submit_contact_form()
{
$content = file_get_contents("php://input");
if ($content) {
$contactData = json_decode($content, true);
$data = array('title' => '联系我们', 'posted_data' => $contactData);
$data = (object) $data;
require_once ABSPATH . 'wp-content/plugins/contact-form-7-to-database-extension/CF7DBPlugin.php';
$plugin = new CF7DBPlugin();
$plugin->saveFormData($data);
}
die;
}
示例9: saveFormData
public function saveFormData($bool, $new_post, $form_params)
{
// $msg = '$new_post=' . print_r($new_post, true) . "\n" .
// '$form_params=' . print_r($form_params, true);
// $this->plugin->getErrorLog()->log($msg);
try {
if (is_array($new_post)) {
$postedData = array();
foreach ($new_post as $key => $value) {
$postedData[$key] = urldecode($value);
}
$title = 'Enfold';
if (is_array($form_params) && isset($form_params['heading']) && $form_params['heading']) {
$title = strip_tags($form_params['heading']);
}
$data = (object) array('title' => $title, 'posted_data' => $postedData, 'uploaded_files' => array());
$this->plugin->saveFormData($data);
}
} catch (Exception $ex) {
}
return true;
}
示例10: saveFormData
/**
* @param int $entry_id
* @param int $form_id
* @return bool
*/
public function saveFormData($entry_id, $form_id)
{
global $wpdb;
// Get form title
$sql = "SELECT name FROM {$wpdb->prefix}frm_forms WHERE id = %d";
$sql = $wpdb->prepare($sql, $form_id);
$title = $wpdb->get_var($sql);
if (!$title) {
return true;
}
// Get submission values
$sql = "SELECT f.name AS 'key', m.meta_value AS 'value' FROM {$wpdb->prefix}frm_item_metas m, wp_frm_fields f WHERE m.field_id = f.id AND m.item_id = %d";
$sql = $wpdb->prepare($sql, $entry_id);
$results = $wpdb->get_results($sql, ARRAY_A);
if (!$results) {
return true;
}
$postedData = array();
foreach ($results as $result) {
$key = $result['key'];
$value = $result['value'];
if (is_serialized($value)) {
$value = unserialize($value);
if (is_array($value)) {
$value = implode(',', $value);
} else {
$value = (string) $value;
// shouldn't get here
}
}
$postedData[$key] = $value;
}
// Save submission
$data = (object) array('title' => $title, 'posted_data' => $postedData, 'uploaded_files' => array());
// todo
$this->plugin->saveFormData($data);
return true;
}