aboutsummaryrefslogtreecommitdiff
path: root/mod/ecml/views
diff options
context:
space:
mode:
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