aboutsummaryrefslogtreecommitdiff
path: root/mod/ecml/views
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-15 19:01:51 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-15 19:01:51 +0000
commiteb3f65345410313a6b87149fdea504d0a66e53af (patch)
treef2013a420db7d201634a6fea0d18761c1d5e3eb4 /mod/ecml/views
parentc852d9e9e0fd64d70dcaace105f2bf7e7d3c1b95 (diff)
downloadelgg-eb3f65345410313a6b87149fdea504d0a66e53af.tar.gz
elgg-eb3f65345410313a6b87149fdea504d0a66e53af.tar.bz2
Added ability for ECML keyword definitions to restrict themselves to specific views.
git-svn-id: http://code.elgg.org/elgg/trunk@5750 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/ecml/views')
-rw-r--r--mod/ecml/views/default/ecml/admin/ecml_admin.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/mod/ecml/views/default/ecml/admin/ecml_admin.php b/mod/ecml/views/default/ecml/admin/ecml_admin.php
index bb2cd7f05..2a5663327 100644
--- a/mod/ecml/views/default/ecml/admin/ecml_admin.php
+++ b/mod/ecml/views/default/ecml/admin/ecml_admin.php
@@ -40,11 +40,17 @@ foreach ($views as $view => $desc) {
<td class=\"ecml_view_desc\">$desc</td>
";
foreach ($keywords as $keyword => $info) {
- $checked = (in_array($keyword, $perms[$view])) ? 'checked="checked"' : '';
+ // if this is restricted and we're not on the specified view don't allow changes
+ // since we don't save this, no need to pass a name
+ if (isset($info['restricted']) && !in_array($view, $info['restricted'])) {
+ $form_body .= "<td><input type=\"checkbox\" checked=\"checked\" disabled=\"disabled\"/></td>";
+ } else {
+ $checked = (in_array($keyword, $perms[$view])) ? 'checked="checked"' : '';
- // ooook. input/checkboxes isn't overly useful.
- // do it ourself.
- $form_body .= "<td><input type=\"checkbox\" name=\"perms[$view][]\" value=\"$keyword\" $checked /></td>";
+ // ooook. input/checkboxes isn't overly useful.
+ // do it ourself.
+ $form_body .= "<td><input type=\"checkbox\" name=\"perms[$view][]\" value=\"$keyword\" $checked /></td>";
+ }
}
$form_body .= '</tr>';