function options_ui()
    {
        global $pp_options_ui;
        $ui = $pp_options_ui;
        // shorten syntax
        $tab = 'install';
        $ppcom_connect = pp_update_info_enabled();
        $use_network_admin = pp_use_network_updates();
        $suppress_updates = $use_network_admin && !is_super_admin();
        $section = 'key';
        // --- UPDATE KEY SECTION ---
        if (!empty($ui->form_options[$tab][$section]) && !$suppress_updates) {
            ?>
			<tr><td scope="row" colspan="2"><span style="font-weight:bold;vertical-align:top"><?php 
            echo $ui->section_captions[$tab][$section];
            ?>
</span>
			<?php 
            global $activated;
            if ($ppcom_connect) {
                require_once dirname(__FILE__) . '/plugin_pp.php';
                PP_Plugin_Status::get_version_info();
            }
            $id = 'support_key';
            $opt_val = pp_get_option($id);
            if (!is_array($opt_val) || count($opt_val) < 2) {
                $activated = false;
                $expired = false;
                $key = '';
            } else {
                $activated = 1 == $opt_val[0];
                $expired = -1 == $opt_val[0];
                $key = $opt_val[1];
            }
            if (isset($opt_val['expire_date_gmt'])) {
                $expire_days = intval((strtotime($opt_val['expire_date_gmt']) - time()) / 86400);
            }
            if ($expired) {
                $class = 'activating';
                $is_err = true;
                $msg = sprintf(__('Your support key has expired. For information on renewal at a discounted rate, <a href="%s">click here</a>.', 'pp'), 'admin.php?page=pp-settings&amp;pp_renewal=1');
            } elseif (!empty($opt_val['expire_date_gmt'])) {
                $class = 'activating';
                if ($expire_days < 30) {
                    $is_err = true;
                }
                if ($expire_days < 1) {
                    $msg = sprintf(__('Your support key (for plugin updates) will expire today. For information on renewal at a discounted rate, <a href="%2$s">click here</a>.', 'pp'), $expire_days, 'admin.php?page=pp-settings&amp;pp_renewal=1');
                } elseif ($expire_days < 30) {
                    $msg = sprintf(__('Your support key (for plugin updates) will expire in %1$s days. For information on renewal at a discounted rate, <a href="%2$s">click here</a>.', 'pp'), $expire_days, 'admin.php?page=pp-settings&amp;pp_renewal=1');
                } else {
                    $class = "activating hidden";
                }
            } elseif (!$activated) {
                $class = 'activating';
                $msg = sprintf(__('Activate your support key to install Pro extensions and access the member support forums. Available at <a href="%s">presspermit.com</a>.', 'pp'), 'http://presspermit.com/' . 'purchase/');
            } else {
                $class = "activating hidden";
                $msg = '';
            }
            ?>
				
				<span style="margin-left:145px;">
					<?php 
            if ($expired && !empty($key)) {
                ?>
						<span class="pp-key-exired"><?php 
                _e("Key Expired", 'pp');
                ?>
</span>
						<button type="button" id="activation-button" name="activation-button" class="button-secondary"><?php 
                _e('Deactivate Key', 'pp');
                ?>
</button>
						<span class="pp-key-exired pp-key-warning"> <?php 
                _e('note: Renewal does not require deactivation. If you do deactivate, re-entry of the support key will be required.', 'pp');
                ?>
</span>
					<?php 
            } else {
                ?>
						<?php 
                if ($activated) {
                    ?>
						<span class="pp-key-active"><?php 
                    _e("Key Activated", 'pp');
                    ?>
</span>
						<?php 
                }
                ?>
						<input name="<?php 
                echo $id;
                ?>
" type="text" id="<?php 
                echo $id;
                ?>
" <?php 
                echo $activated ? ' style="display:none"' : '';
                ?>
 />
						<button type="button" id="activation-button" name="activation-button" class="button-secondary"><?php 
                echo !$activated ? __('Activate Key', 'pp') : __('Deactivate Key', 'pp');
                ?>
</button>
					<?php 
            }
            ?>
					
					<img id="pp_support_waiting" class="waiting" style="display:none;position:relative" src="<?php 
            echo esc_url(admin_url('images/wpspin_light.gif'));
            ?>
" alt="" />
				</span>

				<br />
				
				<span style="margin-left:217px">
					<?php 
            if ($activated) {
                ?>
					<span class="pp-key-active pp-key-warning"> <?php 
                _e('note: If you deactive, re-entry of the support key will be required for re-activation.', 'pp');
                ?>
</span>
					<?php 
            } elseif (!$expired) {
                ?>
					<span class="pp-subtext"> <?php 
                _e('note: Your site URL and version info will be sent to presspermit.com', 'pp');
                ?>
</span>
					<?php 
            }
            ?>
				</span>
				
				<br /><div id="activation-status" class="<?php 
            echo $class;
            ?>
"><?php 
            echo $msg;
            ?>
</div><div id="activation-reload" style="display:none;margin-top:10px"><a href="<?php 
            echo admin_url('admin.php?page=pp-settings');
            ?>
"><?php 
            _e('reload extension links', 'pp');
            ?>
</a></div>
				
				<?php 
            if (!empty($is_err)) {
                ?>
				<div id="activation-error" class="error" style="margin-top:35px"><?php 
                echo $msg;
                ?>
</div>
				<?php 
            }
            ?>
				
				<?php 
            if (!$activated || $expired) {
                require_once dirname(__FILE__) . '/pro-promo_pp.php';
            }
            ?>
			</td></tr>
		<?php 
            do_action('pp_support_key_ui');
            self::footer_js($activated);
        }
        // any options accessable in this section
        $section = 'version';
        // --- VERSION SECTION ---
        if (!empty($ui->form_options[$tab][$section])) {
            ?>
			<tr>
			<th scope="row"><?php 
            echo $ui->section_captions[$tab][$section];
            ?>
</th>
			<td>
			
			<?php 
            if ($ppcom_connect) {
                $update_info = pp_get_all_updates_info(!empty($_REQUEST['pp_refresh_updates']));
            } else {
                $update_info = array();
            }
            //dump($update_info);
            $info_link = '';
            $update_link = '';
            $alert = '';
            if (!$suppress_updates) {
                $wp_plugin_updates = get_site_transient('update_plugins');
                if ($wp_plugin_updates && isset($wp_plugin_updates->response[PPC_BASENAME]) && !empty($wp_plugin_updates->response[PPC_BASENAME]->new_version) && version_compare($wp_plugin_updates->response[PPC_BASENAME]->new_version, PPC_VERSION, '>')) {
                    $slug = 'press-permit-core';
                    $_url = "plugin-install.php?tab=plugin-information&plugin={$slug}&section=changelog&TB_iframe=true&width=600&height=800";
                    $info_url = $use_network_admin ? network_admin_url($_url) : admin_url($_url);
                    $info_link = "<span class='update-message'> &bull; <a href='{$info_url}' class='thickbox'>" . sprintf(__ppw('%s&nbsp;details', 'pp'), $update_info[$slug]['new_version']) . '</a></span>';
                }
            }
            printf(__('Press Permit Core Version: %1$s %2$s', 'pp'), PPC_VERSION, $info_link . $update_link . $alert);
            ?>
			<br />
			<?php 
            printf(__("Database Schema Version: %s", 'pp'), PPC_DB_VERSION);
            ?>
			<br />
			<?php 
            global $wp_version;
            printf(__("WordPress Version: %s", 'pp'), $wp_version);
            ?>
			<br />
			<?php 
            printf(__("PHP Version: %s", 'pp'), phpversion());
            ?>
			<br />
			<?php 
            if (empty($activated) && empty($expired) && !defined('PP_FORCE_PPCOM_INFO')) {
                ?>
				<div style="margin-top:10px">
				<?php 
                $hint = __('Periodically query presspermit.com for available extensions. Your version info will be sent.', 'pp');
                $ui->option_checkbox('ppcom_update_info', $tab, $section, $hint);
                ?>
				</div>
			<?php 
            }
            ?>
			
			</td></tr>
		<?php 
        }
        // any options accessable in this section
        $section = 'extensions';
        // --- EXTENSIONS SECTION ---
        if (!empty($ui->form_options[$tab][$section])) {
            ?>
			<tr><th scope="row"><?php 
            echo $ui->section_captions[$tab][$section];
            if ($ppcom_connect) {
                echo '&nbsp;&nbsp;&bull;&nbsp;&nbsp;<a href="admin.php?page=pp-settings&amp;pp_refresh_updates=1">' . __('refresh', 'pp') . '</a>';
            }
            ?>
</th><td>
			<?php 
            global $pp_extensions;
            $missing = $inactive = array();
            if (pp_get_option('display_hints') && $ppcom_connect) {
                $ext_info = pp_get_extension_info(!empty($_REQUEST['pp_refresh_done']));
                $ext_info->blurb['capability-manager-enhanced'] = __('Create your own WP roles or modify the capabilities defined for any WP Role.', 'pp');
                $ext_info->descript['capability-manager-enhanced'] = __('Create your own WP roles or modify the capabilities defined for any WP Role. Not necessary for all installations, but PP interop is particularly important for bbPress and BuddyPress installations.', 'pp');
            }
            if (!empty($ext_info) && (empty($ext_info->blurb) || empty($ext_info->descript))) {
                unset($ext_info);
            }
            if ($missing = array_diff_key($update_info, $pp_extensions)) {
                unset($missing['press-permit-core']);
                foreach (array_keys($missing) as $slug) {
                    if (0 === validate_plugin("{$slug}/{$slug}.php")) {
                        unset($missing[$slug]);
                        $inactive[$slug] = true;
                    }
                }
            }
            ksort($pp_extensions);
            if ($pp_extensions) {
                $change_log_caption = __('<strong>Change Log</strong> (since your current version)', 'pp');
                ?>
				<h4 style="margin-bottom:2px;margin-top:0"><?php 
                _e('Active Extensions:', 'pp');
                ?>
</h4>
				<table class="pp-extensions">
				<?php 
                foreach ($pp_extensions as $slug => $plugin_info) {
                    $info_link = '';
                    $update_link = '';
                    $alert = '';
                    if (isset($update_info[$slug]) && version_compare($update_info[$slug]['new_version'], $plugin_info->version, '>')) {
                        $_url = "plugin-install.php?tab=plugin-information&plugin={$slug}&TB_iframe=true&width=600&height=800";
                        $info_url = $use_network_admin ? network_admin_url($_url) : admin_url($_url);
                        $info_link = "<span class='update-message'> &bull; <a href='{$info_url}' class='thickbox' title='{$change_log_caption}'>" . sprintf(__ppw('%s&nbsp;details', 'pp'), $update_info[$slug]['new_version']) . '</a></span>';
                        if (!$suppress_updates) {
                            $style = $activated ? '' : "style='display:none'";
                            $url = pp_plugin_update_url($plugin_info->basename, $slug) . '&pp_install=1&TB_iframe=true&height=400';
                            $update_link = "<span class='pp-update-link' {$style}> &bull; <a href='{$url}' class='thickbox' target='_blank'>" . __ppw('update&nbsp;now', 'pp') . '</a></span>';
                            $alert = !empty($update_info[$slug]['alert']) ? " &bull; <span class='pp-red'>{$update_info[$slug]['alert']}</span>" : '';
                        }
                    }
                    ?>
				<tr>
				<td <?php 
                    if ($alert) {
                        echo 'colspan="2"';
                    }
                    ?>
><?php 
                    echo __($plugin_info->label) . ' <span class="pp-gray">' . $plugin_info->version . "</span> {$info_link} {$update_link} {$alert}";
                    ?>
</td>
				<?php 
                    if (!empty($ext_info) && !$alert) {
                        ?>
				<td>
					<?php 
                        if (isset($ext_info->blurb[$slug])) {
                            ?>
					<span class="pp-ext-info" title="<?php 
                            if (isset($ext_info->descript[$slug])) {
                                echo esc_attr($ext_info->descript[$slug]);
                            }
                            ?>
"><?php 
                            echo $ext_info->blurb[$slug];
                            ?>
</span>
					<?php 
                        }
                        ?>
				</td>
				<?php 
                    }
                    ?>
				</tr>
				<?php 
                }
                ?>
				</table>
			<?php 
            }
            if (!defined('CAPSMAN_ENH_VERSION')) {
                if (0 === validate_plugin('capability-manager-enhanced/capsman-enhanced.php') || 0 === validate_plugin('capsman-enhanced/capsman-enhanced.php')) {
                    $inactive['capability-manager-enhanced'] = true;
                } else {
                    $missing['capability-manager-enhanced'] = true;
                }
            }
            ksort($inactive);
            if ($inactive) {
                ?>
			<h4 style="margin-bottom:2px"><?php 
                $url = PP_MULTISITE ? 'network/plugins.php/' : 'plugins.php';
                printf(__('%1$sInactive Extensions%2$s:', 'pp'), "<a href='{$url}'>", '</a>');
                ?>
</h4>
			<table class="pp-extensions">
			<?php 
                foreach (array_keys($inactive) as $slug) {
                    ?>
			<tr>
			<td><?php 
                    echo pp_pretty_slug($slug);
                    ?>
</td>
			<?php 
                    if (!empty($ext_info)) {
                        ?>
				<td>
					<?php 
                        if (isset($ext_info->blurb[$slug])) {
                            ?>
					<span class="pp-ext-info" title="<?php 
                            if (isset($ext_info->descript[$slug])) {
                                echo esc_attr($ext_info->descript[$slug]);
                            }
                            ?>
"><?php 
                            echo $ext_info->blurb[$slug];
                            ?>
</span>
					<?php 
                        }
                        ?>
				</td>
			<?php 
                    }
                    ?>
			</tr>
			<?php 
                }
                ?>
			</table>
			<?php 
            }
            ksort($missing);
            if ($missing) {
                ?>
			<h4 style="margin-bottom:2px"><?php 
                _e('Available Pro Extensions:', 'pp');
                ?>
</h4>
			<table class="pp-extensions">
			<?php 
                foreach (array_keys($missing) as $slug) {
                    if ($need_supplemental_key = isset($update_info[$slug]['key_type']) && 'pp' != $update_info[$slug]['key_type']) {
                        $any_supplemental_key = true;
                    }
                    if ($activated && isset($update_info[$slug]) && !$need_supplemental_key && !$suppress_updates) {
                        $_url = "update.php?action={$slug}&amp;plugin={$slug}&pp_install=1&TB_iframe=true&height=400";
                        $install_url = $use_network_admin ? network_admin_url($_url) : admin_url($_url);
                        $url = wp_nonce_url($install_url, "{$slug}_{$slug}");
                        $install_link = "<span> &bull; <a href='{$url}' class='thickbox' target='_blank'>" . __ppw('install', 'pp') . '</a></span>';
                    } else {
                        $install_link = '';
                    }
                    ?>
			<tr>
			<td><?php 
                    if (!empty($update_info[$slug])) {
                        echo "<a href='http://presspermit.com/extensions/{$slug}'>" . pp_pretty_slug($slug) . '</a>' . $install_link;
                    } else {
                        $caption = ucwords(str_replace('-', ' ', $slug));
                        echo '<span class="plugins update-message"><a href="' . pp_plugin_info_url($slug) . '" class="thickbox" title=" ' . $caption . '">' . str_replace(' ', '&nbsp;', $caption) . '</a></span>';
                    }
                    ?>
</td>
			<?php 
                    if (!empty($ext_info)) {
                        ?>
				<td>
					<?php 
                        if (isset($ext_info->blurb[$slug])) {
                            ?>
					<span class="pp-ext-info" title="<?php 
                            if (isset($ext_info->descript[$slug])) {
                                echo esc_attr($ext_info->descript[$slug]);
                            }
                            ?>
"><?php 
                            echo $ext_info->blurb[$slug];
                            ?>
</span>
					<?php 
                        }
                        ?>
				</td>
			<?php 
                    }
                    ?>
			</tr>
			<?php 
                }
                ?>
			</table>
			<p style="padding-left:15px;">
			<?php 
                if (!$activated) {
                    echo '<span class="pp-red">' . __('To enable one-click installation and update of extensions, please activate your Press Permit Pro support key above.', 'pp') . '<span>';
                } elseif (!empty($any_supplemental_key)) {
                    printf(__('Visit %1$spresspermit.com%2$s for further information on obtaining and installing extensions.', 'pp'), '<a href="http://presspermit.com">', '</a>');
                }
                ?>
			</p>
			
			<?php 
            } elseif (!pp_update_info_enabled()) {
                ?>
				<p style="margin-top:20px"><strong><?php 
                _e('Press Permit Pro extensions supply:', 'pp');
                ?>
</strong></p>
				<ul class="pp-bullet-list">
				<li><?php 
                printf(__('%1$sContent-specific editing permissions, with Edit Flow, Revisionary and Post Forking support%2$s', 'pp'), '<a href="http://presspermit.com/extensions/pp-collaborative-editing">', '</a>');
                ?>
</li>
				<li><?php 
                printf(__('%1$sCustom Post Statuses (for visibility or moderation)%2$s', 'pp'), '<a href="http://presspermit.com/extensions/pp-custom-post-statuses">', '</a>');
                ?>
</li>
				<li><?php 
                printf(__('%1$sCustomize bbPress forum access%2$s', 'pp'), '<a href="http://presspermit.com/extensions/pp-compatibility">', '</a>');
                ?>
</li>
				<li><?php 
                printf(__('%1$sFile URL filtering%2$s', 'pp'), '<a href="http://presspermit.com/extensions/pp-file-url-filter">', '</a>');
                ?>
</li>
				<li><?php 
                printf(__('%1$sRole Scoper import script%2$s', 'pp'), '<a href="http://presspermit.com/extensions/pp-import">', '</a>');
                ?>
</li>
				<li><?php 
                printf(__('%1$s...and more%2$s', 'pp'), '<a href="http://presspermit.com/extensions/">', '</a>');
                ?>
</li>
				</ul>
				<p>
				<?php 
                printf(__('For updated availability, enable the "update info" option above or visit %1$spresspermit.com%2$s.', 'pp'), '<a href="http://presspermit.com/extensions/">', '</a>');
                ?>
</p>
			<?php 
            }
            ?>
			<?php 
            if (!empty($ext_info) && pp_get_option('display_hints')) {
                ?>
			<p><span class="pp-subtext">
			<?php 
                _e('Note: Hover over descriptions for more detail. Press Permit extensions can also be maintained on the Plugins screen.', 'pp');
                ?>
			</span></p>
			<?php 
            }
            ?>
			
			<?php 
            ?>
			</td></tr>
			<?php 
        }
        // any options accessable in this section
        $section = 'help';
        // --- HELP SECTION ---
        if (!empty($ui->form_options[$tab][$section])) {
            ?>
			<tr><th scope="row"><?php 
            echo $ui->section_captions[$tab][$section];
            ?>
</th><td>
			<?php 
            if ($activated) {
                ?>
				<ul class="pp-support-list">
				<li><a href='http://presspermit.com/docs/' target='pp_doc'><?php 
                _e('Press Permit Documentation', 'pp');
                ?>
</a></li>

				<li class="pp-support-forum"><a href="admin.php?page=pp-settings&amp;pp_support_forum=1" target="pp_forum"><?php 
                _e('Press Permit Support Forums', 'pp');
                ?>
</a> <strong>*</strong></li>

				<li class="upload-config"><a href="admin.php?page=pp-settings&amp;pp_upload_config=1"><?php 
                _e('Upload site configuration to presspermit.com now', 'pp');
                ?>
</a> <strong>*</strong> 
				<img id="pp_upload_waiting" class="waiting" style="display:none;position:relative" src="<?php 
                echo esc_url(admin_url('images/wpspin_light.gif'));
                ?>
" alt="" />
				</li>
				</ul>
				
				<div style="text-indent: -10px;padding-left: 10px;margin-top:15px;margin-left:10px"><strong>
				<?php 
                printf(__('%s Site configuration data selected below will be uploaded to presspermit.com:', 'pp'), '<strong>* </strong>');
                ?>
				</strong></div>
				
				<div style="padding-left:22px">
				<?php 
                $ok = (array) pp_get_option('support_data');
                $ok['ver'] = 1;
                $ui->all_options[] = 'support_data';
                $avail = array('ver' => __('Version info for server, WP, bbPress, BuddyPress, PP and all extensions', 'pp'), 'pp_options' => __('PP Settings and related WP Settings', 'pp'), 'theme' => __('Theme name, version and status', 'pp'), 'active_plugins' => __('Activated plugins list', 'pp'), 'installed_plugins' => __('Inactive plugins list', 'pp'), 'wp_roles_types' => __('WordPress Roles, Capabilities, Post Types, Taxonomies and Post Statuses', 'pp'), 'pp_permissions' => __('Role Assignments and Exceptions', 'pp'), 'pp_groups' => __('Group definitions', 'pp'), 'pp_group_members' => __('Group Membership (id only)', 'pp'), 'pp_imports' => __('Role Scoper / PP 1.x Configuration and PP Import Results', 'pp'), 'post_data' => __('Post id, status, author id, parent id, and term ids and taxonomy name (when support accessed from post or term edit form)', 'pp'), 'error_log' => __('PHP Error Log (recent entries, no absolute paths)', 'pp'));
                $ok['ver'] = true;
                $ok['pp_options'] = true;
                ?>
				<div class="support_data">
				<?php 
                foreach ($avail as $key => $caption) {
                    $id = 'support_data_' . $key;
                    $disabled = in_array($key, array('ver', 'pp_options')) ? 'disabled="disabled"' : '';
                    ?>
					<div>
					<label for="<?php 
                    echo $id;
                    ?>
"><input type="checkbox" id="<?php 
                    echo $id;
                    ?>
" name="support_data[<?php 
                    echo $key;
                    ?>
]" value="1" <?php 
                    echo $disabled;
                    checked('1', !empty($ok[$key]), true);
                    ?>
 /> <?php 
                    echo $caption;
                    ?>
</label>
					</div>
				<?php 
                }
                ?>
				</div>
				
				<div>
				<label for="pp_support_data_all"><input type="checkbox" id="pp_support_data_all" value="1" /> <?php 
                _e('(all)', 'pp');
                ?>
</label>
				</div>
				
				<div style="margin-top:10px">
				<?php 
                _e('<strong>note:</strong> user data, absolute paths, database prefix, post title, post content and post excerpt are <strong>never</strong> uploaded', 'pp');
                ?>
				</div>
				
				</div>
				<?php 
            } else {
                ?>
				<div>
				<?php 
                _e('Purchase of a support key enables access to the following resources:', 'pp');
                ?>
				</div>
	
				<ul class="pp-support-list pp-bullet-list">
				<!-- <li><a href='http://presspermit.com/docs/' target='pp_doc'><?php 
                _e('Pro Documentation on presspermit.com', 'pp');
                ?>
</a></li> -->
				<li><a href='http://presspermit.com/forums/' target='pp_forum'><?php 
                _e('Pro Support Forums on presspermit.com', 'pp');
                ?>
</a></li>
				<li><?php 
                _e('Optional uploading of your site configuration to assist troubleshooting', 'pp');
                ?>
</li>
				</ul>
				<?php 
            }
            if (version_compare(PPC_VERSION, '1.0', '<')) {
                echo '<div>';
                _e('Note that these resources may be unavailable or incomplete during the project\'s initial beta phase.', 'pp');
                echo '</div>';
            }
            ?>
			</td></tr>
		<?php 
        }
        // any options accessable in this section
        if (!empty($activated)) {
            $section = 'beta_updates';
            // --- BETA UPDATES SECTION ---
            if (!empty($ui->form_options[$tab][$section]) && !$suppress_updates && $ppcom_connect) {
                ?>
				<tr><th scope="row"><?php 
                echo $ui->section_captions[$tab][$section];
                ?>
</th><td>
				<?php 
                if (preg_match("/dev|alpha|beta|rc/i", PPC_VERSION) && version_compare(PPC_VERSION, '0.9', '>')) {
                    $hint = __('If you have already received a beta update and want to switch back to the current production version, switch off this option and click Update. Then look for an update prompt in the Plugins list.', 'pp');
                } else {
                    $hint = '';
                }
                $ui->option_checkbox('beta_updates', $tab, $section, $hint);
                ?>
				</td></tr>
				<?php 
            }
            // any options accessable in this section
        }
    }
    function options_ui()
    {
        global $pp_options_ui;
        $ui = $pp_options_ui;
        // shorten syntax
        $tab = 'advanced';
        $section = 'enable';
        // --- ENABLE SECTION ---
        if (!empty($ui->form_options[$tab][$section])) {
            ?>
			<tr><th scope="row"><?php 
            echo $ui->section_captions[$tab][$section];
            ?>
</th><td>
			<?php 
            $hint = '';
            $ui->option_checkbox('advanced_options', $tab, $section, $hint);
            ?>
			</td></tr>
		<?php 
        }
        // any options accessable in this section
        $section = 'file_filtering';
        if ($this->enabled || true || PP_MULTISITE) {
            ?>
		<tr><th scope="row"><?php 
            echo $ui->section_captions[$tab][$section];
            ?>
</th><td>
		<?php 
            if (defined('PPFF_VERSION')) {
                do_action('ppff_pp_option_hint');
            } else {
                _e('To filter access to attached files, install the Press Permit File URL Filter extension.', 'pp');
                echo '<br />';
            }
            ?>
		</td></tr>
		<?php 
        }
        if ($this->enabled) {
            $section = 'anonymous';
            // --- ANONYMOUS USERS SECTION ---
            if (!empty($ui->form_options[$tab][$section])) {
                ?>
				<tr><th scope="row"><?php 
                echo $ui->section_captions[$tab][$section];
                ?>
</th><td>
				<?php 
                $hint = sprintf(__('Disable PP filtering for users who are not logged in. %1$sNote that this performance enhancement will make reading exceptions ineffective%2$s.', 'pp'), '<span class="pp-warning"><strong>', '</strong></span>');
                $ui->option_checkbox('anonymous_unfiltered', $tab, $section, $hint);
                $hint = __('If checked, pages blocked from the "All" or "Authenticated" groups will still be listed to Administrators.', 'pp');
                $ui->option_checkbox('suppress_administrator_metagroups', $tab, $section, $hint);
                do_action('pp_options_ui_insertion', $tab, $section);
                ?>
				</td></tr>
			<?php 
            }
            // any options accessable in this section
            $section = 'custom_statuses';
            // --- CUSTOM POST STATUSES SECTION ---
            if (!empty($ui->form_options[$tab][$section])) {
                ?>
				<tr><th scope="row"><?php 
                echo $ui->section_captions[$tab][$section];
                ?>
</th><td>
				<?php 
                do_action('pp_options_ui_insertion', $tab, $section);
                ?>
				</td></tr>
			<?php 
            }
            // any options accessable in this section
            $section = 'permissions_admin';
            // --- PERMISSIONS ADMIN SECTION ---
            if (!empty($ui->form_options[$tab][$section])) {
                ?>
				<tr><th scope="row"><?php 
                echo $ui->section_captions[$tab][$section];
                ?>
</th><td>
				<?php 
                $hint = __('If enabled, users with the pp_set_read_exceptions capability in the WP role can set reading exceptions for their editable posts.', 'pp');
                $ui->option_checkbox('non_admins_set_read_exceptions', $tab, $section, $hint);
                do_action('pp_options_ui_insertion', $tab, $section);
                ?>
				</td></tr>
			<?php 
            }
            // any options accessable in this section
            $section = 'capabilities';
            // --- PP CAPABILITIES SECTION ---
            ?>
				<tr><td scope="row" colspan="2"><span style="font-weight:bold"><?php 
            echo $ui->section_captions[$tab][$section];
            ?>
</span>
				<span style="margin-left:125px">
				<?php 
            if (pp_get_option('display_hints')) {
                ?>
					<span class="pp-subtext">
					<?php 
                if (ppc_is_plugin_active('capsman-enhanced')) {
                    $url = 'admin.php?page=capsman';
                    printf(__('You can customize Press Permit administration capabilities %1$s for any WP role%2$s:', 'pp'), '<a href="' . $url . '">', '</a>');
                } else {
                    printf(__('You can customize Press Permit administration capabilities by using a WP role editor such as %1$s:', 'pp'), '<span class="plugins update-message"><a href="' . pp_plugin_info_url('capability-manager-enhanced') . '" class="thickbox" title=" Capability Manager Enhanced">Capability&nbsp;Manager&nbsp;Enhanced</a></span>');
                }
                ?>
					</span>
				<?php 
            }
            ?>
				</span>
				
	
				<table id="pp_cap_descripts">
				<thead>
				<tr>
				<th class="cap-name"><?php 
            _e('Capability Name', 'pp');
            ?>
</th>
				<th><?php 
            echo __ppw('Description', 'pp');
            ?>
</th>
				</tr>
				</thead>
				<tbody>
				
				<?php 
            $pp_caps = array('pp_manage_settings' => __('Modify these Press Permit settings', 'pp'), 'pp_unfiltered' => __('Press Permit does not apply any supplemental roles or exceptions to limit or expand viewing or editing access', 'pp'), 'pp_administer_content' => __('PP implicitly grants capabilities for all post types and statuses, but does not apply exceptions', 'pp'), 'pp_create_groups' => __('Can create Permission Groups', 'pp'), 'pp_edit_groups' => __('Can edit all Permission Groups (barring Exceptions)', 'pp'), 'pp_delete_groups' => __('Can delete Permission Groups', 'pp'), 'pp_manage_members' => __('If group editing is allowed, can also modify group membership', 'pp'), 'pp_assign_roles' => __('Assign supplemental Roles or Exceptions. Other capabilities may also be required.', 'pp'), 'pp_set_read_exceptions' => __('Set Reading Exceptions for editable posts on Edit Post/Term screen (for non-Administrators lacking edit_users capability; may be disabled by PP option)', 'pp'));
            if (!defined('PPCE_VERSION') && !pp_key_active()) {
                if (class_exists('Fork')) {
                    $pp_caps['pp_set_fork_exceptions'] = __('(PP Pro capability)', 'pp');
                }
                if (defined('RVY_VERSION')) {
                    $pp_caps['pp_set_revise_exceptions'] = __('(PP Pro capability)', 'pp');
                }
                $pp_caps = array_merge($pp_caps, array('pp_set_edit_exceptions' => __('(PP Pro capability)', 'pp'), 'pp_set_associate_exceptions' => __('(PP Pro capability)', 'pp'), 'pp_set_term_assign_exceptions' => __('(PP Pro capability)', 'pp'), 'pp_set_term_manage_exceptions' => __('(PP Pro capability)', 'pp'), 'pp_set_term_associate_exceptions' => __('(PP Pro capability)', 'pp'), 'list_others_unattached_files' => __('(PP Pro capability)', 'pp'), 'edit_own_attachments' => __('(PP Pro capability)', 'pp')));
            }
            if (!defined('PPS_VERSION') && !pp_key_active()) {
                $pp_caps = array_merge($pp_caps, array('pp_define_post_status' => __('(PP Pro capability)', 'pp'), 'pp_define_moderation' => __('(PP Pro capability)', 'pp'), 'pp_define_privacy' => __('(PP Pro capability)', 'pp'), 'set_posts_status' => __('(PP Pro capability)', 'pp'), 'pp_moderate_any' => __('(PP Pro capability)', 'pp')));
            }
            $pp_caps = apply_filters('pp_cap_descriptions', $pp_caps);
            foreach ($pp_caps as $cap_name => $descript) {
                ?>
				<tr>
				<td class="cap-name"><?php 
                echo $cap_name;
                ?>
</td>
				<td><?php 
                echo $descript;
                ?>
</td>
				</tr>
				<?php 
            }
            ?>
				</tbody>
				</table>

	
				</td></tr>
			<?php 
            $section = 'misc';
            // --- MISC SECTION ---
            if (!empty($ui->form_options[$tab][$section])) {
                ?>
				<tr><th scope="row"><?php 
                echo $ui->section_captions[$tab][$section];
                ?>
</th><td>
				<?php 
                $hint = __('Display a role dropdown alongside the user search input box to narrow results.', 'pp');
                $ui->option_checkbox('user_search_by_role', $tab, $section, $hint);
                $hint = __('Display additional descriptions in role assignment and options UI.', 'pp');
                $ui->option_checkbox('display_hints', $tab, $section, $hint);
                $hint = __('Display descriptive captions for additional functionality provided by missing or deactivated extension plugins (Press Permit Pro package).', 'pp');
                $ui->option_checkbox('display_extension_hints', $tab, $section, $hint);
                ?>
				</td></tr>
			<?php 
            }
            // any options accessable in this section
            $section = 'role_integration';
            // --- ROLE INTEGRATION SECTION ---
            if (!empty($ui->form_options[$tab][$section])) {
                ?>
				<tr><th scope="row"><?php 
                echo $ui->section_captions[$tab][$section];
                ?>
</th><td>
				<?php 
                $hint = __('Detect user roles which are appended dynamically but not stored to the WP database. May be useful for sites that sync with Active Directory or other external user registration systems.', 'pp');
                $args = defined('PP_FORCE_DYNAMIC_ROLES') ? array('val' => 1, 'no_storage' => true, 'disabled' => true) : array();
                $ui->option_checkbox('dynamic_wp_roles', $tab, $section, $hint, '', $args);
                ?>
				</td></tr>
			<?php 
            }
            // any options accessable in this section
        }
        // endif advanced options enabled
        if (PP_MULTISITE) {
            $section = 'network';
            ?>
			<tr><th scope="row"><?php 
            echo $ui->section_captions[$tab][$section];
            ?>
</th><td>

			<div id="pp_modify_default_settings" style="max-width:700px">
			<?php 
            _e('To modify one or more default settings network-wide, <strong>copy</strong> the following code into your theme&apos;s <strong>functions.php</strong> file (or some other file which is always executed and not auto-updated) and modify as desired:', 'pp');
            ?>
			<textarea rows='10' cols='150' readonly='readonly' style="margin-top:5px">
// Use this filter if you want to change the default, but still allow manual setting
add_filter( 'pp_default_options', 'my_pp_default_options', 99 );

function my_pp_default_options( $def_options ) {
	// Array key corresponds to name attributes of checkboxes, dropdowns and input boxes. Modify for desired default settings.

	$def_options['new_user_groups_ui'] = 0;
	
	return $def_options;
}
			</textarea>
			</div>
			<br />
			
			<div id="pp_force_settings" style="max-width:700px">
			<?php 
            _e('To force the value of one or more settings network-wide, <strong>copy</strong> the following code into your theme&apos;s <strong>functions.php</strong> file (or some other file which is always executed and not auto-updated) and modify as desired:', 'pp');
            ?>
			<textarea rows='13' cols='150' readonly='readonly' style="margin-top:5px">
// Use this filter if you want to force an option, blocking/disregarding manual setting
add_filter( 'pp_options', 'my_pp_options', 99 );

// Use this filter if you also want to hide an option from the PP settings screen (works for most options)
add_filter( 'pp_hide_options', 'my_pp_options', 99 );

function my_pp_options( $options ) {
	// Array key corresponds to pp_prefixed name attributes of checkboxes, dropdowns and input boxes. Modify for desired settings.

	$options['pp_new_user_groups_ui'] = 1;
	$options['pp_display_hints'] = 0;	// note: advanced options can be forced here even if advanced settings are disabled
	
	return $options;
}
			</textarea>
			</div>
			
			</td></tr>
		<?php 
        }
        // endif multisite
    }