// Get stored data for the current field
$customFieldData = $CustomFieldData->getEntry($r['id'], 'field_id', "T.record_id = ".$this->recordId);
-
+
// Place the save field data into the current result
$r = array_merge($r, array(
'text_data' => $customFieldData['text_data'],
case 'text':
case 'textarea':
- $r['stored'] = $customFieldData['text_data'];
+ $r['stored'] = $r['text_data'];
break;
case 'checkbox':
- $r['stored'] = ($customFieldData['checkbox_data'] ? 'Yes' : 'No');
+ $r['stored'] = ($r['checkbox_data'] ? 'Yes' : 'No');
break;
case 'picklist':
if ($optVal['option_value'] == $customFieldData['text_data']) {
$val = true;
$name = 'Yes';
+ $r['stored'] = $optVal['option_value'];
+ $r['option_text'] = $optVal['option_text'];
}
$r['options'][$optKey]['option_default']['value'] = $val;
$r['options'][$optKey]['option_default']['name'] = $name;
}
}
- $r['stored'] = $optVal['stored'] = $csutomFieldData['text_data'];
-
break;
case 'integer':
- $r['stored'] = $customFieldData['integer_data'];
+ $r['stored'] = $r['integer_data'];
break;
case 'float':
- $r['stored'] = $customFieldData['float_data'];
+ $r['stored'] = $r['float_data'];
break;
}
-ini_set ( log_errors_max_len, 8192 );
-trigger_error('Stored Data: '.print_r($r,1), E_USER_NOTICE);
-
}
+
+ini_set(log_errors_max_len,4096);
+trigger_error('Form Fields: '.print_r($r, 1), E_USER_NOTICE);
}
return $r;
/**
* Does the specified Form ID have any input fields
*
- * @param $content string Default state (supply false). This will be overridden if result is true.
- * @param $fid string Unique ID of form
+ * @param $content string Default state (supply false). This will be overridden if result is true.
+ * @param $fid string Unique ID of form
*
* returns an array with status and HTML for editing the form.
*/
/**
* Store data from a call to the "glm-members-customfields-form-submit" filter
+ *
+ * NOTE: The glm-members-customfields-form-submit filter above can store data for a form submission in one
+ * call. This filter is for situations where there may need to be additional processing between form submission
+ * and storage.
*
- * @param $content string Any supplied content. Form will be appended to this
- * @param $fid string Unique ID of form
- * @param $recordId integer ID for instance of this form (generally the ID of the associated record) - Required
- * @param $formData array Copy of the array returned by the "glm-members-customfields-form-submit" filter.
+ * @param $content string Any supplied content. Form will be appended to this
+ * @param $fid string Unique ID of form
+ * @param $recordId integer ID for instance of this form (generally the ID of the associated record) - Required
+ * @param $formData array Copy of the array returned by the "glm-members-customfields-form-submit" filter.
*
* returns an array with status and HTML for editing the form.
*/
}, 10, 4 );
-
+/**
+ * Recall data for a form stored with a specific record ID
+ *
+ * @param $content string Any supplied content. Form will be appended to this
+ * @param $fid string Unique ID of form
+ * @param $recordId integer ID for instance of this form (generally the ID of the associated record) - Required
+ * @param $priorityDisplay boolean Display only priority fields flag
+ * Note that fields with a cost value are always considered to be priority.
+ *
+ * returns an array with HTML for displaying the results and an array of data that may be used for custom
+ * display.
+ */
+add_filter( 'glm-members-customfields-form-data-recall', function( $content, $fid, $recordId = 0, $priorityDisplay = false ){
+
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
+ trigger_error('Custom Fields Filter Called: glm-members-customfields-form-data-recall', E_USER_NOTICE);
+ }
+
+ require_once GLM_MEMBERS_CUSTOMFIELDS_PLUGIN_CLASS_PATH.'/data/dataCustomField.php';
+ $CustomFields = new GlmCustomFields($this->wpdb, $this->config);
+
+ $form = $CustomFieldSupport->getFormWithData($fid, $recordId, $priorityDisplay);
+
+ini_set(log_errors_max_len, 5192);
+trigger_error('Form Data Recall: '.print_r($form, 1), E_USER_NOTICE);
+
+ // Consider using a shortcode to build the HTML
+
+ return $content;
+
+}, 10, 4 );
+
+