[ Index ] |
PHP Cross Reference of BuddyPress |
[Summary view] [Print] [Text view]
1 <?php 2 require_once ('admin.php'); 3 4 $forums = bb_get_forums(); 5 $forums_count = $forums ? count($forums) : 0; 6 7 if ( isset($_GET['action']) && 'delete' == $_GET['action'] ) { 8 $forum_to_delete = (int) $_GET['id']; 9 $deleted_forum = bb_get_forum( $forum_to_delete ); 10 if ( !$deleted_forum || $forums_count < 2 || !bb_current_user_can( 'delete_forum', $forum_to_delete ) ) { 11 bb_safe_redirect( add_query_arg( array('action' => false, 'id' => false) ) ); 12 exit; 13 } 14 } 15 16 if ( isset($_GET['message']) ) { 17 switch ( $_GET['message'] ) : 18 case 'updated' : 19 bb_admin_notice( __( '<strong>Forum Updated.</strong>' ) ); 20 break; 21 case 'deleted' : 22 bb_admin_notice( sprintf( 23 __( '<strong>Forum deleted.</strong> You should <a href="%s">recount your site information</a>.' ), 24 bb_get_uri('bb-admin/tools-recount.php', null, BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN) 25 ) ); 26 break; 27 endswitch; 28 } 29 30 if ( !isset($_GET['action']) ) 31 wp_enqueue_script( 'admin-forums' ); 32 elseif ( 'delete' == @$_GET['action'] ) 33 bb_admin_notice( sprintf( __( 'Are you sure you want to delete the "<strong>%s</strong>" forum?' ), $deleted_forum->forum_name ) ); 34 35 $bb_admin_body_class = ' bb-admin-forums'; 36 37 bb_get_admin_header(); 38 ?> 39 40 <div class="wrap"> 41 42 <h2><?php _e('Forums'); ?></h2> 43 <?php do_action( 'bb_admin_notices' ); ?> 44 <?php switch ( @$_GET['action'] ) : ?> 45 <?php case 'edit' : ?> 46 <?php bb_forum_form( (int) $_GET['id'] ); ?> 47 <?php break; case 'delete' : ?> 48 49 <form class="settings" method="post" id="delete-forums" action="<?php bb_uri('bb-admin/bb-forum.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN); ?>"> 50 <fieldset> 51 <legend><?php _e('Delete Forum'); ?></legend> 52 <p><?php _e('This forum contains:'); ?></p> 53 <ul> 54 <li><?php printf(__ngettext('%d topic', '%d topics', $deleted_forum->topics), $deleted_forum->topics); ?></li> 55 <li><?php printf(__ngettext('%d post', '%d posts', $deleted_forum->posts), $deleted_forum->posts); ?></li> 56 </ul> 57 <div id="option-forum-delete-contents"> 58 <div class="label"><?php _e( 'Action' ); ?></div> 59 <div class="inputs"> 60 <label class="radios"> 61 <input type="radio" name="move_topics" id="move-topics-delete" value="delete" /> <?php _e('Delete all topics and posts in this forum. <em>This can never be undone.</em>'); ?> 62 </label> 63 <label class="radios"> 64 <input type="radio" name="move_topics" id="move-topics-move" value="move" checked="checked" /> <?php _e('Move topics from this forum into the replacement forum below.'); ?> 65 </label> 66 </div> 67 </div> 68 <div id="option-forum-delete-contents"> 69 <label for="move-topics-forum"><?php _e( 'Replacement forum' ); ?></label> 70 <div class="inputs"> 71 <?php bb_forum_dropdown( array('id' => 'move_topics_forum', 'callback' => 'strcmp', 'callback_args' => array($deleted_forum->forum_id), 'selected' => $deleted_forum->forum_parent) ); ?> 72 </div> 73 </div> 74 </fieldset> 75 <fieldset class="submit"> 76 <?php bb_nonce_field( 'delete-forums' ); ?> 77 <input type="hidden" name="action" value="delete" /> 78 <input type="hidden" name="forum_id" value="<?php echo $deleted_forum->forum_id; ?>" /> 79 <a href="<?php bb_uri('bb-admin/forums.php', null, BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN); ?>" class="cancel"><?php _e('Cancel') ?></a> 80 <input class="submit delete" type="submit" name="submit" value="<?php _e('Delete Forum') ?>" /> 81 </fieldset> 82 </form> 83 84 <?php break; default : ?> 85 86 87 <?php if ( bb_forums( 'type=list&walker=BB_Walker_ForumAdminlistitems' ) ) : ?> 88 <ul id="forum-list" class="list:forum list-block holder"> 89 <li class="thead list-block"><?php _e('Forum'); ?></li> 90 <?php while ( bb_forum() ) : ?> 91 <?php bb_forum_row(); ?> 92 <?php endwhile; ?> 93 </ul> 94 <?php endif; // bb_forums() ?> 95 96 <hr class="settings" /> 97 98 <?php bb_forum_form(); ?> 99 100 <?php break; endswitch; // action ?> 101 102 <div id="ajax-response"></div> 103 104 </div> 105 106 <?php bb_get_admin_footer(); ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Dec 7 01:01:35 2017 | Cross-referenced by PHPXref 0.7.1 |