/bp-themes/bp-default/groups/single/admin.php

  1. <div class="item-list-tabs no-ajax" id="subnav" role="navigation"> 
  2. <ul> 
  3. <?php bp_group_admin_tabs(); ?> 
  4. </ul> 
  5. </div><!-- .item-list-tabs --> 
  6.  
  7. <form action="<?php bp_group_admin_form_action(); ?>" name="group-settings-form" id="group-settings-form" class="standard-form" method="post" enctype="multipart/form-data" role="main"> 
  8.  
  9. <?php do_action( 'bp_before_group_admin_content' ); ?> 
  10.  
  11. <?php /** Edit Group Details */ ?> 
  12. <?php if ( bp_is_group_admin_screen( 'edit-details' ) ) : ?> 
  13.  
  14. <?php do_action( 'bp_before_group_details_admin' ); ?> 
  15.  
  16. <label for="group-name"><?php _e( 'Group Name (required)', 'buddypress' ); ?></label> 
  17. <input type="text" name="group-name" id="group-name" value="<?php bp_group_name(); ?>" aria-required="true" /> 
  18.  
  19. <label for="group-desc"><?php _e( 'Group Description (required)', 'buddypress' ); ?></label> 
  20. <textarea name="group-desc" id="group-desc" aria-required="true"><?php bp_group_description_editable(); ?></textarea> 
  21.  
  22. <?php do_action( 'groups_custom_group_fields_editable' ); ?> 
  23.  
  24. <p> 
  25. <label for="group-notifiy-members"> 
  26. <input type="checkbox" name="group-notify-members" value="1" /> <?php _e( 'Notify group members of these changes via email', 'buddypress' ); ?> 
  27. </label> 
  28. </p> 
  29.  
  30. <?php do_action( 'bp_after_group_details_admin' ); ?> 
  31.  
  32. <p><input type="submit" value="<?php esc_attr_e( 'Save Changes', 'buddypress' ); ?>" id="save" name="save" /></p> 
  33. <?php wp_nonce_field( 'groups_edit_group_details' ); ?> 
  34.  
  35. <?php endif; ?> 
  36.  
  37. <?php /** Manage Group Settings */ ?> 
  38. <?php if ( bp_is_group_admin_screen( 'group-settings' ) ) : ?> 
  39.  
  40. <?php do_action( 'bp_before_group_settings_admin' ); ?> 
  41.  
  42. <?php if ( bp_is_active( 'forums' ) ) : ?> 
  43.  
  44. <?php if ( bp_forums_is_installed_correctly() ) : ?> 
  45.  
  46. <div class="checkbox"> 
  47. <label><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php bp_group_show_forum_setting(); ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ); ?></label> 
  48. </div> 
  49.  
  50. <hr /> 
  51.  
  52. <?php endif; ?> 
  53.  
  54. <?php endif; ?> 
  55.  
  56. <h4><?php _e( 'Privacy Options', 'buddypress' ); ?></h4> 
  57.  
  58. <div class="radio"> 
  59. <label> 
  60. <input type="radio" name="group-status" value="public"<?php bp_group_show_status_setting( 'public' ); ?> /> 
  61. <strong><?php _e( 'This is a public group', 'buddypress' ); ?></strong> 
  62. <ul> 
  63. <li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li> 
  64. <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li> 
  65. <li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li> 
  66. </ul> 
  67. </label> 
  68.  
  69. <label> 
  70. <input type="radio" name="group-status" value="private"<?php bp_group_show_status_setting( 'private' ); ?> /> 
  71. <strong><?php _e( 'This is a private group', 'buddypress' ); ?></strong> 
  72. <ul> 
  73. <li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li> 
  74. <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li> 
  75. <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li> 
  76. </ul> 
  77. </label> 
  78.  
  79. <label> 
  80. <input type="radio" name="group-status" value="hidden"<?php bp_group_show_status_setting( 'hidden' ); ?> /> 
  81. <strong><?php _e( 'This is a hidden group', 'buddypress' ); ?></strong> 
  82. <ul> 
  83. <li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li> 
  84. <li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li> 
  85. <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li> 
  86. </ul> 
  87. </label> 
  88. </div> 
  89.  
  90. <hr /> 
  91.  
  92. <h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4> 
  93.  
  94. <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p> 
  95.  
  96. <div class="radio"> 
  97. <label> 
  98. <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> 
  99. <strong><?php _e( 'All group members', 'buddypress' ); ?></strong> 
  100. </label> 
  101.  
  102. <label> 
  103. <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> 
  104. <strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong> 
  105. </label> 
  106.  
  107. <label> 
  108. <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> 
  109. <strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong> 
  110. </label> 
  111. </div> 
  112.  
  113. <hr /> 
  114.  
  115. <?php do_action( 'bp_after_group_settings_admin' ); ?> 
  116.  
  117. <p><input type="submit" value="<?php esc_attr_e( 'Save Changes', 'buddypress' ); ?>" id="save" name="save" /></p> 
  118. <?php wp_nonce_field( 'groups_edit_group_settings' ); ?> 
  119.  
  120. <?php endif; ?> 
  121.  
  122. <?php /** Group Avatar Settings */ ?> 
  123. <?php if ( bp_is_group_admin_screen( 'group-avatar' ) ) : ?> 
  124.  
  125. <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?> 
  126.  
  127. <p><?php _e("Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results.", 'buddypress'); ?></p> 
  128.  
  129. <p> 
  130. <input type="file" name="file" id="file" /> 
  131. <input type="submit" name="upload" id="upload" value="<?php esc_attr_e( 'Upload Image', 'buddypress' ); ?>" /> 
  132. <input type="hidden" name="action" id="action" value="bp_avatar_upload" /> 
  133. </p> 
  134.  
  135. <?php if ( bp_get_group_has_avatar() ) : ?> 
  136.  
  137. <p><?php _e( "If you'd like to remove the existing avatar but not upload a new one, please use the delete avatar button.", 'buddypress' ); ?></p> 
  138.  
  139. <?php bp_button( array( 'id' => 'delete_group_avatar', 'component' => 'groups', 'wrapper_id' => 'delete-group-avatar-button', 'link_class' => 'edit', 'link_href' => bp_get_group_avatar_delete_link(), 'link_title' => __( 'Delete Avatar', 'buddypress' ), 'link_text' => __( 'Delete Avatar', 'buddypress' ) ) ); ?> 
  140.  
  141. <?php endif; ?> 
  142.  
  143. <?php wp_nonce_field( 'bp_avatar_upload' ); ?> 
  144.  
  145. <?php endif; ?> 
  146.  
  147. <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?> 
  148.  
  149. <h3><?php _e( 'Crop Avatar', 'buddypress' ); ?></h3> 
  150.  
  151. <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php esc_attr_e( 'Avatar to crop', 'buddypress' ); ?>" /> 
  152.  
  153. <div id="avatar-crop-pane"> 
  154. <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php esc_attr_e( 'Avatar preview', 'buddypress' ); ?>" /> 
  155. </div> 
  156.  
  157. <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php esc_attr_e( 'Crop Image', 'buddypress' ); ?>" /> 
  158.  
  159. <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" /> 
  160. <input type="hidden" id="x" name="x" /> 
  161. <input type="hidden" id="y" name="y" /> 
  162. <input type="hidden" id="w" name="w" /> 
  163. <input type="hidden" id="h" name="h" /> 
  164.  
  165. <?php wp_nonce_field( 'bp_avatar_cropstore' ); ?> 
  166.  
  167. <?php endif; ?> 
  168.  
  169. <?php endif; ?> 
  170.  
  171. <?php /** Manage Group Members */ ?> 
  172. <?php if ( bp_is_group_admin_screen( 'manage-members' ) ) : ?> 
  173.  
  174. <?php do_action( 'bp_before_group_manage_members_admin' ); ?> 
  175.  
  176. <div class="bp-widget"> 
  177. <h4><?php _e( 'Administrators', 'buddypress' ); ?></h4> 
  178.  
  179. <?php if ( bp_has_members( '&include='. bp_group_admin_ids() ) ) : ?> 
  180.  
  181. <ul id="admins-list" class="item-list single-line"> 
  182.  
  183. <?php while ( bp_members() ) : bp_the_member(); ?> 
  184. <li> 
  185. <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?> 
  186. <h5> 
  187. <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a> 
  188. <?php if ( count( bp_group_admin_ids( false, 'array' ) ) > 1 ) : ?> 
  189. <span class="small"> 
  190. <a class="button confirm admin-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ); ?>"><?php _e( 'Demote to Member', 'buddypress' ); ?></a> 
  191. </span> 
  192. <?php endif; ?> 
  193. </h5> 
  194. </li> 
  195. <?php endwhile; ?> 
  196.  
  197. </ul> 
  198.  
  199. <?php endif; ?> 
  200.  
  201. </div> 
  202.  
  203. <?php if ( bp_group_has_moderators() ) : ?> 
  204. <div class="bp-widget"> 
  205. <h4><?php _e( 'Moderators', 'buddypress' ); ?></h4> 
  206.  
  207. <?php if ( bp_has_members( '&include=' . bp_group_mod_ids() ) ) : ?> 
  208. <ul id="mods-list" class="item-list single-line"> 
  209.  
  210. <?php while ( bp_members() ) : bp_the_member(); ?> 
  211. <li> 
  212. <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?> 
  213. <h5> 
  214. <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a> 
  215. <span class="small"> 
  216. <a href="<?php bp_group_member_promote_admin_link( array( 'user_id' => bp_get_member_user_id() ) ); ?>" class="button confirm mod-promote-to-admin" title="<?php esc_attr_e( 'Promote to Admin', 'buddypress' ); ?>"><?php _e( 'Promote to Admin', 'buddypress' ); ?></a> 
  217. <a class="button confirm mod-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ); ?>"><?php _e( 'Demote to Member', 'buddypress' ); ?></a> 
  218. </span> 
  219. </h5> 
  220. </li> 
  221. <?php endwhile; ?> 
  222.  
  223. </ul> 
  224.  
  225. <?php endif; ?> 
  226. </div> 
  227. <?php endif ?> 
  228.  
  229.  
  230. <div class="bp-widget"> 
  231. <h4><?php _e("Members", "buddypress"); ?></h4> 
  232.  
  233. <?php if ( bp_group_has_members( 'per_page=15&exclude_banned=0' ) ) : ?> 
  234.  
  235. <?php if ( bp_group_member_needs_pagination() ) : ?> 
  236.  
  237. <div class="pagination no-ajax"> 
  238.  
  239. <div id="member-count" class="pag-count"> 
  240. <?php bp_group_member_pagination_count(); ?> 
  241. </div> 
  242.  
  243. <div id="member-admin-pagination" class="pagination-links"> 
  244. <?php bp_group_member_admin_pagination(); ?> 
  245. </div> 
  246.  
  247. </div> 
  248.  
  249. <?php endif; ?> 
  250.  
  251. <ul id="members-list" class="item-list single-line"> 
  252. <?php while ( bp_group_members() ) : bp_group_the_member(); ?> 
  253.  
  254. <li class="<?php bp_group_member_css_class(); ?>"> 
  255. <?php bp_group_member_avatar_mini(); ?> 
  256.  
  257. <h5> 
  258. <?php bp_group_member_link(); ?> 
  259.  
  260. <?php if ( bp_get_group_member_is_banned() ) _e( '(banned)', 'buddypress'); ?> 
  261.  
  262. <span class="small"> 
  263.  
  264. <?php if ( bp_get_group_member_is_banned() ) : ?> 
  265.  
  266. <a href="<?php bp_group_member_unban_link(); ?>" class="button confirm member-unban" title="<?php esc_attr_e( 'Unban this member', 'buddypress' ); ?>"><?php _e( 'Remove Ban', 'buddypress' ); ?></a> 
  267.  
  268. <?php else : ?> 
  269.  
  270. <a href="<?php bp_group_member_ban_link(); ?>" class="button confirm member-ban" title="<?php esc_attr_e( 'Kick and ban this member', 'buddypress' ); ?>"><?php _e( 'Kick & Ban', 'buddypress' ); ?></a> 
  271. <a href="<?php bp_group_member_promote_mod_link(); ?>" class="button confirm member-promote-to-mod" title="<?php esc_attr_e( 'Promote to Mod', 'buddypress' ); ?>"><?php _e( 'Promote to Mod', 'buddypress' ); ?></a> 
  272. <a href="<?php bp_group_member_promote_admin_link(); ?>" class="button confirm member-promote-to-admin" title="<?php esc_attr_e( 'Promote to Admin', 'buddypress' ); ?>"><?php _e( 'Promote to Admin', 'buddypress' ); ?></a> 
  273.  
  274. <?php endif; ?> 
  275.  
  276. <a href="<?php bp_group_member_remove_link(); ?>" class="button confirm" title="<?php esc_attr_e( 'Remove this member', 'buddypress' ); ?>"><?php _e( 'Remove from group', 'buddypress' ); ?></a> 
  277.  
  278. <?php do_action( 'bp_group_manage_members_admin_item' ); ?> 
  279.  
  280. </span> 
  281. </h5> 
  282. </li> 
  283.  
  284. <?php endwhile; ?> 
  285. </ul> 
  286.  
  287. <?php else: ?> 
  288.  
  289. <div id="message" class="info"> 
  290. <p><?php _e( 'This group has no members.', 'buddypress' ); ?></p> 
  291. </div> 
  292.  
  293. <?php endif; ?> 
  294.  
  295. </div> 
  296.  
  297. <?php do_action( 'bp_after_group_manage_members_admin' ); ?> 
  298.  
  299. <?php endif; ?> 
  300.  
  301. <?php /** Manage Membership Requests */ ?> 
  302. <?php if ( bp_is_group_admin_screen( 'membership-requests' ) ) : ?> 
  303.  
  304. <?php do_action( 'bp_before_group_membership_requests_admin' ); ?> 
  305.  
  306. <?php if ( bp_group_has_membership_requests() ) : ?> 
  307.  
  308. <ul id="request-list" class="item-list"> 
  309. <?php while ( bp_group_membership_requests() ) : bp_group_the_membership_request(); ?> 
  310.  
  311. <li> 
  312. <?php bp_group_request_user_avatar_thumb(); ?> 
  313. <h4><?php bp_group_request_user_link(); ?> <span class="comments"><?php bp_group_request_comment(); ?></span></h4> 
  314. <span class="activity"><?php bp_group_request_time_since_requested(); ?></span> 
  315.  
  316. <?php do_action( 'bp_group_membership_requests_admin_item' ); ?> 
  317.  
  318. <div class="action"> 
  319.  
  320. <?php bp_button( array( 'id' => 'group_membership_accept', 'component' => 'groups', 'wrapper_class' => 'accept', 'link_href' => bp_get_group_request_accept_link(), 'link_title' => __( 'Accept', 'buddypress' ), 'link_text' => __( 'Accept', 'buddypress' ) ) ); ?> 
  321.  
  322. <?php bp_button( array( 'id' => 'group_membership_reject', 'component' => 'groups', 'wrapper_class' => 'reject', 'link_href' => bp_get_group_request_reject_link(), 'link_title' => __( 'Reject', 'buddypress' ), 'link_text' => __( 'Reject', 'buddypress' ) ) ); ?> 
  323.  
  324. <?php do_action( 'bp_group_membership_requests_admin_item_action' ); ?> 
  325.  
  326. </div> 
  327. </li> 
  328.  
  329. <?php endwhile; ?> 
  330. </ul> 
  331.  
  332. <?php else: ?> 
  333.  
  334. <div id="message" class="info"> 
  335. <p><?php _e( 'There are no pending membership requests.', 'buddypress' ); ?></p> 
  336. </div> 
  337.  
  338. <?php endif; ?> 
  339.  
  340. <?php do_action( 'bp_after_group_membership_requests_admin' ); ?> 
  341.  
  342. <?php endif; ?> 
  343.  
  344. <?php do_action( 'groups_custom_edit_steps' ) // Allow plugins to add custom group edit screens ?> 
  345.  
  346. <?php /** Delete Group Option */ ?> 
  347. <?php if ( bp_is_group_admin_screen( 'delete-group' ) ) : ?> 
  348.  
  349. <?php do_action( 'bp_before_group_delete_admin' ); ?> 
  350.  
  351. <div id="message" class="info"> 
  352. <p><?php _e( 'WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back, please be careful with this option.', 'buddypress' ); ?></p> 
  353. </div> 
  354.  
  355. <label><input type="checkbox" name="delete-group-understand" id="delete-group-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-group-button').disabled = ''; } else { document.getElementById('delete-group-button').disabled = 'disabled'; }" /> <?php _e( 'I understand the consequences of deleting this group.', 'buddypress' ); ?></label> 
  356.  
  357. <?php do_action( 'bp_after_group_delete_admin' ); ?> 
  358.  
  359. <div class="submit"> 
  360. <input type="submit" disabled="disabled" value="<?php esc_attr_e( 'Delete Group', 'buddypress' ); ?>" id="delete-group-button" name="delete-group-button" /> 
  361. </div> 
  362.  
  363. <?php wp_nonce_field( 'groups_delete_group' ); ?> 
  364.  
  365. <?php endif; ?> 
  366.  
  367. <?php /** This is important, don't forget it */ ?> 
  368. <input type="hidden" name="group-id" id="group-id" value="<?php bp_group_id(); ?>" /> 
  369.  
  370. <?php do_action( 'bp_after_group_admin_content' ); ?> 
  371.  
  372. </form><!-- #group-settings-form --> 
.