Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
thank_you_keywords.php
1 <?php
17  require_once dirname(__FILE__).'/../../../../../core/include/init.inc';
18  require_once dirname(__FILE__).'/../../../../../core/lib/html_form/html_form.inc';
19  if (!isset($_GET['assetid'])) return FALSE;
20 
21  assert_valid_assetid($_GET['assetid']);
22  $asset = $GLOBALS['SQ_SYSTEM']->am->getAsset($_GET['assetid']);
23  if (!($asset instanceof Form)) {
24  trigger_localised_error('CMS0002', E_USER_ERROR, $asset);
25  return FALSE ;
26  }
27 ?>
28 
29 <html>
30  <head>
31  <title>'<?php echo $asset->attr('name') ?>' Thank You / Emails Keyword Replacements</title>
32  <style>
33  body {
34  background-color: #FFFFFF;
35  }
36 
37  body, p, td, ul, li, input, select, textarea{
38  color: #000000;
39  font-family: Arial, Verdana Helvetica, sans-serif;
40  font-size: 11px;
41  }
42 
43  fieldset {
44  padding: 0px 10px 5px 5px;
45  border: 1px solid #E0E0E0;
46  }
47 
48  legend {
49  color: #2086EA;
50  }
51  </style>
52  </head>
53 
54  <body>
55  <?php
56  require_once dirname(__FILE__).'/../../../../../core/include/backend_outputter.inc';
57  // $backend = new Backend();
58  $o = new Backend_Outputter();
59 
60  $o->openSection('Keyword List for \''.$asset->attr('name').'\' (#'.$asset->id.')');
61  $o->openField('&nbsp;');
62 
63  $questions = $asset->getQuestions();
64  $sections = $asset->getSections();
65  ?>
66  <p>These keywords are available for use in Complex Formatting for insertion into the 'Thank You' bodycopy, if it is enabled, as well as in emails sent from this form. The <b>'Response'</b> keywords (%response_*%) are replaced with the actual response for that question. The <b>'Section Title'</b> keywords (%section_title_*%) will be replaced with the name of the section.</p>
67 
68  <p>
69  <fieldset>
70  <legend><b>Unattached Questions</b></legend>
71  <table border="0" width="100%">
72  <?php
73  foreach ($questions as $q_id => $question) {
74  ?> <tr><td valign="top" width="200"><b>%response_<?php echo $asset->id.'_q'.$q_id; ?>%</b></td><td valign="top"><?php echo get_asset_tag_line($asset->id.':q'.$q_id); ?></td></tr><?php
75  }
76  ?>
77  </table>
78  </fieldset>
79  </p>
80 
81  <?php
82  foreach ($sections as $section) {
83  ?>
84  <p>
85  <fieldset>
86  <legend><b><?php echo get_asset_tag_line($section->id); ?></b></legend>
87  <table border="0" width="100%">
88  <tr><td valign="top" width="200"><b>%section_title_<?php echo $section->id ?>%</b></td><td valign="top">Section Title</td></tr>
89  <?php
90  $replacements['section_title_'.$section->id] = $section->attr('name');
91  $questions = $section->getQuestions();
92  foreach ($questions as $q_id => $question) {
93  ?>
94  <tr><td valign="top" width="200"><b>%response_<?php echo $section->id.'_q'.$q_id; ?>%</b></td><td valign="top"><?php echo get_asset_tag_line($section->id.':q'.$q_id); ?></td></tr>
95  <?php
96  }
97  ?>
98  </table>
99  </fieldset>
100  </p>
101  <?php
102  }
103  ?>
104 
105 
106  </table>
107  </fieldset>
108  </p>
109 
110 <?php
111 $o->openField('', 'commit');
112 normal_button('cancel', 'Close Window', 'window.close()');
113 $o->closeSection();
114 $o->paint();
115 ?>
116  </body>
117 </html>