public function SetupMenuItems() { RWLogger::LogEnterence('SetupMenuItems'); $submenu = array(); // Basic settings. $submenu[] = array('menu_title' => __('Settings', WP_RW__ID), 'function' => 'SettingsPage', 'slug' => ''); // Append registered setting menu items. foreach ($this->_extensions as $extension) { if ($extension->HasSettingsMenu()) { $submenu[] = $extension->GetSettingsMenuItem(); } } if ($this->IsBuddyPressInstalled()) { // BuddyPress settings. $submenu[] = array('menu_title' => 'BuddyPress', 'function' => 'SettingsPage'); } if (false === is_active_widget(false, false, strtolower('RatingWidgetPlugin_TopRatedWidget'), true)) { // Top-Rated Promotion Page. $submenu[] = array('menu_title' => __('Top-Rated Widget', WP_RW__ID), 'function' => 'TopRatedSettingsPageRender', 'load_function' => 'TopRatedSettingsPageLoad', 'slug' => 'toprated'); } // Reports. $submenu[] = array('menu_title' => __('Reports', WP_RW__ID), 'function' => 'ReportsPageRender'); // Advanced settings. $submenu[] = array('menu_title' => __('Advanced', WP_RW__ID), 'function' => 'AdvancedSettingsPageRender'); // Affiliation application page. $submenu[] = array('menu_title' => __('Affiliation', WP_RW__ID), 'function' => 'affiliation_settings_page_render'); // Add Ons page $submenu[] = array('menu_title' => __('Add Ons', WP_RW__ID), 'function' => 'addons_settings_page_render', 'slug' => 'addons'); foreach ($submenu as $item) { $this->fs->add_submenu_item($item['menu_title'], array(&$this, $item['function']), __('Ratings', WP_RW__ID) . '–' . $item['menu_title'], 'edit_posts', isset($item['slug']) ? $item['slug'] : false, isset($item['load_function']) && !empty($item['load_function']) ? array(&$this, $item['load_function']) : false); } }