|
Revision 744, 1.0 kB
(checked in by MDMAN, 4 years ago)
|
|
new Version 1.0.7 added to de.mdman.snowfall
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | require_once(WCF_DIR.'lib/system/event/EventListener.class.php'); |
|---|
| 3 | |
|---|
| 4 | /* |
|---|
| 5 | * removes the category and menuItem from the UserCPMenu |
|---|
| 6 | */ |
|---|
| 7 | class UserCPMenuSnowfallListener implements EventListener |
|---|
| 8 | { |
|---|
| 9 | public function execute($eventObj, $className, $eventName) |
|---|
| 10 | { |
|---|
| 11 | if (SNOWFALL_AKTIV == 0 && WCF::getUser()->checkPermission('user.snowfall.activation.canseesnow') == false) { |
|---|
| 12 | |
|---|
| 13 | $categoryName = 'wcf.user.option.settings.display.snowfall'; |
|---|
| 14 | |
|---|
| 15 | $parentCategoryName = $eventObj->menuItemList[$categoryName]['parentMenuItem']; |
|---|
| 16 | |
|---|
| 17 | unset( $eventObj->menuItemList[$categoryName] ); |
|---|
| 18 | |
|---|
| 19 | foreach ( $eventObj->menuItems[$parentCategoryName] as $key => $category ) |
|---|
| 20 | { |
|---|
| 21 | if ( $category['menuItem'] == $categoryName ) |
|---|
| 22 | { |
|---|
| 23 | unset( $eventObj->menuItems[$parentCategoryName][$key] ); |
|---|
| 24 | break; |
|---|
| 25 | } |
|---|
| 26 | } |
|---|
| 27 | } |
|---|
| 28 | } |
|---|
| 29 | } |
|---|
| 30 | ?> |
|---|