Example #1
0
        _e('Group Avatar', 'buddypress');
        ?>
</h2>
	
		<?php 
        do_action('template_notices');
        ?>
	
		<form action="<?php 
        bp_group_admin_form_action('group-avatar');
        ?>
" name="group-avatar-form" id="group-avatar-form" class="standard-form" method="post" enctype="multipart/form-data">
		
			<div class="page-menu">
				<?php 
        bp_group_current_avatar();
        ?>
			</div>
		
			<div class="main-column">
				<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>
			
				<?php 
        bp_group_avatar_edit_form();
        ?>
			</div>

			<input type="hidden" name="group-id" id="group-id" value="<?php 
function bp_group_create_form()
{
    global $bp, $create_group_step, $completed_to_step;
    global $group_obj, $invites;
    ?>
	<form action="<?php 
    echo $bp->displayed_user->domain . $bp->groups->slug;
    ?>
/create/step/<?php 
    echo $create_group_step;
    ?>
" method="post" id="create-group-form" class="standard-form" enctype="multipart/form-data">
	<?php 
    switch ((int) $create_group_step) {
        case 1:
            ?>
			<label for="group-name">* <?php 
            _e('Group Name', 'buddypress');
            ?>
</label>
			<input type="text" name="group-name" id="group-name" value="<?php 
            echo attribute_escape($group_obj ? $group_obj->name : $_POST['group-name']);
            ?>
" />
		
			<label for="group-desc">* <?php 
            _e('Group Description', 'buddypress');
            ?>
</label>
			<textarea name="group-desc" id="group-desc"><?php 
            echo htmlspecialchars($group_obj ? $group_obj->description : $_POST['group-desc']);
            ?>
</textarea>
		
			<label for="group-news"><?php 
            _e('Recent News', 'buddypress');
            ?>
</label>
			<textarea name="group-news" id="group-news"><?php 
            echo htmlspecialchars($group_obj ? $group_obj->news : $_POST['group-news']);
            ?>
</textarea>
			
			<?php 
            do_action('groups_custom_group_fields_editable');
            ?>
			
			<p><input type="submit" value="<?php 
            _e('Create Group and Continue', 'buddypress');
            ?>
 &raquo;" id="save" name="save"/></p>
			
			<?php 
            wp_nonce_field('groups_step1_save');
            ?>
		<?php 
            break;
            ?>
		
		<?php 
        case 2:
            ?>
			<?php 
            if ($completed_to_step > 0) {
                ?>
				<?php 
                if (function_exists('bp_wire_install')) {
                    ?>
				<div class="checkbox">
					<label><input type="checkbox" name="group-show-wire" id="group-show-wire" value="1"<?php 
                    if ($group_obj->enable_wire) {
                        ?>
 checked="checked"<?php 
                    }
                    ?>
 /> <?php 
                    _e('Enable comment wire', 'buddypress');
                    ?>
</label>
				</div>
				<?php 
                }
                ?>
				
				<?php 
                if (function_exists('bp_forums_setup')) {
                    ?>
					<?php 
                    if (bp_forums_is_installed_correctly()) {
                        ?>
						<div class="checkbox">
							<label><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php 
                        if ($group_obj->enable_forum) {
                            ?>
 checked="checked"<?php 
                        }
                        ?>
 /> <?php 
                        _e('Enable discussion forum', 'buddypress');
                        ?>
</label>
						</div>
					<?php 
                    } else {
                        if (is_site_admin()) {
                            ?>
							<div class="checkbox">
								<label><input type="checkbox" disabled="disabled" name="disabled" id="disabled" value="0" /> <?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->root_domain . '/wp-admin/admin.php?page=' . BP_PLUGIN_DIR . '/bp-forums/bp-forums-admin.php');
                            ?>
</label>
							</div>
							<?php 
                        }
                    }
                    ?>
				<?php 
                }
                ?>
				
				<?php 
                if (function_exists('bp_albums_install')) {
                    ?>
				<div class="checkbox with-suboptions">
					<label><input type="checkbox" name="group-show-photos" id="group-show-photos" value="1"<?php 
                    if ($group_obj->enable_photos) {
                        ?>
 checked="checked"<?php 
                    }
                    ?>
 /> <?php 
                    _e('Enable photo gallery', 'buddypress');
                    ?>
</label>
					<div class="sub-options"<?php 
                    if (!$group_obj->enable_photos) {
                        ?>
 style="display: none;"<?php 
                    }
                    ?>
>
						<label><input type="radio" name="group-photos-status" value="all"<?php 
                    if (!$group_obj->photos_admin_only) {
                        ?>
 checked="checked"<?php 
                    }
                    ?>
 /> <?php 
                    _e('All members can upload photos', 'buddypress');
                    ?>
</label>
						<label><input type="radio" name="group-photos-status" value="admins"<?php 
                    if ($group_obj->photos_admin_only) {
                        ?>
 checked="checked"<?php 
                    }
                    ?>
 /> <?php 
                    _e('Only group admins can upload photos', 'buddypress');
                    ?>
</label>
					</div>
				</div>
				<?php 
                }
                ?>
			
				<h3><?php 
                _e('Privacy Options', 'buddypress');
                ?>
</h3>
			
				<div class="radio">
					<label><input type="radio" name="group-status" value="public"<?php 
                if ('public' == $group_obj->status) {
                    ?>
 checked="checked"<?php 
                }
                ?>
 /> 
						<strong><?php 
                _e('This is a public group', 'buddypress');
                ?>
</strong>
						<ul>
							<li><?php 
                _e('Any site member can join this group.', 'buddypress');
                ?>
</li>
							<li><?php 
                _e('This group will be listed in the groups directory and in search results.', 'buddypress');
                ?>
</li>
							<li><?php 
                _e('Group content and activity will be visible to any site member.', 'buddypress');
                ?>
</li>
						</ul>
					</label>
					
					<label><input type="radio" name="group-status" value="private"<?php 
                if ('private' == $group_obj->status) {
                    ?>
 checked="checked"<?php 
                }
                ?>
 />
						<strong><?php 
                _e('This is a private group', 'buddypress');
                ?>
</strong>
						<ul>
							<li><?php 
                _e('Only users who request membership and are accepted can join the group.', 'buddypress');
                ?>
</li>
							<li><?php 
                _e('This group will be listed in the groups directory and in search results.', 'buddypress');
                ?>
</li>
							<li><?php 
                _e('Group content and activity will only be visible to members of the group.', 'buddypress');
                ?>
</li>
						</ul>
					</label>
					
					<label><input type="radio" name="group-status" value="hidden"<?php 
                if ('hidden' == $group_obj->status) {
                    ?>
 checked="checked"<?php 
                }
                ?>
 />
						<strong><?php 
                _e('This is a hidden group', 'buddypress');
                ?>
</strong>
						<ul>
							<li><?php 
                _e('Only users who are invited can join the group.', 'buddypress');
                ?>
</li>
							<li><?php 
                _e('This group will not be listed in the groups directory or search results.', 'buddypress');
                ?>
</li>
							<li><?php 
                _e('Group content and activity will only be visible to members of the group.', 'buddypress');
                ?>
</li>
						</ul>
					</label>
				</div>

				<p><input type="submit" value="<?php 
                _e('Save and Continue', 'buddypress');
                ?>
 &raquo;" id="save" name="save"/></p>

				<?php 
                wp_nonce_field('groups_step2_save');
                ?>
			<?php 
            } else {
                ?>
				<div id="message" class="info">
					<p><?php 
                _e('Please complete all previous steps first.', 'buddypress');
                ?>
</p>
				</div>
			<?php 
            }
            ?>
		<?php 
            break;
            ?>
		
		<?php 
        case 3:
            ?>
			<?php 
            if ($completed_to_step > 1) {
                ?>
				<div class="left-menu">
					<?php 
                bp_group_current_avatar();
                ?>
				</div>
				
				<div class="main-column">
					<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>
					
					<?php 
                if (!empty($_FILES) || isset($_POST['orig']) && isset($_POST['canvas'])) {
                    groups_avatar_upload($_FILES);
                } else {
                    bp_core_render_avatar_upload_form('', true);
                }
                ?>
					
					<div id="skip-continue">
						<input type="submit" value="<?php 
                _e('Skip', 'buddypress');
                ?>
 &raquo;" id="skip" name="skip"/>
					</div>
				</div>
				
				<?php 
                wp_nonce_field('groups_step3_save');
                ?>
			<?php 
            } else {
                ?>
				<div id="message" class="info">
					<p><?php 
                _e('Please complete all previous steps first.', 'buddypress');
                ?>
</p>
				</div>
			<?php 
            }
            ?>
		<?php 
            break;
            ?>
		<?php 
        case 4:
            ?>
			<?php 
            if ($completed_to_step > 2) {
                $group_link = bp_get_group_permalink($group_obj);
                if (function_exists('friends_install')) {
                    if (friends_get_friend_count_for_user($bp->loggedin_user->id)) {
                        bp_group_send_invite_form($group_obj);
                    } else {
                        ?>
						<div id="message" class="info">
							<p><?php 
                        _e('Once you build up your friends list you will be able to invite friends to join your group.', 'buddypress');
                        ?>
</p>
						</div>
						<?php 
                    }
                }
                ?>
				
				<p class="clear"><input type="submit" value="<?php 
                _e('Finish', 'buddypress');
                ?>
 &raquo;" id="save" name="save" /></p>
				
				<?php 
                wp_nonce_field('groups_step4_save');
                ?>
				
				<?php 
            } else {
                ?>
				<div id="message" class="info">
					<p><?php 
                _e('Please complete all previous steps first.', 'buddypress');
                ?>
</p>
				</div>
		<?php 
            }
            ?>
		<?php 
            break;
            ?>
	<?php 
    }
    ?>
	</form>
<?php 
}