<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][3975] trunk/bp-core/admin/bp-core-admin.php: Reworks Component Setup admin screen to better match WP admin.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd>3975</dd>
<dt>Author</dt> <dd>boonebgorges</dd>
<dt>Date</dt> <dd>2011-01-31 15:29:02 +0000 (Mon, 31 Jan 2011)</dd>
</dl>

<h3>Log Message</h3>
<pre>Reworks Component Setup admin screen to better match WP admin. Adds Page Setup section to enable bp-pages configuration after installation. Fixes #3019</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpcoreadminbpcoreadminphp">trunk/bp-core/admin/bp-core-admin.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpcoreadminbpcoreadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-core/admin/bp-core-admin.php (3974 => 3975)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-core/admin/bp-core-admin.php        2011-01-30 21:40:05 UTC (rev 3974)
+++ trunk/bp-core/admin/bp-core-admin.php        2011-01-31 15:29:02 UTC (rev 3975)
</span><span class="lines">@@ -233,12 +233,20 @@
</span><span class="cx">                 if ( !check_admin_referer('bp-admin-component-setup') )
</span><span class="cx">                         return false;
</span><span class="cx"> 
</span><del>-                // Settings form submitted, now save the settings.
</del><ins>+                // Settings form submitted, now save the settings. First, set active components
</ins><span class="cx">                 foreach ( (array)$_POST['bp_components'] as $key =&gt; $value ) {
</span><span class="cx">                         if ( !(int) $value )
</span><span class="cx">                                 $disabled[$key] = 1;
</span><span class="cx">                 }
</span><span class="cx">                 update_site_option( 'bp-deactivated-components', $disabled );
</span><ins>+                
+                // Then, update the directory pages
+                $directory_pages = array();        
+                foreach ( (array)$_POST['bp_pages'] as $key =&gt; $value ) {
+                        if ( !empty( $value ) )
+                                $directory_pages[$key] = (int)$value;
+                }
+                bp_core_update_page_meta( $directory_pages );
</ins><span class="cx">         } ?&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;div class=&quot;wrap&quot;&gt;
</span><span class="lines">@@ -255,11 +263,13 @@
</span><span class="cx"> 
</span><span class="cx">                 &lt;form action=&quot;&quot; method=&quot;post&quot; id=&quot;bp-admin-component-form&quot;&gt;
</span><span class="cx"> 
</span><del>-                        &lt;p&gt;&lt;?php _e('By default, all BuddyPress components are enabled. You can selectively disable any of the components by using the form below. Your BuddyPress installation will continue to function, however the features of the disabled components will no longer be accessible to anyone using the site.', 'buddypress' ) ?&gt;&lt;/p&gt;
</del><ins>+                        
</ins><span class="cx"> 
</span><span class="cx">                         &lt;?php $disabled_components = get_site_option( 'bp-deactivated-components' ); ?&gt;
</span><span class="cx">                         
</span><span class="cx">                         &lt;?php bp_core_admin_component_options() ?&gt;
</span><ins>+                        
+                        &lt;?php bp_core_admin_page_options() ?&gt;
</ins><span class="cx"> 
</span><span class="cx">                         &lt;p class=&quot;submit clear&quot;&gt;
</span><span class="cx">                                 &lt;input class=&quot;button-primary&quot; type=&quot;submit&quot; name=&quot;bp-admin-component-submit&quot; id=&quot;bp-admin-component-submit&quot; value=&quot;&lt;?php _e( 'Save Settings', 'buddypress' ) ?&gt;&quot;/&gt;
</span><span class="lines">@@ -274,7 +284,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Creates reusable markup for the component setup dashboard panel.
</del><ins>+ * Creates reusable markup for component setup on the Components and Pages dashboard panel.
</ins><span class="cx">  *
</span><span class="cx">  * This markup has been abstracted so that it can be used both during the setup wizard as well as
</span><span class="cx">  * when BP has been fully installed.
</span><span class="lines">@@ -284,100 +294,132 @@
</span><span class="cx">  */
</span><span class="cx"> function bp_core_admin_component_options() {
</span><span class="cx">         $disabled_components = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) ); 
</span><ins>+        
+        // An array of strings looped over to create component setup markup
+        $optional_components = array(
+                'xprofile' =&gt; array(
+                        'title'         =&gt; __( &quot;Extended Profiles&quot;, 'buddypress' ),
+                        'description'         =&gt; __( &quot;Fully editable profile fields allow you to define the fields users can fill in to describe themselves. Tailor profile fields to suit your audience.&quot;, 'buddypress' )
+                ),
+                'friends' =&gt; array(
+                        'title'         =&gt; __( &quot;Friend Connections&quot;, 'buddypress' ),
+                        'description'         =&gt; __( &quot;Let your users make connections so they can track the activity of others, or filter on only those users they care about the most.&quot;, 'buddypress' ) 
+                ),
+                'messages' =&gt; array(
+                        'title'                =&gt; __( &quot;Private Messaging&quot;, 'buddypress' ),
+                        'description'         =&gt; __( &quot;Private messaging will allow your users to talk to each other directly, and in private. Not just limited to one on one discussions, your users can send messages to multiple recipients.&quot;, 'buddypress' )
+                ),
+                'activity' =&gt; array(
+                        'title'         =&gt; __( &quot;Activity Streams&quot;, 'buddypress' ),
+                        'description'         =&gt; __( &quot;Global, personal and group activity streams with threaded commenting, direct posting, favoriting and @mentions. All with full RSS feed and email notification support.&quot;, 'buddypress' )
+                ),
+                'groups' =&gt; array(
+                        'title'         =&gt; __( &quot;Extensible Groups&quot;, 'buddypress' ),
+                        'description'         =&gt; __( &quot;Powerful public, private or hidden groups allow your users to break the discussion down into specific topics with a separate activity stream and member listing.&quot;, 'buddypress' )
+                ),
+                'forums' =&gt; array(
+                        'title'         =&gt; __( &quot;Discussion Forums&quot;, 'buddypress' ),
+                        'description'         =&gt; __( &quot;Full powered discussion forums built directly into groups allow for more conventional in-depth conversations. NOTE: This will require an extra (but easy) setup step.&quot;, 'buddypress' )
+                )
+        );
+        
+        if ( is_multisite() ) {
+                $optional_components['blogs'] = array(
+                        'title'                =&gt; __( &quot;Blog Tracking&quot;, 'buddypress' ),
+                        'description'        =&gt; __( &quot;Track new blogs, new posts and new comments across your entire blog network.&quot;, 'buddypress' )
+                );
+        }
+        
</ins><span class="cx">         ?&gt;
</span><span class="cx">         
</span><del>-        &lt;div class=&quot;component&quot;&gt;
-                &lt;h5&gt;&lt;?php _e( &quot;Extended Profiles&quot;, 'buddypress' ) ?&gt;&lt;/h5&gt;
</del><ins>+        &lt;h3&gt;&lt;?php _e( 'Optional Components', 'buddypress' ) ?&gt;&lt;/h3&gt;
+                                
+        &lt;p&gt;&lt;?php _e( &quot;Select the BuddyPress components you'd like to enable.&quot;, 'buddypress' ) ?&gt;&lt;/p&gt;
+        
+        &lt;table class=&quot;form-table&quot;&gt;
+                &lt;tbody&gt;
+                        &lt;?php foreach ( $optional_components as $name =&gt; $labels ) : ?&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;
+                                        &lt;?php echo esc_html( $labels['title'] ) ?&gt;
+                                &lt;/th&gt;
+                                
+                                &lt;td&gt;
+                                        &lt;label for=&quot;bp_components[bp-&lt;?php echo esc_attr( $name ) ?&gt;.php]&quot;&gt;
+                                                &lt;input type=&quot;checkbox&quot; name=&quot;bp_components[bp-&lt;?php echo esc_attr( $name ) ?&gt;.php]&quot; value=&quot;1&quot;&lt;?php if ( !isset( $disabled_components['bp-' . esc_attr( $name ) . '.php'] ) ) : ?&gt; checked=&quot;checked&quot;&lt;?php endif ?&gt; /&gt;
+                                                &lt;?php echo esc_html( $labels['description'] ) ?&gt;
+                                        &lt;/label&gt;
</ins><span class="cx"> 
</span><del>-                &lt;div class=&quot;radio&quot;&gt;
-                        &lt;input type=&quot;radio&quot; name=&quot;bp_components[bp-xprofile.php]&quot; value=&quot;1&quot;&lt;?php if ( !isset( $disabled_components['bp-xprofile.php'] ) ) : ?&gt; checked=&quot;checked&quot; &lt;?php endif; ?&gt;/&gt; &lt;?php _e( 'Enabled', 'buddypress' ) ?&gt; &amp;nbsp;
-                        &lt;input type=&quot;radio&quot; name=&quot;bp_components[bp-xprofile.php]&quot; value=&quot;0&quot;&lt;?php if ( isset( $disabled_components['bp-xprofile.php'] ) ) : ?&gt; checked=&quot;checked&quot; &lt;?php endif; ?&gt;/&gt; &lt;?php _e( 'Disabled', 'buddypress' ) ?&gt;
-                &lt;/div&gt;
</del><ins>+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+                        &lt;?php endforeach ?&gt;
+                &lt;/tbody&gt;
+        &lt;/table&gt;
</ins><span class="cx"> 
</span><del>-                &lt;img src=&quot;&lt;?php echo plugins_url( 'buddypress/screenshot-2.gif' ) ?&gt;&quot; alt=&quot;Activity Streams&quot; /&gt;
-                &lt;p&gt;&lt;?php _e( &quot;Fully editable profile fields allow you to define the fields users can fill in to describe themselves. Tailor profile fields to suit your audience.&quot;, 'buddypress' ) ?&gt;&lt;/p&gt;
-        &lt;/div&gt;
-
-        &lt;div class=&quot;component&quot;&gt;
-                &lt;h5&gt;&lt;?php _e( &quot;Friend Connections&quot;, 'buddypress' ) ?&gt;&lt;/h5&gt;
-
-                &lt;div class=&quot;radio&quot;&gt;
-                        &lt;input type=&quot;radio&quot; name=&quot;bp_components[bp-friends.php]&quot; value=&quot;1&quot;&lt;?php if ( !isset( $disabled_components['bp-friends.php'] ) ) : ?&gt; checked=&quot;checked&quot; &lt;?php endif; ?&gt;/&gt; &lt;?php _e( 'Enabled', 'buddypress' ) ?&gt; &amp;nbsp;
-                        &lt;input type=&quot;radio&quot; name=&quot;bp_components[bp-friends.php]&quot; value=&quot;0&quot;&lt;?php if ( isset( $disabled_components['bp-friends.php'] ) ) : ?&gt; checked=&quot;checked&quot; &lt;?php endif; ?&gt;/&gt; &lt;?php _e( 'Disabled', 'buddypress' ) ?&gt;
-                &lt;/div&gt;
-
-                &lt;img src=&quot;&lt;?php echo plugins_url( 'buddypress/screenshot-4.gif' ) ?&gt;&quot; alt=&quot;Activity Streams&quot; /&gt;
-                &lt;p&gt;&lt;?php _e( &quot;Let your users make connections so they can track the activity of others, or filter on only those users they care about the most.&quot;, 'buddypress' ) ?&gt;&lt;/p&gt;
-        &lt;/div&gt;
-
-        &lt;div class=&quot;component&quot;&gt;
-                &lt;h5&gt;&lt;?php _e( &quot;Discussion Forums&quot;, 'buddypress' ) ?&gt;&lt;/h5&gt;
-
-                &lt;div class=&quot;radio&quot;&gt;
-                        &lt;input type=&quot;radio&quot; name=&quot;bp_components[bp-forums.php]&quot; value=&quot;1&quot;&lt;?php if ( !isset( $disabled_components['bp-forums.php'] ) ) : ?&gt; checked=&quot;checked&quot; &lt;?php endif; ?&gt;/&gt; &lt;?php _e( 'Enabled', 'buddypress' ) ?&gt; &amp;nbsp;
-                        &lt;input type=&quot;radio&quot; name=&quot;bp_components[bp-forums.php]&quot; value=&quot;0&quot;&lt;?php if ( isset( $disabled_components['bp-forums.php'] ) ) : ?&gt; checked=&quot;checked&quot; &lt;?php endif; ?&gt;/&gt; &lt;?php _e( 'Disabled', 'buddypress' ) ?&gt;
-                &lt;/div&gt;
-
-                &lt;img src=&quot;&lt;?php echo plugins_url( 'buddypress/screenshot-6.gif' ) ?&gt;&quot; alt=&quot;Activity Streams&quot; /&gt;
-                &lt;p&gt;&lt;?php _e( &quot;Full powered discussion forums built directly into groups allow for more conventional in-depth conversations. &lt;strong&gt;NOTE: This will require an extra (but easy) setup step.&lt;/strong&gt;&quot;, 'buddypress' ) ?&gt;&lt;/p&gt;
-        &lt;/div&gt;
-
-        &lt;div class=&quot;component&quot;&gt;
-                &lt;h5&gt;&lt;?php _e( &quot;Activity Streams&quot;, 'buddypress' ) ?&gt;&lt;/h5&gt;
-
-                &lt;div class=&quot;radio&quot;&gt;
-                        &lt;input type=&quot;radio&quot; name=&quot;bp_components[bp-activity.php]&quot; value=&quot;1&quot;&lt;?php if ( !isset( $disabled_components['bp-activity.php'] ) ) : ?&gt; checked=&quot;checked&quot; &lt;?php endif; ?&gt;/&gt; &lt;?php _e( 'Enabled', 'buddypress' ) ?&gt; &amp;nbsp;
-                        &lt;input type=&quot;radio&quot; name=&quot;bp_components[bp-activity.php]&quot; value=&quot;0&quot;&lt;?php if ( isset( $disabled_components['bp-activity.php'] ) ) : ?&gt; checked=&quot;checked&quot; &lt;?php endif; ?&gt;/&gt; &lt;?php _e( 'Disabled', 'buddypress' ) ?&gt;
-                &lt;/div&gt;
-
-                &lt;img src=&quot;&lt;?php echo plugins_url( 'buddypress/screenshot-1.gif' ) ?&gt;&quot; alt=&quot;Activity Streams&quot; /&gt;
-                &lt;p&gt;&lt;?php _e( &quot;Global, personal and group activity streams with threaded commenting, direct posting, favoriting and @mentions. All with full RSS feed and email notification support.&quot;, 'buddypress' ) ?&gt;&lt;/p&gt;
-        &lt;/div&gt;
-
-        &lt;div class=&quot;component&quot;&gt;
-                &lt;h5&gt;&lt;?php _e( &quot;Extensible Groups&quot;, 'buddypress' ) ?&gt;&lt;/h5&gt;
-
-                &lt;div class=&quot;radio&quot;&gt;
-                        &lt;input type=&quot;radio&quot; name=&quot;bp_components[bp-groups.php]&quot; value=&quot;1&quot;&lt;?php if ( !isset( $disabled_components['bp-groups.php'] ) ) : ?&gt; checked=&quot;checked&quot; &lt;?php endif; ?&gt;/&gt; &lt;?php _e( 'Enabled', 'buddypress' ) ?&gt; &amp;nbsp;
-                        &lt;input type=&quot;radio&quot; name=&quot;bp_components[bp-groups.php]&quot; value=&quot;0&quot;&lt;?php if ( isset( $disabled_components['bp-groups.php'] ) ) : ?&gt; checked=&quot;checked&quot; &lt;?php endif; ?&gt;/&gt; &lt;?php _e( 'Disabled', 'buddypress' ) ?&gt;
-                &lt;/div&gt;
-
-                &lt;img src=&quot;&lt;?php echo plugins_url( 'buddypress/screenshot-3.gif' ) ?&gt;&quot; alt=&quot;Activity Streams&quot; /&gt;
-                &lt;p&gt;&lt;?php _e( &quot;Powerful public, private or hidden groups allow your users to break the discussion down into specific topics with a separate activity stream and member listing.&quot;, 'buddypress' ) ?&gt;&lt;/p&gt;
-        &lt;/div&gt;
-
-        &lt;div class=&quot;component&quot;&gt;
-                &lt;h5&gt;&lt;?php _e( &quot;Private Messaging&quot;, 'buddypress' ) ?&gt;&lt;/h5&gt;
-
-                &lt;div class=&quot;radio&quot;&gt;
-                        &lt;input type=&quot;radio&quot; name=&quot;bp_components[bp-messages.php]&quot; value=&quot;1&quot;&lt;?php if ( !isset( $disabled_components['bp-messages.php'] ) ) : ?&gt; checked=&quot;checked&quot; &lt;?php endif; ?&gt;/&gt; &lt;?php _e( 'Enabled', 'buddypress' ) ?&gt; &amp;nbsp;
-                        &lt;input type=&quot;radio&quot; name=&quot;bp_components[bp-messages.php]&quot; value=&quot;0&quot;&lt;?php if ( isset( $disabled_components['bp-messages.php'] ) ) : ?&gt; checked=&quot;checked&quot; &lt;?php endif; ?&gt;/&gt; &lt;?php _e( 'Disabled', 'buddypress' ) ?&gt;
-                &lt;/div&gt;
-
-                &lt;img src=&quot;&lt;?php echo plugins_url( 'buddypress/screenshot-5.gif' ) ?&gt;&quot; alt=&quot;Activity Streams&quot; /&gt;
-                &lt;p&gt;&lt;?php _e( &quot;Private messaging will allow your users to talk to each other directly, and in private. Not just limited to one on one discussions, your users can send messages to multiple recipients.&quot;, 'buddypress' ) ?&gt;&lt;/p&gt;
-        &lt;/div&gt;
-
-        &lt;?php if ( is_multisite() ) : ?&gt;
-
-                &lt;div class=&quot;component&quot;&gt;
-                        &lt;h5&gt;&lt;?php _e( &quot;Blog Tracking&quot;, 'buddypress' ) ?&gt;&lt;/h5&gt;
-
-                        &lt;div class=&quot;radio&quot;&gt;
-                                &lt;input type=&quot;radio&quot; name=&quot;bp_components[bp-blogs.php]&quot; value=&quot;1&quot;&lt;?php if ( !isset( $disabled_components['bp-blogs.php'] ) ) : ?&gt; checked=&quot;checked&quot; &lt;?php endif; ?&gt;/&gt; &lt;?php _e( 'Enabled', 'buddypress' ) ?&gt; &amp;nbsp;
-                                &lt;input type=&quot;radio&quot; name=&quot;bp_components[bp-blogs.php]&quot; value=&quot;0&quot;&lt;?php if ( isset( $disabled_components['bp-blogs.php'] ) ) : ?&gt; checked=&quot;checked&quot; &lt;?php endif; ?&gt;/&gt; &lt;?php _e( 'Disabled', 'buddypress' ) ?&gt;
-                        &lt;/div&gt;
-
-                        &lt;img src=&quot;&lt;?php echo plugins_url( 'buddypress/screenshot-7.gif' ) ?&gt;&quot; alt=&quot;Activity Streams&quot; /&gt;
-                                &lt;p&gt;&lt;?php _e( &quot;Track new blogs, new posts and new comments across your entire blog network.&quot;, 'buddypress' ) ?&gt;&lt;/p&gt;
-                &lt;/div&gt;
-
-        &lt;?php else: ?&gt;
-
</del><ins>+        &lt;?php /* Make sure that the blogs component is deactivated when multisite is shut off */ ?&gt;
+        &lt;?php if ( !is_multisite() ) : ?&gt;
</ins><span class="cx">                 &lt;input type=&quot;hidden&quot; name=&quot;bp_components[bp-blogs.php]&quot; value=&quot;0&quot; /&gt;
</span><ins>+        &lt;?php endif ?&gt;
+        
+        &lt;?php
+}
</ins><span class="cx"> 
</span><del>-        &lt;?php endif; ?&gt;
</del><ins>+/**
+ * Creates reusable markup for page setup on the Components and Pages dashboard panel.
+ *
+ * This markup has been abstracted so that it can be used both during the setup wizard as well as
+ * when BP has been fully installed.
+ *
+ * @package BuddyPress Core
+ * @since 1.3
+ */
+function bp_core_admin_page_options() {
+        // Get the existing WP pages
+        $existing_pages = bp_core_get_page_meta();
</ins><span class="cx">         
</span><ins>+        // An array of strings looped over to create component setup markup
+        $directory_pages = array(
+                'groups' =&gt; __( &quot;Groups Directory&quot;, 'buddypress' ),
+                'forums' =&gt; __( &quot;Forums Directory&quot;, 'buddypress' ),
+                'members' =&gt; __( &quot;Members Directory&quot;, 'buddypress' ),
+                'activity' =&gt; __( &quot;Activity&quot;, 'buddypress' ),
+                'register' =&gt; __( &quot;Register&quot;, 'buddypress' ),
+                'activate' =&gt; __( &quot;Activate&quot;, 'buddypress' )
+        );
+        
+        if ( is_multisite() ) {
+                $directory_pages['blogs'] = __( &quot;Blogs Directory&quot;, 'buddypress' );
+        }
+        
+        ?&gt;
+        
+        &lt;h3&gt;&lt;?php _e( &quot;BuddyPress Page Setup&quot;, 'buddypress' ) ?&gt;&lt;/h3&gt;
+        
+        &lt;p&gt;&lt;?php _e( &quot;Choose the WordPress pages you'd like to associate with the following BuddyPress content.&quot;, 'buddypress' ) ?&gt;&lt;/p&gt;
+        
+        &lt;p&gt;&lt;?php _e( &quot;Leaving any of these items unset makes that content inaccessible to visitors, so be sure to fill this section out carefully.&quot;, 'buddypress' ) ?&gt;&lt;/p&gt;
+        
+        &lt;table class=&quot;form-table&quot;&gt;
+                &lt;tbody&gt;
+                        &lt;?php foreach ( $directory_pages as $name =&gt; $label ) : ?&gt;
+                        &lt;tr valign=&quot;top&quot;&gt;
+                                &lt;th scope=&quot;row&quot;&gt;
+                                        &lt;label for=&quot;bp_pages[&lt;?php echo esc_attr( $name ) ?&gt;]&quot;&gt;&lt;?php echo esc_html( $label ) ?&gt;&lt;/label&gt;
+                                &lt;/th&gt;
+                                
+                                &lt;td&gt;
+                                        &lt;?php echo wp_dropdown_pages( array(
+                                                'name' =&gt; 'bp_pages[' . esc_attr( $name ) . ']',
+                                                'echo' =&gt; false,
+                                                'show_option_none' =&gt; __( '- Select -', 'buddypress' ),
+                                                'selected' =&gt; !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
+                                        ) ) ?&gt;
+                                &lt;/td&gt;
+                        &lt;/tr&gt;
+                        &lt;?php endforeach ?&gt;
+                &lt;/tbody&gt;
+        &lt;/table&gt;
+        
</ins><span class="cx">         &lt;?php
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>