init(); } /** * Initialise the sitewide admin panel: register actions and filters */ function init() { if (is_null($this->settings)) $this->settings = AA_settings(); add_action('admin_menu', array(&$this, 'add_submenu')); } /** * Adds the settings page to the "Site Admin" menu */ function add_submenu() { get_currentuserinfo(); if (!is_super_admin()) return false; // only for site admins add_submenu_page('wpmu-admin.php', __('Sitewide Author Avatars Configuration', 'author-avatars'), __('Author Avatars List', 'author-avatars'), 'manage_options', 'wpmu_author_avatars', array(&$this,'config_page')); } /** * Renders the sitewide configuration page */ function config_page() { if ($_POST['action'] == 'update') $updated = $this->save_settings(); else $updated = false; $this->render_config_page($updated); } function save_settings() { check_admin_referer(); $settings = $_POST['settings_sitewide']; return $this->settings->save_sitewide($settings); } function render_config_page($updated) { require_once('FormHelper.class.php'); echo '
'. __('Options saved.', 'author-avatars') .'
'. implode('
',$updated) .'