Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
page_contents_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') ?>' Page Contents 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 'Page Contents' bodycopy, if it is enabled. The <b>'Question Field'</b> keywords (%question_field_*%) are replaced with the appropriate input field 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  $q_asset = $GLOBALS['SQ_SYSTEM']->am->getAsset($asset->id.':q'.$q_id);
75  $q_name = $q_asset->attr('name');
76  ?> <tr><td valign="top" width="200"><b>%question_field_<?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
77  }
78  ?>
79  </table>
80  </fieldset>
81  </p>
82 
83  <?php
84  foreach ($sections as $section) {
85  ?>
86  <p>
87  <fieldset>
88  <legend><b><?php echo get_asset_tag_line($section->id); ?></b></legend>
89  <table border="0" width="100%">
90  <tr><td valign="top" width="200"><b>%section_title_<?php echo $section->id ?>%</b></td><td valign="top">Section Title</td></tr>
91  <?php
92  $replacements['section_title_'.$section->id] = $section->attr('name');
93  $questions = $section->getQuestions();
94  foreach ($questions as $q_id => $question) {
95  $q_asset = $GLOBALS['SQ_SYSTEM']->am->getAsset($section->id.':q'.$q_id);
96  $q_name = $section->attr('name').': '.$q_asset->attr('name');
97  ?>
98  <tr><td valign="top" width="200"><b>%question_field_<?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>
99  <?php
100  }
101  ?>
102  </table>
103  </fieldset>
104  </p>
105  <?php
106  }
107  ?>
108 
109 
110  </table>
111  </fieldset>
112  </p>
113 
114 <?php
115 $o->openField('', 'commit');
116 normal_button('cancel', 'Close Window', 'window.close()');
117 $o->closeSection();
118 $o->paint();
119 ?>
120  </body>
121 </html>