. */ require_once('ShortCodeLoader.php'); require_once('CFDBPostDataConverter.php'); class CFDBShortCodeSaveFormMakerSubmission extends ShortCodeLoader { const FORM_TITLE_FIELD = 'form_title'; const DEFAULT_FORM_TITLE = 'Form Maker'; /** * @param $atts array (associative) of shortcode inputs * @param $content string inner content of short code * @return string shortcode content */ public function handleShortcode($atts, $content = null) { // echo '
';
//        print_r($_POST);
//        echo "\n";
//        print_r($_FILES);
//        echo '
'; $converter = new CFDBPostDataConverter(); $converter->addExcludeField(self::FORM_TITLE_FIELD); $title = isset($_POST[self::FORM_TITLE_FIELD]) ? $_POST[self::FORM_TITLE_FIELD] : self::DEFAULT_FORM_TITLE; $data = $converter->convert($title); if ($data) { // Call hook to submit data do_action_ref_array('cfdb_submit', array(&$data)); } } }