settings = $this->get_settings(); $this->site_settings = $this->get_site_settings(); $this->forbid_local_caps = $this->forbid_local_caps(); $this->minimum_cap = $this->minimum_cap(); $this->display(); } /** * Loads the settings for the blog * * @package Anthologize * @since 0.6 */ function get_settings() { return get_option( 'anth_settings' ); } /** * Loads the settings for the blog * * @package Anthologize * @since 0.6 */ function get_site_settings() { $site_settings = array(); if ( is_multisite() ) $site_settings = get_site_option( 'anth_site_settings' ); return apply_filters( 'anth_site_settings', $site_settings ); } /** * Determine whether the network admin has forbidden the setting of local caps * * @package Anthologize * @since 0.6 */ function forbid_local_caps() { $forbid_local_caps = false; if ( !empty( $this->site_settings['forbid_per_blog_caps'] ) ) $forbid_local_caps = true; return apply_filters( 'anth_forbid_local_caps', $forbid_local_caps ); } /** * Catches a saved settings page and saves settings * * @package Anthologize * @since 0.6 */ function save() { check_admin_referer( 'anth_settings' ); $anth_settings = !empty( $_POST['anth_settings'] ) ? $_POST['anth_settings'] : array(); // These need to be reset so that we don't have to refresh the page $this->settings = $anth_settings; $this->minimum_cap = $anth_settings['minimum_cap']; update_option( 'anth_settings', $anth_settings ); } /** * Markup for the settings panel * * @package Anthologize * @since 0.6 */ function display() { if ( !empty( $_POST['anth_settings_submit'] ) ) $this->save(); ?>

: forbid_local_caps ) : ?>

site_settings['forbid_per_blog_caps'] ) ? true : false; if ( $this->forbid_local_caps ) { $minimum_cap = !empty( $this->site_settings['minimum_cap'] ) ? $this->site_settings['minimum_cap'] : 'manage_options'; } else { // If the network admin has not forbidden local caps, we still must // check whether there's a network default $default_cap = !empty( $this->site_settings['minimum_cap'] ) ? $this->site_settings['minimum_cap'] : 'manage_options'; $minimum_cap = !empty( $this->settings['minimum_cap'] ) ? $this->settings['minimum_cap'] : $default_cap; } } else { // On non-MS, we can check the local settings directly $minimum_cap = !empty( $this->settings['minimum_cap'] ) ? $this->settings['minimum_cap'] : $default_cap; } return apply_filters( 'anth_settings_minimum_cap', $minimum_cap ); } } $anthologize_settings = new Anthologize_Settings; ?>