Changeset 3946 for branches/plugin/bbp-admin/bbp-admin.php
- Timestamp:
- 06/12/2012 05:36:00 AM (14 years ago)
- File:
-
- 1 edited
-
branches/plugin/bbp-admin/bbp-admin.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-admin/bbp-admin.php
r3945 r3946 45 45 public $styles_url = ''; 46 46 47 /** Tools *****************************************************************/48 49 /**50 * @var bool Enable screens in Tools area51 */52 public $enable_tools = false;53 54 /** Settings **************************************************************/55 56 /**57 * @var bool Enable screens in Settings area58 */59 public $enable_settings = false;60 61 47 /** Capability ************************************************************/ 62 48 … … 182 168 public function admin_menus() { 183 169 184 // Are tools enabled? 185 if ( is_super_admin() || ! empty( $this->enable_tools ) ) { 186 187 $hooks = array(); 188 189 // These are later removed in admin_head 190 $hooks[] = add_management_page( 191 __( 'Repair Forums', 'bbpress' ), 192 __( 'Forum Repair', 'bbpress' ), 193 $this->minimum_capability, 194 'bbp-repair', 195 'bbp_admin_repair' 196 ); 197 $hooks[] = add_management_page( 198 __( 'Import Forums', 'bbpress' ), 199 __( 'Forum Import', 'bbpress' ), 200 $this->minimum_capability, 201 'bbp-converter', 202 'bbp_converter_settings' 203 ); 204 $hooks[] = add_management_page( 205 __( 'Reset Forums', 'bbpress' ), 206 __( 'Forum Reset', 'bbpress' ), 207 $this->minimum_capability, 208 'bbp-reset', 209 'bbp_admin_reset' 210 ); 170 $hooks = array(); 171 172 // These are later removed in admin_head 173 if ( bbp_current_user_can_see( 'bbp_tools_page' ) ) { 174 if ( bbp_current_user_can_see( 'bbp_tools_repair_page' ) ) { 175 $hooks[] = add_management_page( 176 __( 'Repair Forums', 'bbpress' ), 177 __( 'Forum Repair', 'bbpress' ), 178 $this->minimum_capability, 179 'bbp-repair', 180 'bbp_admin_repair' 181 ); 182 } 183 184 if ( bbp_current_user_can_see( 'bbp_tools_import_page' ) ) { 185 $hooks[] = add_management_page( 186 __( 'Import Forums', 'bbpress' ), 187 __( 'Forum Import', 'bbpress' ), 188 $this->minimum_capability, 189 'bbp-converter', 190 'bbp_converter_settings' 191 ); 192 } 193 194 if ( bbp_current_user_can_see( 'bbp_tools_reset_page' ) ) { 195 $hooks[] = add_management_page( 196 __( 'Reset Forums', 'bbpress' ), 197 __( 'Forum Reset', 'bbpress' ), 198 $this->minimum_capability, 199 'bbp-reset', 200 'bbp_admin_reset' 201 ); 202 } 211 203 212 204 // Fudge the highlighted subnav item when on a bbPress admin page … … 226 218 227 219 // Are settings enabled? 228 if ( is_super_admin() || ! empty( $this->enable_settings) ) {220 if ( bbp_current_user_can_see( 'bbp_settings_page' ) ) { 229 221 add_options_page( 230 222 __( 'Forums', 'bbpress' ), … … 281 273 282 274 $section = 'bbp_settings_main'; 283 if ( bbp_ admin_show_ui( $section ) ) {275 if ( bbp_current_user_can_see( $section ) ) { 284 276 285 277 // Add the main section … … 328 320 329 321 $section = 'bbp_settings_theme_compat'; 330 if ( bbp_ admin_show_ui( $section ) ) {322 if ( bbp_current_user_can_see( $section ) ) { 331 323 332 324 // Add the per page section … … 341 333 342 334 $section = 'bbp_settings_per_page'; 343 if ( bbp_ admin_show_ui( $section ) ) {335 if ( bbp_current_user_can_see( $section ) ) { 344 336 345 337 // Add the per page section … … 358 350 359 351 $section = 'bbp_settings_per_page_rss'; 360 if ( bbp_ admin_show_ui( $section ) ) {352 if ( bbp_current_user_can_see( $section ) ) { 361 353 362 354 // Add the per page section … … 375 367 376 368 $section = 'bbp_settings_root_slugs'; 377 if ( bbp_ admin_show_ui( $section ) ) {369 if ( bbp_current_user_can_see( $section ) ) { 378 370 379 371 // Add the per page section … … 397 389 398 390 $section = 'bbp_settings_single_slugs'; 399 if ( bbp_ admin_show_ui( $section ) ) {391 if ( bbp_current_user_can_see( $section ) ) { 400 392 401 393 // Add the per page section … … 436 428 437 429 $section = 'bbp_settings_buddypress'; 438 if ( bbp_ admin_show_ui( $section ) ) {430 if ( bbp_current_user_can_see( $section ) ) { 439 431 440 432 // Add the per page section … … 453 445 454 446 $section = 'bbp_settings_akismet'; 455 if ( bbp_ admin_show_ui( $section ) ) {447 if ( bbp_current_user_can_see( $section ) ) { 456 448 457 449 // Add the per page section
Note: See TracChangeset
for help on using the changeset viewer.