aboutsummaryrefslogtreecommitdiff
path: root/mod/ecml/views
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-16 17:20:53 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-04-16 17:20:53 +0000
commit732207c9a17483d1a660f9b7cec81f531a0838e5 (patch)
treeafbf7f6205102350a33d3a6c6ba46fc36ca417a6 /mod/ecml/views
parent741808bdf03d09c3e5c2ac3865451fade409d892 (diff)
downloadelgg-732207c9a17483d1a660f9b7cec81f531a0838e5.tar.gz
elgg-732207c9a17483d1a660f9b7cec81f531a0838e5.tar.bz2
ECML permissions frontend presents a whitelist instead of a black list.
git-svn-id: http://code.elgg.org/elgg/trunk@5779 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/ecml/views')
-rw-r--r--mod/ecml/views/default/ecml/admin/css.php3
-rw-r--r--mod/ecml/views/default/ecml/admin/ecml_admin.php27
2 files changed, 21 insertions, 9 deletions
diff --git a/mod/ecml/views/default/ecml/admin/css.php b/mod/ecml/views/default/ecml/admin/css.php
index 960941a03..1431074f0 100644
--- a/mod/ecml/views/default/ecml/admin/css.php
+++ b/mod/ecml/views/default/ecml/admin/css.php
@@ -14,4 +14,7 @@
}
.ecml_row_even {
+}
+.ecml_restricted {
+ color: #555;
} \ No newline at end of file
diff --git a/mod/ecml/views/default/ecml/admin/ecml_admin.php b/mod/ecml/views/default/ecml/admin/ecml_admin.php
index 0bd7793c8..36ad11f93 100644
--- a/mod/ecml/views/default/ecml/admin/ecml_admin.php
+++ b/mod/ecml/views/default/ecml/admin/ecml_admin.php
@@ -35,21 +35,30 @@ $form_body .= '</tr>';
$odd = 'odd';
foreach ($keywords as $keyword => $keyword_info) {
$keyword_desc = $keyword_info['description'];
- $form_body .= "
- <tr class=\"ecml_row_$odd\">
- <td class=\"ecml_keyword_desc\"><acronym class=\"ecml_keyword ecml_check_all\" title=\"$keyword_desc\">$keyword</acronym></td>
-";
+ if (isset($keyword_info['restricted'])) {
+ $restricted = elgg_echo('ecml:admin:restricted');
+ $form_body .= "
+ <tr class=\"ecml_row_$odd\">
+ <td class=\"ecml_keyword_desc\"><acronym class=\"ecml_keyword ecml_restricted\" title=\"$keyword_desc\">$keyword ($restricted)</acronym></td>
+ ";
+ } else {
+ $form_body .= "
+ <tr class=\"ecml_row_$odd\">
+ <td class=\"ecml_keyword_desc\"><acronym class=\"ecml_keyword ecml_check_all\" title=\"$keyword_desc\">$keyword</acronym></td>
+ ";
+ }
foreach ($views as $view => $view_info) {
// 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($keyword_info['restricted']) && !in_array($view, $keyword_info['restricted'])) {
- $form_body .= "<td><input type=\"checkbox\" checked=\"checked\" disabled=\"disabled\"/></td>";
+ if (isset($keyword_info['restricted'])) {
+ $checked = (in_array($view, $keyword_info['restricted'])) ? 'checked="checked"' : '';
+ $form_body .= "<td><input type=\"checkbox\" $checked name=\"whitelist[$view][]\" value=\"$keyword\" disabled=\"disabled\"/></td>";
} else {
- $checked = (in_array($keyword, $perms[$view])) ? 'checked="checked"' : '';
+ $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>";
+ $form_body .= "<td><input type=\"checkbox\" name=\"whitelist[$view][]\" value=\"$keyword\" $checked /></td>";
}
}
$form_body .= '</tr>';
@@ -71,7 +80,7 @@ echo elgg_view('input/form', array(
$(document).ready(function() {
// append check all link
- $('.ecml_check_all').before('<input type="checkbox" class="check_all">');
+ $('.ecml_check_all').before('<input type="checkbox" checked="checked" class="check_all">');
$('input.check_all').click(function() {
// yoinked from