From e534871167c3b1c275a11b97af53309339a10e5c Mon Sep 17 00:00:00 2001 From: vargenau Date: Mon, 23 Aug 2010 15:10:10 +0000 Subject: [PATCH] Move "perm" and "acl" columns from plugins to PageList git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@7647 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/PageList.php | 31 ++++++++++++++++++++++++++++++- lib/plugin/WikiAdminChmod.php | 10 ---------- lib/plugin/WikiAdminSetAcl.php | 29 ----------------------------- pgsrc/Help%2FPageList | 6 +++--- 4 files changed, 33 insertions(+), 43 deletions(-) diff --git a/lib/PageList.php b/lib/PageList.php index 811cd38a7..ac6c5289b 100644 --- a/lib/PageList.php +++ b/lib/PageList.php @@ -546,6 +546,35 @@ class _PageList_Column_pagename extends _PageList_Column_base { } }; +class _PageList_Column_perm extends _PageList_Column { + function _getValue ($page_handle, &$revision_handle) { + $perm_array = pagePermissions($page_handle->_pagename); + return pagePermissionsSimpleFormat($perm_array, + $page_handle->get('author'), + $page_handle->get('group')); + } +}; + +class _PageList_Column_acl extends _PageList_Column { + function _getValue ($page_handle, &$revision_handle) { + $perm_tree = pagePermissions($page_handle->_pagename); + + list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree); + if ($type == 'inherited') { + $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]); + } elseif ($type == 'page') { + $type = _("individual page permission"); + } elseif ($type == 'default') { + $type = _("default page permission"); + } + $result = HTML::span(); + $result->pushContent($type); + $result->pushContent(HTML::br()); + $result->pushContent($perm->asAclGroupLines()); + return $result; + } +}; + class PageList { var $_group_rows = 3; var $_columns = array(); @@ -1176,11 +1205,11 @@ class PageList { // initialised by the plugin 'renamed_pagename' => new _PageList_Column_renamed_pagename('rename', _("Rename to")), + */ 'perm' => new _PageList_Column_perm('perm', _("Permission")), 'acl' => new _PageList_Column_acl('acl', _("ACL")), - */ 'checkbox' => new _PageList_Column_checkbox('p', _("All")), 'pagename' diff --git a/lib/plugin/WikiAdminChmod.php b/lib/plugin/WikiAdminChmod.php index 1673120a7..69e9f054d 100644 --- a/lib/plugin/WikiAdminChmod.php +++ b/lib/plugin/WikiAdminChmod.php @@ -188,16 +188,6 @@ extends WikiPlugin_WikiAdminSelect } } -// conflicts with WikiAdminSetAcl -class _PageList_Column_chmod_perm extends _PageList_Column { - function _getValue ($page_handle, &$revision_handle) { - $perm_array = pagePermissions($page_handle->_pagename); - return pagePermissionsSimpleFormat($perm_array, - $page_handle->get('author'), - $page_handle->get('group')); - } -}; - // Local Variables: // mode: php // tab-width: 8 diff --git a/lib/plugin/WikiAdminSetAcl.php b/lib/plugin/WikiAdminSetAcl.php index 8b6f11107..9d4208546 100644 --- a/lib/plugin/WikiAdminSetAcl.php +++ b/lib/plugin/WikiAdminSetAcl.php @@ -278,35 +278,6 @@ extends WikiPlugin_WikiAdminSelect } } -class _PageList_Column_acl extends _PageList_Column { - function _getValue ($page_handle, &$revision_handle) { - $perm_tree = pagePermissions($page_handle->_pagename); - - list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree); - if ($type == 'inherited') { - $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]); - } elseif ($type == 'page') { - $type = _("individual page permission"); - } elseif ($type == 'default') { - $type = _("default page permission"); - } - $result = HTML::span(); - $result->pushContent($type); - $result->pushContent(HTML::br()); - $result->pushContent($perm->asAclGroupLines()); - return $result; - } -}; - -class _PageList_Column_perm extends _PageList_Column { - function _getValue ($page_handle, &$revision_handle) { - $perm_array = pagePermissions($page_handle->_pagename); - return pagePermissionsSimpleFormat($perm_array, - $page_handle->get('author'), - $page_handle->get('group')); - } -}; - // Local Variables: // mode: php // tab-width: 8 diff --git a/pgsrc/Help%2FPageList b/pgsrc/Help%2FPageList index e0bd67b57..7b5fc413c 100644 --- a/pgsrc/Help%2FPageList +++ b/pgsrc/Help%2FPageList @@ -1,4 +1,4 @@ -Date: Tue, 1 Jun 2010 17:01:57 +0000 +Date: Mon, 23 Aug 2010 17:09:36 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC-20100415) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -111,11 +111,11 @@ Column 'info=' arguments: |= owner | Owner |= checkbox | Selectable checkbox at the left |= content | Page content +|= perm | Permission Mask +|= acl | ACL Special, custom columns, either theme or plugin (~WikiAdmin*) specific: |= remove | Remove -|= perm | Permission Mask -|= acl | ACL |= renamed_pagename | Rename to |= ratingwidget | wikilens theme specific. |= custom | See plugin/_WikiTranslation -- 2.45.0