Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
form_management.inc
1 <?php
18 require_once SQ_INCLUDE_PATH.'/asset_management.inc';
19 
31 {
32 
33 
40  function Form_Management(&$pm)
41  {
42  $this->Asset_Management($pm);
43 
44  $this->vars = Array(
45  'name' => Array(
46  'added' => '0.0.1',
47  'type' => 'text',
48  'default' => '',
49  'update_fn' => '',
50  'is_admin' => FALSE,
51  'is_contextable'=> TRUE,
52  ),
53  'log_submissions' => Array(
54  'added' => '0.0.1',
55  'type' => 'boolean',
56  'default' => TRUE,
57  'parameters' => Array(
58  'allow_empty' => FALSE,
59  ),
60  ),
61  'show_results' => Array(
62  'added' => '0.0.1',
63  'type' => 'boolean',
64  'default' => TRUE,
65  'parameters' => Array(
66  'allow_empty' => FALSE,
67  ),
68  ),
69  'submit_button' => Array(
70  'added' => '0.0.1',
71  'type' => 'text',
72  'default' => '',
73  'is_contextable' => TRUE,
74  ),
75  'reset_button' => Array(
76  'added' => '0.0.1',
77  'type' => 'text',
78  'default' => '',
79  'is_contextable' => TRUE,
80  ),
81  'question_col_width' => Array(
82  'added' => '0.0.1',
83  'type' => 'html_width',
84  'default' => '40%',
85  ),
86  'answer_col_width' => Array(
87  'added' => '0.0.1',
88  'type' => 'html_width',
89  'default' => '60%',
90  ),
91  'form_width' => Array(
92  'added' => '0.0.1',
93  'type' => 'html_width',
94  'default' => '100%',
95  ),
96  'sort_order' => Array(
97  'added' => '0.0.1',
98  'type' => 'serialise',
99  'default' => Array(),
100  ),
101  'questions' => Array(
102  'added' => '0.0.1',
103  'type' => 'serialise',
104  'default' => Array(),
105  ),
106  'use_bodycopy_main' => Array(
107  'added' => '0.0.1',
108  'type' => 'boolean',
109  'default' => FALSE,
110  'parameters' => Array(
111  'allow_empty' => FALSE,
112  ),
113  ),
114  'use_bodycopy_thank_you' => Array(
115  'added' => '0.0.1',
116  'type' => 'boolean',
117  'default' => FALSE,
118  'parameters' => Array(
119  'allow_empty' => FALSE,
120  ),
121  ),
122  'use_bodycopy_exit' => Array(
123  'added' => '0.0.1',
124  'type' => 'boolean',
125  'default' => FALSE,
126  'parameters' => Array(
127  'allow_empty' => FALSE,
128  ),
129  ),
130  'use_bodycopy_confirmation' => Array(
131  'added' => '0.13',
132  'type' => 'boolean',
133  'default' => FALSE,
134  'parameters' => Array(
135  'allow_empty' => FALSE,
136  ),
137  ),
138  'use_bodycopy_unattached' => Array(
139  'added' => '0.13',
140  'type' => 'boolean',
141  'default' => FALSE,
142  'parameters' => Array(
143  'allow_empty' => FALSE,
144  ),
145  ),
146  'use_client_side' => Array(
147  'added' => '0.0.1',
148  'type' => 'boolean',
149  'default' => FALSE,
150  'parameters' => Array(
151  'allow_empty' => FALSE,
152  ),
153  ),
154  'note_size' => Array(
155  'added' => '0.0.1',
156  'type' => 'text',
157  'default' => '80%',
158  ),
159  'next_questionid' => Array(
160  'added' => '0.3',
161  'type' => 'int',
162  'default' => 0,
163  ),
164  'submission_errors_msg' => Array(
165  'added' => '0.0.2',
166  'type' => 'wysiwyg',
167  'default' => '',
168  'is_contextable' => TRUE,
169  ),
170  'require_captcha' => Array(
171  'type' => 'boolean',
172  'default' => FALSE,
173  'parameters' => Array(
174  'allow_empty' => FALSE,
175  ),
176  ),
177  'captcha_length' => Array(
178  'added' => '0.9',
179  'type' => 'int',
180  'default' => 4,
181  ),
182  'captcha_zoom' => Array(
183  'added' => '0.9',
184  'type' => 'int',
185  'default' => 1,
186  ),
187  'captcha_link_text' => Array(
188  'added' => '0.9',
189  'type' => 'text',
190  'default' => 'Regenerate security key',
191  'is_contextable' => TRUE,
192  ),
193  'multi_page' => Array(
194  'added' => '0.13',
195  'type' => 'boolean',
196  'default' => FALSE,
197  'description' => 'If TRUE, top-level sections will be used as pages in a multi-page form, ordered by sort order. Unattached questions will appear on a first page, before the first section. If FALSE, the form will appear on a single page.',
198  'parameters' => Array(
199  'allow_empty' => FALSE,
200  ),
201  ),
202  'use_confirmation_page' => Array(
203  'added' => '0.13',
204  'type' => 'boolean',
205  'default' => FALSE,
206  'description' => 'Add a confirmation page after the final page of the form, allowing users of the form to review their entries before submitting.',
207  'parameters' => Array(
208  'allow_empty' => FALSE,
209  ),
210  ),
211  'next_button' => Array(
212  'added' => '0.13',
213  'type' => 'text',
214  'default' => 'Next Page',
215  'description' => 'Sets the text of a Next Page button for multiple page forms. Next Page and Submit buttons both use the Submit Button keyword, however will show the Next Page text when there are still pages to view (rather than Submit on the last page).',
216  'is_contextable' => TRUE,
217  ),
218  'previous_button' => Array(
219  'added' => '0.13',
220  'type' => 'text',
221  'default' => 'Previous Page',
222  'description' => 'Sets the text of a Previous Page button for multiple page forms. In a single-page form, any Previous Page button keywords will be blanked out.',
223  'is_contextable' => TRUE,
224  ),
225  'save_button' => Array(
226  'added' => '0.13',
227  'type' => 'text',
228  'default' => '',
229  'description' => 'Text of the Save button for multiple-page forms. The Save button saves the current page\'s contents (without validating), and reloads the same page.',
230  'is_contextable' => TRUE,
231  ),
232  'save_confirmation_message' => Array(
233  'added' => '0.13',
234  'type' => 'text',
235  'default' => 'Save',
236  'description' => 'The %save_confirmation% keyword will be replaced with this just after the Save button is pressed, otherwise keyword is blank. HTML allowed.',
237  'is_contextable' => TRUE,
238  ),
239  'save_and_exit_button' => Array(
240  'added' => '0.13',
241  'type' => 'text',
242  'default' => 'Save and Exit',
243  'description' => 'Text of the Save and Exit button for multiple-page forms. Save and Exit saves the current page\'s contents (without validating), and then paints an "Exit Bodycopy". The current page counter is not changed from where the user clicked Save and Exit.',
244  'is_contextable' => TRUE,
245  ),
246  'unattached_page_name' => Array(
247  'added' => '0.13',
248  'type' => 'text',
249  'default' => 'Unattached Questions',
250  'description' => 'Page name in a multi-page form for the "Unattached Questions" page (ie. questions attached directly to the form), which are displayed as Page 1 when at least one exists.',
251  'is_contextable' => TRUE,
252  ),
253  'confirmation_page_name' => Array(
254  'added' => '0.13',
255  'type' => 'text',
256  'default' => 'Confirmation',
257  'description' => 'Page name in a multi-page form for the "Confirmation" page, when turned on.',
258  'is_contextable' => TRUE,
259  ),
260  'page_list_format' => Array(
261  'added' => '0.13',
262  'type' => 'text',
263  'default' => '%page_number%',
264  'description' => 'A format for each entry of a page list. Keywords allowed. HTML allowed, but keyword replacements will be escaped.',
265  ),
266  'submission_warning_time' => Array(
267  'added' => '0.13',
268  'type' => 'duration',
269  'default' => 0,
270  'description' => 'Length of time before a warning email is sent out to the owner of an incomplete submission',
271  ),
272  'submission_expiry_time' => Array(
273  'added' => '0.13',
274  'type' => 'duration',
275  'default' => 0,
276  'description' => 'Length of time until an incomplete submission is liable to be mopped up by a clean-up procedure',
277  ),
278  'warning_email_format' => Array(
279  'added' => '0.13',
280  'type' => 'email_format',
281  'default' => Array(),
282  ),
283  'captcha_use_colours' => Array(
284  'type' => 'boolean',
285  'default' => FALSE,
286  'parameters' => Array(
287  'allow_empty' => FALSE,
288  ),
289  ),
290  'captcha_bgcolour' => Array(
291  'added' => '0.14',
292  'type' => 'colour',
293  'default' => 'FFFFFF',
294  ),
295  'captcha_textcolour' => Array(
296  'added' => '0.14',
297  'type' => 'colour',
298  'default' => '000000',
299  ),
300  'captcha_bordercolour' => Array(
301  'added' => '0.14',
302  'type' => 'colour',
303  'default' => '000000',
304  ),
305  'submit_button_extras' => Array(
306  'added' => '0.15',
307  'type' => 'text',
308  'default' => '',
309  ),
310  'reset_button_extras' => Array(
311  'added' => '0.15',
312  'type' => 'text',
313  'default' => '',
314  ),
315  'captcha_usefont' => Array(
316  'type' => 'boolean',
317  'default' => FALSE,
318  'parameters' => Array(
319  'allow_empty' => FALSE,
320  ),
321  ),
322  'captcha_ttf' => Array(
323  'added' => '0.9',
324  'type' => 'assetid',
325  'default' => '',
326  'description' => 'The asset id of the font file.',
327  ),
328  'captcha_font_size' => Array(
329  'added' => '0.9',
330  'type' => 'int',
331  'default' => 20,
332  ),
333  'captcha_min_angle' => Array(
334  'added' => '0.9',
335  'type' => 'int',
336  'default' => -20,
337  ),
338  'captcha_max_angle' => Array(
339  'added' => '0.9',
340  'type' => 'int',
341  'default' => 20,
342  ),
343  'captcha_x_start' => Array(
344  'added' => '0.9',
345  'type' => 'int',
346  'default' => 10,
347  ),
348  'captcha_min_distance' => Array(
349  'added' => '0.9',
350  'type' => 'int',
351  'default' => 10,
352  ),
353  'captcha_max_distance' => Array(
354  'added' => '0.9',
355  'type' => 'int',
356  'default' => 20,
357  ),
358  'captcha_width' => Array(
359  'added' => '0.9',
360  'type' => 'int',
361  'default' => 200,
362  ),
363  'captcha_height' => Array(
364  'added' => '0.9',
365  'type' => 'int',
366  'default' => 36,
367  ),
368  'captcha_arc' => Array(
369  'type' => 'boolean',
370  'default' => FALSE,
371  'parameters' => Array(
372  'allow_empty' => FALSE,
373  ),
374  ),
375  'captcha_arc_colour' => Array(
376  'added' => '0.9',
377  'type' => 'colour',
378  'default' => 'D20A0A',
379  ),
380  'captcha_include_uppercase' => Array(
381  'type' => 'boolean',
382  'default' => FALSE,
383  'parameters' => Array(
384  'allow_empty' => FALSE,
385  ),
386  ),
387  'captcha_include_numbers' => Array(
388  'type' => 'boolean',
389  'default' => FALSE,
390  'parameters' => Array(
391  'allow_empty' => FALSE,
392  ),
393  ),
394  'provide_accessible_captcha' => Array(
395  'type' => 'boolean',
396  'default' => FALSE,
397  'parameters' => Array(
398  'allow_empty' => FALSE,
399  ),
400  ),
401 
402  'captcha_invalid_error_message' => Array(
403  'added' => '0.15',
404  'type' => 'text',
405  'default' => 'Security Key Incorrect',
406  'is_contextable' => TRUE,
407  ),
408  'captcha_form_invalid_error_message' => Array(
409  'added' => '0.15',
410  'type' => 'text',
411  'default' => 'Valid CAPTCHA is required, but none is found in this form submission',
412  'is_contextable' => TRUE,
413  ),
414 
415  // Mollom Spam Check question response ///////
416  'use_mollom' => Array(
417  'added' => '0.15',
418  'type' => 'boolean',
419  'default' => FALSE,
420  'parameters' => Array(
421  'allow_empty' => FALSE,
422  ),
423  ),
424  'mollom_questions_to_check' => Array(
425  'added' => '0.15',
426  'type' => 'serialise',
427  'default' => Array(),
428  'description' => 'Question response to check for spam',
429  ),
430  'mollom_unsure_submission_text' => Array(
431  'added' => '0.15',
432  'type' => 'text',
433  'default' => 'Please enter the characters in the image to verify your submission',
434  'description' => 'Mollom error message text for unsure submission',
435  ),
436  'mollom_spam_submission_text' => Array(
437  'added' => '0.15',
438  'type' => 'text',
439  'default' => 'This submission looks like a spam. Cannot accept this submission',
440  'description' => 'Mollom error message text for spam submission',
441  ),
442  'mollom_captcha_incorrect_text' => Array(
443  'added' => '0.15',
444  'type' => 'text',
445  'default' => 'Incorrect security key. Please try again',
446  'description' => 'Mollom error message text for incorrect captcha',
447  ),
448  'mollom_captcha_regen_link_text' => Array(
449  'added' => '0.15',
450  'type' => 'text',
451  'default' => 'Regenerate security key',
452  'description' => 'Mollom CAPTCHA regen link text',
453  ),
454  'disable_keyword_replacements' => Array(
455  'added' => '0.16',
456  'type' => 'boolean',
457  'default' => TRUE,
458  'description' => 'If true, will not replace any keywords from user input',
459  'parameters' => Array(
460  'allow_empty' => FALSE,
461  ),
462  ),
463  'submission_limit' => Array(
464  'added' => '0.16',
465  'type' => 'int',
466  'default' => 0,
467  'description' => 'limit the number of submissions allowed',
468  ),
469  'submission_limit_reached_text' => Array(
470  'added' => '0.16',
471  'type' => 'text',
472  'default' => 'Submission limit has been reached on this form. No more submission will be accepted',
473  'is_contextable'=> TRUE,
474  ),
475  );
476 
477  }//end constructor
478 
479 
486  function getEventList()
487  {
488  return Array(
489  Array(
490  'event_name' => 'requestKeywords',
491  'broadcast_type_code' => 'content_type',
492  'broadcast_strict_type_code' => FALSE,
493  'options' => Array(
494  'side_of_link' => 'major',
495  'indirect' => TRUE,
496  'is_exclusive' => NULL,
497  'is_dependant' => 1,
498  'value' => '',
499  'link_type' => SQ_LINK_TYPE_2 | SQ_LINK_TYPE_1,
500  ),
501  ),
502  );
503 
504  }//end getEventList()
505 
506 
513  function _getFileList()
514  {
515  return Array(
516  'popups/page_contents_keywords.php',
517  'popups/thank_you_keywords.php',
518  );
519 
520  }//end _getFileList()
521 
522 }//end class
523 ?>