Changeset 3897 for branches/plugin/bbp-admin/bbp-admin.php
- Timestamp:
- 05/14/2012 07:48:18 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-admin/bbp-admin.php
r3894 r3897 52 52 public $enable_tools = false; 53 53 54 /** Settings **************************************************************/ 55 56 /** 57 * @var bool Enable screens in Settings area 58 */ 59 public $enable_settings = false; 60 61 /** Capability ************************************************************/ 62 63 /** 64 * @var bool Minimum capability to access Tools and Settings 65 */ 66 public $minimum_capability = 'manage_options'; 67 54 68 /** Admin Scheme **********************************************************/ 55 69 … … 168 182 public function admin_menus() { 169 183 170 // Are tools enabled 171 if ( is_super_admin() || ! empty( $this->enable_tools ) ) {184 // Are tools enabled? 185 if ( is_super_admin() || ! empty( $this->enable_tools ) ) { 172 186 173 187 $hooks = array(); … … 176 190 $hooks[] = add_management_page( 177 191 __( 'Repair Forums', 'bbpress' ), 178 __( 'Forum Repair', 'bbpress' ),179 'manage_options',192 __( 'Forum Repair', 'bbpress' ), 193 $this->minimum_capability, 180 194 'bbp-repair', 181 195 'bbp_admin_repair' … … 183 197 $hooks[] = add_management_page( 184 198 __( 'Import Forums', 'bbpress' ), 185 __( 'Forum Import', 'bbpress' ),186 'manage_options',199 __( 'Forum Import', 'bbpress' ), 200 $this->minimum_capability, 187 201 'bbp-converter', 188 202 'bbp_converter_settings' … … 190 204 $hooks[] = add_management_page( 191 205 __( 'Reset Forums', 'bbpress' ), 192 __( 'Forum Reset', 'bbpress' ),193 'manage_options',206 __( 'Forum Reset', 'bbpress' ), 207 $this->minimum_capability, 194 208 'bbp-reset', 195 209 'bbp_admin_reset' … … 205 219 __( 'Forums', 'bbpress' ), 206 220 __( 'Forums', 'bbpress' ), 207 'manage_options',221 $this->minimum_capability, 208 222 'bbp-repair', 209 223 'bbp_admin_repair' … … 211 225 } 212 226 213 // Forums settings 214 add_options_page( 215 __( 'Forums', 'bbpress' ), 216 __( 'Forums', 'bbpress' ), 217 'manage_options', 218 'bbpress', 219 'bbp_admin_settings' 220 ); 227 // Are settings enabled? 228 if ( is_super_admin() || ! empty( $this->enable_settings ) ) { 229 add_options_page( 230 __( 'Forums', 'bbpress' ), 231 __( 'Forums', 'bbpress' ), 232 $this->minimum_capability, 233 'bbpress', 234 'bbp_admin_settings' 235 ); 236 } 221 237 } 222 238
Note: See TracChangeset
for help on using the changeset viewer.