Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
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 
20  $assetid = array_get_index($_GET, 'assetid');
21  if (is_null($assetid)) return FALSE;
22  assert_valid_assetid($assetid);
23 
24  $all = array_get_index($_REQUEST, 'all', FALSE);
25 
26 ?>
27 
28 <html>
29  <head>
30  <title>Metadata Keyword Replacements</title>
31  <style>
32  body {
33  background-color: #FFFFFF;
34  }
35 
36  body, p, td, ul, li, input, select, textarea{
37  color: #000000;
38  font-family: Arial, Verdana Helvetica, sans-serif;
39  font-size: 10px;
40  }
41 
42  fieldset {
43  padding: 0px 10px 5px 5px;
44  border: 1px solid #E0E0E0;
45  }
46 
47  legend {
48  color: #2086EA;
49  }
50  </style>
51  </head>
52 
53  <body>
54  <p><b><i>The following keyword replacements may be used for metadata values.<br />Note that the percentage signs (%) are required.</i></b></p>
55 
56  <p>
57  <fieldset>
58  <legend><b>Asset Information</b></legend>
59  <table border="0" width="100%">
60  <tr><td valign="top" width="200"><b>%asset_assetid%</b></td><td valign="top">The ID of the asset</td></tr>
61  <tr><td valign="top" width="200"><b>%asset_name%</b></td><td valign="top">Full name of the asset</td></tr>
62  <tr><td valign="top" width="200"><b>%asset_name_linked%</b></td><td valign="top">Full name of the asset with hyperlink</td></tr>
63  <tr><td valign="top" width="200"><b>%asset_short_name%</b></td><td valign="top">Short name of the asset</td></tr>
64  <tr><td valign="top" width="200"><b>%asset_short_name_linked%</b></td><td valign="top">Short name of the asset with hyperlink</td></tr>
65  <tr><td valign="top" width="200"><b>%asset_version%</b></td><td valign="top">Version of the asset being displayed</td></tr>
66  <tr><td valign="top" width="200"><b>%asset_url%</b></td><td valign="top">URL of the asset</td></tr>
67  <tr><td valign="top" width="200"><b>%asset_href%</b></td><td valign="top">Relative HREF of the asset</td></tr>
68  </table>
69  </fieldset>
70  </p>
71 
72  <p>
73  <fieldset>
74  <legend><b>Creation Details</b></legend>
75  <table border="0" width="100%">
76  <tr><td valign="top" width="200"><b>%asset_created%</b></td><td valign="top">Date/Time the asset was created (YYYY-MM-DD HH-MM-SS)</td></tr>
77  <tr><td valign="top" width="200"><b>%asset_created_short%</b></td><td valign="top">Date/Time the asset was created (YYYY-MM-DD)</td></tr>
78  <tr><td valign="top" width="200"><b>%asset_created_readable%</b></td><td valign="top">Date/Time the asset was created (DD M YYYY H:MM[AM\PM])</td></tr>
79  <tr><td valign="top" width="200"><b>%asset_created_by_name%</b></td><td valign="top">Full name of the user that created this asset</td></tr>
80  <tr><td valign="top" width="200"><b>%asset_created_by_first_name%</b></td><td valign="top">First name of the user that created this asset</td></tr>
81  <tr><td valign="top" width="200"><b>%asset_created_by_last_name%</b></td><td valign="top">Surname of the user that created this asset</td></tr>
82  <tr><td valign="top" width="200"><b>%asset_created_by_email%</b></td><td valign="top">Email of the user that created this asset</td></tr>
83  </table>
84  </fieldset>
85  </p>
86 
87  <p>
88  <fieldset>
89  <legend><b>Last Updated Details</b></legend>
90  <table border="0" width="100%">
91  <tr><td valign="top" width="200"><b>%asset_updated%</b></td><td valign="top">Date/Time the asset was last updated (YYYY-MM-DD HH-MM-SS)</td></tr>
92  <tr><td valign="top" width="200"><b>%asset_updated_short%</b></td><td valign="top">Date/Time the asset was last updated (YYYY-MM-DD)</td></tr>
93  <tr><td valign="top" width="200"><b>%asset_updated_readable%</b></td><td valign="top">Date/Time the asset was last updated (DD M YYYY H:MM[AM\PM])</td></tr>
94  <tr><td valign="top" width="200"><b>%asset_updated_by_name%</b></td><td valign="top">Full name of the user that last updated this asset</td></tr>
95  <tr><td valign="top" width="200"><b>%asset_updated_by_first_name%</b></td><td valign="top">First name of the user that last updated this asset</td></tr>
96  <tr><td valign="top" width="200"><b>%asset_updated_by_last_name%</b></td><td valign="top">Surname of the user that last updated this asset</td></tr>
97  <tr><td valign="top" width="200"><b>%asset_updated_by_email%</b></td><td valign="top">Email of the user that last updated this asset</td></tr>
98  </table>
99  </fieldset>
100  </p>
101 
102  <p>
103  <fieldset>
104  <legend><b>Last Published Details</b></legend>
105  <table border="0" width="100%">
106  <tr><td valign="top" width="200"><b>%asset_published%</b></td><td valign="top">Date/Time the asset was last published (YYYY-MM-DD HH-MM-SS)</td></tr>
107  <tr><td valign="top" width="200"><b>%asset_published_short%</b></td><td valign="top">Date/Time the asset was last published (YYYY-MM-DD)</td></tr>
108  <tr><td valign="top" width="200"><b>%asset_published_readable%</b></td><td valign="top">Date/Time the asset was last published (DD M YYYY H:MM[AM\PM])</td></tr>
109  <tr><td valign="top" width="200"><b>%asset_published_by_name%</b></td><td valign="top">Full name of the user that last published this asset</td></tr>
110  <tr><td valign="top" width="200"><b>%asset_published_by_first_name%</b></td><td valign="top">First name of the user that last published this asset</td></tr>
111  <tr><td valign="top" width="200"><b>%asset_published_by_last_name%</b></td><td valign="top">Surname of the user that last published this asset</td></tr>
112  <tr><td valign="top" width="200"><b>%asset_published_by_email%</b></td><td valign="top">Email of the user that last published this asset</td></tr>
113  </table>
114  </fieldset>
115  </p>
116 
117  <p>
118  <fieldset>
119  <legend><b>Permissions</b></legend>
120  <table border="0" width="100%">
121  <tr><td valign="top" width="200"><b>%asset_read_permission%</b></td><td valign="top">Comma separated list of the full names for users with read access</td></tr>
122  <tr><td valign="top" width="200"><b>%asset_write_permission%</b></td><td valign="top">Comma separated list of the full names for users with write access</td></tr>
123  <tr><td valign="top" width="200"><b>%asset_admin_permission%</b></td><td valign="top">Comma separated list of the full names for users with administrator access</td></tr>
124  <tr><td valign="top" width="200"><b>%asset_read_permission_email%</b></td><td valign="top">Comma separated list of email addresses for users with read access</td></tr>
125  <tr><td valign="top" width="200"><b>%asset_write_permission_email%</b></td><td valign="top">Comma separated list of email addresses for users with write access</td></tr>
126  <tr><td valign="top" width="200"><b>%asset_admin_permission_email%</b></td><td valign="top">Comma separated list of email addresses for users with administrator access</td></tr>
127  <tr><td valign="top" width="200"><b>%asset_read_permission_email_linked%</b></td><td valign="top">Comma separated list of linked email addresses for users with read access</td></tr>
128  <tr><td valign="top" width="200"><b>%asset_write_permission_email_linked%</b></td><td valign="top">Comma separated list of linked email addresses for users with write access</td></tr>
129  <tr><td valign="top" width="200"><b>%asset_admin_permission_email_linked%</b></td><td valign="top">Comma separated list of linked email addresses for users with administrator access</td></tr>
130  </table>
131  </fieldset>
132  </p>
133 
134  <?php
135  $roles = Array();
136  if ($all) {
137  $roles_temp = $GLOBALS['SQ_SYSTEM']->am->getTypeAssetids('role');
138  $users = Array();
139  foreach ($roles_temp as $roleid) {
140  $role = $GLOBALS['SQ_SYSTEM']->am->getAsset($roleid);
141  if ($role->readAccess(Array())) $roles[] = $roleid;
142  $GLOBALS['SQ_SYSTEM']->am->forgetAsset($role);
143  }
144  } else {
145  $roles = $GLOBALS['SQ_SYSTEM']->am->getRole($assetid);
146  $roles = array_keys($roles);
147  }
148 
149  if (!empty($roles)) {
150  ?>
151  <p>
152  <fieldset>
153  <legend><b>Roles</b></legend>
154  <table border="0" width="100%">
155  <?php
156  $roleinfo = $GLOBALS['SQ_SYSTEM']->am->getAssetInfo($roles, Array(), FALSE, 'name');
157  foreach ($roleinfo as $roleid => $name) {
158  ?>
159  <tr>
160  <td valign="top" width="200" colspan="2"><b><?php echo $name; ?></b></td>
161  </tr>
162  <tr>
163  <td valign="top" width="200"><b>%asset_role_<?php echo $roleid; ?>%</b></td>
164  <td valign="top">Comma separated list of the full names for users/groups who can perform the "<?php echo $name; ?>" role</td>
165  </tr>
166  <tr>
167  <td valign="top" width="200"><b>%asset_role_<?php echo $roleid; ?>_email%</b></td>
168  <td valign="top">Comma separated list of email addresses for users/groups who can perform the "<?php echo $name; ?>" role</td>
169  </tr>
170  <tr>
171  <td valign="top" width="200"><b>%asset_role_<?php echo $roleid; ?>_email_linked%</b></td>
172  <td valign="top">Comma separated list of linked email addresses for users/groups who can perform the "<?php echo $name; ?>" role</td>
173  </tr>
174  <?php
175  }
176  ?>
177  </table>
178  </fieldset>
179  </p>
180  <?php
181  }//end if
182 
183 ?>
184 <p>
185 <fieldset>
186 <legend><b>All Keywords</b> (dynamically populated)</legend>
187 <table border="0" width="100%">
188 <?php
189 $asset = $GLOBALS['SQ_SYSTEM']->am->getAsset($assetid);
190 $keywords = $asset->getAvailableKeywords();
191 ksort($keywords);
192 
193 foreach ($keywords as $keyword => $description) {
194  ?>
195  <tr>
196  <td valign="top" width="200"><b>%<?php echo $keyword; ?>%</b></td>
197  <td valign="top"><?php echo $description; ?></td>
198  </tr>
199  <?php
200 }
201 
202 ?>
203 </table>
204 </fieldset>
205 </p>
206 
207  </body>
208 </html>