Groups - Version 1.2.4

Version Description

  • Minor improvements on Options screen
  • Added show="users" option to [groups_group_info] shortcode which lists user logins for users in a group - rather experimental as it doesn't offer any sorting, pagination, linking or other options
Download this release

Release Info

Developer itthinx
Plugin Icon 128x128 Groups
Version 1.2.4
Comparing to
See all releases

Code changes from version 1.2.3 to 1.2.4

css/groups_admin.css CHANGED
@@ -103,3 +103,15 @@ div.groups-footer a {
103
  div.groups-footer form {
104
  display: inline;
105
  }
 
 
 
 
 
 
 
 
 
 
 
 
103
  div.groups-footer form {
104
  display: inline;
105
  }
106
+
107
+ .groups-options input[type="checkbox"] {
108
+ margin-right: 4px;
109
+ }
110
+ .groups-options .groups-permissions thead td {
111
+ padding: 0 4px;
112
+ font-weight: bold;
113
+ margin: 0;
114
+ }
115
+ .groups-options .groups-permissions td.checkbox {
116
+ text-align: center;
117
+ }
groups.php CHANGED
@@ -21,13 +21,13 @@
21
  * Plugin Name: Groups
22
  * Plugin URI: http://www.itthinx.com/plugins/groups
23
  * Description: Groups provides group-based user membership management, group-based capabilities and content access control.
24
- * Version: 1.2.3
25
  * Author: itthinx
26
  * Author URI: http://www.itthinx.com
27
  * Donate-Link: http://www.itthinx.com
28
  * License: GPLv3
29
  */
30
- define( 'GROUPS_CORE_VERSION', '1.2.3' );
31
  define( 'GROUPS_FILE', __FILE__ );
32
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
33
  define( 'GROUPS_CORE_DIR', WP_PLUGIN_DIR . '/groups' );
21
  * Plugin Name: Groups
22
  * Plugin URI: http://www.itthinx.com/plugins/groups
23
  * Description: Groups provides group-based user membership management, group-based capabilities and content access control.
24
+ * Version: 1.2.4
25
  * Author: itthinx
26
  * Author URI: http://www.itthinx.com
27
  * Donate-Link: http://www.itthinx.com
28
  * License: GPLv3
29
  */
30
+ define( 'GROUPS_CORE_VERSION', '1.2.4' );
31
  define( 'GROUPS_FILE', __FILE__ );
32
  if ( !defined( 'GROUPS_CORE_DIR' ) ) {
33
  define( 'GROUPS_CORE_DIR', WP_PLUGIN_DIR . '/groups' );
lib/admin/groups-admin-options.php CHANGED
@@ -41,14 +41,16 @@ function groups_admin_options() {
41
  $active_sitewide_plugins = array_keys( $active_sitewide_plugins );
42
  $is_sitewide_plugin = in_array( 'groups/groups.php', $active_sitewide_plugins );
43
  }
44
-
 
 
45
  echo
46
  '<div>' .
47
  '<h2>' .
48
  __( 'Groups options', GROUPS_PLUGIN_DOMAIN ) .
49
  '</h2>' .
50
  '</div>';
51
-
52
  $caps = array(
53
  GROUPS_ACCESS_GROUPS => __( 'Access Groups', GROUPS_PLUGIN_DOMAIN ),
54
  GROUPS_ADMINISTER_GROUPS => __( 'Administer Groups', GROUPS_PLUGIN_DOMAIN ),
@@ -169,8 +171,10 @@ function groups_admin_options() {
169
  '<div>' .
170
  '<h3>' . __( 'Administrator Access Override', GROUPS_PLUGIN_DOMAIN ) . '</h3>' .
171
  '<p>' .
 
172
  '<input name="' . GROUPS_ADMINISTRATOR_ACCESS_OVERRIDE . '" type="checkbox" ' . ( $admin_override ? 'checked="checked"' : '' ) . '/>' .
173
- '<label for="' . GROUPS_ADMINISTRATOR_ACCESS_OVERRIDE . '">' . __( 'Administrators override all access permissions derived from Groups capabilities.', GROUPS_PLUGIN_DOMAIN ) . '</label>' .
 
174
  '</p>';
175
 
176
  echo '<h3>' . __( 'Access restricions', GROUPS_PLUGIN_DOMAIN ) . '</h3>';
@@ -199,8 +203,10 @@ function groups_admin_options() {
199
  echo
200
  '<h3>' . __( 'Tree view', GROUPS_PLUGIN_DOMAIN ) . '</h3>' .
201
  '<p>' .
 
202
  '<input name="' . GROUPS_SHOW_TREE_VIEW . '" type="checkbox" ' . ( $show_tree_view ? 'checked="checked"' : '' ) . '/>' .
203
- '<label for="' . GROUPS_SHOW_TREE_VIEW . '">' . __( 'Show the Groups tree view.', GROUPS_PLUGIN_DOMAIN ) . '</label>' .
 
204
  '</p>';
205
  echo
206
  '<h3>' . __( 'Permissions', GROUPS_PLUGIN_DOMAIN ) . '</h3>' .
@@ -215,20 +221,24 @@ function groups_admin_options() {
215
  echo
216
  '<h3>' . __( 'Deactivation and data persistence', GROUPS_PLUGIN_DOMAIN ) . '</h3>' .
217
  '<p>' .
218
- '<input name="delete-data" type="checkbox" ' . ( $delete_data ? 'checked="checked"' : '' ) . '/>' .
219
- '<label for="delete-data">' . __( 'Delete all Groups plugin data on deactivation', GROUPS_PLUGIN_DOMAIN ) . '</label>' .
 
 
220
  '</p>' .
221
  '<p class="description warning">' .
222
- __( 'CAUTION: If this option is active while the plugin is deactivated, ALL plugin settings and data will be DELETED. If you are going to use this option, now would be a good time to make a backup. By enabling this option you agree to be solely responsible for any loss of data or any other consequences thereof.', GROUPS_PLUGIN_DOMAIN ) .
223
  '</p>';
224
  }
225
  echo
226
  '<p>' .
227
- wp_nonce_field( 'admin', GROUPS_ADMIN_OPTIONS_NONCE, true, false ) .
228
- '<input class="button" type="submit" name="submit" value="' . __( 'Save', GROUPS_PLUGIN_DOMAIN ) . '"/>' .
229
  '</p>' .
230
  '</div>' .
231
  '</form>';
 
 
232
  Groups_Help::footer();
233
  }
234
 
41
  $active_sitewide_plugins = array_keys( $active_sitewide_plugins );
42
  $is_sitewide_plugin = in_array( 'groups/groups.php', $active_sitewide_plugins );
43
  }
44
+
45
+ echo '<div class="groups-options">';
46
+
47
  echo
48
  '<div>' .
49
  '<h2>' .
50
  __( 'Groups options', GROUPS_PLUGIN_DOMAIN ) .
51
  '</h2>' .
52
  '</div>';
53
+
54
  $caps = array(
55
  GROUPS_ACCESS_GROUPS => __( 'Access Groups', GROUPS_PLUGIN_DOMAIN ),
56
  GROUPS_ADMINISTER_GROUPS => __( 'Administer Groups', GROUPS_PLUGIN_DOMAIN ),
171
  '<div>' .
172
  '<h3>' . __( 'Administrator Access Override', GROUPS_PLUGIN_DOMAIN ) . '</h3>' .
173
  '<p>' .
174
+ '<label>' .
175
  '<input name="' . GROUPS_ADMINISTRATOR_ACCESS_OVERRIDE . '" type="checkbox" ' . ( $admin_override ? 'checked="checked"' : '' ) . '/>' .
176
+ __( 'Administrators override all access permissions derived from Groups capabilities.', GROUPS_PLUGIN_DOMAIN ) .
177
+ '</label>' .
178
  '</p>';
179
 
180
  echo '<h3>' . __( 'Access restricions', GROUPS_PLUGIN_DOMAIN ) . '</h3>';
203
  echo
204
  '<h3>' . __( 'Tree view', GROUPS_PLUGIN_DOMAIN ) . '</h3>' .
205
  '<p>' .
206
+ '<label>' .
207
  '<input name="' . GROUPS_SHOW_TREE_VIEW . '" type="checkbox" ' . ( $show_tree_view ? 'checked="checked"' : '' ) . '/>' .
208
+ __( 'Show the Groups tree view.', GROUPS_PLUGIN_DOMAIN ) .
209
+ '</label>' .
210
  '</p>';
211
  echo
212
  '<h3>' . __( 'Permissions', GROUPS_PLUGIN_DOMAIN ) . '</h3>' .
221
  echo
222
  '<h3>' . __( 'Deactivation and data persistence', GROUPS_PLUGIN_DOMAIN ) . '</h3>' .
223
  '<p>' .
224
+ '<label>' .
225
+ '<input name="delete-data" type="checkbox" ' . ( $delete_data ? 'checked="checked"' : '' ) . '/>' .
226
+ __( 'Delete all Groups plugin data on deactivation', GROUPS_PLUGIN_DOMAIN ) .
227
+ '</label>' .
228
  '</p>' .
229
  '<p class="description warning">' .
230
+ __( 'CAUTION: If this option is active while the plugin is deactivated, ALL plugin settings and data will be DELETED. If you are going to use this option, now would be a good time to make a backup. By enabling this option you agree to be solely responsible for any loss of data or any other consequences thereof.', GROUPS_PLUGIN_DOMAIN ) .
231
  '</p>';
232
  }
233
  echo
234
  '<p>' .
235
+ wp_nonce_field( 'admin', GROUPS_ADMIN_OPTIONS_NONCE, true, false ) .
236
+ '<input class="button" type="submit" name="submit" value="' . __( 'Save', GROUPS_PLUGIN_DOMAIN ) . '"/>' .
237
  '</p>' .
238
  '</div>' .
239
  '</form>';
240
+
241
+ echo '</div>'; // .groups-options
242
  Groups_Help::footer();
243
  }
244
 
lib/views/class-groups-shortcodes.php CHANGED
@@ -43,8 +43,11 @@ class Groups_Shortcodes {
43
  /**
44
  * Renders information about a group.
45
  * Attributes:
46
- * - "group" : group name or id
47
- * - "show" : what to show, can be "name", "description", "count"
 
 
 
48
  *
49
  * @param array $atts attributes
50
  * @param string $content content to render
@@ -88,6 +91,22 @@ class Groups_Shortcodes {
88
  $count = intval( $count );
89
  }
90
  $output .= _n( $options['single'], sprintf( $options['plural'], $count ), $count, GROUPS_PLUGIN_DOMAIN );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  break;
92
  }
93
  }
43
  /**
44
  * Renders information about a group.
45
  * Attributes:
46
+ * - "group" : group name or id
47
+ * - "show" : what to show, can be "name", "description", "count"
48
+ * - "format" :
49
+ * - "single" : used with show="count", single form, defaults to '1'
50
+ * - "plural" : used with show="count", plural form, defaults to '%d', must contain %d to show number
51
  *
52
  * @param array $atts attributes
53
  * @param string $content content to render
91
  $count = intval( $count );
92
  }
93
  $output .= _n( $options['single'], sprintf( $options['plural'], $count ), $count, GROUPS_PLUGIN_DOMAIN );
94
+ break;
95
+ // @todo experimental - could use pagination, sorting, link to profile, ...
96
+ case 'users' :
97
+ $user_group_table = _groups_get_tablename( "user_group" );
98
+ $users = $wpdb->get_results( $wpdb->prepare(
99
+ "SELECT * FROM $wpdb->users LEFT JOIN $user_group_table ON $wpdb->users.ID = $user_group_table.user_id WHERE $user_group_table.group_id = %d",
100
+ Groups_Utility::id( $current_group->group_id )
101
+ ) );
102
+ if ( $users ) {
103
+ $output .= '<ul>';
104
+ foreach( $users as $user ) {
105
+ $output .= '<li>' . wp_filter_nohtml_kses( $user->user_login ) . '</li>';
106
+ }
107
+ $output .= '</ul>';
108
+ }
109
+
110
  break;
111
  }
112
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.itthinx.com/plugins/groups
4
  Tags: access, access control, capability, capabilities, content, download, downloads, file, file access, files, group, groups, member, members, membership, permission, permissions
5
  Requires at least: 3.3
6
  Tested up to: 3.4.1
7
- Stable tag: 1.2.3
8
  License: GPLv3
9
 
10
  Groups provides group-based user membership management, group-based capabilities and content access control.
@@ -204,7 +204,7 @@ See above for examples and descriptions.
204
  This shortcode takes the following attributes to show information about a group:
205
 
206
  - _group_ : (required) the group ID or name
207
- - _show_ : (required) what to show, accepted values are: _name_, _description_, _count_
208
  - _single_ : (optional) used when show="count" and there is 1 member in the group
209
  - _plural_ : (optional) used when show="count" and there is more than 1 member in the group, must contain %d to show the number of members
210
 
@@ -316,6 +316,10 @@ See also [Groups](http://www.itthinx.com/plugins/groups/)
316
 
317
  == Changelog ==
318
 
 
 
 
 
319
  = 1.2.3 =
320
  * New shortcode [groups_join group="..."] lets a user join the given group
321
  * New shortcode [groups_leave group="..."] lets a user leave the given group
@@ -384,6 +388,10 @@ Some installations wouldn't work correctly, showing no capabilities and making i
384
 
385
  == Upgrade Notice ==
386
 
 
 
 
 
387
  = 1.2.3 =
388
  * This release provides new shortcodes to let users join or leave groups by clicking a button.
389
 
4
  Tags: access, access control, capability, capabilities, content, download, downloads, file, file access, files, group, groups, member, members, membership, permission, permissions
5
  Requires at least: 3.3
6
  Tested up to: 3.4.1
7
+ Stable tag: 1.2.4
8
  License: GPLv3
9
 
10
  Groups provides group-based user membership management, group-based capabilities and content access control.
204
  This shortcode takes the following attributes to show information about a group:
205
 
206
  - _group_ : (required) the group ID or name
207
+ - _show_ : (required) what to show, accepted values are: _name_, _description_, _count_, _users_
208
  - _single_ : (optional) used when show="count" and there is 1 member in the group
209
  - _plural_ : (optional) used when show="count" and there is more than 1 member in the group, must contain %d to show the number of members
210
 
316
 
317
  == Changelog ==
318
 
319
+ = 1.2.4 =
320
+ * Minor improvements on Options screen
321
+ * Added show="users" option to [groups_group_info] shortcode which lists user logins for users in a group - rather experimental as it doesn't offer any sorting, pagination, linking or other options
322
+
323
  = 1.2.3 =
324
  * New shortcode [groups_join group="..."] lets a user join the given group
325
  * New shortcode [groups_leave group="..."] lets a user leave the given group
388
 
389
  == Upgrade Notice ==
390
 
391
+ = 1.2.4 =
392
+ * Minor improvements on Options screen
393
+ * Added show="users" option to [groups_group_info] shortcode
394
+
395
  = 1.2.3 =
396
  * This release provides new shortcodes to let users join or leave groups by clicking a button.
397