PageRenderTime 26ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/themes/metrohealthintranet/groups/create.php

https://bitbucket.org/codemen_iftekhar/codemen
PHP | 315 lines | 196 code | 113 blank | 6 comment | 30 complexity | 57ecaf86bed53e155c255a57f1036e01 MD5 | raw file
  1. <?php
  2. /**
  3. * BuddyPress - Create Group
  4. *
  5. * @package BuddyPress
  6. * @subpackage bp-default
  7. */
  8. get_header( 'buddypress' ); ?>
  9. <div id="content">
  10. <div class="padder">
  11. <?php do_action( 'bp_before_create_group_content_template' ); ?>
  12. <form action="<?php bp_group_creation_form_action(); ?>" method="post" id="create-group-form" class="standard-form" enctype="multipart/form-data">
  13. <h3><?php _e( 'Create a Group', 'buddypress' ); ?> &nbsp;<a class="button" href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ); ?>"><?php _e( 'Groups Directory', 'buddypress' ); ?></a></h3>
  14. <?php do_action( 'bp_before_create_group' ); ?>
  15. <div class="item-list-tabs no-ajax" id="group-create-tabs" role="navigation">
  16. <ul>
  17. <?php bp_group_creation_tabs(); ?>
  18. </ul>
  19. </div>
  20. <?php do_action( 'template_notices' ); ?>
  21. <div class="item-body" id="group-create-body">
  22. <?php /* Group creation step 1: Basic group details */ ?>
  23. <?php if ( bp_is_group_creation_step( 'group-details' ) ) : ?>
  24. <?php do_action( 'bp_before_group_details_creation_step' ); ?>
  25. <label for="group-name"><?php _e( 'Group Name (required)', 'buddypress' ); ?></label>
  26. <input type="text" name="group-name" id="group-name" aria-required="true" value="<?php bp_new_group_name(); ?>" />
  27. <label for="group-desc"><?php _e( 'Group Description (required)', 'buddypress' ); ?></label>
  28. <textarea name="group-desc" id="group-desc" aria-required="true"><?php bp_new_group_description(); ?></textarea>
  29. <?php
  30. do_action( 'bp_after_group_details_creation_step' );
  31. do_action( 'groups_custom_group_fields_editable' ); // @Deprecated
  32. wp_nonce_field( 'groups_create_save_group-details' ); ?>
  33. <?php endif; ?>
  34. <?php /* Group creation step 2: Group settings */ ?>
  35. <?php if ( bp_is_group_creation_step( 'group-settings' ) ) : ?>
  36. <?php do_action( 'bp_before_group_settings_creation_step' ); ?>
  37. <h4><?php _e( 'Privacy Options', 'buddypress' ); ?></h4>
  38. <div class="radio">
  39. <label><input type="radio" name="group-status" value="public"<?php if ( 'public' == bp_get_new_group_status() || !bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> />
  40. <strong><?php _e( 'This is a public group', 'buddypress' ); ?></strong>
  41. <ul>
  42. <li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li>
  43. <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
  44. <li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li>
  45. </ul>
  46. </label>
  47. <label><input type="radio" name="group-status" value="private"<?php if ( 'private' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> />
  48. <strong><?php _e( 'This is a private group', 'buddypress' ); ?></strong>
  49. <ul>
  50. <li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li>
  51. <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
  52. <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
  53. </ul>
  54. </label>
  55. <label><input type="radio" name="group-status" value="hidden"<?php if ( 'hidden' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> />
  56. <strong><?php _e('This is a hidden group', 'buddypress'); ?></strong>
  57. <ul>
  58. <li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li>
  59. <li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li>
  60. <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
  61. </ul>
  62. </label>
  63. </div>
  64. <h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4>
  65. <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p>
  66. <div class="radio">
  67. <label>
  68. <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> />
  69. <strong><?php _e( 'All group members', 'buddypress' ); ?></strong>
  70. </label>
  71. <label>
  72. <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> />
  73. <strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong>
  74. </label>
  75. <label>
  76. <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> />
  77. <strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong>
  78. </label>
  79. </div>
  80. <?php if ( bp_is_active( 'forums' ) ) : ?>
  81. <h4><?php _e( 'Group Forums', 'buddypress' ); ?></h4>
  82. <?php if ( bp_forums_is_installed_correctly() ) : ?>
  83. <p><?php _e( 'Should this group have a forum?', 'buddypress' ); ?></p>
  84. <div class="checkbox">
  85. <label><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>
  86. </div>
  87. <?php elseif ( is_super_admin() ) : ?>
  88. <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>
  89. <?php endif; ?>
  90. <?php endif; ?>
  91. <?php do_action( 'bp_after_group_settings_creation_step' ); ?>
  92. <?php wp_nonce_field( 'groups_create_save_group-settings' ); ?>
  93. <?php endif; ?>
  94. <?php /* Group creation step 3: Avatar Uploads */ ?>
  95. <?php if ( bp_is_group_creation_step( 'group-avatar' ) ) : ?>
  96. <?php do_action( 'bp_before_group_avatar_creation_step' ); ?>
  97. <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
  98. <div class="left-menu">
  99. <?php bp_new_group_avatar(); ?>
  100. </div><!-- .left-menu -->
  101. <div class="main-column">
  102. <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>
  103. <p>
  104. <input type="file" name="file" id="file" />
  105. <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ); ?>" />
  106. <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
  107. </p>
  108. <p><?php _e( 'To skip the avatar upload process, hit the "Next Step" button.', 'buddypress' ); ?></p>
  109. </div><!-- .main-column -->
  110. <?php endif; ?>
  111. <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
  112. <h3><?php _e( 'Crop Group Avatar', 'buddypress' ); ?></h3>
  113. <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ); ?>" />
  114. <div id="avatar-crop-pane">
  115. <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ); ?>" />
  116. </div>
  117. <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ); ?>" />
  118. <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" />
  119. <input type="hidden" name="upload" id="upload" />
  120. <input type="hidden" id="x" name="x" />
  121. <input type="hidden" id="y" name="y" />
  122. <input type="hidden" id="w" name="w" />
  123. <input type="hidden" id="h" name="h" />
  124. <?php endif; ?>
  125. <?php do_action( 'bp_after_group_avatar_creation_step' ); ?>
  126. <?php wp_nonce_field( 'groups_create_save_group-avatar' ); ?>
  127. <?php endif; ?>
  128. <?php /* Group creation step 4: Invite friends to group */ ?>
  129. <?php if ( bp_is_group_creation_step( 'group-invites' ) ) : ?>
  130. <?php do_action( 'bp_before_group_invites_creation_step' ); ?>
  131. <?php if ( bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
  132. <div class="left-menu">
  133. <div id="invite-list">
  134. <ul>
  135. <?php bp_new_group_invite_friend_list(); ?>
  136. </ul>
  137. <?php wp_nonce_field( 'groups_invite_uninvite_user', '_wpnonce_invite_uninvite_user' ); ?>
  138. </div>
  139. </div><!-- .left-menu -->
  140. <div class="main-column">
  141. <div id="message" class="info">
  142. <p><?php _e('Select people to invite from your friends list.', 'buddypress'); ?></p>
  143. </div>
  144. <?php /* The ID 'friend-list' is important for AJAX support. */ ?>
  145. <ul id="friend-list" class="item-list" role="main">
  146. <?php if ( bp_group_has_invites() ) : ?>
  147. <?php while ( bp_group_invites() ) : bp_group_the_invite(); ?>
  148. <li id="<?php bp_group_invite_item_id(); ?>">
  149. <?php bp_group_invite_user_avatar(); ?>
  150. <h4><?php bp_group_invite_user_link(); ?></h4>
  151. <span class="activity"><?php bp_group_invite_user_last_active(); ?></span>
  152. <div class="action">
  153. <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>
  154. </div>
  155. </li>
  156. <?php endwhile; ?>
  157. <?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites' ); ?>
  158. <?php endif; ?>
  159. </ul>
  160. </div><!-- .main-column -->
  161. <?php else : ?>
  162. <div id="message" class="info">
  163. <p><?php _e( 'Once you have built up friend connections you will be able to invite others to your group. You can send invites any time in the future by selecting the "Send Invites" option when viewing your new group.', 'buddypress' ); ?></p>
  164. </div>
  165. <?php endif; ?>
  166. <?php wp_nonce_field( 'groups_create_save_group-invites' ); ?>
  167. <?php do_action( 'bp_after_group_invites_creation_step' ); ?>
  168. <?php endif; ?>
  169. <?php do_action( 'groups_custom_create_steps' ); // Allow plugins to add custom group creation steps ?>
  170. <?php do_action( 'bp_before_group_creation_step_buttons' ); ?>
  171. <?php if ( 'crop-image' != bp_get_avatar_admin_step() ) : ?>
  172. <div class="submit" id="previous-next">
  173. <?php /* Previous Button */ ?>
  174. <?php if ( !bp_is_first_group_creation_step() ) : ?>
  175. <input type="button" value="<?php _e( 'Back to Previous Step', 'buddypress' ); ?>" id="group-creation-previous" name="previous" onclick="location.href='<?php bp_group_creation_previous_link(); ?>'" />
  176. <?php endif; ?>
  177. <?php /* Next Button */ ?>
  178. <?php if ( !bp_is_last_group_creation_step() && !bp_is_first_group_creation_step() ) : ?>
  179. <input type="submit" value="<?php _e( 'Next Step', 'buddypress' ); ?>" id="group-creation-next" name="save" />
  180. <?php endif;?>
  181. <?php /* Create Button */ ?>
  182. <?php if ( bp_is_first_group_creation_step() ) : ?>
  183. <input type="submit" value="<?php _e( 'Create Group and Continue', 'buddypress' ); ?>" id="group-creation-create" name="save" />
  184. <?php endif; ?>
  185. <?php /* Finish Button */ ?>
  186. <?php if ( bp_is_last_group_creation_step() ) : ?>
  187. <input type="submit" value="<?php _e( 'Finish', 'buddypress' ); ?>" id="group-creation-finish" name="save" />
  188. <?php endif; ?>
  189. </div>
  190. <?php endif;?>
  191. <?php do_action( 'bp_after_group_creation_step_buttons' ); ?>
  192. <?php /* Don't leave out this hidden field */ ?>
  193. <input type="hidden" name="group_id" id="group_id" value="<?php bp_new_group_id(); ?>" />
  194. <?php do_action( 'bp_directory_groups_content' ); ?>
  195. </div><!-- .item-body -->
  196. <?php do_action( 'bp_after_create_group' ); ?>
  197. </form>
  198. <?php do_action( 'bp_after_create_group_content_template' ); ?>
  199. </div><!-- .padder -->
  200. </div><!-- #content -->
  201. <?php get_sidebar( 'buddypress' ); ?>
  202. <?php get_footer( 'buddypress' ); ?>