aboutsummaryrefslogtreecommitdiff
path: root/mod/ecml/views/default/settings
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-26 11:55:03 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-26 11:55:03 +0000
commit68803264c6476fd96311bc83937f04164348cce4 (patch)
tree3e88f86684643cd2e05fcf1b0cc6add400bf1831 /mod/ecml/views/default/settings
parent49d3c5b5f577b1120f75b11e90849f597747f71b (diff)
downloadelgg-68803264c6476fd96311bc83937f04164348cce4.tar.gz
elgg-68803264c6476fd96311bc83937f04164348cce4.tar.bz2
moving ecml to plugins repository as it won't be a part of 1.8.0. It will be back though...
git-svn-id: http://code.elgg.org/elgg/trunk@7938 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/ecml/views/default/settings')
-rw-r--r--mod/ecml/views/default/settings/ecml/edit.php133
1 files changed, 0 insertions, 133 deletions
diff --git a/mod/ecml/views/default/settings/ecml/edit.php b/mod/ecml/views/default/settings/ecml/edit.php
deleted file mode 100644
index 8c1a3b4a1..000000000
--- a/mod/ecml/views/default/settings/ecml/edit.php
+++ /dev/null
@@ -1,133 +0,0 @@
-<?php
-/**
- * Configs granular access
- *
- * @package ECML
- */
-
-$views = $vars['config']->ecml_parse_views;
-$keywords = $vars['config']->ecml_keywords;
-$perms = $vars['config']->ecml_permissions;
-
-ksort($views);
-ksort($keywords);
-
-echo '<p class="margin-top">' . elgg_echo('ecml:admin:instruction') . '</p>';
-
-// yes I'm using a table because this is table.
-$form_body = <<<___END
-<table class="ecml_admin_table">
- <tr>
- <th>&nbsp</th>
-___END;
-
-foreach ($views as $view => $view_desc) {
- $form_body .= "<th><acronym class=\"ecml_view ecml_check_all\" title=\"$view\">$view_desc</acronym></th>";
- $n++;
-}
-$form_body .= '</tr>';
-
-$odd = 'odd';
-foreach ($keywords as $keyword => $keyword_info) {
- $keyword_desc = $keyword_info['description'];
- 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'])) {
- $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"' : '';
-
- // ooook. input/checkboxes isn't overly useful.
- // do it ourself.
- $form_body .= "<td><input type=\"checkbox\" name=\"whitelist[$view][]\" value=\"$keyword\" $checked /></td>";
- }
- }
- $form_body .= '</tr>';
-
- $odd = ($odd == 'odd') ? 'even' : 'odd';
-}
-
-$form_body .= '</table>';
-
-echo $form_body;
-
-?>
-<script type="text/javascript">
-
-$(document).ready(function() {
- // append check all link
- $('.ecml_check_all').before('<input type="checkbox" checked="checked" class="check_all">');
-
- // determin initial state of checkall checkbox.
- $('.ecml_check_all').each(function() {
- var keyword = $(this).hasClass('ecml_keyword');
- var checkbox = $(this).parent().find('input[type=checkbox]');
- var checked;
-
- // no keywords checked, checkall unchecked
- // any keyword checked, checkall unchecked
- // all keywords checked, checkall checked
-
- // if keyword, check the TR
- if (keyword) {
- checked = true;
- $(this).parent().parent().find('input').each(function() {
- if (!$(this).hasClass('check_all') && !$(this).attr('disabled')) {
- checked = (checked && $(this).attr('checked'));
- // can't break...
- }
- });
- checkbox.attr('checked', checked);
- } else {
- checked = true;
- var rowIndex = $(this).parent().parent().children().index($(this).parent());
-
- $('.ecml_admin_table > tbody > tr td:nth-child(' + (rowIndex + 1) + ') input[type=checkbox]').each(function() {
- if (!$(this).hasClass('check_all') && !$(this).attr('disabled')) {
- checked = (checked && $(this).attr('checked'));
- // can't break...
- }
- });
- checkbox.attr('checked', checked);
- }
- });
-
- // handle checkall boxes
- $('input.check_all').click(function() {
- // yoinked from
- // http://stackoverflow.com/questions/788225/table-row-and-column-number-in-jquery
- var rowIndex = $(this).parent().parent().children().index($(this).parent());
- var check = $(this).attr('checked');
-
- // clicked on a keyword on the left, check all boxes in the tr
- if (rowIndex == 0) {
- $(this).parent().parent().find('input').each(function() {
- if (!$(this).attr('disabled')) {
- $(this).attr('checked', check);
- }
- });
- } else {
- boxes = $('.ecml_admin_table > tbody > tr td:nth-child(' + (rowIndex + 1) + ') input[type=checkbox]');
- boxes.each(function() {
- if (!$(this).attr('disabled')) {
- $(this).attr('checked', check);
- }
- });
- }
- });
-});
-</script>