PluginProbe
User Access Manager / 1.0.2
User Access Manager v1.0.2
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
user-access-manager / tpl / groupInfo.php

groupInfo.php in User Access Manager 1.0.2, at tpl/groupInfo.php

168 lines 4.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * groupInfo.php
4 *
5 * Shows the group informations at the admim panel.
6 *
7 * PHP versions 5
8 *
9 * @category UserAccessManager
10 * @package UserAccessManager
11 * @author Alexander Schneider <alexanderschneider85@googlemail.com>
12 * @copyright 2008-2010 Alexander Schneider
13 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
14 * @version SVN: $Id$
15 * @link http://wordpress.org/extend/plugins/user-access-manager/
16 */
17
18 if (!function_exists('walkPath')) {
19 /**
20 * Retruns the html code for the recursive access.
21 *
22 * @param mixed $object The object.
23 * @param string $type The type of the object.
24 *
25 * @return string
26 */
27 function walkPath($object, $type)
28 {
29 $out = '';
30
31 if (is_object($object)) {
32 if ($type == 'post') {
33 $post = get_post($object->ID);
34 $out = $post->post_title;
35 } elseif ($type == 'category') {
36 $category = get_category($object->term_id);
37 $out = $category->name;
38 }
39
40
41 if (isset($object->recursiveMember['byPost'])) {
42 $out .= '<ul>';
43 foreach ($object->recursiveMember['byPost'] as $post) {
44 $out .= '<li>';
45 $out .= walkPath($post, 'post');
46 $out .= '</li>';
47 }
48 $out .= '</ul>';
49 }
50
51 if (isset($object->recursiveMember['byCategory'])) {
52 $out .= '<ul>';
53 foreach ($object->recursiveMember['byCategory'] as $category) {
54 $out .= '<li>';
55 $out .= walkPath($category, 'category');
56 $out .= '</li>';
57 }
58 $out .= '</ul>';
59 }
60 } else {
61 if ($type == 'post') {
62 $post = get_post($object);
63 $out = $post->post_title;
64 } elseif ($type == 'category') {
65 $category = get_category($object);
66 $out = $category->name;
67 }
68 }
69
70 return $out;
71 }
72 }
73 ?>
74 <div class="tooltip">
75 <ul class="uam_group_info">
76 <?php
77 if (isset($userGroupsForObject[$uamUserGroup->getId()]->setRecursive[$objectId]['byCategory'])) {
78 ?>
79 <li class="uam_group_info_head">
80 <?php echo TXT_GROUP_MEMBERSHIP_BY_CATEGORIES; ?>:
81 <ul>
82 <?php
83 foreach ($userGroupsForObject[$uamUserGroup->getId()]->setRecursive[$objectId]['byCategory'] as $category) {
84 ?>
85 <li class="recusiveTree"><?php echo walkPath($category, 'category'); ?></li>
86 <?php
87 }
88 ?>
89 </ul>
90 </li>
91 <?php
92 }
93 ?>
94 <?php
95 if (isset($userGroupsForObject[$uamUserGroup->getId()]->setRecursive[$objectId]['byPost'])) {
96 ?>
97 <li class="uam_group_info_head">
98 <?php echo TXT_GROUP_MEMBERSHIP_BY_POSTS; ?>:
99 <ul>
100 <?php
101 foreach ($userGroupsForObject[$uamUserGroup->getId()]->setRecursive[$objectId]['byPost'] as $post) {
102 ?>
103 <li class="recusiveTree"><?php echo walkPath($post, 'post'); ?></li>
104 <?php
105 }
106 ?>
107 </ul>
108 </li>
109 <?php
110 }
111 ?>
112 <?php
113 if (isset($userGroupsForObject[$uamUserGroup->getId()]->setRecursive[$objectId]['byRole'])) {
114 ?>
115 <li class="uam_group_info_head">
116 <?php echo TXT_GROUP_MEMBERSHIP_BY_ROLE; ?>:
117 <ul>
118 <?php
119 foreach ($userGroupsForObject[$uamUserGroup->getId()]->setRecursive[$objectId]['byRole'] as $role) {
120 ?>
121 <li><?php echo $role; ?></li>
122 <?php
123 }
124 ?>
125 </ul>
126 </li>
127 <?php
128 }
129 ?>
130 <li class="uam_group_info_head"><?php echo TXT_GROUP_INFO; ?>:
131 <ul>
132 <li><?php echo TXT_READ_ACCESS; ?>:
133 <?php
134 if ($uamUserGroup->getReadAccess() == "all") {
135 echo TXT_ALL;
136 } elseif ($uamUserGroup->getReadAccess() == "group") {
137 echo TXT_ONLY_GROUP_USERS;
138 }
139 ?>
140 </li>
141 <li><?php echo TXT_WRITE_ACCESS; ?>:
142 <?php
143 if ($uamUserGroup->getWriteAccess() == "all") {
144 echo TXT_ALL;
145 } elseif ($uamUserGroup->getWriteAccess() == "group") {
146 echo TXT_ONLY_GROUP_USERS;
147 }
148 ?>
149 </li>
150 <li>
151 <?php echo TXT_GROUP_ROLE; ?>: <?php
152 if ($uamUserGroup->getRoles()) {
153 $out = '';
154
155 foreach ($uamUserGroup->getRoles() as $role) {
156 $out .= trim($role['role_name']).', ';
157 }
158
159 echo rtrim($out, ', ');
160 } else {
161 echo TXT_NONE;
162 }
163 ?>
164 </li>
165 </ul>
166 </li>
167 </ul>
168 </div>