CFDBViewShortCodeBuilder

The Contact Form DB CFDBViewShortCodeBuilder class.

Defined (1)

The class is defined in the following location(s).

/CFDBViewShortCodeBuilder.php  
  1. class CFDBViewShortCodeBuilder extends CFDBView { 
  2.  
  3. /** 
  4. * @param $plugin CF7DBPlugin 
  5. * @return void 
  6. */ 
  7. function display(&$plugin) { 
  8. if ($plugin == null) { 
  9. $plugin = new CF7DBPlugin; 
  10. $this->pageHeader($plugin); 
  11.  
  12. $siteUrl = get_option('home'); 
  13. $user = wp_get_current_user(); 
  14. $userName = $user ? $user->user_login : ''; 
  15.  
  16. // Identify which forms have data in the database 
  17. global $wpdb; 
  18. $tableName = $plugin->getSubmitsTableName(); 
  19. $rows = $wpdb->get_results("select distinct `form_name` from `$tableName` order by `form_name`"); 
  20. // if ($rows == null || count($rows) == 0) { 
  21. // echo htmlspecialchars(__('No form submissions in the database', 'contact-form-7-to-database-extension')); 
  22. // return; 
  23. // } 
  24.  
  25. // Collect any values in $_REQUEST to pre-populate the page controls 
  26. $postedForm = $this->getRequestParam('form'); 
  27. $postedEnc = $this->getRequestParam('enc'); 
  28. $postedSC = $this->getRequestParam('sc'); 
  29. $postedTrans = $this->getRequestParam('trans'); 
  30. $postedShow = $this->getRequestParam('show'); 
  31. $postedHide = $this->getRequestParam('hide'); 
  32. $postedRole = $this->getRequestParam('role'); 
  33. $postedPermissionmsg = $this->getRequestParam('permissionmsg'); 
  34. $postedEdit = $this->getRequestParam('edit'); 
  35. $postedSearch = $this->getRequestParam('search'); 
  36. $postedFilter = $this->getRequestParam('filter'); 
  37. $postedTSearch = $this->getRequestParam('tsearch'); 
  38. $postedTFilter = $this->getRequestParam('tfilter'); 
  39. $postedLimit = $this->getRequestParam('limit'); 
  40. $postedTLimit = $this->getRequestParam('tlimit'); 
  41.  
  42. $postedLimitComponents = explode(', ', $postedLimit); 
  43. $postedLimitStart = ''; 
  44. $postedLimitNumRows = ''; 
  45. switch (count($postedLimitComponents)) { 
  46. case 2: 
  47. $postedLimitStart = $postedLimitComponents[0]; 
  48. $postedLimitNumRows = $postedLimitComponents[1]; 
  49. break; 
  50. case 1: 
  51. $postedLimitNumRows = $postedLimitComponents[0]; 
  52. break; 
  53. default: 
  54. break; 
  55.  
  56. $postedUnbuffered = $this->getRequestParam('unbuffered'); 
  57. $postedRandom = $this->getRequestParam('random'); 
  58. $postedOrderby = $this->getRequestParam('orderby'); 
  59. $postedTOrderby = $this->getRequestParam('torderby'); 
  60. $postedHeader = $this->getRequestParam('header'); 
  61. $postedHeaders = $this->getRequestParam('headers'); 
  62. $postedItemtitle = $this->getRequestParam('itemtitle'); 
  63. $postedId = $this->getRequestParam('id'); 
  64. $postedClass = $this->getRequestParam('class'); 
  65. $postedStyle = $this->getRequestParam('style'); 
  66. $postedEdit = $this->getRequestParam('edit'); 
  67. $postedDtOptions = $this->getRequestParam('dt_options'); 
  68. $postedVar = $this->getRequestParam('var'); 
  69. $postedFormat = $this->getRequestParam('format'); 
  70. $postedFunction = $this->getRequestParam('function'); 
  71. $postedDelimiter = $this->getRequestParam('delimiter'); 
  72. $postedFilelinks = $this->getRequestParam('filelinks'); 
  73. $postedWpautop = $this->getRequestParam('wpautop'); 
  74. $postedStripbr = $this->getRequestParam('stripbr'); 
  75. $postedContent = $this->getRequestParam('content'); 
  76. $postedContentBefore = ''; 
  77. $postedContentAfter = ''; 
  78. if ($postedContent) { 
  79. $parser = new CFDBShortCodeContentParser; 
  80. list($postedContentBefore, $postedContent, $postedContentAfter) = $parser->parseBeforeContentAfter($postedContent); 
  81.  
  82. $postedUrlonly = $this->getRequestParam('urlonly'); 
  83. $postedLinktext = $this->getRequestParam('linktext'); 
  84.  
  85. $infoImg = $plugin->getPluginFileUrl('/img/info.jpg'); 
  86. ?> 
  87. <script type="text/javascript" language="JavaScript"> 
  88.  
  89. var shortCodeDocUrls = { 
  90. '' : 'http://cfdbplugin.com/?page_id=89',  
  91. '[cfdb-html]' : 'http://cfdbplugin.com/?page_id=284',  
  92. '[cfdb-table]' : 'http://cfdbplugin.com/?page_id=93',  
  93. '[cfdb-datatable]' : 'http://cfdbplugin.com/?page_id=91',  
  94. '[cfdb-value]' : 'http://cfdbplugin.com/?page_id=98',  
  95. '[cfdb-count]' : 'http://cfdbplugin.com/?page_id=278',  
  96. '[cfdb-json]' : 'http://cfdbplugin.com/?page_id=96',  
  97. '[cfdb-export-link]' : 'http://cfdbplugin.com/?page_id=419' 
  98. }; 
  99.  
  100. function showHideOptionDivs() { 
  101. var shortcode = jQuery('#shortcode_ctrl').val(); 
  102. jQuery('#doc_url_tag').attr('href', shortCodeDocUrls[shortcode]); 
  103. jQuery('#doc_url_tag').html(shortcode + " <?php echo htmlspecialchars(__('Documentation', 'contact-form-7-to-database-extension')); ?>"); 
  104. switch (shortcode) { 
  105. case "[cfdb-html]": 
  106. jQuery('#show_hide_div').show(); 
  107. jQuery('#limitorder_div').show(); 
  108. jQuery('#html_format_div').hide(); 
  109. jQuery('#dt_options_div').hide(); 
  110. jQuery('#json_div').hide(); 
  111. jQuery('#value_div').hide(); 
  112. jQuery('#template_div').show(); 
  113. jQuery('#url_link_div').hide(); 
  114. jQuery('#headers_div').hide(); 
  115. break; 
  116. case "[cfdb-table]": 
  117. jQuery('#show_hide_div').show(); 
  118. jQuery('#limitorder_div').show(); 
  119. jQuery('#html_format_div').show(); 
  120. jQuery('#dt_options_div').hide(); 
  121. jQuery('#json_div').hide(); 
  122. jQuery('#value_div').hide(); 
  123. jQuery('#template_div').hide(); 
  124. jQuery('#url_link_div').hide(); 
  125. jQuery('#headers_div').show(); 
  126. break; 
  127. case "[cfdb-datatable]": 
  128. jQuery('#show_hide_div').show(); 
  129. jQuery('#limitorder_div').show(); 
  130. jQuery('#html_format_div').show(); 
  131. <?php 
  132. if (!$plugin->isEditorActive()) { ?> 
  133. jQuery('#edit_mode_cntl').attr('disabled', 'disabled'); <?php 
  134. ?> 
  135. jQuery('#dt_options_div').show(); 
  136. jQuery('#json_div').hide(); 
  137. jQuery('#value_div').hide(); 
  138. jQuery('#template_div').hide(); 
  139. jQuery('#url_link_div').hide(); 
  140. jQuery('#headers_div').show(); 
  141. break; 
  142. case "[cfdb-value]": 
  143. jQuery('#show_hide_div').show(); 
  144. jQuery('#limitorder_div').show(); 
  145. jQuery('#html_format_div').hide(); 
  146. jQuery('#dt_options_div').hide(); 
  147. jQuery('#json_div').hide(); 
  148. jQuery('#value_div').show(); 
  149. jQuery('#template_div').hide(); 
  150. jQuery('#url_link_div').hide(); 
  151. jQuery('#headers_div').hide(); 
  152. break; 
  153. case "[cfdb-count]": 
  154. jQuery('#show_hide_div').hide(); 
  155. jQuery('#limitorder_div').hide(); 
  156. jQuery('#html_format_div').hide(); 
  157. jQuery('#dt_options_div').hide(); 
  158. jQuery('#json_div').hide(); 
  159. jQuery('#value_div').hide(); 
  160. jQuery('#template_div').hide(); 
  161. jQuery('#url_link_div').hide(); 
  162. jQuery('#headers_div').hide(); 
  163. break; 
  164. case "[cfdb-json]": 
  165. jQuery('#show_hide_div').show(); 
  166. jQuery('#limitorder_div').show(); 
  167. jQuery('#html_format_div').hide(); 
  168. jQuery('#dt_options_div').hide(); 
  169. jQuery('#json_div').show(); 
  170. jQuery('#value_div').hide(); 
  171. jQuery('#template_div').hide(); 
  172. jQuery('#url_link_div').hide(); 
  173. jQuery('#headers_div').show(); 
  174. break; 
  175. case "[cfdb-export-link]": 
  176. jQuery('#show_hide_div').show(); 
  177. jQuery('#limitorder_div').show(); 
  178. jQuery('#html_format_div').hide(); 
  179. jQuery('#dt_options_div').hide(); 
  180. jQuery('#json_div').hide(); 
  181. jQuery('#value_div').hide(); 
  182. jQuery('#template_div').hide(); 
  183. jQuery('#url_link_div').show(); 
  184. jQuery('#headers_div').show(); 
  185. break; 
  186. default: 
  187. jQuery('#show_hide_div').show(); 
  188. jQuery('#limitorder_div').show(); 
  189. jQuery('#html_format_div').hide(); 
  190. jQuery('#dt_options_div').hide(); 
  191. jQuery('#json_div').hide(); 
  192. jQuery('#value_div').hide(); 
  193. jQuery('#template_div').hide(); 
  194. jQuery('#url_link_div').hide(); 
  195. jQuery('#headers_div').hide(); 
  196. break; 
  197. var exportSelected = jQuery('#export_cntl').val(); 
  198. jQuery('#label_export_link').show(); 
  199. jQuery('#label_gld_function').hide(); 
  200. jQuery('#userpass_span_msg').show(); 
  201. jQuery('#gld_userpass_span_msg').hide(); 
  202. if (exportSelected) { 
  203. if (exportSelected == 'RSS') { 
  204. jQuery('#itemtitle_span').show(); 
  205. else { 
  206. jQuery('#itemtitle_span').hide(); 
  207. jQuery('#headers_div').show(); 
  208. if (exportSelected == "GLD") { 
  209. jQuery('#userpass_span_msg').hide(); 
  210. jQuery('#gld_userpass_span_msg').show(); 
  211. jQuery('#label_export_link').hide(); 
  212. jQuery('#label_gld_function').show(); 
  213.  
  214. if (exportSelected == "JSON") { 
  215. jQuery('#json_div').show(); 
  216. else { 
  217. jQuery('#json_div').hide(); 
  218. } else { 
  219. jQuery('#itemtitle_span').hide(); 
  220. jQuery('#userpass_span_msg').show(); 
  221. jQuery('#gld_userpass_span_msg').hide(); 
  222. jQuery('#label_gld_script').hide(); 
  223.  
  224. function getValue(attr, value, errors) { 
  225. if (value) { 
  226. if (errors && value.indexOf('"') > -1) { 
  227. errors.push('<?php echo htmlspecialchars(__('Error: "', 'contact-form-7-to-database-extension')); ?>' 
  228. + attr + 
  229. '<?php echo htmlspecialchars(__('" should not contain double-quotes (")', 'contact-form-7-to-database-extension')); ?>'); 
  230. value = value.replace('"', "'"); 
  231. return attr + '="' + value + '"'; 
  232. return ''; 
  233.  
  234. function pushNameValue(attr, value, array, errors) { 
  235. if (value) { 
  236. if (errors && value.indexOf('"') > -1) { 
  237. errors.push('<?php echo htmlspecialchars(__('Error: "', 'contact-form-7-to-database-extension')); ?>' 
  238. + attr + 
  239. '<?php echo htmlspecialchars(__('" should not contain double-quotes (")', 'contact-form-7-to-database-extension')); ?>'); 
  240. value = value.replace('"', "'"); 
  241. array.push(attr); 
  242. array.push(value); 
  243. return true; 
  244. return false; 
  245.  
  246. function getValueUrl(attr, value) { 
  247. if (value) { 
  248. return attr + '=' + encodeURIComponent(value) 
  249. return ''; 
  250.  
  251.  
  252. function join(arr, delim) { 
  253. if (delim == null) { 
  254. delim = ' '; 
  255. var tmp = []; 
  256. for (idx=0; idx<arr.length; idx++) { 
  257. if (arr[idx] != '') { 
  258. tmp.push(arr[idx]); 
  259. return tmp.join(delim); 
  260.  
  261. function chopLastChar(text) { 
  262. return text ? text.substr(0, text.length - 1) : text; 
  263.  
  264. function createShortCodeAndExportLink() { 
  265. var scElements = []; 
  266. var scUrlElements = []; 
  267. var scValidationErrors = []; 
  268.  
  269. var exportUrlElements = []; 
  270. var exportValidationErrors = []; 
  271.  
  272. var googleScriptElements = []; 
  273. var googleScriptValidationErrors = []; 
  274.  
  275. var shortcode = jQuery('#shortcode_ctrl').val(); 
  276. if (shortcode == '') { 
  277. jQuery('#shortcode_result_text').html(''); 
  278. scElements.push(chopLastChar(shortcode)); 
  279.  
  280. var pushErrorMessagesToAll = function(errMsg) { 
  281. scValidationErrors.push(errMsg); 
  282. exportValidationErrors.push(errMsg); 
  283. googleScriptValidationErrors.push(errMsg); 
  284. }; 
  285.  
  286. var formName = jQuery('#form_name_cntl').val(); 
  287. var errMsg; 
  288. if (!formName) { 
  289. errMsg = '<?php echo htmlspecialchars(__('Error: no form is chosen', 'contact-form-7-to-database-extension')) ?>'; 
  290. jQuery('#form_validations_text').html(errMsg); 
  291. pushErrorMessagesToAll(errMsg); 
  292. else { 
  293. jQuery('#form_validations_text').html(''); 
  294. scElements.push('form="' + formName + '"'); 
  295. scUrlElements.push('form=' + encodeURIComponent(formName)); 
  296. exportUrlElements.push('form=' + encodeURIComponent(formName)); 
  297. googleScriptElements.push('<?php echo $siteUrl ?>'); 
  298. googleScriptElements.push(formName); 
  299. googleScriptElements.push('<?php echo is_user_logged_in() ? 
  300. wp_get_current_user()->user_login : 
  301. 'user' ?>'); 
  302. googleScriptElements.push('<password>'); 
  303.  
  304. var pushValueToAll = function(name, val) { 
  305. scElements.push(getValue(name, val, scValidationErrors)); 
  306. scUrlElements.push(getValueUrl(name, val)); 
  307. exportUrlElements.push(getValueUrl(name, val)); 
  308. pushNameValue(name, val, googleScriptElements, googleScriptValidationErrors); 
  309. }; 
  310.  
  311. var val; 
  312. if (shortcode != '[cfdb-count]') { 
  313. val = jQuery('#show_cntl').val(); 
  314. pushValueToAll('show', val); 
  315.  
  316. val = jQuery('#hide_cntl').val(); 
  317. pushValueToAll('hide', val); 
  318.  
  319. val = jQuery('#role_cntl').val(); 
  320. pushValueToAll('role', val); 
  321.  
  322. val = jQuery('#permissionmsg_cntl').val(); 
  323. pushValueToAll('permissionmsg', val); 
  324.  
  325. val = jQuery('#trans_cntl').val(); 
  326. pushValueToAll('trans', val); 
  327.  
  328.  
  329. var handleFilterSearch = function(filterName, filter, searchName, search) { 
  330. if (filter) { 
  331. pushValueToAll(filterName, filter); 
  332. if (search) { 
  333. var errMsg = '<?php echo htmlspecialchars(__('Warning: "search" field ignored because FIELD is used (use one but not both)', 'contact-form-7-to-database-extension')); ?>'.replace('FIELD', filterName); 
  334. pushErrorMessagesToAll(errMsg); 
  335. else { 
  336. pushValueToAll(searchName, search); 
  337. }; 
  338. var filter = jQuery('#filter_cntl').val(); 
  339. var search = jQuery('#search_cntl').val(); 
  340. handleFilterSearch('filter', filter, 'search', search); 
  341.  
  342. var tfilter = jQuery('#tfilter_cntl').val(); 
  343. var tsearch = jQuery('#tsearch_cntl').val(); 
  344. handleFilterSearch('tfilter', tfilter, 'tsearch', tsearch); 
  345.  
  346.  
  347. if (shortcode != '[cfdb-count]') { 
  348.  
  349. var handleLimit = function (limitName, limitRows, limitStart) { 
  350. if (limitStart && !limitRows) { 
  351. errMsg = '<?php echo htmlspecialchars(__('Error: "FIELD": if you provide a value for "Start Row" then you must also provide a value for "Num Rows"', 'contact-form-7-to-database-extension')); ?>'.replace('FIELD', limitName); 
  352. pushErrorMessagesToAll(errMsg); 
  353. if (limitRows) { 
  354. if (!/^\d+$/.test(limitRows)) { 
  355. errMsg = '<?php echo htmlspecialchars(__('Error: "FIELD": "Num Rows" must be a positive integer', 'contact-form-7-to-database-extension')); ?>'.replace('FIELD', limitName); 
  356. pushErrorMessagesToAll(errMsg); 
  357. else { 
  358. var limitOption = ''; 
  359. var limitOptionUrl = limitName + '='; 
  360. if (limitStart) { 
  361. if (!/^\d+$/.test(limitStart)) { 
  362. errMsg = '<?php echo htmlspecialchars(__('Error: "FIELD": "Start Row" must be a positive integer', 'contact-form-7-to-database-extension')); ?>'.replace('FIELD', limitName); 
  363. pushErrorMessagesToAll(errMsg); 
  364. else { 
  365. limitOption += limitStart + ", "; 
  366. limitOptionUrl += encodeURIComponent(limitStart + ", "); 
  367. limitOption += limitRows; 
  368. limitOptionUrl += limitRows; 
  369. scElements.push(limitName + '="' + limitOption + '"'); 
  370. scUrlElements.push(limitOptionUrl); 
  371. exportUrlElements.push(limitOptionUrl); 
  372. pushNameValue(limitName, limitOption, googleScriptElements, googleScriptValidationErrors); 
  373. }; 
  374.  
  375. var limitRows = jQuery('#limit_rows_cntl').val(); 
  376. var limitStart = jQuery('#limit_start_cntl').val(); 
  377. handleLimit('limit', limitRows, limitStart); 
  378.  
  379. var tlimitRows = jQuery('#tlimit_rows_cntl').val(); 
  380. var tlimitStart = jQuery('#tlimit_start_cntl').val(); 
  381. handleLimit('tlimit', tlimitRows, tlimitStart); 
  382.  
  383.  
  384.  
  385. val = jQuery('#random_cntl').val(); 
  386. scElements.push(getValue('random', val, scValidationErrors)); 
  387. scUrlElements.push(getValueUrl('random', val)); 
  388. pushNameValue("random", val, googleScriptElements, googleScriptValidationErrors); 
  389.  
  390. if (jQuery('#unbuffered_cntl').is(':checked')) { 
  391. scElements.push('unbuffered="true"'); 
  392. scUrlElements.push(getValueUrl('unbuffered', 'true')); 
  393. exportUrlElements.push('unbuffered=true'); 
  394. pushNameValue("unbuffered", "true", googleScriptElements, googleScriptValidationErrors); 
  395.  
  396. var handleOrderBy = function (name, val) { 
  397. if (val) { 
  398. var orderByElem = getValue(name, val, scValidationErrors); 
  399. var orderByElemUrl = getValueUrl(name, val); 
  400. var orderByDir = jQuery('#' + name + 'dir_cntl').val(); 
  401. if (orderByDir) { 
  402. orderBy += ' ' + orderByDir; 
  403. orderByElem = chopLastChar(orderByElem) + ' ' + orderByDir + '"'; 
  404. orderByElemUrl = orderByElemUrl + encodeURIComponent(' ' + orderByDir); 
  405. scElements.push(orderByElem); 
  406. scUrlElements.push(orderByElemUrl); 
  407. exportUrlElements.push(orderByElemUrl); 
  408. pushNameValue(name, orderBy, googleScriptElements, googleScriptValidationErrors); 
  409. }; 
  410. var orderBy = jQuery('#orderby_cntl').val(); 
  411. handleOrderBy('orderby', orderBy); 
  412.  
  413. var torderBy = jQuery('#torderby_cntl').val(); 
  414. handleOrderBy('torderby', torderBy); 
  415.  
  416. var scText; 
  417. switch (shortcode) { 
  418. case '[cfdb-html]': 
  419. val = jQuery('#filelinks_cntl').val(); 
  420. scElements.push(getValue('filelinks', val, scValidationErrors)); 
  421. scUrlElements.push(getValueUrl('filelinks', val)); 
  422.  
  423. val = jQuery('#wpautop_cntl').val(); 
  424. scElements.push(getValue('wpautop', val, scValidationErrors)); 
  425. scUrlElements.push(getValueUrl('wpautop', val)); 
  426.  
  427. val = jQuery('#stripbr_cntl').val(); 
  428. scElements.push(getValue('stripbr', val, scValidationErrors)); 
  429. scUrlElements.push(getValueUrl('stripbr', val)); 
  430.  
  431. var template = jQuery('#content_cntl').val(); 
  432. var content = template; 
  433. var contentBefore = jQuery('#before_cntl').val(); 
  434. var contentAfter = jQuery('#after_cntl').val(); 
  435. if (contentBefore) { 
  436. content = "<?php echo CFDBShortCodeContentParser::BEFORE_START_DELIMITER ?>" + contentBefore + "<?php echo CFDBShortCodeContentParser::BEFORE_END_DELIMITER ?>" + content; 
  437. if (contentAfter) { 
  438. content += "<?php echo CFDBShortCodeContentParser::AFTER_START_DELIMITER ?>" + contentAfter + "<?php echo CFDBShortCodeContentParser::AFTER_END_DELIMITER ?>"; 
  439. scUrlElements.push('content=' + encodeURIComponent(content)); 
  440. scUrlElements.push('enc=HTMLTemplate'); 
  441. scText = join(scElements) + ']' + 
  442. // Escape html tags for display on page 
  443. content.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>') + 
  444. '[/cfdb-html]'; 
  445. if (template == "") { 
  446. scValidationErrors.push('<?php echo htmlspecialchars(__('Error: [cfdb-html] has empty Template. It will not output anything. ', 'contact-form-7-to-database-extension')); ?>'); 
  447. jQuery('#content_cntl').addClass('validation'); // highlight template area 
  448. else { 
  449. jQuery('#content_cntl').removeClass('validation'); // remove highlight template area 
  450. break; 
  451. case '[cfdb-table]': 
  452. if (!jQuery('#header_cntl').is(':checked')) { 
  453. scElements.push('header="false"'); 
  454. scUrlElements.push(getValueUrl('header', 'false')); 
  455. pushNameValue("header", "false", googleScriptElements, googleScriptValidationErrors); 
  456. val = jQuery('#headers_cntl').val(); 
  457. scElements.push(getValue('headers', val, scValidationErrors)); 
  458. scUrlElements.push(getValueUrl('headers', val)); 
  459.  
  460. val = jQuery('#id_cntl').val(); 
  461. scElements.push(getValue('id', val, scValidationErrors)); 
  462. scUrlElements.push(getValueUrl('id', val)); 
  463.  
  464. val = jQuery('#class_cntl').val(); 
  465. scElements.push(getValue('class', val, scValidationErrors)); 
  466. scUrlElements.push(getValueUrl('class', val)); 
  467.  
  468. val = jQuery('#style_cntl').val(); 
  469. scElements.push(getValue('style', val, scValidationErrors)); 
  470. scUrlElements.push(getValueUrl('style', val)); 
  471.  
  472. var contentBefore = jQuery('#before_cntl').val(); 
  473. var contentAfter = jQuery('#after_cntl').val(); 
  474. var content = ''; 
  475. if (contentBefore) { 
  476. content = "<?php echo CFDBShortCodeContentParser::BEFORE_START_DELIMITER ?>" + contentBefore + "<?php echo CFDBShortCodeContentParser::BEFORE_END_DELIMITER ?>" + content; 
  477. if (contentAfter) { 
  478. content += "<?php echo CFDBShortCodeContentParser::AFTER_START_DELIMITER ?>" + contentAfter + "<?php echo CFDBShortCodeContentParser::AFTER_END_DELIMITER ?>"; 
  479. scUrlElements.push('content=' + encodeURIComponent(content)); 
  480.  
  481. scUrlElements.push('enc=HTML'); 
  482. scText = join(scElements) + ']'; 
  483. if (content) { 
  484. // Escape html tags for display on page 
  485. scText += content.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>') + 
  486. '[/cfdb-table]'; 
  487. break; 
  488. case '[cfdb-datatable]': 
  489. if (!jQuery('#header_cntl').is(':checked')) { 
  490. scElements.push('header="false"'); 
  491. scUrlElements.push(getValueUrl('header', 'false')); 
  492. val = jQuery('#headers_cntl').val(); 
  493. scElements.push(getValue('headers', val, scValidationErrors)); 
  494. scUrlElements.push(getValueUrl('headers', val)); 
  495. var hadHeaders = val != ''; 
  496.  
  497. val = jQuery('#id_cntl').val(); 
  498. scElements.push(getValue('id', val, scValidationErrors)); 
  499. scUrlElements.push(getValueUrl('id', val)); 
  500.  
  501. val = jQuery('#class_cntl').val(); 
  502. scElements.push(getValue('class', val, scValidationErrors)); 
  503. scUrlElements.push(getValueUrl('class', val)); 
  504.  
  505. val = jQuery('#style_cntl').val(); 
  506. scElements.push(getValue('style', val, scValidationErrors)); 
  507. scUrlElements.push(getValueUrl('style', val)); 
  508.  
  509. val = jQuery('#edit_mode_cntl').val(); 
  510. scElements.push(getValue('edit', val, scValidationErrors)); 
  511. scUrlElements.push(getValueUrl('edit', val)); 
  512. if (hadHeaders && val == 'true') { 
  513. scValidationErrors.push('<?php echo htmlspecialchars(__('Error: "edit=true" will not work properly when setting "headers" ', 'contact-form-7-to-database-extension')); ?>'); 
  514.  
  515. val = jQuery('#dt_options_cntl').val(); 
  516. scElements.push(getValue('dt_options', val, scValidationErrors)); 
  517. scUrlElements.push(getValueUrl('dt_options', val)); 
  518.  
  519. var contentBefore = jQuery('#before_cntl').val(); 
  520. var contentAfter = jQuery('#after_cntl').val(); 
  521. var content = ''; 
  522. if (contentBefore) { 
  523. content = "<?php echo CFDBShortCodeContentParser::BEFORE_START_DELIMITER ?>" + contentBefore + "<?php echo CFDBShortCodeContentParser::BEFORE_END_DELIMITER ?>" + content; 
  524. if (contentAfter) { 
  525. content += "<?php echo CFDBShortCodeContentParser::AFTER_START_DELIMITER ?>" + contentAfter + "<?php echo CFDBShortCodeContentParser::AFTER_END_DELIMITER ?>"; 
  526. scUrlElements.push('content=' + encodeURIComponent(content)); 
  527.  
  528. scUrlElements.push('enc=DT'); 
  529. scText = join(scElements) + ']'; 
  530. if (content) { 
  531. // Escape html tags for display on page 
  532. scText += content.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>') + 
  533. '[/cfdb-datatable]'; 
  534. break; 
  535. case '[cfdb-value]': 
  536. val = jQuery('#function_cntl').val(); 
  537. scElements.push(getValue('function', val, scValidationErrors)); 
  538. scUrlElements.push(getValueUrl('function', val)); 
  539.  
  540. val = jQuery('#delimiter_cntl').val(); 
  541. scElements.push(getValue('delimiter', val, scValidationErrors)); 
  542. scUrlElements.push(getValueUrl('delimiter', val)); 
  543.  
  544. var contentBefore = jQuery('#before_cntl').val(); 
  545. var contentAfter = jQuery('#after_cntl').val(); 
  546. var content = ''; 
  547. if (contentBefore) { 
  548. content = "<?php echo CFDBShortCodeContentParser::BEFORE_START_DELIMITER ?>" + contentBefore + "<?php echo CFDBShortCodeContentParser::BEFORE_END_DELIMITER ?>" + content; 
  549. if (contentAfter) { 
  550. content += "<?php echo CFDBShortCodeContentParser::AFTER_START_DELIMITER ?>" + contentAfter + "<?php echo CFDBShortCodeContentParser::AFTER_END_DELIMITER ?>"; 
  551. scUrlElements.push('content=' + encodeURIComponent(content)); 
  552.  
  553. scUrlElements.push('enc=VALUE'); 
  554. scText = join(scElements) + ']'; 
  555. if (content) { 
  556. // Escape html tags for display on page 
  557. scText += content.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>') + 
  558. '[/cfdb-value]'; 
  559. break; 
  560. case '[cfdb-count]': 
  561. var contentBefore = jQuery('#before_cntl').val(); 
  562. var contentAfter = jQuery('#after_cntl').val(); 
  563. var content = ''; 
  564. if (contentBefore) { 
  565. content = "<?php echo CFDBShortCodeContentParser::BEFORE_START_DELIMITER ?>" + contentBefore + "<?php echo CFDBShortCodeContentParser::BEFORE_END_DELIMITER ?>" + content; 
  566. if (contentAfter) { 
  567. content += "<?php echo CFDBShortCodeContentParser::AFTER_START_DELIMITER ?>" + contentAfter + "<?php echo CFDBShortCodeContentParser::AFTER_END_DELIMITER ?>"; 
  568. scUrlElements.push('content=' + encodeURIComponent(content)); 
  569.  
  570. scUrlElements.push('enc=COUNT'); 
  571. scText = join(scElements) + ']'; // hopLastChar(scElements.join(' ')) + ']'; 
  572. if (content) { 
  573. // Escape html tags for display on page 
  574. scText += content.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>') + 
  575. '[/cfdb-count]'; 
  576. break; 
  577. case '[cfdb-json]': 
  578. if (!jQuery('#header_cntl').is(':checked')) { 
  579. scElements.push('header="false"'); 
  580. scUrlElements.push(getValueUrl('header', 'false')); 
  581. pushNameValue("header", "false", googleScriptElements, googleScriptValidationErrors); 
  582. val = jQuery('#headers_cntl').val(); 
  583. scElements.push(getValue('headers', val, scValidationErrors)); 
  584. scUrlElements.push(getValueUrl('headers', val)); 
  585.  
  586. val = jQuery('#var_cntl').val(); 
  587. scElements.push(getValue('var', val, scValidationErrors)); 
  588. scUrlElements.push(getValueUrl('var', val)); 
  589.  
  590. val = jQuery('#format_cntl').val(); 
  591. scElements.push(getValue('format', val, scValidationErrors)); 
  592. scUrlElements.push(getValueUrl('format', val)); 
  593.  
  594. var contentBefore = jQuery('#before_cntl').val(); 
  595. var contentAfter = jQuery('#after_cntl').val(); 
  596. var content = ''; 
  597. if (contentBefore) { 
  598. content = "<?php echo CFDBShortCodeContentParser::BEFORE_START_DELIMITER ?>" + contentBefore + "<?php echo CFDBShortCodeContentParser::BEFORE_END_DELIMITER ?>" + content; 
  599. if (contentAfter) { 
  600. content += "<?php echo CFDBShortCodeContentParser::AFTER_START_DELIMITER ?>" + contentAfter + "<?php echo CFDBShortCodeContentParser::AFTER_END_DELIMITER ?>"; 
  601. scUrlElements.push('content=' + encodeURIComponent(content)); 
  602.  
  603. scUrlElements.push('enc=JSON'); 
  604. scText = join(scElements) + ']'; 
  605. if (content) { 
  606. // Escape html tags for display on page 
  607. scText += content.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>') + 
  608. '[/cfdb-json]'; 
  609. break; 
  610. case '[cfdb-export-link]': 
  611. val = jQuery('#enc_cntl').val(); 
  612. scElements.push(getValue('enc', val, scValidationErrors)); 
  613. scUrlElements.push(getValueUrl('enc', val)); 
  614. scElements.push(getValue('urlonly', jQuery('#urlonly_cntl').val(), scValidationErrors)); 
  615. scElements.push(getValue('linktext', jQuery('#linktext_cntl').val(), scValidationErrors)); 
  616.  
  617. if (!jQuery('#header_cntl').is(':checked')) { 
  618. scElements.push('header="false"'); 
  619. scUrlElements.push(getValueUrl('header', 'false')); 
  620. val = jQuery('#headers_cntl').val(); 
  621. scElements.push(getValue('headers', val, scValidationErrors)); 
  622. scUrlElements.push(getValueUrl('headers', val)); 
  623.  
  624. scText = join(scElements) + ']'; 
  625. break; 
  626. default: 
  627. scText = shortcode; 
  628. break; 
  629.  
  630. var urlBase = '<?php echo admin_url('admin-ajax.php') ?>?action=cfdb-export&'; 
  631.  
  632. if (shortcode) { 
  633. // Output short code text 
  634. var scUrl = urlBase + join(scUrlElements, '&'); 
  635. jQuery('#shortcode_result_text').html('<a target="_cfdb_sc_results" href="' + scUrl + '">' + scText + '</a>'); 
  636.  
  637. // Output short code errors 
  638. jQuery('#shortcode_validations_text').html(scValidationErrors.join('<br/>')); 
  639. else { 
  640. // Don't report errors 
  641. jQuery('#shortcode_validations_text').html(''); 
  642.  
  643. // Export link or Google Spreadsheet function call 
  644. var exportSelection = jQuery('#export_cntl').val(); 
  645. if (exportSelection) { 
  646. if (exportSelection != 'GLD') { 
  647. exportUrlElements.push(getValueUrl('enc', exportSelection)); 
  648. if (exportSelection == 'RSS') { 
  649. exportUrlElements.push(getValueUrl('itemtitle', jQuery('#add_itemtitle').val())); 
  650. } else { 
  651. if (!jQuery('#header_cntl').is(':checked')) { 
  652. exportUrlElements.push(getValueUrl('header', 'false')); 
  653. pushNameValue("header", "false", googleScriptElements, googleScriptValidationErrors); 
  654. val = jQuery('#headers_cntl').val(); 
  655. exportUrlElements.push(getValueUrl('headers', val, scValidationErrors)); 
  656. pushNameValue("headers", val, googleScriptElements, googleScriptValidationErrors); 
  657.  
  658. exportUrlElements.push(getValueUrl('format', jQuery('#format_cntl').val(), scValidationErrors)); 
  659.  
  660. var user = jQuery("#gld_user").val(); 
  661. var pass = jQuery("#gld_pass").val(); 
  662. var obfuscate = jQuery('#obfuscate_cntl').is(':checked') 
  663. if (user || pass) { 
  664. if (obfuscate) { 
  665. var key = 'kx82XcPjq8q8S!xafx%$&7p6'; 
  666. exportUrlElements.push("l=" + encodeURI(printHex(des(key, user + "/" + pass, 1)))); 
  667. } else { 
  668. exportUrlElements.push("username=" + encodeURI(user)); 
  669. exportUrlElements.push("password=" + encodeURI(pass)); 
  670. urlBase = '<?php echo admin_url('admin-ajax.php') ?>?action=cfdb-login&cfdb-action=cfdb-export&'; 
  671. exportValidationErrors.push("<?php echo htmlspecialchars(__('Warning: the function includes your WP login information. Avoid sharing it.', 'contact-form-7-to-database-extension')) ?>"); 
  672.  
  673. // Output 
  674. var exportUrl = urlBase + join(exportUrlElements, '&'); 
  675. if (exportSelection == 'GLD') { 
  676. if (!user || !pass) { 
  677. exportValidationErrors.push("<?php echo htmlspecialchars(__('Error: WP User and Password are required for the Google Spreadsheet to pull data from your WordPress site.', 'contact-form-7-to-database-extension')) ?>"); 
  678. if (exportUrl.length > 255) { 
  679. exportValidationErrors.push("<?php echo htmlspecialchars(__('Because the generated URL would be too long, you must use this alternative function and add its script to your Google Spreadsheet', 'contact-form-7-to-database-extension')) ?>"); 
  680. jQuery('#label_gld_script').show(); 
  681. jQuery('#label_gld_function').hide(); 
  682. jQuery('#export_result_text').html(formName ? 
  683. ("=cfdbdata(\"" + googleScriptElements.join("\", \"") + "\")") : 
  684. ""); 
  685. } else { 
  686. jQuery('#export_result_text').html(formName ? 
  687. ("<a target='_cfdb_exp_results' href='" + exportUrl + "'>=IMPORTDATA(\"" + exportUrl + "\")</a>") : 
  688. ""); 
  689. } else { 
  690. jQuery('#export_result_text').html(formName ? ('<a target="_cfdb_exp_results" href="' + exportUrl + '">' + exportUrl + '</a>') : ''); 
  691.  
  692. // Output export errors 
  693. jQuery('#export_validations_text').html(exportValidationErrors.join('<br/>')); 
  694.  
  695. } else { 
  696. jQuery('#export_result_text').html(''); 
  697. // Don't report errors 
  698. jQuery('#export_validations_text').html(''); 
  699.  
  700. var getFormFieldsUrlBase = '<?php echo $plugin->getFormFieldsAjaxUrlBase() ?>'; 
  701. function getFormFields() { 
  702. jQuery('[id^=add]').attr('disabled', 'disabled'); 
  703. jQuery('[id^=btn]').attr('disabled', 'disabled'); 
  704. var formName = jQuery('#form_name_cntl').val(); 
  705. var url = getFormFieldsUrlBase + encodeURIComponent(formName); 
  706. jQuery.ajax({ 
  707. dataType: "json",  
  708. url: url,  
  709. async: false,  
  710. success: function(json) { 
  711. var optionsHtml = '<option value=""></option>'; 
  712. jQuery(json).each(function () { 
  713. optionsHtml += '<option value="' + this + '">' + this + '</option>'; 
  714. }); 
  715. optionsHtml += '<option value="$_POST(param)">$_POST(param)</option>'; 
  716. optionsHtml += '<option value="$_GET(param)">$_GET(param)</option>'; 
  717. optionsHtml += '<option value="$_COOKIE(param)">$_COOKIE(param)</option>'; 
  718. jQuery('[id^=add]').html(optionsHtml).removeAttr('disabled'); 
  719. jQuery('[id^=btn]').removeAttr('disabled'); 
  720. }); 
  721.  
  722. function validateSubmitTime() { 
  723. var url = "<?php echo $plugin->getValidateSubmitTimeAjaxUrlBase() ?>" + jQuery('#filter_val').val(); 
  724. jQuery.get(url, function(data) { 
  725. alert(data); 
  726. }); 
  727.  
  728. function showValidateSubmitTimeHelp(show) { 
  729. if (show) { 
  730. jQuery('#span_validate_submit_time').show(); 
  731. else { 
  732. jQuery('#span_validate_submit_time').hide(); 
  733.  
  734. function addFieldToShow() { 
  735. var value = jQuery('#show_cntl').val(); 
  736. if (value) { 
  737. value += ', '; 
  738. jQuery('#show_cntl').val(value + jQuery('#add_show').val()); 
  739. createShortCodeAndExportLink(); 
  740.  
  741. function addFieldToHide() { 
  742. var value = jQuery('#hide_cntl').val(); 
  743. if (value) { 
  744. value += ', '; 
  745. jQuery('#hide_cntl').val(value + jQuery('#add_hide').val()); 
  746. createShortCodeAndExportLink(); 
  747.  
  748. function addFieldToOrderBy(field) { 
  749. var value = jQuery('#' + field + '_cntl').val(); 
  750. if (value) { 
  751. value += ', '; 
  752. jQuery('#' + field + '_cntl').val(value + jQuery('#add_' + field).val()); 
  753. createShortCodeAndExportLink(); 
  754.  
  755. function addFieldToFilter(field) { 
  756. var value = jQuery('#' + field + '_cntl').val(); 
  757. if (value) { 
  758. value += jQuery('#' + field + '_bool').val(); 
  759. value += jQuery('#add_' + field).val() + jQuery('#' + field + '_op').val() + jQuery('#' + field + '_val').val(); 
  760. jQuery('#' + field + '_cntl').val(value); 
  761. createShortCodeAndExportLink(); 
  762.  
  763. function addToTrans() { 
  764. var value = jQuery('#trans_cntl').val(); 
  765. if (value) { 
  766. value += "&&"; 
  767. var field = jQuery('#add_trans').val(); 
  768. if (field) { 
  769. value += field; 
  770. value += "=" 
  771. value += jQuery('#trans_val').val(); 
  772. jQuery('#trans_cntl').val(value); 
  773. createShortCodeAndExportLink(); 
  774.  
  775. function addFieldToHeaders() { 
  776. var col = jQuery('#add_headers').val(); 
  777. var disp = jQuery('#headers_val').val(); 
  778. if (!col || !disp) { 
  779. return; 
  780. var value = jQuery('#headers_cntl').val(); 
  781. if (value) { 
  782. value += ', '; 
  783. value += col + '=' + disp; 
  784. jQuery('#headers_cntl').val(value); 
  785. createShortCodeAndExportLink(); 
  786.  
  787. function addFieldToContent() { 
  788. jQuery('#content_cntl').val(jQuery('#content_cntl').val() + '${' + jQuery('#add_content').val() + '}'); 
  789.  
  790. function reset() { 
  791. // Form 
  792. jQuery('#form_name_cntl').val(<?php echo json_encode($postedForm) ?>); 
  793. getFormFields(); 
  794.  
  795. // Export File 
  796. jQuery('#export_cntl').val(<?php echo json_encode($postedEnc) ?>); 
  797. jQuery('#add_itemtitle').val(<?php echo json_encode($postedItemtitle) ?>); 
  798.  
  799. // Short Code 
  800. jQuery('#shortcode_ctrl').val(<?php echo json_encode($postedSC) ?>); 
  801. jQuery('#show_cntl').val(<?php echo json_encode($postedShow) ?>); 
  802. jQuery('#hide_cntl').val(<?php echo json_encode($postedHide) ?>); 
  803. jQuery('#role_cntl').val(<?php echo json_encode($postedRole) ?>); 
  804. jQuery('#permissionmsg_cntl').val(<?php echo json_encode($postedPermissionmsg) ?>); 
  805. jQuery('#trans_cntl').val(<?php echo json_encode($postedTrans) ?>); 
  806. jQuery('#search_cntl').val(<?php echo json_encode($postedSearch) ?>); 
  807. jQuery('#filter_cntl').val(<?php echo json_encode($postedFilter) ?>); 
  808. jQuery('#tsearch_cntl').val(<?php echo json_encode($postedTSearch) ?>); 
  809. jQuery('#tfilter_cntl').val(<?php echo json_encode($postedTFilter) ?>); 
  810. jQuery('#limit_rows_cntl').val(<?php echo json_encode($postedLimitNumRows) ?>); 
  811. jQuery('#limit_start_cntl').val(<?php echo json_encode($postedLimitStart) ?>); 
  812. jQuery('#random_cntl').val(<?php echo json_encode($postedRandom) ?>); 
  813. jQuery('#unbuffered_cntl').attr("checked", false); 
  814. jQuery('#orderby_cntl').val(<?php echo json_encode($postedOrderby) ?>); 
  815. jQuery('#torderby_cntl').val(<?php echo json_encode($postedTOrderby) ?>); 
  816. jQuery('#header_cntl').prop("checked", <?php echo $postedHeader == 'false' ? 'false' : 'true' ?>); // default = true 
  817. jQuery('#headers_cntl').val(<?php echo json_encode($postedHeaders) ?>); 
  818. jQuery('#id_cntl').val(<?php echo json_encode($postedId) ?>); 
  819. jQuery('#class_cntl').val(<?php echo json_encode($postedClass) ?>); 
  820. jQuery('#style_cntl').val(<?php echo json_encode($postedStyle) ?>); 
  821. jQuery('#edit_mode_cntl').val(<?php echo json_encode($postedEdit) ?>); 
  822. jQuery('#dt_options_cntl').val(<?php echo json_encode($postedDtOptions) ?>); 
  823. jQuery('#var_cntl').val(<?php echo json_encode($postedVar) ?>); 
  824. jQuery('#format_cntl').val(<?php echo json_encode($postedFormat) ?>); 
  825. jQuery('#function_cntl').val(<?php echo json_encode($postedFunction) ?>); 
  826. jQuery('#delimiter_cntl').val(<?php echo json_encode($postedDelimiter) ?>); 
  827. jQuery('#filelinks_cntl').val(<?php echo json_encode($postedFilelinks) ?>); 
  828. jQuery('#wpautop_cntl').val(<?php echo json_encode($postedWpautop) ?>); 
  829. jQuery('#stripbr_cntl').val(<?php echo json_encode($postedStripbr) ?>); 
  830. jQuery('#content_cntl').val(<?php echo json_encode($postedContent) ?>); 
  831. jQuery('#before_cntl').val(<?php echo json_encode($postedContentBefore) ?>); 
  832. jQuery('#after_cntl').val(<?php echo json_encode($postedContentAfter) ?>); 
  833. jQuery('#enc_cntl').val(<?php echo json_encode($postedEnc) ?>); 
  834. jQuery('#urlonly_cntl').val(<?php echo json_encode($postedUrlonly) ?>); 
  835. jQuery('#linktext_cntl').val(<?php echo json_encode($postedLinktext) ?>); 
  836.  
  837. showValidateSubmitTimeHelp(false); 
  838. showHideOptionDivs(); 
  839. createShortCodeAndExportLink(); 
  840.  
  841. jQuery.ajaxSetup({ 
  842. cache: false 
  843. }); 
  844.  
  845. jQuery(document).ready(function() { 
  846. reset(); 
  847. showHideOptionDivs(); 
  848. createShortCodeAndExportLink(); 
  849. jQuery('#shortcode_ctrl').change(showHideOptionDivs); 
  850. jQuery('#shortcode_ctrl').change(createShortCodeAndExportLink); 
  851. jQuery('select[id$="cntl"]').change(createShortCodeAndExportLink); 
  852. jQuery('input[id$="cntl"]').keyup(createShortCodeAndExportLink); 
  853. jQuery('textarea[id$="cntl"]').keyup(createShortCodeAndExportLink); 
  854. jQuery('#form_name_cntl').change(getFormFields); 
  855. jQuery('#btn_show').click(addFieldToShow); 
  856. jQuery('#btn_hide').click(addFieldToHide); 
  857. jQuery('#btn_orderby').click(function () { 
  858. addFieldToOrderBy('orderby'); 
  859. }); 
  860. jQuery('#btn_torderby').click(function () { 
  861. addFieldToOrderBy('torderby'); 
  862. }); 
  863. jQuery('#btn_filter').click(function () { 
  864. addFieldToFilter('filter'); 
  865. }); 
  866. jQuery('#btn_tfilter').click(function () { 
  867. addFieldToFilter('tfilter'); 
  868. }); 
  869. jQuery('#btn_trans').click(addToTrans); 
  870. jQuery('#header_cntl').click(createShortCodeAndExportLink); 
  871. jQuery('#unbuffered_cntl').click(createShortCodeAndExportLink); 
  872. jQuery('#edit_mode_cntl').click(createShortCodeAndExportLink); 
  873. jQuery('#btn_headers').click(addFieldToHeaders); 
  874. jQuery('#btn_content').click(function() { 
  875. addFieldToContent(); 
  876. createShortCodeAndExportLink(); 
  877. }); 
  878. jQuery('#enc_cntl').click(createShortCodeAndExportLink); 
  879. jQuery('#urlonly_cntl').click(createShortCodeAndExportLink); 
  880. jQuery('#reset_button').click(reset); 
  881. jQuery('#btn_validate_submit_time').click(validateSubmitTime); 
  882. jQuery('#add_filter').change(function() { 
  883. showValidateSubmitTimeHelp(jQuery('#add_filter').val() == "submit_time"); 
  884. }); 
  885. jQuery('#export_cntl').change(function() { 
  886. showHideOptionDivs(); 
  887. createShortCodeAndExportLink(); 
  888. }); 
  889. jQuery('#add_itemtitle').change(createShortCodeAndExportLink); 
  890. jQuery('#gld_user').change(createShortCodeAndExportLink); 
  891. jQuery('#gld_user').keyup(createShortCodeAndExportLink); 
  892. jQuery('#gld_pass').change(createShortCodeAndExportLink); 
  893. jQuery('#gld_pass').keyup(createShortCodeAndExportLink); 
  894. jQuery('#obfuscate_cntl').click(createShortCodeAndExportLink); 
  895. jQuery('#form_name_cntl').change(createShortCodeAndExportLink); 
  896. }); 
  897.  
  898.  
  899. </script> 
  900. <style type="text/css"> 
  901. div.shortcodeoptions { 
  902. border: #ccccff groove; 
  903. margin-bottom: 10px; 
  904. padding: 5px; 
  905.  
  906. div.shortcodeoptions label { 
  907. font-weight: bold; 
  908. font-family: Arial sans-serif; 
  909. margin-top: 5px; 
  910.  
  911. #shortcode_result_div { 
  912. margin-top: 1em; 
  913.  
  914. .label_box { 
  915. display: inline-block; 
  916. min-width: 50px; 
  917. padding-left: 2px; 
  918. padding-right: 2px; 
  919. border: 1px; 
  920. margin-right: 5px; 
  921.  
  922. .generated { 
  923. margin-top: 5px; 
  924. margin-bottom: 5px; 
  925. margin-left: 10px; 
  926. white-space: -moz-pre-wrap; 
  927. white-space: -pre-wrap; 
  928. white-space: -o-pre-wrap; 
  929. white-space: pre-wrap; 
  930. word-wrap: break-word; 
  931. font-size: larger; 
  932. font-weight: bold; 
  933. font-family: "courier new", monospace; 
  934. background-color: #ffffc3; 
  935.  
  936. .validation { 
  937. background-color: #ffe200; 
  938. font-style:italic; 
  939. </style> 
  940.  
  941. <h2><?php echo htmlspecialchars(__('Export and Short Code Builder', 'contact-form-7-to-database-extension')) ?></h2> 
  942. <?php // FORM ?> 
  943. <div class="shortcodeoptions" style="margin-top:10px;"> 
  944. <div class="label_box"><label for="form_name_cntl"><?php echo htmlspecialchars(__('form', 'contact-form-7-to-database-extension')) ?></label></div> 
  945. <select name="form_name_cntl" id="form_name_cntl"> 
  946. <option value=""><?php echo htmlspecialchars(__('* Select a form *', 'contact-form-7-to-database-extension')) ?></option> 
  947. <?php foreach ($rows as $aRow) { 
  948. $formName = $aRow->form_name; 
  949. ?> 
  950. <option value="<?php echo $formName ?>"><?php echo $formName ?></option> 
  951. <?php } ?> 
  952. </select> 
  953.  
  954. <?php // RESET ?> 
  955. <span style="margin-left:10px"> 
  956. <button id="reset_button"><?php echo htmlspecialchars(__('Reset', 'contact-form-7-to-database-extension')) ?></button> 
  957. </span> 
  958.  
  959. <div id="form_validations_text" class="validation"></div> 
  960. </div> 
  961.  
  962. <?php // EXPORT ?> 
  963. <div class="shortcodeoptions"> 
  964. <label for="export_cntl"><?php echo htmlspecialchars(__('Export File', 'contact-form-7-to-database-extension')); ?></label> 
  965. <select id="export_cntl" name="export_cntl"> 
  966. <option value=""></option> 
  967. <option value="CSVUTF8BOM"> 
  968. <?php echo htmlspecialchars(__('Excel CSV (UTF8-BOM)', 'contact-form-7-to-database-extension')); ?> 
  969. </option> 
  970. <option value="TSVUTF16LEBOM"> 
  971. <?php echo htmlspecialchars(__('Excel TSV (UTF16LE-BOM)', 'contact-form-7-to-database-extension')); ?> 
  972. </option> 
  973. <option value="CSVUTF8"> 
  974. <?php echo htmlspecialchars(__('Plain CSV (UTF-8)', 'contact-form-7-to-database-extension')); ?> 
  975. </option> 
  976. <option value="CSVSJIS"> 
  977. <?php echo htmlspecialchars(__('Excel CSV for Japanese (Shift-JIS)', 'contact-form-7-to-database-extension')); ?> 
  978. </option> 
  979. <option value="IQY"> 
  980. <?php echo htmlspecialchars(__('Excel Internet Query', 'contact-form-7-to-database-extension')); ?> 
  981. </option> 
  982. <option value="GLD"> 
  983. <?php echo htmlspecialchars(__('Google Spreadsheet Live Data', 'contact-form-7-to-database-extension')); ?> 
  984. </option> 
  985. <option value="RSS"> 
  986. <?php echo htmlspecialchars(__('RSS', 'contact-form-7-to-database-extension')); ?> 
  987. </option> 
  988. <option value="JSON"> 
  989. <?php echo htmlspecialchars(__('JSON', 'contact-form-7-to-database-extension')); ?> 
  990. </option> 
  991. </select> 
  992. <span id="itemtitle_span"> 
  993. <label for="add_itemtitle"><?php echo htmlspecialchars(__('Item Title', 'contact-form-7-to-database-extension')); ?></label> 
  994. <select name="add_itemtitle" id="add_itemtitle"></select> 
  995. </span> 
  996. <span id="userpass_span"> 
  997. <br/> 
  998. <span id="gld_userpass_span_msg"> 
  999. <?php echo htmlspecialchars(__('Provide a WP login for the Google Spreadsheet to use to connect to your WP site', 'contact-form-7-to-database-extension')); ?> 
  1000. </span> 
  1001. <span id="userpass_span_msg" style="display: none"> 
  1002. <?php echo htmlspecialchars(__('Optional: provide a WP login for the link to work without being already logged in', 'contact-form-7-to-database-extension')); ?> 
  1003. </span> 
  1004. <br/> 
  1005. <label for="gld_user"><?php echo htmlspecialchars(__('WP User', 'contact-form-7-to-database-extension')); ?></label> 
  1006. <input id="gld_user" type="text" value="<?php echo htmlspecialchars($userName); ?>"/> 
  1007. <label for="gld_pass"><?php echo htmlspecialchars(__('WP Password', 'contact-form-7-to-database-extension')); ?></label> 
  1008. <input id="gld_pass" type="password" value=""/> 
  1009. <input id="obfuscate_cntl" type="checkbox" checked/><?php echo htmlspecialchars(__('Hide Credentials', 'contact-form-7-to-database-extension')); ?> 
  1010. </span> 
  1011.  
  1012. <div id="export_result_div"> 
  1013. <span id="label_export_link"><?php echo htmlspecialchars(__('Generated Export Link:', 'contact-form-7-to-database-extension')); ?></span> 
  1014. <span id="label_gld_function" style="display:none"> 
  1015. <?php echo htmlspecialchars(__('Enter this function into a cell in your Google Spreadsheet:', 'contact-form-7-to-database-extension')); ?> 
  1016. </span> 
  1017. <span id="label_gld_script" style="display:none"> 
  1018. <?php echo htmlspecialchars(__('Generated Google Spreadsheet Function:', 'contact-form-7-to-database-extension')); ?> 
  1019. <?php _e('Replace <strong><password></strong> with your <em>WordPress</em> password', 'contact-form-7-to-database-extension'); ?> 
  1020. <br/> 
  1021. <?php echo htmlspecialchars(__('Requires code installed in your Google Spreadsheet script editor.')); ?> 
  1022. <a target="code" href="<?php echo $siteUrl ?>/wp-content/plugins/contact-form-7-to-database-extension/CFDBGoogleSSLiveData.php"><?php echo htmlspecialchars(__('Get code', 'contact-form-7-to-database-extension')); ?></a>. 
  1023. <a target="instructions" href="<?php echo $siteUrl ?>/wp-admin/admin-ajax.php?action=cfdb-export&enc=GLD&form=<?php echo urlencode($postedForm) ?>"><?php echo htmlspecialchars(__('See instructions.', 'contact-form-7-to-database-extension')); ?></a> 
  1024. </span> 
  1025. <br/><div class="generated" id="export_result_text"></div> 
  1026. </div> 
  1027. <div id="export_validations_text" class="validation"></div> 
  1028. </div> 
  1029.  
  1030.  
  1031. <?php // SHORT CODE ?> 
  1032. <div class="shortcodeoptions"> 
  1033. <div style="margin-bottom:10px"> 
  1034. <div class="label_box"><label 
  1035. for="shortcode_ctrl"><?php echo htmlspecialchars(__('Short Code', 'contact-form-7-to-database-extension')); ?></label> 
  1036. </div> 
  1037. <select name="shortcode_ctrl" id="shortcode_ctrl"> 
  1038. <option value=""><?php echo htmlspecialchars(__('* Select a short code *', 'contact-form-7-to-database-extension')); ?></option> 
  1039. <option value="[cfdb-html]">[cfdb-html]</option> 
  1040. <option value="[cfdb-table]">[cfdb-table]</option> 
  1041. <option value="[cfdb-datatable]">[cfdb-datatable]</option> 
  1042. <option value="[cfdb-value]">[cfdb-value]</option> 
  1043. <option value="[cfdb-count]">[cfdb-count]</option> 
  1044. <option value="[cfdb-json]">[cfdb-json]</option> 
  1045. <option value="[cfdb-export-link]">[cfdb-export-link]</option> 
  1046. </select> 
  1047. <a id="doc_url_tag" target="_docs" 
  1048. href="http://cfdbplugin.com/?page_id=89"><?php echo htmlspecialchars(__('Documentation', 'contact-form-7-to-database-extension')); ?></a> 
  1049. <br/> 
  1050. </div> 
  1051.  
  1052.  
  1053. <div id="shortcode_result_div"> 
  1054. <?php echo htmlspecialchars(__('Generated Short Code:', 'contact-form-7-to-database-extension')); ?> 
  1055. <br/><div class="generated" id="shortcode_result_text"></div> 
  1056. </div> 
  1057. <div id="shortcode_validations_text" class="validation"></div> 
  1058. <span style="font-size: x-small;"> 
  1059. <a target="_docs" 
  1060. href="http://cfdbplugin.com/?page_id=444"><?php echo htmlspecialchars(__('(Did you know: you can create your own short code)', 'contact-form-7-to-database-extension')); ?></a> 
  1061. </span> 
  1062.  
  1063. </div> 
  1064.  
  1065. <?php // SECURITY ?> 
  1066. <div id="security_div" class="shortcodeoptions"> 
  1067. <?php echo htmlspecialchars(__('Security', 'contact-form-7-to-database-extension')); ?> 
  1068. <div> 
  1069. <div class="label_box"> 
  1070. <label for="role_cntl"><?php echo htmlspecialchars(__('role', 'contact-form-7-to-database-extension')); ?></label> 
  1071. <a target="_docs" href="http://cfdbplugin.com/?page_id=89#role"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1072. </div> 
  1073. <select id="role_cntl" name="role_cntl"> 
  1074. <option value=""></option> 
  1075. <option value="Administrator"><?php echo htmlspecialchars(__('Administrator', 'contact-form-7-to-database-extension')); ?></option> 
  1076. <option value="Editor"><?php echo htmlspecialchars(__('Editor', 'contact-form-7-to-database-extension')); ?></option> 
  1077. <option value="Author"><?php echo htmlspecialchars(__('Author', 'contact-form-7-to-database-extension')); ?></option> 
  1078. <option value="Contributor"><?php echo htmlspecialchars(__('Contributor', 'contact-form-7-to-database-extension')); ?></option> 
  1079. <option value="Subscriber"><?php echo htmlspecialchars(__('Subscriber', 'contact-form-7-to-database-extension')); ?></option> 
  1080. <option value="Anyone"><?php echo htmlspecialchars(__('Anyone', 'contact-form-7-to-database-extension')); ?></option> 
  1081. </select> 
  1082. <div class="label_box"> 
  1083. <label for="permissionmsg_cntl"><?php echo htmlspecialchars(__('permissionmsg', 'contact-form-7-to-database-extension')); ?></label> 
  1084. <a target="_docs" href="http://cfdbplugin.com/?page_id=89#permissionmsg"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1085. </div> 
  1086. <select id="permissionmsg_cntl" name="permissionmsg_cntl"> 
  1087. <option value=""></option> 
  1088. <option value="true"><?php echo htmlspecialchars(__('true', 'contact-form-7-to-database-extension')); ?></option> 
  1089. <option value="false"><?php echo htmlspecialchars(__('false', 'contact-form-7-to-database-extension')); ?></option> 
  1090. </select> 
  1091. </div> 
  1092. </div> 
  1093. <?php // SHOW HIDE ?> 
  1094. <div id="show_hide_div" class="shortcodeoptions"> 
  1095. <?php echo htmlspecialchars(__('Which fields/columns do you want to display?', 'contact-form-7-to-database-extension')); ?> 
  1096. <div> 
  1097. <div class="label_box"> 
  1098. <label for="show_cntl"><?php echo htmlspecialchars(__('show', 'contact-form-7-to-database-extension')); ?></label> 
  1099. <a target="_docs" href="http://cfdbplugin.com/?page_id=89#show"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1100. </div> 
  1101. <select name="add_show" id="add_show"></select><button id="btn_show">»</button> 
  1102. <input name="show_cntl" id="show_cntl" type="text" size="100" placeholder="<?php echo htmlspecialchars(__('field1, field2, field3', 'contact-form-7-to-database-extension')) ?>"/> 
  1103. </div> 
  1104. <div> 
  1105. <div class="label_box"> 
  1106. <label for="hide_cntl"><?php echo htmlspecialchars(__('hide', 'contact-form-7-to-database-extension')); ?></label> 
  1107. <a target="_docs" href="http://cfdbplugin.com/?page_id=89#hide"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1108. </div> 
  1109. <select name="add_hide" id="add_hide"></select><button id="btn_hide">»</button> 
  1110. <input name="hide_cntl" id="hide_cntl" type="text" size="100" placeholder="<?php htmlspecialchars(__('field1, field2, field3', 'contact-form-7-to-database-extension')) ?>"/> 
  1111. </div> 
  1112. </div> 
  1113. <?php // SEARCH FILTER ?> 
  1114. <div id="filter_div" class="shortcodeoptions"> 
  1115. <div><?php echo htmlspecialchars(__('Which rows/submissions do you want to display?', 'contact-form-7-to-database-extension')); ?></div> 
  1116. <div> 
  1117. <div class="label_box"> 
  1118. <label for="search_cntl"><?php echo htmlspecialchars(__('search', 'contact-form-7-to-database-extension')) ?></label> 
  1119. <a target="_docs" href="http://cfdbplugin.com/?page_id=89#search"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1120. </div> 
  1121. <input name="search_cntl" id="search_cntl" type="text" size="30" placeholder="<?php echo htmlspecialchars(__('search text', 'contact-form-7-to-database-extension')) ?>"/> 
  1122. </div> 
  1123. <div> 
  1124. <div class="label_box"> 
  1125. <label for="filter_cntl"><?php echo htmlspecialchars(__('filter', 'contact-form-7-to-database-extension')) ?></label> 
  1126. <a target="_docs" href="http://cfdbplugin.com/?page_id=89#filter"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1127. </div> 
  1128. <select name="filter_bool" id="filter_bool"> 
  1129. <option value="&&">&&</option> 
  1130. <option value="||">||</option> 
  1131. </select> 
  1132. <select name="add_filter" id="add_filter"></select> 
  1133. <select name="filter_op" id="filter_op"> 
  1134. <option value="=">=</option> 
  1135. <option value="!=">!=</option> 
  1136. <option value=">">></option> 
  1137. <option value="<"><</option> 
  1138. <option value=">=">>=</option> 
  1139. <option value="<="><=</option> 
  1140. <option value="===">===</option> 
  1141. <option value="!==">!==</option> 
  1142. <option value="~~">~~</option> 
  1143. </select> 
  1144. <input name="filter_val" id="filter_val" type="text" size="20" placeholder="<?php echo htmlspecialchars(__('value', 'contact-form-7-to-database-extension')) ?>"/> 
  1145. <button id="btn_filter">»</button> 
  1146. <span id="span_validate_submit_time" style="display:none;"> 
  1147. <button id="btn_validate_submit_time"><?php echo htmlspecialchars(__('Validate submit_time', 'contact-form-7-to-database-extension')); ?></button> 
  1148. <a target="_blank" href="http://cfdbplugin.com/?page_id=553"><?php echo htmlspecialchars(__('Formats', 'contact-form-7-to-database-extension')); ?></a> 
  1149. </span> 
  1150. <br/> 
  1151. <input name="filter_cntl" id="filter_cntl" type="text" size="100" placeholder="<?php echo htmlspecialchars(__('filter expression', 'contact-form-7-to-database-extension')) ?>"/> 
  1152. </div> 
  1153. </div> 
  1154. <?php // LIMIT, ORDER BY, RANDOM ?> 
  1155. <div id="limitorder_div" class="shortcodeoptions"> 
  1156. <div> 
  1157. <div class="label_box"> 
  1158. <label for="limit_rows_cntl"><?php echo htmlspecialchars(__('limit', 'contact-form-7-to-database-extension')) ?></label> 
  1159. <a target="_docs" href="http://cfdbplugin.com/?page_id=89#limit"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1160. </div> 
  1161. <?php echo htmlspecialchars(__('Num Rows', 'contact-form-7-to-database-extension')); ?> <input name="limit_rows_cntl" id="limit_rows_cntl" type="text" size="10" placeholder="<?php echo htmlspecialchars(__('number', 'contact-form-7-to-database-extension')); ?>"/> 
  1162. <?php echo htmlspecialchars(__('Start Row (0)', 'contact-form-7-to-database-extension')); ?> <input name="limit_start_cntl" id="limit_start_cntl" type="text" size="10" placeholder="<?php echo htmlspecialchars(__('number', 'contact-form-7-to-database-extension')); ?>"/> 
  1163. </div> 
  1164. <div> 
  1165. <div class="label_box"> 
  1166. <label for="unbuffered_cntl"><?php echo htmlspecialchars(__('unbuffered', 'contact-form-7-to-database-extension')); ?></label> 
  1167. <a target="_docs" href="http://cfdbplugin.com/?p=696"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1168. <input id="unbuffered_cntl" type="checkbox" <?php echo $postedUnbuffered == 'true' ? 'checked' : ''?>/> 
  1169. </div> 
  1170. </div> 
  1171. <div> 
  1172. <div class="label_box"> 
  1173. <label for="random_cntl"><?php echo htmlspecialchars(__('random', 'contact-form-7-to-database-extension')) ?></label> 
  1174. <a target="_docs" href="http://cfdbplugin.com/?page_id=89#random"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1175. </div> 
  1176. <input name="random_cntl" id="random_cntl" type="text" size="10" placeholder="<?php echo htmlspecialchars(__('number', 'contact-form-7-to-database-extension')) ?>"/> 
  1177. </div> 
  1178. <div id="orderby_div"> 
  1179. <div class="label_box"> 
  1180. <label for="orderby_cntl"><?php echo htmlspecialchars(__('orderby', 'contact-form-7-to-database-extension')) ?></label> 
  1181. <a target="_docs" href="http://cfdbplugin.com/?page_id=89#orderby"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1182. </div> 
  1183. <select name="add_orderby" id="add_orderby"></select><button id="btn_orderby" placeholder="<?php echo htmlspecialchars(__('field', 'contact-form-7-to-database-extension')) ?>">»</button> 
  1184. <input name="orderby_cntl" id="orderby_cntl" type="text" size="100" placeholder="<?php echo htmlspecialchars(__('field1, field2, field3', 'contact-form-7-to-database-extension')) ?>"/> 
  1185. <select id="orderbydir_cntl" name="orderbydir_cntl"> 
  1186. <option value=""></option> 
  1187. <option value="ASC"><?php echo htmlspecialchars(__('ASC', 'contact-form-7-to-database-extension')) ?></option> 
  1188. <option value="DESC"><?php echo htmlspecialchars(__('DESC', 'contact-form-7-to-database-extension')) ?></option> 
  1189. </select> 
  1190. </div> 
  1191. </div> 
  1192. <?php // HEADERS ?> 
  1193. <div id="headers_div" class="shortcodeoptions"> 
  1194. <div><?php echo htmlspecialchars(__('Table Headers', 'contact-form-7-to-database-extension')); ?></div> 
  1195. <div> 
  1196. <div class="label_box"> 
  1197. <input id="header_cntl" type="checkbox" checked/> 
  1198. <label for="header_cntl"><?php echo htmlspecialchars(__('Include Header Row', 'contact-form-7-to-database-extension')); ?></label> 
  1199. </div> 
  1200. </div> 
  1201. <div> 
  1202. <div class="label_box"> 
  1203. <label for="headers_cntl"><?php echo htmlspecialchars(__('headers', 'contact-form-7-to-database-extension')); ?></label> 
  1204. <a target="_docs" href="http://cfdbplugin.com/?page_id=93#headers"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1205. </div> 
  1206. <select name="add_headers" id="add_headers"></select> 
  1207. <?php echo htmlspecialchars(__('display as', 'contact-form-7-to-database-extension')); ?> 
  1208. <input name="headers_val" id="headers_val" type="text" size="20" placeholder="<?php echo htmlspecialchars(__('display value', 'contact-form-7-to-database-extension')); ?>"/> 
  1209. <button id="btn_headers">»</button> 
  1210. <br/> 
  1211. <input name="headers_cntl" id="headers_cntl" type="text" size="100" placeholder="<?php echo htmlspecialchars(__('field1=Display Name 1, field2=Display Name 2', 'contact-form-7-to-database-extension')); ?>"/> 
  1212. </div> 
  1213. </div> 
  1214. <?php // ID, CLASS, STYLE ?> 
  1215. <div id="html_format_div" class="shortcodeoptions"> 
  1216. <div><?php echo htmlspecialchars(__('HTML Table Formatting', 'contact-form-7-to-database-extension')); ?></div> 
  1217. <div> 
  1218. <div class="label_box"> 
  1219. <label for="id_cntl"><?php echo htmlspecialchars(__('id', 'contact-form-7-to-database-extension')); ?></label> 
  1220. <a target="_docs" href="http://cfdbplugin.com/?page_id=93#id"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1221. </div> 
  1222. <input name="id_cntl" id="id_cntl" type="text" size="10" placeholder="<?php echo htmlspecialchars(__('HTML id', 'contact-form-7-to-database-extension')); ?>"/> 
  1223. </div> 
  1224. <div> 
  1225. <div class="label_box"> 
  1226. <label for="class_cntl"><?php echo htmlspecialchars(__('class', 'contact-form-7-to-database-extension')); ?></label> 
  1227. <a target="_docs" href="http://cfdbplugin.com/?page_id=93#class"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1228. </div> 
  1229. <input name="class_cntl" id="class_cntl" type="text" size="10" placeholder="<?php echo htmlspecialchars(__('HTML class', 'contact-form-7-to-database-extension')); ?>"/> 
  1230. </div> 
  1231. <div> 
  1232. <div class="label_box"> 
  1233. <label for="style_cntl"><?php echo htmlspecialchars(__('style', 'contact-form-7-to-database-extension')); ?></label> 
  1234. <a target="_docs" href="http://cfdbplugin.com/?page_id=93#style"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1235. </div> 
  1236. <input name="style_cntl" id="style_cntl" type="text" size="100" placeholder="<?php echo htmlspecialchars(__('CSS style', 'contact-form-7-to-database-extension')); ?>"/> 
  1237. </div> 
  1238. </div> 
  1239. <?php // DT_OPTIONS ?> 
  1240. <div id="dt_options_div" class="shortcodeoptions"> 
  1241. <div><?php echo htmlspecialchars(__('[cfdb-datatable] Options', 'contact-form-7-to-database-extension')); ?></div> 
  1242. <div id="edit_mode_div"> 
  1243. <div class="label_box"> 
  1244. <label for="edit_mode_cntl"><?php echo htmlspecialchars(__('edit', 'contact-form-7-to-database-extension')); ?></label> 
  1245. <a target="_docs" href="http://cfdbplugin.com/?page_id=91#edit"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1246. </div> 
  1247. <select id="edit_mode_cntl" name="edit_mode_cntl"> 
  1248. <option value=""></option> 
  1249. <option value="true"><?php echo htmlspecialchars(__('true', 'contact-form-7-to-database-extension')); ?></option> 
  1250. <option value="cells"><?php echo htmlspecialchars(__('cells', 'contact-form-7-to-database-extension')); ?></option> 
  1251. </select> 
  1252. </div> 
  1253. <div> 
  1254. <div class="label_box"> 
  1255. <label for="dt_options_cntl"><?php echo htmlspecialchars(__('dt_options', 'contact-form-7-to-database-extension')) ?></label> 
  1256. <a target="_docs" href="http://cfdbplugin.com/?page_id=91#dt_options"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1257. </div> 
  1258. <input name="dt_options_cntl" id="dt_options_cntl" type="text" size="100" placeholder="<?php echo htmlspecialchars(__('datatable options (JSON)', 'contact-form-7-to-database-extension')) ?>"/> 
  1259. </div> 
  1260. </div> 
  1261. <?php // JSON VAR, FORMAT ?> 
  1262. <div id="json_div" class="shortcodeoptions"> 
  1263. <div><?php echo htmlspecialchars(__('[cfdb-json] Options', 'contact-form-7-to-database-extension')); ?></div> 
  1264. <div> 
  1265. <div class="label_box"> 
  1266. <label for="var_cntl"><?php echo htmlspecialchars(__('var', 'contact-form-7-to-database-extension')) ?></label> 
  1267. <a target="_docs" href="http://cfdbplugin.com/?page_id=96#var"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1268. </div> 
  1269. <input name="var_cntl" id="var_cntl" type="text" size="10" placeholder="<?php echo htmlspecialchars(__('JS var name', 'contact-form-7-to-database-extension')) ?>"/> 
  1270. </div> 
  1271. <div> 
  1272. <div class="label_box"> 
  1273. <label for="format_cntl"><?php echo htmlspecialchars(__('format', 'contact-form-7-to-database-extension')) ?></label> 
  1274. <a target="_docs" href="http://cfdbplugin.com/?page_id=96#format"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1275. </div> 
  1276. <select id="format_cntl" name="format_cntl"> 
  1277. <option value=""></option> 
  1278. <option value="map"><?php echo htmlspecialchars(__('map', 'contact-form-7-to-database-extension')) ?></option> 
  1279. <option value="array"><?php echo htmlspecialchars(__('array', 'contact-form-7-to-database-extension')) ?></option> 
  1280. <option value="arraynoheader"><?php echo htmlspecialchars(__('arraynoheader', 'contact-form-7-to-database-extension')) ?></option> 
  1281. </select> 
  1282. </div> 
  1283. </div> 
  1284. <?php // VALUE FUNCTION, DELIMITER ?> 
  1285. <div id="value_div" class="shortcodeoptions"> 
  1286. <div><?php echo htmlspecialchars(__('[cfdb-value] Options', 'contact-form-7-to-database-extension')); ?></div> 
  1287. <div> 
  1288. <div class="label_box"> 
  1289. <label for="function_cntl"><?php echo htmlspecialchars(__('function', 'contact-form-7-to-database-extension')) ?></label> 
  1290. <a target="_docs" href="http://cfdbplugin.com/?page_id=98#function"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1291. </div> 
  1292. <select id="function_cntl" name="function_cntl"> 
  1293. <option value=""></option> 
  1294. <option value="min"><?php echo htmlspecialchars(__('min', 'contact-form-7-to-database-extension')) ?></option> 
  1295. <option value="max"><?php echo htmlspecialchars(__('max', 'contact-form-7-to-database-extension')) ?></option> 
  1296. <option value="sum"><?php echo htmlspecialchars(__('sum', 'contact-form-7-to-database-extension')) ?></option> 
  1297. <option value="mean"><?php echo htmlspecialchars(__('mean', 'contact-form-7-to-database-extension')) ?></option> 
  1298. <option value="percent"><?php echo htmlspecialchars(__('percent', 'contact-form-7-to-database-extension')) ?></option> 
  1299. </select> 
  1300. </div> 
  1301. <div> 
  1302. <div class="label_box"> 
  1303. <label for="delimiter_cntl"><?php echo htmlspecialchars(__('delimiter', 'contact-form-7-to-database-extension')) ?></label> 
  1304. <a target="_docs" href="http://cfdbplugin.com/?page_id=98#delimiter"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1305. </div> 
  1306. <input name="delimiter_cntl" id="delimiter_cntl" type="text" size="10"/> 
  1307. </div> 
  1308. </div> 
  1309. <?php // HTML TEMPLATE ?> 
  1310. <div id="template_div" class="shortcodeoptions"> 
  1311. <div><?php echo htmlspecialchars(__('[cfdb-html] Options', 'contact-form-7-to-database-extension')); ?></div> 
  1312. <div> 
  1313. <div class="label_box"> 
  1314. <label for="filelinks_cntl"><?php echo htmlspecialchars(__('filelinks', 'contact-form-7-to-database-extension')) ?></label> 
  1315. <a target="_docs" href="http://cfdbplugin.com/?page_id=284#filelinks"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1316. </div> 
  1317. <select id="filelinks_cntl" name="filelinks_cntl"> 
  1318. <option value=""></option> 
  1319. <option value="url"><?php echo htmlspecialchars(__('url', 'contact-form-7-to-database-extension')) ?></option> 
  1320. <option value="name"><?php echo htmlspecialchars(__('name', 'contact-form-7-to-database-extension')) ?></option> 
  1321. <option value="link"><?php echo htmlspecialchars(__('link', 'contact-form-7-to-database-extension')) ?></option> 
  1322. <option value="img"><?php echo htmlspecialchars(__('img', 'contact-form-7-to-database-extension')) ?></option> 
  1323. </select> 
  1324. <div class="label_box"> 
  1325. <label for="stripbr_cntl"><?php echo htmlspecialchars(__('stripbr', 'contact-form-7-to-database-extension')) ?></label> 
  1326. <a target="_docs" href="http://cfdbplugin.com/?page_id=284#stripbr"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1327. </div> 
  1328. <select id="stripbr_cntl" name="stripbr_cntl"> 
  1329. <option value=""></option> 
  1330. <option value="false"><?php echo htmlspecialchars(__('false', 'contact-form-7-to-database-extension')) ?></option> 
  1331. <option value="true"><?php echo htmlspecialchars(__('true', 'contact-form-7-to-database-extension')) ?></option> 
  1332. </select> 
  1333. <div class="label_box"> 
  1334. <label for="wpautop_cntl" style="text-decoration:line-through;"><?php echo htmlspecialchars(__('wpautop', 'contact-form-7-to-database-extension')) ?></label> 
  1335. <a target="_docs" href="http://cfdbplugin.com/?page_id=284#wpautop"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1336. </div> 
  1337. <select id="wpautop_cntl" name="wpautop_cntl"> 
  1338. <option value=""></option> 
  1339. <option value="false"><?php echo htmlspecialchars(__('false', 'contact-form-7-to-database-extension')) ?></option> 
  1340. <option value="true"><?php echo htmlspecialchars(__('true', 'contact-form-7-to-database-extension')) ?></option> 
  1341. </select> 
  1342. </div> 
  1343. <div> 
  1344. <div class="label_box"> 
  1345. <label for="content_cntl"><?php echo htmlspecialchars(__('Template', 'contact-form-7-to-database-extension')) ?></label> 
  1346. <a target="_docs" href="http://cfdbplugin.com/?page_id=284#template"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1347. </div> 
  1348. <select name="add_content" id="add_content"></select><button id="btn_content">»</button><br/> 
  1349. <textarea name="content_cntl" id="content_cntl" cols="100" rows="10" placeholder="<?php echo htmlspecialchars(__('Per-entry HTML using ${field name} variables', 'contact-form-7-to-database-extension')); ?>"></textarea> 
  1350. </div> 
  1351. </div> 
  1352. <?php // URL ENC, URL_ONLY LINK_TEXT ?> 
  1353. <div id="url_link_div" class="shortcodeoptions"> 
  1354. <div><?php echo htmlspecialchars(__('[cfdb-export-link] Options', 'contact-form-7-to-database-extension')); ?></div> 
  1355. <div> 
  1356. <div class="label_box"> 
  1357. <label for="enc_cntl"><?php echo htmlspecialchars(__('enc', 'contact-form-7-to-database-extension')); ?></label> 
  1358. <a target="_docs" href="http://cfdbplugin.com/?page_id=419"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1359. </div> 
  1360. <select id="enc_cntl" name="enc_cntl"> 
  1361. <option value=""></option> 
  1362. <option id="CSVUTF8BOM" value="CSVUTF8BOM"> 
  1363. <?php echo htmlspecialchars(__('Excel CSV (UTF8-BOM)', 'contact-form-7-to-database-extension'));; ?> 
  1364. </option> 
  1365. <option id="TSVUTF16LEBOM" value="TSVUTF16LEBOM"> 
  1366. <?php echo htmlspecialchars(__('Excel TSV (UTF16LE-BOM)', 'contact-form-7-to-database-extension')); ?> 
  1367. </option> 
  1368. <option id="CSVUTF8" value="CSVUTF8"> 
  1369. <?php echo htmlspecialchars(__('Plain CSV (UTF-8)', 'contact-form-7-to-database-extension')); ?> 
  1370. </option> 
  1371. <option value="CSVSJIS"> 
  1372. <?php echo htmlspecialchars(__('Excel CSV for Japanese (Shift-JIS)', 'contact-form-7-to-database-extension')); ?> 
  1373. </option> 
  1374. <option id="IQY" value="IQY"> 
  1375. <?php echo htmlspecialchars(__('Excel Internet Query', 'contact-form-7-to-database-extension')); ?> 
  1376. </option> 
  1377. </select> 
  1378. </div> 
  1379. <div> 
  1380. <div class="label_box"> 
  1381. <label for="urlonly_cntl"><?php echo htmlspecialchars(__('urlonly', 'contact-form-7-to-database-extension')); ?></label> 
  1382. <a target="_docs" href="http://cfdbplugin.com/?page_id=419#urlonly"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1383. </div> 
  1384. <select id="urlonly_cntl" name="urlonly_cntl"> 
  1385. <option value=""></option> 
  1386. <option value="true"><?php echo htmlspecialchars(__('true', 'contact-form-7-to-database-extension')); ?></option> 
  1387. <option value="false"><?php echo htmlspecialchars(__('false', 'contact-form-7-to-database-extension')); ?></option> 
  1388. </select> 
  1389. </div> 
  1390. <div> 
  1391. <div class="label_box"> 
  1392. <label for="linktext_cntl"><?php echo htmlspecialchars(__('linktext', 'contact-form-7-to-database-extension')); ?></label> 
  1393. <a target="_docs" href="http://cfdbplugin.com/?page_id=419#linktext"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1394. </div> 
  1395. <input name="linktext_cntl" id="linktext_cntl" type="text" size="30"/> 
  1396. </div> 
  1397. </div> 
  1398. <?php // BEFORE and AFTER ?> 
  1399. <div id="beforeafter_div" class="shortcodeoptions"> 
  1400. <div> 
  1401. <div class="label_box"> 
  1402. <label for="before_cntl"><?php echo htmlspecialchars(__('Before', 'contact-form-7-to-database-extension')); ?></label> 
  1403. <a target="_docs" href="http://cfdbplugin.com/?page_id=284#before"><img alt="?" src="<?php echo $infoImg ?>"/></a><br/> 
  1404. </div> 
  1405. <br/> 
  1406. <textarea name="before_cntl" id="before_cntl" cols="100" rows="5" placeholder="<?php echo htmlspecialchars(__('Optional HTML/Javascript before the short code output', 'contact-form-7-to-database-extension')); ?>"></textarea> 
  1407. </div> 
  1408. <div> 
  1409. <div class="label_box"> 
  1410. <label for="after_cntl"><?php echo htmlspecialchars(__('After', 'contact-form-7-to-database-extension')); ?></label> 
  1411. <a target="_docs" href="http://cfdbplugin.com/?page_id=284#after"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1412. </div> 
  1413. <br/> 
  1414. <textarea name="after_cntl" id="after_cntl" cols="100" rows="5" placeholder="<?php echo htmlspecialchars(__('Optional HTML/Javascript after the short code output', 'contact-form-7-to-database-extension')); ?>"></textarea> 
  1415. </div> 
  1416. </div> 
  1417. <?php // TRANS ?> 
  1418. <div id="trans_div" class="shortcodeoptions"> 
  1419. <?php echo htmlspecialchars(__('Transform', 'contact-form-7-to-database-extension')); ?> 
  1420. <div> 
  1421. <div class="label_box"> 
  1422. <label for="trans_cntl"><?php echo htmlspecialchars(__('trans', 'contact-form-7-to-database-extension')) ?></label> 
  1423. <a target="_docs" href="http://cfdbplugin.com/?page_id=1118#trans"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1424. </div> 
  1425. <select name="add_trans" id="add_trans"></select> 
  1426. <input name="trans_val" id="trans_val" type="text" size="20" placeholder="<?php echo htmlspecialchars(__('PHP function or class', 'contact-form-7-to-database-extension')) ?>"/> 
  1427. <button id="btn_trans">»</button> 
  1428. <br/> 
  1429. <input name="trans_cntl" id="trans_cntl" type="text" size="100" placeholder="<?php echo htmlspecialchars(__('transform expression', 'contact-form-7-to-database-extension')) ?>"/> 
  1430. </div> 
  1431. <div> 
  1432. <div class="label_box"> 
  1433. <label for="tsearch_cntl"><?php echo htmlspecialchars(__('tsearch', 'contact-form-7-to-database-extension')) ?></label> 
  1434. <a target="_docs" href="http://cfdbplugin.com/?page_id=1118#tsearch"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1435. </div> 
  1436. <input name="tsearch_cntl" id="tsearch_cntl" type="text" size="30" placeholder="<?php echo htmlspecialchars(__('search text', 'contact-form-7-to-database-extension')) ?>"/> 
  1437. </div> 
  1438. <div> 
  1439. <div class="label_box"> 
  1440. <label for="tfilter_cntl"><?php echo htmlspecialchars(__('tfilter', 'contact-form-7-to-database-extension')) ?></label> 
  1441. <a target="_docs" href="http://cfdbplugin.com/?page_id=1118#tfilter"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1442. </div> 
  1443. <select name="tfilter_bool" id="tfilter_bool"> 
  1444. <option value="&&">&&</option> 
  1445. <option value="||">||</option> 
  1446. </select> 
  1447. <select name="add_tfilter" id="add_tfilter"></select> 
  1448. <select name="tfilter_op" id="tfilter_op"> 
  1449. <option value="=">=</option> 
  1450. <option value="!=">!=</option> 
  1451. <option value=">">></option> 
  1452. <option value="<"><</option> 
  1453. <option value=">=">>=</option> 
  1454. <option value="<="><=</option> 
  1455. <option value="===">===</option> 
  1456. <option value="!==">!==</option> 
  1457. <option value="~~">~~</option> 
  1458. </select> 
  1459. <input name="tfilter_val" id="tfilter_val" type="text" size="20" placeholder="<?php echo htmlspecialchars(__('value', 'contact-form-7-to-database-extension')) ?>"/> 
  1460. <button id="btn_tfilter">»</button> 
  1461. <span id="span_validate_submit_time" style="display:none;"> 
  1462. <button id="btn_validate_submit_time"><?php echo htmlspecialchars(__('Validate submit_time', 'contact-form-7-to-database-extension')); ?></button> 
  1463. <a target="_blank" href="http://cfdbplugin.com/?page_id=553"><?php echo htmlspecialchars(__('Formats', 'contact-form-7-to-database-extension')); ?></a> 
  1464. </span> 
  1465. <br/> 
  1466. <input name="tfilter_cntl" id="tfilter_cntl" type="text" size="100" placeholder="<?php echo htmlspecialchars(__('filter expression', 'contact-form-7-to-database-extension')) ?>"/> 
  1467. </div> 
  1468. <div> 
  1469. <div class="label_box"> 
  1470. <label for="tlimit_rows_cntl"><?php echo htmlspecialchars(__('tlimit', 'contact-form-7-to-database-extension')) ?></label> 
  1471. <a target="_docs" href="http://cfdbplugin.com/?page_id=1118#tlimit"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1472. </div> 
  1473. <?php echo htmlspecialchars(__('Num Rows', 'contact-form-7-to-database-extension')) ?> <input name="tlimit_rows_cntl" id="tlimit_rows_cntl" type="text" size="10" placeholder="<?php echo htmlspecialchars(__('number', 'contact-form-7-to-database-extension')) ?>"/> 
  1474. <?php echo htmlspecialchars(__('Start Row (0)', 'contact-form-7-to-database-extension')) ?> <input name="tlimit_start_cntl" id="tlimit_start_cntl" type="text" size="10" placeholder="<?php echo htmlspecialchars(__('number', 'contact-form-7-to-database-extension')) ?>"/> 
  1475. </div> 
  1476. <div id="torderby_div"> 
  1477. <div class="label_box"> 
  1478. <label for="torderby_cntl"><?php echo htmlspecialchars(__('torderby', 'contact-form-7-to-database-extension')) ?></label> 
  1479. <a target="_docs" href="http://cfdbplugin.com/?page_id=1118#torderby"><img alt="?" src="<?php echo $infoImg ?>"/></a> 
  1480. </div> 
  1481. <select name="add_torderby" id="add_torderby"></select><button id="btn_torderby" placeholder="<?php echo htmlspecialchars(__('field', 'contact-form-7-to-database-extension')) ?>">»</button> 
  1482. <input name="torderby_cntl" id="torderby_cntl" type="text" size="100" placeholder="<?php echo htmlspecialchars(__('field1, field2, field3', 'contact-form-7-to-database-extension')) ?>"/> 
  1483. <select id="torderbydir_cntl" name="torderbydir_cntl"> 
  1484. <option value=""></option> 
  1485. <option value="ASC"><?php echo htmlspecialchars(__('ASC', 'contact-form-7-to-database-extension')) ?></option> 
  1486. <option value="DESC"><?php echo htmlspecialchars(__('DESC', 'contact-form-7-to-database-extension')) ?></option> 
  1487. </select> 
  1488. </div> 
  1489. </div> 
  1490. <?php 
  1491.