preserved.php 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349
  1. <?php return array (
  2. '953f6b6ddd51950efd5d388d77eb9b75' =>
  3. array (
  4. 'criteria' =>
  5. array (
  6. 'name' => 'formit',
  7. ),
  8. 'object' =>
  9. array (
  10. 'name' => 'formit',
  11. 'path' => '{core_path}components/formit/',
  12. 'assets_path' => '{assets_path}components/formit/',
  13. ),
  14. ),
  15. 'b69690504bae45da58159b70d2f92ad5' =>
  16. array (
  17. 'criteria' =>
  18. array (
  19. 'key' => 'formit.recaptcha_public_key',
  20. ),
  21. 'object' =>
  22. array (
  23. 'key' => 'formit.recaptcha_public_key',
  24. 'value' => '',
  25. 'xtype' => 'textfield',
  26. 'namespace' => 'formit',
  27. 'area' => 'recaptcha',
  28. 'editedon' => NULL,
  29. ),
  30. ),
  31. '22bc14e9b588fb2d7f1bf83573d6c072' =>
  32. array (
  33. 'criteria' =>
  34. array (
  35. 'key' => 'formit.recaptcha_private_key',
  36. ),
  37. 'object' =>
  38. array (
  39. 'key' => 'formit.recaptcha_private_key',
  40. 'value' => '',
  41. 'xtype' => 'textfield',
  42. 'namespace' => 'formit',
  43. 'area' => 'recaptcha',
  44. 'editedon' => NULL,
  45. ),
  46. ),
  47. 'cdd985cea073ccf0fe49b3d5f72b9458' =>
  48. array (
  49. 'criteria' =>
  50. array (
  51. 'key' => 'formit.recaptcha_use_ssl',
  52. ),
  53. 'object' =>
  54. array (
  55. 'key' => 'formit.recaptcha_use_ssl',
  56. 'value' => '0',
  57. 'xtype' => 'combo-boolean',
  58. 'namespace' => 'formit',
  59. 'area' => 'recaptcha',
  60. 'editedon' => NULL,
  61. ),
  62. ),
  63. '5bb5615d3f9741afc5097a651debd6e6' =>
  64. array (
  65. 'criteria' =>
  66. array (
  67. 'key' => 'formit.exclude_contexts',
  68. ),
  69. 'object' =>
  70. array (
  71. 'key' => 'formit.exclude_contexts',
  72. 'value' => 'mgr',
  73. 'xtype' => 'combo-boolean',
  74. 'namespace' => 'formit',
  75. 'area' => 'system',
  76. 'editedon' => NULL,
  77. ),
  78. ),
  79. '72a8c40fd433a10392bb95112668e7f5' =>
  80. array (
  81. 'criteria' =>
  82. array (
  83. 'key' => 'formit.form_encryptkey',
  84. ),
  85. 'object' =>
  86. array (
  87. 'key' => 'formit.form_encryptkey',
  88. 'value' => 'modx5a09f5d5d6a2e3.05406325',
  89. 'xtype' => 'textfield',
  90. 'namespace' => 'formit',
  91. 'area' => 'system',
  92. 'editedon' => '2017-11-14 09:06:08',
  93. ),
  94. ),
  95. '7131aac09c140e180fda4dcc040970bb' =>
  96. array (
  97. 'criteria' =>
  98. array (
  99. 'key' => 'formit.attachment.mediasource',
  100. ),
  101. 'object' =>
  102. array (
  103. 'key' => 'formit.attachment.mediasource',
  104. 'value' => '1',
  105. 'xtype' => 'modx-combo-source',
  106. 'namespace' => 'formit',
  107. 'area' => 'system',
  108. 'editedon' => NULL,
  109. ),
  110. ),
  111. '529c89cddd633d3c151804befc3e3f68' =>
  112. array (
  113. 'criteria' =>
  114. array (
  115. 'key' => 'formit.attachment.path',
  116. ),
  117. 'object' =>
  118. array (
  119. 'key' => 'formit.attachment.path',
  120. 'value' => '',
  121. 'xtype' => 'textfield',
  122. 'namespace' => 'formit',
  123. 'area' => 'system',
  124. 'editedon' => NULL,
  125. ),
  126. ),
  127. 'ca5c41a8b87dee7c087f044f3ac55b09' =>
  128. array (
  129. 'criteria' =>
  130. array (
  131. 'key' => 'formit.cleanform.days',
  132. ),
  133. 'object' =>
  134. array (
  135. 'key' => 'formit.cleanform.days',
  136. 'value' => '30',
  137. 'xtype' => 'numberfield',
  138. 'namespace' => 'formit',
  139. 'area' => 'system',
  140. 'editedon' => NULL,
  141. ),
  142. ),
  143. '885975c2b25d331b2033bbb1e8c92746' =>
  144. array (
  145. 'criteria' =>
  146. array (
  147. 'category' => 'FormIt',
  148. ),
  149. 'object' =>
  150. array (
  151. 'id' => 8,
  152. 'parent' => 0,
  153. 'category' => 'FormIt',
  154. 'rank' => 0,
  155. ),
  156. ),
  157. '0ddd3d104cf9a53e7f52cec04f3bb06a' =>
  158. array (
  159. 'criteria' =>
  160. array (
  161. 'name' => 'fiDefaultEmailTpl',
  162. ),
  163. 'object' =>
  164. array (
  165. 'id' => 34,
  166. 'source' => 0,
  167. 'property_preprocess' => 0,
  168. 'name' => 'fiDefaultEmailTpl',
  169. 'description' => 'The default chunk used for the email. Please do not edit this chunk, as this will be overwritten when updating FormIt.',
  170. 'editor_type' => 0,
  171. 'category' => 8,
  172. 'cache_type' => 0,
  173. 'snippet' => '<p>[[+fields]]</p>',
  174. 'locked' => 0,
  175. 'properties' => 'a:0:{}',
  176. 'static' => 0,
  177. 'static_file' => '',
  178. 'content' => '<p>[[+fields]]</p>',
  179. ),
  180. ),
  181. 'a6f082dd377ea74369ccc8050ac0b5dd' =>
  182. array (
  183. 'criteria' =>
  184. array (
  185. 'name' => 'fiDefaultFiarTpl',
  186. ),
  187. 'object' =>
  188. array (
  189. 'id' => 35,
  190. 'source' => 0,
  191. 'property_preprocess' => 0,
  192. 'name' => 'fiDefaultFiarTpl',
  193. 'description' => 'The default chunk used for the autoresponder email. Please do not edit this chunk, as this will be overwritten when updating FormIt.',
  194. 'editor_type' => 0,
  195. 'category' => 8,
  196. 'cache_type' => 0,
  197. 'snippet' => '<p>Hello [[+name]],</p>
  198. <p>Your message has been received. We will respond as soon as possible. Thank you for contacting us.</p>
  199. <p>NOTE: This is an automatic response; please do not respond to this message directly.</p>
  200. <p>Here is your message:<br />
  201. [[+message:nl2br]]</p>',
  202. 'locked' => 0,
  203. 'properties' => 'a:0:{}',
  204. 'static' => 0,
  205. 'static_file' => '',
  206. 'content' => '<p>Hello [[+name]],</p>
  207. <p>Your message has been received. We will respond as soon as possible. Thank you for contacting us.</p>
  208. <p>NOTE: This is an automatic response; please do not respond to this message directly.</p>
  209. <p>Here is your message:<br />
  210. [[+message:nl2br]]</p>',
  211. ),
  212. ),
  213. '170983ba9c8cf49caf30ec0f4ce288d6' =>
  214. array (
  215. 'criteria' =>
  216. array (
  217. 'name' => 'fiDefaultOptGroupTpl',
  218. ),
  219. 'object' =>
  220. array (
  221. 'id' => 36,
  222. 'source' => 0,
  223. 'property_preprocess' => 0,
  224. 'name' => 'fiDefaultOptGroupTpl',
  225. 'description' => 'The default chunk used by the FormItCountryOptions snippet for the select optgroup. Please do not edit this chunk, as this will be overwritten when updating FormIt.',
  226. 'editor_type' => 0,
  227. 'category' => 8,
  228. 'cache_type' => 0,
  229. 'snippet' => '<optgroup label="[[+text]]">
  230. [[+options]]
  231. </optgroup>',
  232. 'locked' => 0,
  233. 'properties' => 'a:0:{}',
  234. 'static' => 0,
  235. 'static_file' => '',
  236. 'content' => '<optgroup label="[[+text]]">
  237. [[+options]]
  238. </optgroup>',
  239. ),
  240. ),
  241. '3e3f695aba261d17003dacf18383a22e' =>
  242. array (
  243. 'criteria' =>
  244. array (
  245. 'name' => 'fiDefaultOptionTpl',
  246. ),
  247. 'object' =>
  248. array (
  249. 'id' => 37,
  250. 'source' => 0,
  251. 'property_preprocess' => 0,
  252. 'name' => 'fiDefaultOptionTpl',
  253. 'description' => 'The default chunk used by the FormItCountryOptions snippet for the select option. Please do not edit this chunk, as this will be overwritten when updating FormIt.',
  254. 'editor_type' => 0,
  255. 'category' => 8,
  256. 'cache_type' => 0,
  257. 'snippet' => '<option value="[[+value]]"[[+selected]]>[[+text]]</option>',
  258. 'locked' => 0,
  259. 'properties' => 'a:0:{}',
  260. 'static' => 0,
  261. 'static_file' => '',
  262. 'content' => '<option value="[[+value]]"[[+selected]]>[[+text]]</option>',
  263. ),
  264. ),
  265. '238047d2eb40c9ffa29dcfdf8c3e00b9' =>
  266. array (
  267. 'criteria' =>
  268. array (
  269. 'name' => 'FormIt',
  270. ),
  271. 'object' =>
  272. array (
  273. 'id' => 16,
  274. 'source' => 0,
  275. 'property_preprocess' => 0,
  276. 'name' => 'FormIt',
  277. 'description' => 'A dynamic form processing snippet.',
  278. 'editor_type' => 0,
  279. 'category' => 8,
  280. 'cache_type' => 0,
  281. 'snippet' => '/**
  282. * FormIt
  283. *
  284. * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
  285. *
  286. * FormIt is free software; you can redistribute it and/or modify it
  287. * under the terms of the GNU General Public License as published by the Free
  288. * Software Foundation; either version 2 of the License, or (at your option) any
  289. * later version.
  290. *
  291. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  292. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  293. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  294. *
  295. * You should have received a copy of the GNU General Public License along with
  296. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  297. * Suite 330, Boston, MA 02111-1307 USA
  298. *
  299. * @package formit
  300. */
  301. /**
  302. * FormIt
  303. *
  304. * A dynamic form processing Snippet for MODx Revolution.
  305. *
  306. * @var modX $modx
  307. * @var array $scriptProperties
  308. *
  309. * @package formit
  310. */
  311. $modelPath = $modx->getOption(
  312. \'formit.core_path\',
  313. null,
  314. $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/formit/\'
  315. ) . \'model/formit/\';
  316. $modx->loadClass(\'FormIt\', $modelPath, true, true);
  317. $fi = new FormIt($modx, $scriptProperties);
  318. $fi->initialize($modx->context->get(\'key\'));
  319. $fi->loadRequest();
  320. $fields = $fi->request->prepare();
  321. return $fi->request->handle($fields);',
  322. 'locked' => 0,
  323. 'properties' => 'a:61:{s:5:"hooks";a:7:{s:4:"name";s:5:"hooks";s:4:"desc";s:22:"prop_formit.hooks_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:8:"preHooks";a:7:{s:4:"name";s:8:"preHooks";s:4:"desc";s:25:"prop_formit.prehooks_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:9:"submitVar";a:7:{s:4:"name";s:9:"submitVar";s:4:"desc";s:26:"prop_formit.submitvar_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:8:"validate";a:7:{s:4:"name";s:8:"validate";s:4:"desc";s:25:"prop_formit.validate_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:6:"errTpl";a:7:{s:4:"name";s:6:"errTpl";s:4:"desc";s:23:"prop_formit.errtpl_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:37:"<span class="error">[[+error]]</span>";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:22:"validationErrorMessage";a:7:{s:4:"name";s:22:"validationErrorMessage";s:4:"desc";s:39:"prop_formit.validationerrormessage_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:96:"<p class="error">A form validation error occurred. Please check the values you have entered.</p>";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:22:"validationErrorBulkTpl";a:7:{s:4:"name";s:22:"validationErrorBulkTpl";s:4:"desc";s:39:"prop_formit.validationerrorbulktpl_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:19:"<li>[[+error]]</li>";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:26:"trimValuesBeforeValidation";a:7:{s:4:"name";s:26:"trimValuesBeforeValidation";s:4:"desc";s:43:"prop_formit.trimvaluesdeforevalidation_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:1;s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:16:"customValidators";a:7:{s:4:"name";s:16:"customValidators";s:4:"desc";s:33:"prop_formit.customvalidators_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:20:"clearFieldsOnSuccess";a:7:{s:4:"name";s:20:"clearFieldsOnSuccess";s:4:"desc";s:37:"prop_formit.clearfieldsonsuccess_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:1;s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:14:"successMessage";a:7:{s:4:"name";s:14:"successMessage";s:4:"desc";s:31:"prop_formit.successmessage_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:25:"successMessagePlaceholder";a:7:{s:4:"name";s:25:"successMessagePlaceholder";s:4:"desc";s:42:"prop_formit.successmessageplaceholder_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:17:"fi.successMessage";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:5:"store";a:7:{s:4:"name";s:5:"store";s:4:"desc";s:22:"prop_formit.store_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:0;s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:17:"placeholderPrefix";a:7:{s:4:"name";s:17:"placeholderPrefix";s:4:"desc";s:34:"prop_formit.placeholderprefix_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:3:"fi.";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:9:"storeTime";a:7:{s:4:"name";s:9:"storeTime";s:4:"desc";s:26:"prop_formit.storetime_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:3:"300";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:13:"storeLocation";a:7:{s:4:"name";s:13:"storeLocation";s:4:"desc";s:30:"prop_formit.storelocation_desc";s:4:"type";s:4:"list";s:7:"options";a:2:{i:0;a:2:{s:5:"value";s:5:"cache";s:4:"text";s:16:"formit.opt_cache";}i:1;a:2:{s:5:"value";s:7:"session";s:4:"text";s:18:"formit.opt_session";}}s:5:"value";s:5:"cache";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:10:"allowFiles";a:7:{s:4:"name";s:10:"allowFiles";s:4:"desc";s:27:"prop_formit.allowfiles_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:1;s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:15:"spamEmailFields";a:7:{s:4:"name";s:15:"spamEmailFields";s:4:"desc";s:32:"prop_formit.spamemailfields_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:5:"email";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:11:"spamCheckIp";a:7:{s:4:"name";s:11:"spamCheckIp";s:4:"desc";s:28:"prop_formit.spamcheckip_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:0;s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:11:"recaptchaJs";a:7:{s:4:"name";s:11:"recaptchaJs";s:4:"desc";s:28:"prop_formit.recaptchajs_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:2:"{}";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:14:"recaptchaTheme";a:7:{s:4:"name";s:14:"recaptchaTheme";s:4:"desc";s:31:"prop_formit.recaptchatheme_desc";s:4:"type";s:4:"list";s:7:"options";a:4:{i:0;a:2:{s:5:"value";s:3:"red";s:4:"text";s:14:"formit.opt_red";}i:1;a:2:{s:5:"value";s:5:"white";s:4:"text";s:16:"formit.opt_white";}i:2;a:2:{s:5:"value";s:5:"clean";s:4:"text";s:16:"formit.opt_clean";}i:3;a:2:{s:5:"value";s:10:"blackglass";s:4:"text";s:21:"formit.opt_blackglass";}}s:5:"value";s:5:"clean";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:10:"redirectTo";a:7:{s:4:"name";s:10:"redirectTo";s:4:"desc";s:27:"prop_formit.redirectto_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:14:"redirectParams";a:7:{s:4:"name";s:14:"redirectParams";s:4:"desc";s:31:"prop_formit.redirectparams_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:7:"emailTo";a:7:{s:4:"name";s:7:"emailTo";s:4:"desc";s:24:"prop_formit.emailto_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:11:"emailToName";a:7:{s:4:"name";s:11:"emailToName";s:4:"desc";s:28:"prop_formit.emailtoname_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:9:"emailFrom";a:7:{s:4:"name";s:9:"emailFrom";s:4:"desc";s:26:"prop_formit.emailfrom_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:13:"emailFromName";a:7:{s:4:"name";s:13:"emailFromName";s:4:"desc";s:30:"prop_formit.emailfromname_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:12:"emailReplyTo";a:7:{s:4:"name";s:12:"emailReplyTo";s:4:"desc";s:29:"prop_formit.emailreplyto_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:16:"emailReplyToName";a:7:{s:4:"name";s:16:"emailReplyToName";s:4:"desc";s:33:"prop_formit.emailreplytoname_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:7:"emailCC";a:7:{s:4:"name";s:7:"emailCC";s:4:"desc";s:24:"prop_formit.emailcc_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:11:"emailCCName";a:7:{s:4:"name";s:11:"emailCCName";s:4:"desc";s:28:"prop_formit.emailccname_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:8:"emailBCC";a:7:{s:4:"name";s:8:"emailBCC";s:4:"desc";s:25:"prop_formit.emailbcc_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:12:"emailBCCName";a:7:{s:4:"name";s:12:"emailBCCName";s:4:"desc";s:29:"prop_formit.emailbccname_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:15:"emailReturnPath";a:7:{s:4:"name";s:15:"emailReturnPath";s:4:"desc";s:32:"prop_formit.emailreturnpath_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:12:"emailSubject";a:7:{s:4:"name";s:12:"emailSubject";s:4:"desc";s:29:"prop_formit.emailsubject_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:23:"emailUseFieldForSubject";a:7:{s:4:"name";s:23:"emailUseFieldForSubject";s:4:"desc";s:40:"prop_formit.emailusefieldforsubject_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:9:"emailHtml";a:7:{s:4:"name";s:9:"emailHtml";s:4:"desc";s:26:"prop_formit.emailhtml_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:1;s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:20:"emailConvertNewlines";a:7:{s:4:"name";s:20:"emailConvertNewlines";s:4:"desc";s:37:"prop_formit.emailconvertnewlines_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:0;s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:17:"emailMultiWrapper";a:7:{s:4:"name";s:17:"emailMultiWrapper";s:4:"desc";s:34:"prop_formit.emailmultiwrapper_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:10:"[[+value]]";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:19:"emailMultiSeparator";a:7:{s:4:"name";s:19:"emailMultiSeparator";s:4:"desc";s:36:"prop_formit.emailmultiseparator_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:7:"fiarTpl";a:7:{s:4:"name";s:7:"fiarTpl";s:4:"desc";s:24:"prop_formit.fiartpl_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:11:"fiarToField";a:7:{s:4:"name";s:11:"fiarToField";s:4:"desc";s:28:"prop_formit.fiartofield_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:5:"email";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:11:"fiarSubject";a:7:{s:4:"name";s:11:"fiarSubject";s:4:"desc";s:28:"prop_formit.fiarsubject_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:30:"[[++site_name]] Auto-Responder";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:8:"fiarFrom";a:7:{s:4:"name";s:8:"fiarFrom";s:4:"desc";s:25:"prop_formit.fiarfrom_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:12:"fiarFromName";a:7:{s:4:"name";s:12:"fiarFromName";s:4:"desc";s:29:"prop_formit.fiarfromname_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:11:"fiarReplyTo";a:7:{s:4:"name";s:11:"fiarReplyTo";s:4:"desc";s:28:"prop_formit.fiarreplyto_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:15:"fiarReplyToName";a:7:{s:4:"name";s:15:"fiarReplyToName";s:4:"desc";s:32:"prop_formit.fiarreplytoname_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:6:"fiarCC";a:7:{s:4:"name";s:6:"fiarCC";s:4:"desc";s:23:"prop_formit.fiarcc_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:10:"fiarCCName";a:7:{s:4:"name";s:10:"fiarCCName";s:4:"desc";s:25:"prop_fiar.fiarccname_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:7:"fiarBCC";a:7:{s:4:"name";s:7:"fiarBCC";s:4:"desc";s:24:"prop_formit.fiarbcc_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:11:"fiarBCCName";a:7:{s:4:"name";s:11:"fiarBCCName";s:4:"desc";s:28:"prop_formit.fiarbccname_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:8:"fiarHtml";a:7:{s:4:"name";s:8:"fiarHtml";s:4:"desc";s:25:"prop_formit.fiarhtml_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:1;s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:12:"mathMinRange";a:7:{s:4:"name";s:12:"mathMinRange";s:4:"desc";s:29:"prop_formit.mathminrange_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:2:"10";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:12:"mathMaxRange";a:7:{s:4:"name";s:12:"mathMaxRange";s:4:"desc";s:29:"prop_formit.mathmaxrange_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:3:"100";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:9:"mathField";a:7:{s:4:"name";s:9:"mathField";s:4:"desc";s:26:"prop_formit.mathfield_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:4:"math";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:12:"mathOp1Field";a:7:{s:4:"name";s:12:"mathOp1Field";s:4:"desc";s:29:"prop_formit.mathop1field_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:3:"op1";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:12:"mathOp2Field";a:7:{s:4:"name";s:12:"mathOp2Field";s:4:"desc";s:29:"prop_formit.mathop2field_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:3:"op2";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:17:"mathOperatorField";a:7:{s:4:"name";s:17:"mathOperatorField";s:4:"desc";s:34:"prop_formit.mathoperatorfield_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:8:"operator";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:12:"saveTmpFiles";a:7:{s:4:"name";s:12:"saveTmpFiles";s:4:"desc";s:29:"prop_formit.savetmpfiles_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:0;s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:18:"attachFilesToEmail";a:7:{s:4:"name";s:18:"attachFilesToEmail";s:4:"desc";s:28:"prop_formit.attachfiles_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:1;s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:16:"storeAttachments";a:7:{s:4:"name";s:16:"storeAttachments";s:4:"desc";s:34:"prop_formit.store_attachments_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:0;s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}}',
  324. 'moduleguid' => '',
  325. 'static' => 0,
  326. 'static_file' => '',
  327. 'content' => '/**
  328. * FormIt
  329. *
  330. * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
  331. *
  332. * FormIt is free software; you can redistribute it and/or modify it
  333. * under the terms of the GNU General Public License as published by the Free
  334. * Software Foundation; either version 2 of the License, or (at your option) any
  335. * later version.
  336. *
  337. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  338. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  339. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  340. *
  341. * You should have received a copy of the GNU General Public License along with
  342. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  343. * Suite 330, Boston, MA 02111-1307 USA
  344. *
  345. * @package formit
  346. */
  347. /**
  348. * FormIt
  349. *
  350. * A dynamic form processing Snippet for MODx Revolution.
  351. *
  352. * @var modX $modx
  353. * @var array $scriptProperties
  354. *
  355. * @package formit
  356. */
  357. $modelPath = $modx->getOption(
  358. \'formit.core_path\',
  359. null,
  360. $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/formit/\'
  361. ) . \'model/formit/\';
  362. $modx->loadClass(\'FormIt\', $modelPath, true, true);
  363. $fi = new FormIt($modx, $scriptProperties);
  364. $fi->initialize($modx->context->get(\'key\'));
  365. $fi->loadRequest();
  366. $fields = $fi->request->prepare();
  367. return $fi->request->handle($fields);',
  368. ),
  369. ),
  370. 'c692e8571219491ec002595641345810' =>
  371. array (
  372. 'criteria' =>
  373. array (
  374. 'name' => 'FormItRetriever',
  375. ),
  376. 'object' =>
  377. array (
  378. 'id' => 18,
  379. 'source' => 0,
  380. 'property_preprocess' => 0,
  381. 'name' => 'FormItRetriever',
  382. 'description' => 'Fetches a form submission for a user for displaying on a thank you page.',
  383. 'editor_type' => 0,
  384. 'category' => 8,
  385. 'cache_type' => 0,
  386. 'snippet' => '/**
  387. * FormIt
  388. *
  389. * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
  390. *
  391. * FormIt is free software; you can redistribute it and/or modify it
  392. * under the terms of the GNU General Public License as published by the Free
  393. * Software Foundation; either version 2 of the License, or (at your option) any
  394. * later version.
  395. *
  396. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  397. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  398. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  399. *
  400. * You should have received a copy of the GNU General Public License along with
  401. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  402. * Suite 330, Boston, MA 02111-1307 USA
  403. *
  404. * @package formit
  405. */
  406. /**
  407. * FormItRetriever
  408. *
  409. * Retrieves a prior form submission that was stored with the &store property
  410. * in a FormIt call.
  411. *
  412. * @var modX $modx
  413. * @var array $scriptProperties
  414. *
  415. * @package formit
  416. */
  417. $modelPath = $modx->getOption(
  418. \'formit.core_path\',
  419. null,
  420. $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/formit/\'
  421. ) . \'model/formit/\';
  422. $fi = $modx->getService(\'formit\', \'FormIt\', $modelPath, $scriptProperties);
  423. /* setup properties */
  424. $placeholderPrefix = $modx->getOption(\'placeholderPrefix\', $scriptProperties, \'fi.\');
  425. $eraseOnLoad = $modx->getOption(\'eraseOnLoad\', $scriptProperties, false);
  426. $redirectToOnNotFound = $modx->getOption(\'redirectToOnNotFound\', $scriptProperties, false);
  427. /* fetch data from cache and set to placeholders */
  428. $fi->loadRequest();
  429. $fi->request->loadDictionary();
  430. $data = $fi->request->dictionary->retrieve();
  431. if (!empty($data)) {
  432. /* set data to placeholders */
  433. foreach ($data as $k => $v) {
  434. /*checkboxes & other multi-values are stored as arrays, must be imploded*/
  435. if (is_array($v)) {
  436. $data[$k] = implode(\',\', $v);
  437. }
  438. }
  439. $modx->toPlaceholders($data, $placeholderPrefix, \'\');
  440. /* if set, erase the data on load, otherwise depend on cache expiry time */
  441. if ($eraseOnLoad) {
  442. $fi->request->dictionary->erase();
  443. }
  444. /* if the data\'s not found, and we want to redirect somewhere if so, do here */
  445. } elseif (!empty($redirectToOnNotFound)) {
  446. $url = $modx->makeUrl($redirectToOnNotFound);
  447. $modx->sendRedirect($url);
  448. }
  449. return \'\';',
  450. 'locked' => 0,
  451. 'properties' => 'a:4:{s:17:"placeholderPrefix";a:7:{s:4:"name";s:17:"placeholderPrefix";s:4:"desc";s:31:"prop_fir.placeholderprefix_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:3:"fi.";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:20:"redirectToOnNotFound";a:7:{s:4:"name";s:20:"redirectToOnNotFound";s:4:"desc";s:34:"prop_fir.redirecttoonnotfound_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:11:"eraseOnLoad";a:7:{s:4:"name";s:11:"eraseOnLoad";s:4:"desc";s:25:"prop_fir.eraseonload_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:0;s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:13:"storeLocation";a:7:{s:4:"name";s:13:"storeLocation";s:4:"desc";s:27:"prop_fir.storelocation_desc";s:4:"type";s:4:"list";s:7:"options";a:2:{i:0;a:2:{s:5:"value";s:5:"cache";s:4:"text";s:16:"formit.opt_cache";}i:1;a:2:{s:5:"value";s:7:"session";s:4:"text";s:18:"formit.opt_session";}}s:5:"value";s:5:"cache";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}}',
  452. 'moduleguid' => '',
  453. 'static' => 0,
  454. 'static_file' => '',
  455. 'content' => '/**
  456. * FormIt
  457. *
  458. * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
  459. *
  460. * FormIt is free software; you can redistribute it and/or modify it
  461. * under the terms of the GNU General Public License as published by the Free
  462. * Software Foundation; either version 2 of the License, or (at your option) any
  463. * later version.
  464. *
  465. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  466. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  467. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  468. *
  469. * You should have received a copy of the GNU General Public License along with
  470. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  471. * Suite 330, Boston, MA 02111-1307 USA
  472. *
  473. * @package formit
  474. */
  475. /**
  476. * FormItRetriever
  477. *
  478. * Retrieves a prior form submission that was stored with the &store property
  479. * in a FormIt call.
  480. *
  481. * @var modX $modx
  482. * @var array $scriptProperties
  483. *
  484. * @package formit
  485. */
  486. $modelPath = $modx->getOption(
  487. \'formit.core_path\',
  488. null,
  489. $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/formit/\'
  490. ) . \'model/formit/\';
  491. $fi = $modx->getService(\'formit\', \'FormIt\', $modelPath, $scriptProperties);
  492. /* setup properties */
  493. $placeholderPrefix = $modx->getOption(\'placeholderPrefix\', $scriptProperties, \'fi.\');
  494. $eraseOnLoad = $modx->getOption(\'eraseOnLoad\', $scriptProperties, false);
  495. $redirectToOnNotFound = $modx->getOption(\'redirectToOnNotFound\', $scriptProperties, false);
  496. /* fetch data from cache and set to placeholders */
  497. $fi->loadRequest();
  498. $fi->request->loadDictionary();
  499. $data = $fi->request->dictionary->retrieve();
  500. if (!empty($data)) {
  501. /* set data to placeholders */
  502. foreach ($data as $k => $v) {
  503. /*checkboxes & other multi-values are stored as arrays, must be imploded*/
  504. if (is_array($v)) {
  505. $data[$k] = implode(\',\', $v);
  506. }
  507. }
  508. $modx->toPlaceholders($data, $placeholderPrefix, \'\');
  509. /* if set, erase the data on load, otherwise depend on cache expiry time */
  510. if ($eraseOnLoad) {
  511. $fi->request->dictionary->erase();
  512. }
  513. /* if the data\'s not found, and we want to redirect somewhere if so, do here */
  514. } elseif (!empty($redirectToOnNotFound)) {
  515. $url = $modx->makeUrl($redirectToOnNotFound);
  516. $modx->sendRedirect($url);
  517. }
  518. return \'\';',
  519. ),
  520. ),
  521. '84f065e8c56c3d6be390ee0b214cb2c4' =>
  522. array (
  523. 'criteria' =>
  524. array (
  525. 'name' => 'FormItIsChecked',
  526. ),
  527. 'object' =>
  528. array (
  529. 'id' => 19,
  530. 'source' => 0,
  531. 'property_preprocess' => 0,
  532. 'name' => 'FormItIsChecked',
  533. 'description' => 'A custom output filter used with checkboxes/radios for checking checked status.',
  534. 'editor_type' => 0,
  535. 'category' => 8,
  536. 'cache_type' => 0,
  537. 'snippet' => '/**
  538. * FormIt
  539. *
  540. * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
  541. *
  542. * FormIt is free software; you can redistribute it and/or modify it
  543. * under the terms of the GNU General Public License as published by the Free
  544. * Software Foundation; either version 2 of the License, or (at your option) any
  545. * later version.
  546. *
  547. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  548. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  549. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  550. *
  551. * You should have received a copy of the GNU General Public License along with
  552. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  553. * Suite 330, Boston, MA 02111-1307 USA
  554. *
  555. * @package formit
  556. */
  557. /**
  558. * FormItIsChecked
  559. *
  560. * Custom output filter that returns checked="checked" if the value is set
  561. *
  562. * @var string $input
  563. * @var string $options
  564. * @var modX $modx
  565. *
  566. * @package formit
  567. */
  568. $output = \' \';
  569. if ($input == $options) {
  570. $output = \' checked="checked"\';
  571. }
  572. $input = $modx->fromJSON($input);
  573. if (!empty($input) && is_array($input) && in_array($options,$input)) {
  574. $output = \' checked="checked"\';
  575. }
  576. return $output;',
  577. 'locked' => 0,
  578. 'properties' => 'a:0:{}',
  579. 'moduleguid' => '',
  580. 'static' => 0,
  581. 'static_file' => '',
  582. 'content' => '/**
  583. * FormIt
  584. *
  585. * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
  586. *
  587. * FormIt is free software; you can redistribute it and/or modify it
  588. * under the terms of the GNU General Public License as published by the Free
  589. * Software Foundation; either version 2 of the License, or (at your option) any
  590. * later version.
  591. *
  592. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  593. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  594. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  595. *
  596. * You should have received a copy of the GNU General Public License along with
  597. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  598. * Suite 330, Boston, MA 02111-1307 USA
  599. *
  600. * @package formit
  601. */
  602. /**
  603. * FormItIsChecked
  604. *
  605. * Custom output filter that returns checked="checked" if the value is set
  606. *
  607. * @var string $input
  608. * @var string $options
  609. * @var modX $modx
  610. *
  611. * @package formit
  612. */
  613. $output = \' \';
  614. if ($input == $options) {
  615. $output = \' checked="checked"\';
  616. }
  617. $input = $modx->fromJSON($input);
  618. if (!empty($input) && is_array($input) && in_array($options,$input)) {
  619. $output = \' checked="checked"\';
  620. }
  621. return $output;',
  622. ),
  623. ),
  624. 'a61d7dc35d61195bac43d8a4482583a9' =>
  625. array (
  626. 'criteria' =>
  627. array (
  628. 'name' => 'FormItIsSelected',
  629. ),
  630. 'object' =>
  631. array (
  632. 'id' => 20,
  633. 'source' => 0,
  634. 'property_preprocess' => 0,
  635. 'name' => 'FormItIsSelected',
  636. 'description' => 'A custom output filter used with dropdowns for checking selected status.',
  637. 'editor_type' => 0,
  638. 'category' => 8,
  639. 'cache_type' => 0,
  640. 'snippet' => '/**
  641. * FormIt
  642. *
  643. * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
  644. *
  645. * FormIt is free software; you can redistribute it and/or modify it
  646. * under the terms of the GNU General Public License as published by the Free
  647. * Software Foundation; either version 2 of the License, or (at your option) any
  648. * later version.
  649. *
  650. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  651. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  652. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  653. *
  654. * You should have received a copy of the GNU General Public License along with
  655. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  656. * Suite 330, Boston, MA 02111-1307 USA
  657. *
  658. * @package formit
  659. */
  660. /**
  661. * FormItIsChecked
  662. *
  663. * Custom output filter that returns checked="checked" if the value is set
  664. *
  665. * @var string $input
  666. * @var string $options
  667. * @var modX $modx
  668. *
  669. * @package formit
  670. */
  671. $output = \' \';
  672. if ($input == $options) {
  673. $output = \' selected="selected"\';
  674. }
  675. $input = $modx->fromJSON($input);
  676. if (!empty($input) && is_array($input) && in_array($options,$input)) {
  677. $output = \' selected="selected"\';
  678. }
  679. return $output;',
  680. 'locked' => 0,
  681. 'properties' => 'a:0:{}',
  682. 'moduleguid' => '',
  683. 'static' => 0,
  684. 'static_file' => '',
  685. 'content' => '/**
  686. * FormIt
  687. *
  688. * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
  689. *
  690. * FormIt is free software; you can redistribute it and/or modify it
  691. * under the terms of the GNU General Public License as published by the Free
  692. * Software Foundation; either version 2 of the License, or (at your option) any
  693. * later version.
  694. *
  695. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  696. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  697. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  698. *
  699. * You should have received a copy of the GNU General Public License along with
  700. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  701. * Suite 330, Boston, MA 02111-1307 USA
  702. *
  703. * @package formit
  704. */
  705. /**
  706. * FormItIsChecked
  707. *
  708. * Custom output filter that returns checked="checked" if the value is set
  709. *
  710. * @var string $input
  711. * @var string $options
  712. * @var modX $modx
  713. *
  714. * @package formit
  715. */
  716. $output = \' \';
  717. if ($input == $options) {
  718. $output = \' selected="selected"\';
  719. }
  720. $input = $modx->fromJSON($input);
  721. if (!empty($input) && is_array($input) && in_array($options,$input)) {
  722. $output = \' selected="selected"\';
  723. }
  724. return $output;',
  725. ),
  726. ),
  727. '6b58a9e2b01a9dd702be2cb97d035394' =>
  728. array (
  729. 'criteria' =>
  730. array (
  731. 'name' => 'FormItCountryOptions',
  732. ),
  733. 'object' =>
  734. array (
  735. 'id' => 21,
  736. 'source' => 0,
  737. 'property_preprocess' => 0,
  738. 'name' => 'FormItCountryOptions',
  739. 'description' => 'A utility snippet for generating a dropdown list of countries.',
  740. 'editor_type' => 0,
  741. 'category' => 8,
  742. 'cache_type' => 0,
  743. 'snippet' => '/**
  744. * FormIt
  745. *
  746. * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
  747. *
  748. * FormIt is free software; you can redistribute it and/or modify it
  749. * under the terms of the GNU General Public License as published by the Free
  750. * Software Foundation; either version 2 of the License, or (at your option) any
  751. * later version.
  752. *
  753. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  754. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  755. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  756. *
  757. * You should have received a copy of the GNU General Public License along with
  758. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  759. * Suite 330, Boston, MA 02111-1307 USA
  760. *
  761. * @package formit
  762. */
  763. /**
  764. * FormItCountryOptions
  765. *
  766. * Automatically generates and outputs a country list for usage in forms
  767. *
  768. * @var modX $modx
  769. * @var array $scriptProperties
  770. *
  771. * @package formit
  772. */
  773. $modelPath = $modx->getOption(
  774. \'formit.core_path\',
  775. null,
  776. $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/formit/\'
  777. ) . \'model/formit/\';
  778. $fi = $modx->getService(\'formit\', \'FormIt\', $modelPath, $scriptProperties);
  779. /** @var fiCountryOptions $co */
  780. $co = $fi->loadModule(\'fiCountryOptions\', \'countryOptions\', $scriptProperties);
  781. $co->initialize();
  782. $co->getData();
  783. $co->loadPrioritized();
  784. $co->iterate();
  785. return $co->output();',
  786. 'locked' => 0,
  787. 'properties' => 'a:11:{s:8:"selected";a:7:{s:4:"name";s:8:"selected";s:4:"desc";s:23:"prop_fico.selected_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:3:"tpl";a:7:{s:4:"name";s:3:"tpl";s:4:"desc";s:18:"prop_fico.tpl_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:18:"fiDefaultOptionTpl";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:10:"useIsoCode";a:7:{s:4:"name";s:10:"useIsoCode";s:4:"desc";s:25:"prop_fico.useisocode_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:1;s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:11:"prioritized";a:7:{s:4:"name";s:11:"prioritized";s:4:"desc";s:26:"prop_fico.prioritized_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:11:"optGroupTpl";a:7:{s:4:"name";s:11:"optGroupTpl";s:4:"desc";s:26:"prop_fico.optgrouptpl_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:20:"fiDefaultOptGroupTpl";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:20:"prioritizedGroupText";a:7:{s:4:"name";s:20:"prioritizedGroupText";s:4:"desc";s:35:"prop_fico.prioritizedgrouptext_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:12:"allGroupText";a:7:{s:4:"name";s:12:"allGroupText";s:4:"desc";s:27:"prop_fico.allgrouptext_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:17:"selectedAttribute";a:7:{s:4:"name";s:17:"selectedAttribute";s:4:"desc";s:32:"prop_fico.selectedattribute_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:20:" selected="selected"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:13:"toPlaceholder";a:7:{s:4:"name";s:13:"toPlaceholder";s:4:"desc";s:28:"prop_fico.toplaceholder_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:7:"country";a:7:{s:4:"name";s:7:"country";s:4:"desc";s:22:"prop_fico.country_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:16:"[[++cultureKey]]";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:7:"limited";a:7:{s:4:"name";s:7:"limited";s:4:"desc";s:22:"prop_fico.limited_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}}',
  788. 'moduleguid' => '',
  789. 'static' => 0,
  790. 'static_file' => '',
  791. 'content' => '/**
  792. * FormIt
  793. *
  794. * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
  795. *
  796. * FormIt is free software; you can redistribute it and/or modify it
  797. * under the terms of the GNU General Public License as published by the Free
  798. * Software Foundation; either version 2 of the License, or (at your option) any
  799. * later version.
  800. *
  801. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  802. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  803. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  804. *
  805. * You should have received a copy of the GNU General Public License along with
  806. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  807. * Suite 330, Boston, MA 02111-1307 USA
  808. *
  809. * @package formit
  810. */
  811. /**
  812. * FormItCountryOptions
  813. *
  814. * Automatically generates and outputs a country list for usage in forms
  815. *
  816. * @var modX $modx
  817. * @var array $scriptProperties
  818. *
  819. * @package formit
  820. */
  821. $modelPath = $modx->getOption(
  822. \'formit.core_path\',
  823. null,
  824. $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/formit/\'
  825. ) . \'model/formit/\';
  826. $fi = $modx->getService(\'formit\', \'FormIt\', $modelPath, $scriptProperties);
  827. /** @var fiCountryOptions $co */
  828. $co = $fi->loadModule(\'fiCountryOptions\', \'countryOptions\', $scriptProperties);
  829. $co->initialize();
  830. $co->getData();
  831. $co->loadPrioritized();
  832. $co->iterate();
  833. return $co->output();',
  834. ),
  835. ),
  836. '70e1a7746556d7d0754f99b717daaeb4' =>
  837. array (
  838. 'criteria' =>
  839. array (
  840. 'name' => 'FormItStateOptions',
  841. ),
  842. 'object' =>
  843. array (
  844. 'id' => 22,
  845. 'source' => 0,
  846. 'property_preprocess' => 0,
  847. 'name' => 'FormItStateOptions',
  848. 'description' => 'A utility snippet for generating a dropdown list of U.S. states.',
  849. 'editor_type' => 0,
  850. 'category' => 8,
  851. 'cache_type' => 0,
  852. 'snippet' => '/**
  853. * FormIt
  854. *
  855. * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
  856. *
  857. * FormIt is free software; you can redistribute it and/or modify it
  858. * under the terms of the GNU General Public License as published by the Free
  859. * Software Foundation; either version 2 of the License, or (at your option) any
  860. * later version.
  861. *
  862. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  863. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  864. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  865. *
  866. * You should have received a copy of the GNU General Public License along with
  867. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  868. * Suite 330, Boston, MA 02111-1307 USA
  869. *
  870. * @package formit
  871. */
  872. /**
  873. * FormItStateOptions
  874. *
  875. * Automatically generates and outputs a U.S. state list for usage in forms
  876. *
  877. * @var modX $modx
  878. * @var array $scriptProperties
  879. *
  880. * @package formit
  881. */
  882. $modelPath = $modx->getOption(
  883. \'formit.core_path\',
  884. null,
  885. $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/formit/\'
  886. ) . \'model/formit/\';
  887. $fi = $modx->getService(\'formit\', \'FormIt\', $modelPath, $scriptProperties);
  888. /** @var fiStateOptions $so */
  889. $so = $fi->loadModule(\'fiStateOptions\', \'stateOptions\', $scriptProperties);
  890. $so->initialize();
  891. $so->getData();
  892. $so->iterate();
  893. return $so->output();',
  894. 'locked' => 0,
  895. 'properties' => 'a:6:{s:8:"selected";a:7:{s:4:"name";s:8:"selected";s:4:"desc";s:23:"prop_fiso.selected_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:3:"tpl";a:7:{s:4:"name";s:3:"tpl";s:4:"desc";s:18:"prop_fiso.tpl_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:18:"fiDefaultOptionTpl";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:7:"useAbbr";a:7:{s:4:"name";s:7:"useAbbr";s:4:"desc";s:22:"prop_fiso.useabbr_desc";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:1;s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:17:"selectedAttribute";a:7:{s:4:"name";s:17:"selectedAttribute";s:4:"desc";s:32:"prop_fiso.selectedattribute_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:20:" selected="selected"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:13:"toPlaceholder";a:7:{s:4:"name";s:13:"toPlaceholder";s:4:"desc";s:28:"prop_fiso.toplaceholder_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}s:7:"country";a:7:{s:4:"name";s:7:"country";s:4:"desc";s:22:"prop_fiso.country_desc";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:16:"[[++cultureKey]]";s:7:"lexicon";s:17:"formit:properties";s:4:"area";s:0:"";}}',
  896. 'moduleguid' => '',
  897. 'static' => 0,
  898. 'static_file' => '',
  899. 'content' => '/**
  900. * FormIt
  901. *
  902. * Copyright 2009-2012 by Shaun McCormick <shaun@modx.com>
  903. *
  904. * FormIt is free software; you can redistribute it and/or modify it
  905. * under the terms of the GNU General Public License as published by the Free
  906. * Software Foundation; either version 2 of the License, or (at your option) any
  907. * later version.
  908. *
  909. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  910. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  911. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  912. *
  913. * You should have received a copy of the GNU General Public License along with
  914. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  915. * Suite 330, Boston, MA 02111-1307 USA
  916. *
  917. * @package formit
  918. */
  919. /**
  920. * FormItStateOptions
  921. *
  922. * Automatically generates and outputs a U.S. state list for usage in forms
  923. *
  924. * @var modX $modx
  925. * @var array $scriptProperties
  926. *
  927. * @package formit
  928. */
  929. $modelPath = $modx->getOption(
  930. \'formit.core_path\',
  931. null,
  932. $modx->getOption(\'core_path\', null, MODX_CORE_PATH) . \'components/formit/\'
  933. ) . \'model/formit/\';
  934. $fi = $modx->getService(\'formit\', \'FormIt\', $modelPath, $scriptProperties);
  935. /** @var fiStateOptions $so */
  936. $so = $fi->loadModule(\'fiStateOptions\', \'stateOptions\', $scriptProperties);
  937. $so->initialize();
  938. $so->getData();
  939. $so->iterate();
  940. return $so->output();',
  941. ),
  942. ),
  943. '744a53007b7b2c46c31c57669c59d5e0' =>
  944. array (
  945. 'criteria' =>
  946. array (
  947. 'name' => 'FormItLoadSavedForm',
  948. ),
  949. 'object' =>
  950. array (
  951. 'id' => 24,
  952. 'source' => 0,
  953. 'property_preprocess' => 0,
  954. 'name' => 'FormItLoadSavedForm',
  955. 'description' => 'Prehook to load previously saved form.',
  956. 'editor_type' => 0,
  957. 'category' => 8,
  958. 'cache_type' => 0,
  959. 'snippet' => '/**
  960. * FormIt
  961. *
  962. * Copyright 2011-12 by SCHERP Ontwikkeling <info@scherpontwikkeling.nl>
  963. * Copyright 2015 by Wieger Sloot <modx@sterc.nl>
  964. * Copyright 2016 by YJ Tso <yj@modx.com>
  965. *
  966. * FormIt is free software; you can redistribute it and/or modify it
  967. * under the terms of the GNU General Public License as published by the Free
  968. * Software Foundation; either version 2 of the License, or (at your option) any
  969. * later version.
  970. *
  971. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  972. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  973. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  974. *
  975. * You should have received a copy of the GNU General Public License along with
  976. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  977. * Suite 330, Boston, MA 02111-1307 USA
  978. *
  979. * @package formit
  980. */
  981. /**
  982. * A custom FormIt prehook for fetching saved form data. - Based on FormItSaveForm
  983. *
  984. * @var modX $modx
  985. * @var array $scriptProperties
  986. * @var FormIt $formit
  987. * @var fiHooks $hook
  988. *
  989. * @package formit
  990. */
  991. /* setup default properties */
  992. // If prehook fails do we continue?
  993. $return = $modx->getOption(\'returnValueOnFail\', $formit->config, true);
  994. $formEncrypt = $modx->getOption(\'formEncrypt\', $formit->config, false);
  995. $formFields = $modx->getOption(\'formFields\', $formit->config, false);
  996. $fieldNames = $modx->getOption(\'fieldNames\', $formit->config, false);
  997. $updateSavedForm = $modx->getOption(\'updateSavedForm\', $formit->config, false); // true, false, \'1\', \'0\', or \'values\'
  998. // If FormIt config says don\'t update, don\'t do it
  999. if (!$updateSavedForm) return $return;
  1000. // In order to load form values, the user must provide the hash key somehow
  1001. // Usually with a $_GET parameter, but a property in $formit->config will override.
  1002. $formHashKeyField = $modx->getOption(\'savedFormHashKeyField\', $formit->config, \'savedFormHashKey\');
  1003. $formHashKey = \'\';
  1004. if (isset($_GET[$formHashKeyField])) $formHashKey = (string) $_GET[$formHashKeyField];
  1005. if ($hook->getValue($formHashKeyField)) $formHashKey = (string) $hook->getValue($formHashKeyField);
  1006. if (isset($formit->config[$formHashKeyField])) $formHashKey = $formit->config[$formHashKeyField];
  1007. // our hashing methods return 32 chars. if no valid hash key we\'re done here.
  1008. if (strlen($formHashKey) !== 32) return $return;
  1009. // Try to fetch the saved form
  1010. $savedForm = $modx->getObject(\'FormItForm\', array(\'hash\' => $formHashKey));
  1011. if (!$savedForm) return $return;
  1012. if ($formFields) {
  1013. $formFields = explode(\',\', $formFields);
  1014. foreach($formFields as $k => $v) {
  1015. $formFields[$k] = trim($v);
  1016. }
  1017. }
  1018. // Initialize the data array
  1019. // Handle encryption
  1020. if ($formEncrypt) {
  1021. $data = $savedForm->decrypt();
  1022. } else {
  1023. $data = $savedForm->get(\'values\');
  1024. }
  1025. if (is_string($data)) $data = $modx->fromJSON($data);
  1026. if (!is_array($data)) return $return;
  1027. //Change the fieldnames
  1028. if ($fieldNames) {
  1029. $newDataArray = array();
  1030. $fieldLabels = array();
  1031. $formFieldNames = explode(\',\', $fieldNames);
  1032. foreach($formFieldNames as $formFieldName){
  1033. list($name, $label) = explode(\'==\', $formFieldName);
  1034. // reverse order from FormItSaveForm snippet
  1035. $fieldLabels[trim($label)] = trim($name);
  1036. }
  1037. foreach ($data as $key => $value) {
  1038. if ($fieldLabels[$key]) {
  1039. $newDataArray[$fieldLabels[$key]] = $value;
  1040. }else{
  1041. $newDataArray[$key] = $value;
  1042. }
  1043. }
  1044. $data = $newDataArray;
  1045. }
  1046. // Always pass back in the provided hash key
  1047. $data[$formHashKeyField] = $formHashKey;
  1048. $hook->setValues($data);
  1049. return true;',
  1050. 'locked' => 0,
  1051. 'properties' => 'a:0:{}',
  1052. 'moduleguid' => '',
  1053. 'static' => 0,
  1054. 'static_file' => '',
  1055. 'content' => '/**
  1056. * FormIt
  1057. *
  1058. * Copyright 2011-12 by SCHERP Ontwikkeling <info@scherpontwikkeling.nl>
  1059. * Copyright 2015 by Wieger Sloot <modx@sterc.nl>
  1060. * Copyright 2016 by YJ Tso <yj@modx.com>
  1061. *
  1062. * FormIt is free software; you can redistribute it and/or modify it
  1063. * under the terms of the GNU General Public License as published by the Free
  1064. * Software Foundation; either version 2 of the License, or (at your option) any
  1065. * later version.
  1066. *
  1067. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  1068. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  1069. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  1070. *
  1071. * You should have received a copy of the GNU General Public License along with
  1072. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  1073. * Suite 330, Boston, MA 02111-1307 USA
  1074. *
  1075. * @package formit
  1076. */
  1077. /**
  1078. * A custom FormIt prehook for fetching saved form data. - Based on FormItSaveForm
  1079. *
  1080. * @var modX $modx
  1081. * @var array $scriptProperties
  1082. * @var FormIt $formit
  1083. * @var fiHooks $hook
  1084. *
  1085. * @package formit
  1086. */
  1087. /* setup default properties */
  1088. // If prehook fails do we continue?
  1089. $return = $modx->getOption(\'returnValueOnFail\', $formit->config, true);
  1090. $formEncrypt = $modx->getOption(\'formEncrypt\', $formit->config, false);
  1091. $formFields = $modx->getOption(\'formFields\', $formit->config, false);
  1092. $fieldNames = $modx->getOption(\'fieldNames\', $formit->config, false);
  1093. $updateSavedForm = $modx->getOption(\'updateSavedForm\', $formit->config, false); // true, false, \'1\', \'0\', or \'values\'
  1094. // If FormIt config says don\'t update, don\'t do it
  1095. if (!$updateSavedForm) return $return;
  1096. // In order to load form values, the user must provide the hash key somehow
  1097. // Usually with a $_GET parameter, but a property in $formit->config will override.
  1098. $formHashKeyField = $modx->getOption(\'savedFormHashKeyField\', $formit->config, \'savedFormHashKey\');
  1099. $formHashKey = \'\';
  1100. if (isset($_GET[$formHashKeyField])) $formHashKey = (string) $_GET[$formHashKeyField];
  1101. if ($hook->getValue($formHashKeyField)) $formHashKey = (string) $hook->getValue($formHashKeyField);
  1102. if (isset($formit->config[$formHashKeyField])) $formHashKey = $formit->config[$formHashKeyField];
  1103. // our hashing methods return 32 chars. if no valid hash key we\'re done here.
  1104. if (strlen($formHashKey) !== 32) return $return;
  1105. // Try to fetch the saved form
  1106. $savedForm = $modx->getObject(\'FormItForm\', array(\'hash\' => $formHashKey));
  1107. if (!$savedForm) return $return;
  1108. if ($formFields) {
  1109. $formFields = explode(\',\', $formFields);
  1110. foreach($formFields as $k => $v) {
  1111. $formFields[$k] = trim($v);
  1112. }
  1113. }
  1114. // Initialize the data array
  1115. // Handle encryption
  1116. if ($formEncrypt) {
  1117. $data = $savedForm->decrypt();
  1118. } else {
  1119. $data = $savedForm->get(\'values\');
  1120. }
  1121. if (is_string($data)) $data = $modx->fromJSON($data);
  1122. if (!is_array($data)) return $return;
  1123. //Change the fieldnames
  1124. if ($fieldNames) {
  1125. $newDataArray = array();
  1126. $fieldLabels = array();
  1127. $formFieldNames = explode(\',\', $fieldNames);
  1128. foreach($formFieldNames as $formFieldName){
  1129. list($name, $label) = explode(\'==\', $formFieldName);
  1130. // reverse order from FormItSaveForm snippet
  1131. $fieldLabels[trim($label)] = trim($name);
  1132. }
  1133. foreach ($data as $key => $value) {
  1134. if ($fieldLabels[$key]) {
  1135. $newDataArray[$fieldLabels[$key]] = $value;
  1136. }else{
  1137. $newDataArray[$key] = $value;
  1138. }
  1139. }
  1140. $data = $newDataArray;
  1141. }
  1142. // Always pass back in the provided hash key
  1143. $data[$formHashKeyField] = $formHashKey;
  1144. $hook->setValues($data);
  1145. return true;',
  1146. ),
  1147. ),
  1148. '5e61bc035adade391a1111de35b3bfac' =>
  1149. array (
  1150. 'criteria' =>
  1151. array (
  1152. 'name' => 'FormIt',
  1153. ),
  1154. 'object' =>
  1155. array (
  1156. 'id' => 4,
  1157. 'source' => 0,
  1158. 'property_preprocess' => 0,
  1159. 'name' => 'FormIt',
  1160. 'description' => '',
  1161. 'editor_type' => 0,
  1162. 'category' => 8,
  1163. 'cache_type' => 0,
  1164. 'plugincode' => '/**
  1165. * FormIt
  1166. *
  1167. * Copyright 2009-2017 by Sterc <modx@sterc.nl>
  1168. *
  1169. * FormIt is free software; you can redistribute it and/or modify it
  1170. * under the terms of the GNU General Public License as published by the Free
  1171. * Software Foundation; either version 2 of the License, or (at your option) any
  1172. * later version.
  1173. *
  1174. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  1175. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  1176. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  1177. *
  1178. * You should have received a copy of the GNU General Public License along with
  1179. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  1180. * Suite 330, Boston, MA 02111-1307 USA
  1181. *
  1182. * @package formit
  1183. */
  1184. /**
  1185. * FormIt plugin
  1186. *
  1187. * @package formit
  1188. */
  1189. $formit = $modx->getService(
  1190. \'formit\',
  1191. \'FormIt\',
  1192. $modx->getOption(\'formit.core_path\', null, $modx->getOption(\'core_path\').\'components/formit/\') .\'model/formit/\',
  1193. array()
  1194. );
  1195. if (!($formit instanceof FormIt)) {
  1196. return;
  1197. }
  1198. switch ($modx->event->name) {
  1199. case \'OnManagerPageBeforeRender\':
  1200. // If migration status is false, show migrate alert message bar in manager
  1201. if (method_exists(\'FormIt\',\'encryptionMigrationStatus\')) {
  1202. if (!$formit->encryptionMigrationStatus()) {
  1203. $modx->lexicon->load(\'formit:mgr\');
  1204. $properties = array(\'message\' => $modx->lexicon(\'formit.migrate_alert\'));
  1205. $chunk = $formit->_getTplChunk(\'migrate/alert\');
  1206. if ($chunk) {
  1207. $modx->regClientStartupHTMLBlock($chunk->process($properties));
  1208. $modx->regClientCSS($formit->config[\'cssUrl\'] . \'migrate.css\');
  1209. }
  1210. }
  1211. }
  1212. }',
  1213. 'locked' => 0,
  1214. 'properties' => 'a:0:{}',
  1215. 'disabled' => 0,
  1216. 'moduleguid' => '',
  1217. 'static' => 0,
  1218. 'static_file' => '',
  1219. 'content' => '/**
  1220. * FormIt
  1221. *
  1222. * Copyright 2009-2017 by Sterc <modx@sterc.nl>
  1223. *
  1224. * FormIt is free software; you can redistribute it and/or modify it
  1225. * under the terms of the GNU General Public License as published by the Free
  1226. * Software Foundation; either version 2 of the License, or (at your option) any
  1227. * later version.
  1228. *
  1229. * FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
  1230. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  1231. * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  1232. *
  1233. * You should have received a copy of the GNU General Public License along with
  1234. * FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
  1235. * Suite 330, Boston, MA 02111-1307 USA
  1236. *
  1237. * @package formit
  1238. */
  1239. /**
  1240. * FormIt plugin
  1241. *
  1242. * @package formit
  1243. */
  1244. $formit = $modx->getService(
  1245. \'formit\',
  1246. \'FormIt\',
  1247. $modx->getOption(\'formit.core_path\', null, $modx->getOption(\'core_path\').\'components/formit/\') .\'model/formit/\',
  1248. array()
  1249. );
  1250. if (!($formit instanceof FormIt)) {
  1251. return;
  1252. }
  1253. switch ($modx->event->name) {
  1254. case \'OnManagerPageBeforeRender\':
  1255. // If migration status is false, show migrate alert message bar in manager
  1256. if (method_exists(\'FormIt\',\'encryptionMigrationStatus\')) {
  1257. if (!$formit->encryptionMigrationStatus()) {
  1258. $modx->lexicon->load(\'formit:mgr\');
  1259. $properties = array(\'message\' => $modx->lexicon(\'formit.migrate_alert\'));
  1260. $chunk = $formit->_getTplChunk(\'migrate/alert\');
  1261. if ($chunk) {
  1262. $modx->regClientStartupHTMLBlock($chunk->process($properties));
  1263. $modx->regClientCSS($formit->config[\'cssUrl\'] . \'migrate.css\');
  1264. }
  1265. }
  1266. }
  1267. }',
  1268. ),
  1269. ),
  1270. 'c881f87f1c0ab41e0cea36f9dbd9db27' =>
  1271. array (
  1272. 'criteria' =>
  1273. array (
  1274. 'pluginid' => 4,
  1275. 'event' => 'OnManagerPageBeforeRender',
  1276. ),
  1277. 'object' =>
  1278. array (
  1279. 'pluginid' => 4,
  1280. 'event' => 'OnManagerPageBeforeRender',
  1281. 'priority' => 0,
  1282. 'propertyset' => 0,
  1283. ),
  1284. ),
  1285. 'e9a66d5a2e6466c764a10f12d04113d8' =>
  1286. array (
  1287. 'criteria' =>
  1288. array (
  1289. 'text' => 'formit',
  1290. ),
  1291. 'object' =>
  1292. array (
  1293. 'text' => 'formit',
  1294. 'parent' => 'components',
  1295. 'action' => '2',
  1296. 'description' => 'formit.menu_desc',
  1297. 'icon' => '',
  1298. 'menuindex' => 0,
  1299. 'params' => '',
  1300. 'handler' => '',
  1301. 'permissions' => '',
  1302. 'namespace' => 'core',
  1303. ),
  1304. ),
  1305. );