summaryrefslogtreecommitdiff
path: root/lib/plugins/acl
diff options
context:
space:
mode:
authorKate Arzamastseva <pshns@ukr.net>2011-08-25 15:01:15 +0300
committerKate Arzamastseva <pshns@ukr.net>2011-08-25 15:01:15 +0300
commit47e84e7a9713558efde9ea83063d3e0830651622 (patch)
tree8416e23249ee823249a98c8a0fbf88cfe26b80d7 /lib/plugins/acl
parent80525638759a0bfe0ca5d83d9b06430f0d94c2ac (diff)
parent1c5f7481f4e685ad3ffe9ba48ed47ed75196e64a (diff)
downloadrpg-47e84e7a9713558efde9ea83063d3e0830651622.tar.gz
rpg-47e84e7a9713558efde9ea83063d3e0830651622.tar.bz2
merging
Diffstat (limited to 'lib/plugins/acl')
-rw-r--r--lib/plugins/acl/admin.php3
-rw-r--r--lib/plugins/acl/lang/fi/lang.php1
-rw-r--r--lib/plugins/acl/lang/fr/lang.php1
-rw-r--r--lib/plugins/acl/lang/hr/help.txt11
-rw-r--r--lib/plugins/acl/lang/hr/lang.php29
-rw-r--r--lib/plugins/acl/script.js155
-rw-r--r--lib/plugins/acl/style.css1
7 files changed, 112 insertions, 89 deletions
diff --git a/lib/plugins/acl/admin.php b/lib/plugins/acl/admin.php
index 7c12b3374..53f6db0cc 100644
--- a/lib/plugins/acl/admin.php
+++ b/lib/plugins/acl/admin.php
@@ -540,7 +540,8 @@ class admin_plugin_acl extends DokuWiki_Admin_Plugin {
function _html_li_acl($item){
- return '<li class="level'.$item['level'].'">';
+ return '<li class="level' . $item['level'] . ' ' .
+ ($item['open'] ? 'open' : 'closed') . '">';
}
diff --git a/lib/plugins/acl/lang/fi/lang.php b/lib/plugins/acl/lang/fi/lang.php
index 04074d8d4..4f145e0f6 100644
--- a/lib/plugins/acl/lang/fi/lang.php
+++ b/lib/plugins/acl/lang/fi/lang.php
@@ -5,6 +5,7 @@
* @author otto@valjakko.net
* @author Otto Vainio <otto@valjakko.net>
* @author Teemu Mattila <ghcsystems@gmail.com>
+ * @author Sami Olmari <sami@olmari.fi>
*/
$lang['admin_acl'] = 'Käyttöoikeudet (ACL)';
$lang['acl_group'] = 'Ryhmä';
diff --git a/lib/plugins/acl/lang/fr/lang.php b/lib/plugins/acl/lang/fr/lang.php
index 36323a51f..fd3f40dfc 100644
--- a/lib/plugins/acl/lang/fr/lang.php
+++ b/lib/plugins/acl/lang/fr/lang.php
@@ -21,6 +21,7 @@
* @author Florian Gaub <floriang@floriang.net>
* @author Samuel Dorsaz samuel.dorsaz@novelion.net
* @author Johan Guilbaud <guilbaud.johan@gmail.com>
+ * @author schplurtz@laposte.net
*/
$lang['admin_acl'] = 'Gestion de la liste des contrôles d\'accès (ACL)';
$lang['acl_group'] = 'Groupe';
diff --git a/lib/plugins/acl/lang/hr/help.txt b/lib/plugins/acl/lang/hr/help.txt
new file mode 100644
index 000000000..4e7cfc3c2
--- /dev/null
+++ b/lib/plugins/acl/lang/hr/help.txt
@@ -0,0 +1,11 @@
+=== Brza Pomoć: ===
+
+Na ovoj stranici možeš dodavati i brisati dozvole za imenske prostore i stranice u svom wiki-u.
+
+Lijevi prozor prikazuje sve dostupne imenske prostore i stranice.
+
+Forma iznad ti omogućuje pregled i mijenjanje dozvola odabranom korisniku ili grupi.
+
+U tablici ispod prikazana su sva trenutno postavljena pravila kontrole pristupa. Koristite je za višestruko brisanje ili mijenjanje pravila.
+
+Čitanje [[doku>acl|službena dokumentacija o ACL]] može vam pomoći potpuno razumijeti kako kontrola pristupa radi u DokuWiki. \ No newline at end of file
diff --git a/lib/plugins/acl/lang/hr/lang.php b/lib/plugins/acl/lang/hr/lang.php
index d2094b77b..8c21f1b0b 100644
--- a/lib/plugins/acl/lang/hr/lang.php
+++ b/lib/plugins/acl/lang/hr/lang.php
@@ -4,4 +4,33 @@
*
* @author Branko Rihtman <theney@gmail.com>
* @author Dražen Odobašić <dodobasic@gmail.com>
+ * @author Dejan Igrec dejan.igrec@gmail.com
*/
+$lang['admin_acl'] = 'Upravljanje listom kontrole pristupa';
+$lang['acl_group'] = 'Grupa';
+$lang['acl_user'] = 'Korisnik';
+$lang['acl_perms'] = 'Dozvole za';
+$lang['page'] = 'Stranica';
+$lang['namespace'] = 'Imenski prostor';
+$lang['btn_select'] = 'Odaberi';
+$lang['p_user_id'] = 'Korisnik <b class="acluser">%s</b> trenutno ima sljedeće dozvole na stranici <b class="aclpage">%s</b>: <i>%s</i>.';
+$lang['p_user_ns'] = 'Korisnik <b class="acluser">%s</b> trenutno ima sljedeće dozvole u imenskom prostoru <b class="aclns">%s</b>: <i>%s</i>.';
+$lang['p_group_id'] = 'Članovi grupe <b class="aclgroup">%s</b> trenutno imaju sljedeće dozvole na stranici <b class="aclpage">%s</b>: <i>%s</i>.';
+$lang['p_group_ns'] = 'Članovi grupe <b class="aclgroup">%s</b> trenutno imaju sljedeće dozvole u imenskom prostoru <b class="aclns">%s</b>: <i>%s</i>.';
+$lang['p_choose_id'] = 'Molim <b>unesti korisnika ili grupu</b> u gornju formu za pregled ili uređivanje dozvola postavljenih za stranicu <b class="aclpage">%s</b>.';
+$lang['p_choose_ns'] = 'Molim <b>unesti korisnika ili grupu</b> u gornju formu za pregled ili uređivanje dozvola postavljenih za imenski prostor <b class="aclns">%s</b>.';
+$lang['p_inherited'] = 'Napomena: Ove dozvole nisu postavljene eksplicitno već su naslijeđene od drugih grupa ili nadređenih imenskih prostora.';
+$lang['p_isadmin'] = 'Napomena: Odabrana grupa ili korisnik uvijek ima sve dozvole jer je postavljen kao superuser.';
+$lang['p_include'] = 'Više dozvole uključuju sve niže. Dozvole Kreiraj, Učitaj i Briši se primjenjuju samo na imenske prostore, ne stranice.';
+$lang['current'] = 'Trenutna ACL Pravila';
+$lang['where'] = 'Stranica/Imenski prostor';
+$lang['who'] = 'Korisnik/Grupa';
+$lang['perm'] = 'Dozvole';
+$lang['acl_perm0'] = 'Ništa';
+$lang['acl_perm1'] = 'Čitaj';
+$lang['acl_perm2'] = 'Uredi';
+$lang['acl_perm4'] = 'Kreiraj';
+$lang['acl_perm8'] = 'Učitaj';
+$lang['acl_perm16'] = 'Briši';
+$lang['acl_new'] = 'Dodaj novi Zapis';
+$lang['acl_mod'] = 'Promijeni Zapis';
diff --git a/lib/plugins/acl/script.js b/lib/plugins/acl/script.js
index a3dbbe0d2..2598bcef8 100644
--- a/lib/plugins/acl/script.js
+++ b/lib/plugins/acl/script.js
@@ -3,16 +3,44 @@
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
-acl = {
+var dw_acl = {
/**
* Initialize the object and attach the event handlers
*/
- init: function(){
- if(!jQuery('#acl_manager').length) return; //FIXME only one underscore!!
+ init: function () {
+ var $tree;
- jQuery('#acl__user select').change(acl.userselhandler);
- jQuery('#acl__tree').click(acl.treehandler);
- jQuery('#acl__user input[type=submit]').click(acl.loadinfo);
+ //FIXME only one underscore!!
+ if (jQuery('#acl_manager').length === 0) {
+ return;
+ }
+
+ jQuery('#acl__user select').change(dw_acl.userselhandler);
+ jQuery('#acl__user input[type=submit]').click(dw_acl.loadinfo);
+
+ $tree = jQuery('#acl__tree');
+ $tree.dw_tree({toggle_selector: 'img',
+ load_data: function (show_sublist, $clicky) {
+ // get the enclosed link and the edit form
+ var $frm = jQuery('#acl__detail form');
+
+ jQuery.post(
+ DOKU_BASE + 'lib/plugins/acl/ajax.php',
+ jQuery.extend(dw_acl.parseatt($clicky.parent().find('a')[0].search),
+ {ajax: 'tree',
+ current_ns: $frm.find('input[name=ns]').val(),
+ current_id: $frm.find('input[name=id]').val()}),
+ show_sublist,
+ 'html'
+ );
+ },
+
+ toggle_display: function ($clicky, opening) {
+ $clicky.attr('src',
+ DOKU_BASE + 'lib/images/' +
+ (opening ? 'minus' : 'plus') + '.gif');
+ }});
+ $tree.delegate('a', 'click', dw_acl.treehandler);
},
/**
@@ -21,32 +49,20 @@ acl = {
* Hides or shows the user/group entry box depending on what was selected in the
* dropdown element
*/
- userselhandler: function(e){
+ userselhandler: function () {
// make entry field visible/invisible
- if(this.value == '__g__' || this.value == '__u__'){
- jQuery('#acl__user input').show();
- }else{
- jQuery('#acl__user input').hide();
- }
- acl.loadinfo();
+ jQuery('#acl__user input').toggle(this.value === '__g__' ||
+ this.value === '__u__');
+ dw_acl.loadinfo();
},
/**
* Load the current permission info and edit form
*/
- loadinfo: function(){
- var frm = jQuery('#acl__detail form')[0];
-
+ loadinfo: function () {
jQuery('#acl__info').load(
DOKU_BASE + 'lib/plugins/acl/ajax.php',
- {
- 'ns': frm.elements['ns'].value,
- 'id': frm.elements['id'].value,
- 'acl_t': frm.elements['acl_t'].value,
- 'acl_w': frm.elements['acl_w'].value,
- 'sectok': frm.elements['sectok'].value,
- 'ajax': 'info'
- }
+ jQuery('#acl__detail form').serialize() + '&ajax=info'
);
return false;
},
@@ -56,11 +72,13 @@ acl = {
*
* @todo put into global script lib?
*/
- parseatt: function(str){
- if(str[0] == '?') str = str.substr(1);
+ parseatt: function (str) {
+ if (str[0] === '?') {
+ str = str.substr(1);
+ }
var attributes = {};
var all = str.split('&');
- for(var i=0; i<all.length; i++){
+ for (var i = 0; i < all.length; i++) {
var att = all[i].split('=');
attributes[att[0]] = decodeURIComponent(att[1]);
}
@@ -68,79 +86,40 @@ acl = {
},
/**
- * Open or close a subtree using AJAX
- *
- * @author Andreas Gohr <andi@splitbrain.org>
- * @param DOMElement clicky - the plus/minus icon in front of a namespace
+ * Handles clicks to the tree nodes
*/
- treetoggle: function(clicky){
- var listitem = jQuery(clicky).parent().parent();
-
- // if already open, close by removing the sublist
- var sublists = listitem.find('ul');
- if(sublists.length){
- listitem.remove('ul');
- clicky.src = DOKU_BASE+'lib/images/plus.gif';
- clicky.alt = '+';
- return false;
- }
-
- // prepare new ul to load into it via ajax
- var ul = document.createElement('ul');
- listitem[0].appendChild(ul);
-
- // get the enclosed link and the edit form
- var link = listitem.find('a')[0];
- var frm = jQuery('#acl__detail form')[0];
+ treehandler: function () {
+ var $link, $frm;
- // prepare ajax data
- var data = acl.parseatt(link.search);
- data['ajax'] = 'tree';
- data['current_ns'] = frm.elements['ns'].value;
- data['current_id'] = frm.elements['id'].value;
+ $link = jQuery(this);
- // run ajax
- jQuery(ul).load(DOKU_BASE + 'lib/plugins/acl/ajax.php', data);
-
- clicky.src = DOKU_BASE+'lib/images/minus.gif';
- return false;
- },
-
- /**
- * Handles all clicks in the tree, dispatching the right action based on the
- * clicked element
- *
- * @param Event e The event object that caused the execution
- */
- treehandler: function(e){
- if(e.target.src){ // is it an image?
- acl.treetoggle(e.target);
- } else if(e.target.href){ // is it a link?
// remove highlighting
jQuery('#acl__tree a.cur').removeClass('cur');
- var link = jQuery(e.target);
-
// add new highlighting
- link.addClass('cur');
+ $link.addClass('cur');
// set new page to detail form
- var frm = jQuery('#acl__detail form')[0];
- if(link.hasClass('wikilink1')){
- jQuery('#acl__detail form input[name=ns]').val('');
- jQuery('#acl__detail form input[name=id]').val(acl.parseatt(link[0].search)['id']);
- }else if(link.hasClass('idx_dir')){
- jQuery('#acl__detail form input[name=ns]').val(acl.parseatt(link[0].search)['ns']);
- jQuery('#acl__detail form input[name=id]').val('');
+ $frm = jQuery('#acl__detail form');
+ if ($link.hasClass('wikilink1')) {
+ $frm.find('input[name=ns]').val('');
+ $frm.find('input[name=id]').val(dw_acl.parseatt($link[0].search).id);
+ } else if ($link.hasClass('idx_dir')) {
+ $frm.find('input[name=ns]').val(dw_acl.parseatt($link[0].search).ns);
+ $frm.find('input[name=id]').val('');
}
- acl.loadinfo();
- }
+ dw_acl.loadinfo();
- e.stopPropagation();
- e.preventDefault();
return false;
}
-
};
-jQuery(acl.init);
+jQuery(dw_acl.init);
+
+var acl = {
+ init: DEPRECATED_WRAP(dw_acl.init, dw_acl),
+ userselhandler: DEPRECATED_WRAP(dw_acl.userselhandler, dw_acl),
+ loadinfo: DEPRECATED_WRAP(dw_acl.loadinfo, dw_acl),
+ parseatt: DEPRECATED_WRAP(dw_acl.parseatt, dw_acl),
+ treehandler: DEPRECATED_WRAP(dw_acl.treehandler, dw_acl)
+};
diff --git a/lib/plugins/acl/style.css b/lib/plugins/acl/style.css
index 0c5a9819b..b7154aa78 100644
--- a/lib/plugins/acl/style.css
+++ b/lib/plugins/acl/style.css
@@ -22,6 +22,7 @@ div#acl_manager div#acl__tree ul {
div#acl_manager div#acl__tree li {
padding-left: 1em;
+ list-style-image: none;
}
div#acl_manager div#acl__tree ul img {