preserved.php 61 KB

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