/bp-templates/bp-legacy/buddypress/groups/create.php

  1. <?php 
  2. /** 
  3. * BuddyPress - Groups Create 
  4. * 
  5. * @package BuddyPress 
  6. * @subpackage bp-legacy 
  7. */ 
  8.  
  9. /** 
  10. * Fires at the top of the groups creation template file. 
  11. * 
  12. * @since 1.7.0 
  13. */ 
  14. do_action( 'bp_before_create_group_page' ); ?> 
  15.  
  16. <div id="buddypress"> 
  17.  
  18. <?php 
  19.  
  20. /** 
  21. * Fires before the display of group creation content. 
  22. * 
  23. * @since 1.6.0 
  24. */ 
  25. do_action( 'bp_before_create_group_content_template' ); ?> 
  26.  
  27. <form action="<?php bp_group_creation_form_action(); ?>" method="post" id="create-group-form" class="standard-form" enctype="multipart/form-data"> 
  28.  
  29. <?php 
  30.  
  31. /** 
  32. * Fires before the display of group creation. 
  33. * 
  34. * @since 1.2.0 
  35. */ 
  36. do_action( 'bp_before_create_group' ); ?> 
  37.  
  38. <div class="item-list-tabs no-ajax" id="group-create-tabs"> 
  39. <ul> 
  40.  
  41. <?php bp_group_creation_tabs(); ?> 
  42.  
  43. </ul> 
  44. </div> 
  45.  
  46. <div id="template-notices" role="alert" aria-atomic="true"> 
  47. <?php 
  48.  
  49. /** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */ 
  50. do_action( 'template_notices' ); ?> 
  51.  
  52. </div> 
  53.  
  54. <div class="item-body" id="group-create-body"> 
  55.  
  56. <?php /** Group creation step 1: Basic group details */ ?> 
  57. <?php if ( bp_is_group_creation_step( 'group-details' ) ) : ?> 
  58.  
  59. <h2 class="bp-screen-reader-text"><?php 
  60. /** translators: accessibility text */ 
  61. _e( 'Group Details', 'buddypress' ); 
  62. ?></h2> 
  63.  
  64. <?php 
  65.  
  66. /** 
  67. * Fires before the display of the group details creation step. 
  68. * 
  69. * @since 1.1.0 
  70. */ 
  71. do_action( 'bp_before_group_details_creation_step' ); ?> 
  72.  
  73. <div> 
  74. <label for="group-name"><?php _e( 'Group Name (required)', 'buddypress' ); ?></label> 
  75. <input type="text" name="group-name" id="group-name" aria-required="true" value="<?php bp_new_group_name(); ?>" /> 
  76. </div> 
  77.  
  78. <div> 
  79. <label for="group-desc"><?php _e( 'Group Description (required)', 'buddypress' ); ?></label> 
  80. <textarea name="group-desc" id="group-desc" aria-required="true"><?php bp_new_group_description(); ?></textarea> 
  81. </div> 
  82.  
  83. <?php 
  84.  
  85. /** 
  86. * Fires after the display of the group details creation step. 
  87. * 
  88. * @since 1.1.0 
  89. */ 
  90. do_action( 'bp_after_group_details_creation_step' ); 
  91. do_action( 'groups_custom_group_fields_editable' ); // @Deprecated 
  92.  
  93. wp_nonce_field( 'groups_create_save_group-details' ); ?> 
  94.  
  95. <?php endif; ?> 
  96.  
  97. <?php /** Group creation step 2: Group settings */ ?> 
  98. <?php if ( bp_is_group_creation_step( 'group-settings' ) ) : ?> 
  99.  
  100. <h2 class="bp-screen-reader-text"><?php 
  101. /** translators: accessibility text */ 
  102. _e( 'Group Settings', 'buddypress' ); 
  103. ?></h2> 
  104.  
  105. <?php 
  106.  
  107. /** 
  108. * Fires before the display of the group settings creation step. 
  109. * 
  110. * @since 1.1.0 
  111. */ 
  112. do_action( 'bp_before_group_settings_creation_step' ); ?> 
  113.  
  114. <fieldset class="group-create-privacy"> 
  115.  
  116. <legend><?php _e( 'Privacy Options', 'buddypress' ); ?></legend> 
  117.  
  118. <div class="radio"> 
  119.  
  120. <label for="group-status-public"><input type="radio" name="group-status" id="group-status-public" value="public"<?php if ( 'public' == bp_get_new_group_status() || !bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="public-group-description" /> <?php _e( 'This is a public group', 'buddypress' ); ?></label> 
  121.  
  122. <ul id="public-group-description"> 
  123. <li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li> 
  124. <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li> 
  125. <li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li> 
  126. </ul> 
  127.  
  128. <label for="group-status-private"><input type="radio" name="group-status" id="group-status-private" value="private"<?php if ( 'private' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="private-group-description" /> <?php _e( 'This is a private group', 'buddypress' ); ?></label> 
  129.  
  130. <ul id="private-group-description"> 
  131. <li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li> 
  132. <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li> 
  133. <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li> 
  134. </ul> 
  135.  
  136. <label for="group-status-hidden"><input type="radio" name="group-status" id="group-status-hidden" value="hidden"<?php if ( 'hidden' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="hidden-group-description" /> <?php _e('This is a hidden group', 'buddypress' ); ?></label> 
  137.  
  138. <ul id="hidden-group-description"> 
  139. <li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li> 
  140. <li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li> 
  141. <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li> 
  142. </ul> 
  143.  
  144. </div> 
  145.  
  146. </fieldset> 
  147.  
  148. <?php // Group type selection ?> 
  149. <?php if ( $group_types = bp_groups_get_group_types( array( 'show_in_create_screen' => true ), 'objects' ) ): ?> 
  150.  
  151. <fieldset class="group-create-types"> 
  152. <legend><?php _e( 'Group Types', 'buddypress' ); ?></legend> 
  153.  
  154. <p><?php _e( 'Select the types this group should be a part of.', 'buddypress' ); ?></p> 
  155.  
  156. <?php foreach ( $group_types as $type ) : ?> 
  157. <div class="checkbox"> 
  158. <label for="<?php printf( 'group-type-%s', $type->name ); ?>"><input type="checkbox" name="group-types[]" id="<?php printf( 'group-type-%s', $type->name ); ?>" value="<?php echo esc_attr( $type->name ); ?>" <?php checked( true, ! empty( $type->create_screen_checked ) ); ?> /> <?php echo esc_html( $type->labels['name'] ); ?> 
  159. <?php 
  160. if ( ! empty( $type->description ) ) { 
  161. /** translators: Group type description shown when creating a group. */ 
  162. printf( __( '– %s', 'buddypress' ), '<span class="bp-group-type-desc">' . esc_html( $type->description ) . '</span>' ); 
  163. ?> 
  164. </label> 
  165. </div> 
  166.  
  167. <?php endforeach; ?> 
  168.  
  169. </fieldset> 
  170.  
  171. <?php endif; ?> 
  172.  
  173. <fieldset class="group-create-invitations"> 
  174.  
  175. <legend><?php _e( 'Group Invitations', 'buddypress' ); ?></legend> 
  176.  
  177. <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p> 
  178.  
  179. <div class="radio"> 
  180.  
  181. <label for="group-invite-status-members"><input type="radio" name="group-invite-status" id="group-invite-status-members" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> <?php _e( 'All group members', 'buddypress' ); ?></label> 
  182.  
  183. <label for="group-invite-status-mods"><input type="radio" name="group-invite-status" id="group-invite-status-mods" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> <?php _e( 'Group admins and mods only', 'buddypress' ); ?></label> 
  184.  
  185. <label for="group-invite-status-admins"><input type="radio" name="group-invite-status" id="group-invite-status-admins" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> <?php _e( 'Group admins only', 'buddypress' ); ?></label> 
  186.  
  187. </div> 
  188.  
  189. </fieldset> 
  190.  
  191. <?php if ( bp_is_active( 'forums' ) ) : ?> 
  192.  
  193. <h4><?php _e( 'Group Forums', 'buddypress' ); ?></h4> 
  194.  
  195. <?php if ( bp_forums_is_installed_correctly() ) : ?> 
  196.  
  197. <p><?php _e( 'Should this group have a forum?', 'buddypress' ); ?></p> 
  198.  
  199. <div class="checkbox"> 
  200. <label for="group-show-forum"><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php checked( bp_get_new_group_enable_forum(), true, true ); ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ); ?></label> 
  201. </div> 
  202. <?php elseif ( is_super_admin() ) : ?> 
  203.  
  204. <p><?php printf( __( '<strong>Attention Site Admin:</strong> Group forums require the <a href="%s">correct setup and configuration</a> of a bbPress installation.', 'buddypress' ), bp_core_do_network_admin() ? network_admin_url( 'settings.php?page=bb-forums-setup' ) : admin_url( 'admin.php?page=bb-forums-setup' ) ); ?></p> 
  205.  
  206. <?php endif; ?> 
  207.  
  208. <?php endif; ?> 
  209.  
  210. <?php 
  211.  
  212. /** 
  213. * Fires after the display of the group settings creation step. 
  214. * 
  215. * @since 1.1.0 
  216. */ 
  217. do_action( 'bp_after_group_settings_creation_step' ); ?> 
  218.  
  219. <?php wp_nonce_field( 'groups_create_save_group-settings' ); ?> 
  220.  
  221. <?php endif; ?> 
  222.  
  223. <?php /** Group creation step 3: Avatar Uploads */ ?> 
  224. <?php if ( bp_is_group_creation_step( 'group-avatar' ) ) : ?> 
  225.  
  226. <h2 class="bp-screen-reader-text"><?php 
  227. /** translators: accessibility text */ 
  228. _e( 'Group Avatar', 'buddypress' ); 
  229. ?></h2> 
  230.  
  231. <?php 
  232.  
  233. /** 
  234. * Fires before the display of the group avatar creation step. 
  235. * 
  236. * @since 1.1.0 
  237. */ 
  238. do_action( 'bp_before_group_avatar_creation_step' ); ?> 
  239.  
  240. <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?> 
  241.  
  242. <div class="left-menu"> 
  243.  
  244. <?php bp_new_group_avatar(); ?> 
  245.  
  246. </div><!-- .left-menu --> 
  247.  
  248. <div class="main-column"> 
  249. <p><?php _e( "Upload an image to use as a profile photo for this group. The image will be shown on the main group page, and in search results.", 'buddypress' ); ?></p> 
  250.  
  251. <p> 
  252. <label for="file" class="bp-screen-reader-text"><?php 
  253. /** translators: accessibility text */ 
  254. _e( 'Select an image', 'buddypress' ); 
  255. ?></label> 
  256. <input type="file" name="file" id="file" /> 
  257. <input type="submit" name="upload" id="upload" value="<?php esc_attr_e( 'Upload Image', 'buddypress' ); ?>" /> 
  258. <input type="hidden" name="action" id="action" value="bp_avatar_upload" /> 
  259. </p> 
  260.  
  261. <p><?php _e( 'To skip the group profile photo upload process, hit the "Next Step" button.', 'buddypress' ); ?></p> 
  262. </div><!-- .main-column --> 
  263.  
  264. <?php 
  265. /** 
  266. * Load the Avatar UI templates 
  267. * 
  268. * @since 2.3.0 
  269. */ 
  270. bp_avatar_get_templates(); ?> 
  271.  
  272. <?php endif; ?> 
  273.  
  274. <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?> 
  275.  
  276. <h4><?php _e( 'Crop Group Profile Photo', 'buddypress' ); ?></h4> 
  277.  
  278. <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php esc_attr_e( 'Profile photo to crop', 'buddypress' ); ?>" /> 
  279.  
  280. <div id="avatar-crop-pane"> 
  281. <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php esc_attr_e( 'Profile photo preview', 'buddypress' ); ?>" /> 
  282. </div> 
  283.  
  284. <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php esc_attr_e( 'Crop Image', 'buddypress' ); ?>" /> 
  285.  
  286. <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" /> 
  287. <input type="hidden" name="upload" id="upload" /> 
  288. <input type="hidden" id="x" name="x" /> 
  289. <input type="hidden" id="y" name="y" /> 
  290. <input type="hidden" id="w" name="w" /> 
  291. <input type="hidden" id="h" name="h" /> 
  292.  
  293. <?php endif; ?> 
  294.  
  295. <?php 
  296.  
  297. /** 
  298. * Fires after the display of the group avatar creation step. 
  299. * 
  300. * @since 1.1.0 
  301. */ 
  302. do_action( 'bp_after_group_avatar_creation_step' ); ?> 
  303.  
  304. <?php wp_nonce_field( 'groups_create_save_group-avatar' ); ?> 
  305.  
  306. <?php endif; ?> 
  307.  
  308. <?php /** Group creation step 4: Cover image */ ?> 
  309. <?php if ( bp_is_group_creation_step( 'group-cover-image' ) ) : ?> 
  310.  
  311. <h2 class="bp-screen-reader-text"><?php 
  312. /** translators: accessibility text */ 
  313. _e( 'Cover Image', 'buddypress' ); 
  314. ?></h2> 
  315.  
  316. <?php 
  317.  
  318. /** 
  319. * Fires before the display of the group cover image creation step. 
  320. * 
  321. * @since 2.4.0 
  322. */ 
  323. do_action( 'bp_before_group_cover_image_creation_step' ); ?> 
  324.  
  325. <div id="header-cover-image"></div> 
  326.  
  327. <p><?php _e( 'The Cover Image will be used to customize the header of your group.', 'buddypress' ); ?></p> 
  328.  
  329. <?php bp_attachments_get_template_part( 'cover-images/index' ); ?> 
  330.  
  331. <?php 
  332.  
  333. /** 
  334. * Fires after the display of the group cover image creation step. 
  335. * 
  336. * @since 2.4.0 
  337. */ 
  338. do_action( 'bp_after_group_cover_image_creation_step' ); ?> 
  339.  
  340. <?php wp_nonce_field( 'groups_create_save_group-cover-image' ); ?> 
  341.  
  342. <?php endif; ?> 
  343.  
  344. <?php /** Group creation step 5: Invite friends to group */ ?> 
  345. <?php if ( bp_is_group_creation_step( 'group-invites' ) ) : ?> 
  346.  
  347. <h2 class="bp-screen-reader-text"><?php 
  348. /** translators: accessibility text */ 
  349. _e( 'Group Invites', 'buddypress' ); 
  350. ?></h2> 
  351.  
  352. <?php 
  353.  
  354. /** 
  355. * Fires before the display of the group invites creation step. 
  356. * 
  357. * @since 1.1.0 
  358. */ 
  359. do_action( 'bp_before_group_invites_creation_step' ); ?> 
  360.  
  361. <?php if ( bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?> 
  362.  
  363. <div class="left-menu"> 
  364.  
  365. <div id="invite-list"> 
  366. <ul> 
  367. <?php bp_new_group_invite_friend_list(); ?> 
  368. </ul> 
  369.  
  370. <?php wp_nonce_field( 'groups_invite_uninvite_user', '_wpnonce_invite_uninvite_user' ); ?> 
  371. </div> 
  372.  
  373. </div><!-- .left-menu --> 
  374.  
  375. <div class="main-column"> 
  376.  
  377. <div id="message" class="info"> 
  378. <p><?php _e('Select people to invite from your friends list.', 'buddypress' ); ?></p> 
  379. </div> 
  380.  
  381. <?php /** The ID 'friend-list' is important for AJAX support. */ ?> 
  382. <ul id="friend-list" class="item-list"> 
  383.  
  384. <?php if ( bp_group_has_invites() ) : ?> 
  385.  
  386. <?php while ( bp_group_invites() ) : bp_group_the_invite(); ?> 
  387.  
  388. <li id="<?php bp_group_invite_item_id(); ?>"> 
  389.  
  390. <?php bp_group_invite_user_avatar(); ?> 
  391.  
  392. <h4><?php bp_group_invite_user_link(); ?></h4> 
  393. <span class="activity"><?php bp_group_invite_user_last_active(); ?></span> 
  394.  
  395. <div class="action"> 
  396. <a class="remove" href="<?php bp_group_invite_user_remove_invite_url(); ?>" id="<?php bp_group_invite_item_id(); ?>"><?php _e( 'Remove Invite', 'buddypress' ); ?></a> 
  397. </div> 
  398. </li> 
  399.  
  400. <?php endwhile; ?> 
  401.  
  402. <?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites' ); ?> 
  403.  
  404. <?php endif; ?> 
  405.  
  406. </ul> 
  407.  
  408. </div><!-- .main-column --> 
  409.  
  410. <?php else : ?> 
  411.  
  412. <div id="message" class="info"> 
  413. <p><?php _e( 'Once you have built up friend connections you will be able to invite others to your group.', 'buddypress' ); ?></p> 
  414. </div> 
  415.  
  416. <?php endif; ?> 
  417.  
  418. <?php wp_nonce_field( 'groups_create_save_group-invites' ); ?> 
  419.  
  420. <?php 
  421.  
  422. /** 
  423. * Fires after the display of the group invites creation step. 
  424. * 
  425. * @since 1.1.0 
  426. */ 
  427. do_action( 'bp_after_group_invites_creation_step' ); ?> 
  428.  
  429. <?php endif; ?> 
  430.  
  431. <?php 
  432.  
  433. /** 
  434. * Fires inside the group admin template. 
  435. * 
  436. * Allows plugins to add custom group creation steps. 
  437. * 
  438. * @since 1.1.0 
  439. */ 
  440. do_action( 'groups_custom_create_steps' ); ?> 
  441.  
  442. <?php 
  443.  
  444. /** 
  445. * Fires before the display of the group creation step buttons. 
  446. * 
  447. * @since 1.1.0 
  448. */ 
  449. do_action( 'bp_before_group_creation_step_buttons' ); ?> 
  450.  
  451. <?php if ( 'crop-image' != bp_get_avatar_admin_step() ) : ?> 
  452.  
  453. <div class="submit" id="previous-next"> 
  454.  
  455. <?php /** Previous Button */ ?> 
  456. <?php if ( !bp_is_first_group_creation_step() ) : ?> 
  457.  
  458. <input type="button" value="<?php esc_attr_e( 'Back to Previous Step', 'buddypress' ); ?>" id="group-creation-previous" name="previous" onclick="location.href='<?php bp_group_creation_previous_link(); ?>'" /> 
  459.  
  460. <?php endif; ?> 
  461.  
  462. <?php /** Next Button */ ?> 
  463. <?php if ( !bp_is_last_group_creation_step() && !bp_is_first_group_creation_step() ) : ?> 
  464.  
  465. <input type="submit" value="<?php esc_attr_e( 'Next Step', 'buddypress' ); ?>" id="group-creation-next" name="save" /> 
  466.  
  467. <?php endif;?> 
  468.  
  469. <?php /** Create Button */ ?> 
  470. <?php if ( bp_is_first_group_creation_step() ) : ?> 
  471.  
  472. <input type="submit" value="<?php esc_attr_e( 'Create Group and Continue', 'buddypress' ); ?>" id="group-creation-create" name="save" /> 
  473.  
  474. <?php endif; ?> 
  475.  
  476. <?php /** Finish Button */ ?> 
  477. <?php if ( bp_is_last_group_creation_step() ) : ?> 
  478.  
  479. <input type="submit" value="<?php esc_attr_e( 'Finish', 'buddypress' ); ?>" id="group-creation-finish" name="save" /> 
  480.  
  481. <?php endif; ?> 
  482. </div> 
  483.  
  484. <?php endif;?> 
  485.  
  486. <?php 
  487.  
  488. /** 
  489. * Fires after the display of the group creation step buttons. 
  490. * 
  491. * @since 1.1.0 
  492. */ 
  493. do_action( 'bp_after_group_creation_step_buttons' ); ?> 
  494.  
  495. <?php /** Don't leave out this hidden field */ ?> 
  496. <input type="hidden" name="group_id" id="group_id" value="<?php bp_new_group_id(); ?>" /> 
  497.  
  498. <?php 
  499.  
  500. /** 
  501. * Fires and displays the groups directory content. 
  502. * 
  503. * @since 1.1.0 
  504. */ 
  505. do_action( 'bp_directory_groups_content' ); ?> 
  506.  
  507. </div><!-- .item-body --> 
  508.  
  509. <?php 
  510.  
  511. /** 
  512. * Fires after the display of group creation. 
  513. * 
  514. * @since 1.2.0 
  515. */ 
  516. do_action( 'bp_after_create_group' ); ?> 
  517.  
  518. </form> 
  519.  
  520. <?php 
  521.  
  522. /** 
  523. * Fires after the display of group creation content. 
  524. * 
  525. * @since 1.6.0 
  526. */ 
  527. do_action( 'bp_after_create_group_content_template' ); ?> 
  528.  
  529. </div> 
  530.  
  531. <?php 
  532.  
  533. /** 
  534. * Fires at the bottom of the groups creation template file. 
  535. * 
  536. * @since 1.7.0 
  537. */ 
  538. do_action( 'bp_after_create_group_page' ); ?> 
.