Zepi/Web/AccessControl/src/EventHandler/RegisterMenuEntries.php
public function execute(Framework $framework, WebRequest $request, Response $response)
    {
        if ($request->hasSession()) {
            $profileMenuEntry = new \Zepi\Web\General\Entity\MenuEntry(
                'profile',
                $this->translate('Profile', '\\Zepi\\Web\\AccessControl'),
                'profile',
                'mdi-person'
            );
            $this->getMenuManager()->addMenuEntry('menu-right', $profileMenuEntry, 90);
            
            // Add the hidden user settings menu entry
            $userSettingsSubMenuEntry = new \Zepi\Web\General\Entity\HiddenMenuEntry(
                $this->translate('User settings', '\\Zepi\\Web\\AccessControl')
            );
            $profileMenuEntry->addChild($userSettingsSubMenuEntry);
            
            // Add the hidden change password menu entry 
            $changePasswordSubMenuEntry = new \Zepi\Web\General\Entity\HiddenMenuEntry(
                $this->translate('Change password', '\\Zepi\\Web\\AccessControl'),
                'profile/change-password',
                'mdi-vpn-key'
            );
            $userSettingsSubMenuEntry->addChild($changePasswordSubMenuEntry);
            
            // Add the logout menu entry
            $menuEntry = new \Zepi\Web\General\Entity\MenuEntry(
                'logout',
                $this->translate('Logout', '\\Zepi\\Web\\AccessControl'),
                'logout',
                'glyphicon-log-out'
            );
            $this->getMenuManager()->addMenuEntry('menu-right', $menuEntry, 100);
        } else {
            if ($this->getSetting('accesscontrol.allowRegistration')) {
                $menuEntry = new \Zepi\Web\General\Entity\MenuEntry(
                    'registration',
                    $this->translate('Registration', '\\Pmx\\Autopilot\\AccessControl'),
                    '/register/',
                    'mdi-account-circle'
                );
                $this->getMenuManager()->addMenuEntry('menu-right', $menuEntry);
            }
            
            $menuEntry = new \Zepi\Web\General\Entity\MenuEntry(
                'login',
                $this->translate('Login', '\\Zepi\\Web\\AccessControl'),
                'login',
                'glyphicon-log-in'
            );
            $this->getMenuManager()->addMenuEntry('menu-right', $menuEntry, 100);
        }
    }
public function execute(Framework $framework, WebRequest $request, Response $response)
    {
        if ($request->hasSession()) {
            $profileMenuEntry = new \Zepi\Web\General\Entity\MenuEntry(
                'profile',
                $this->translate('Profile', '\\Zepi\\Web\\AccessControl'),
                'profile',
                'mdi-person'
            );
            $this->getMenuManager()->addMenuEntry('menu-right', $profileMenuEntry, 90);
            
            // Add the hidden user settings menu entry
            $userSettingsSubMenuEntry = new \Zepi\Web\General\Entity\HiddenMenuEntry(
                $this->translate('User settings', '\\Zepi\\Web\\AccessControl')
            );
            $profileMenuEntry->addChild($userSettingsSubMenuEntry);
            
            // Add the hidden change password menu entry 
            $changePasswordSubMenuEntry = new \Zepi\Web\General\Entity\HiddenMenuEntry(
                $this->translate('Change password', '\\Zepi\\Web\\AccessControl'),
                'profile/change-password',
                'mdi-vpn-key'
            );
            $userSettingsSubMenuEntry->addChild($changePasswordSubMenuEntry);
            
            // Add the logout menu entry
            $menuEntry = new \Zepi\Web\General\Entity\MenuEntry(
                'logout',
                $this->translate('Logout', '\\Zepi\\Web\\AccessControl'),
                'logout',
                'glyphicon-log-out'
            );
            $this->getMenuManager()->addMenuEntry('menu-right', $menuEntry, 100);
        } else {
            if ($this->getSetting('accesscontrol.allowRegistration')) {
                $menuEntry = new \Zepi\Web\General\Entity\MenuEntry(
                    'registration',
                    $this->translate('Registration', '\\Pmx\\Autopilot\\AccessControl'),
                    '/register/',
                    'mdi-account-circle'
                );
                $this->getMenuManager()->addMenuEntry('menu-right', $menuEntry);
            }
            
            $menuEntry = new \Zepi\Web\General\Entity\MenuEntry(
                'login',
                $this->translate('Login', '\\Zepi\\Web\\AccessControl'),
                'login',
                'glyphicon-log-in'
            );
            $this->getMenuManager()->addMenuEntry('menu-right', $menuEntry, 100);
        }
    }
public function execute ( Framework $ framework , WebRequest $ request , Response $ response ) { if ( $ request -> hasSession ( ) ) { $ profileMenuEntry = new \ Zepi \ Web \ General \ Entity \ MenuEntry ( 'profile' , $ this -> translate ( 'Profile' , '\\Zepi\\Web\\AccessControl' ) , 'profile' , 'mdi-person' ) ; $ this -> getMenuManager ( ) -> addMenuEntry ( 'menu-right' , $ profileMenuEntry , 90 ) ; // Add the hidden user settings menu entry $ userSettingsSubMenuEntry = new \ Zepi \ Web \ General \ Entity \ HiddenMenuEntry ( $ this -> translate ( 'User settings' , '\\Zepi\\Web\\AccessControl' ) ) ; $ profileMenuEntry -> addChild ( $ userSettingsSubMenuEntry ) ; // Add the hidden change password menu entry  $ changePasswordSubMenuEntry = new \ Zepi \ Web \ General \ Entity \ HiddenMenuEntry ( $ this -> translate ( 'Change password' , '\\Zepi\\Web\\AccessControl' ) , 'profile/change-password' , 'mdi-vpn-key' ) ; $ userSettingsSubMenuEntry -> addChild ( $ changePasswordSubMenuEntry ) ; // Add the logout menu entry $ menuEntry = new \ Zepi \ Web \ General \ Entity \ MenuEntry ( 'logout' , $ this -> translate ( 'Logout' , '\\Zepi\\Web\\AccessControl' ) , 'logout' , 'glyphicon-log-out' ) ; $ this -> getMenuManager ( ) -> addMenuEntry ( 'menu-right' , $ menuEntry , 100 ) ; } else { if ( $ this -> getSetting ( 'accesscontrol.allowRegistration' ) ) { $ menuEntry = new \ Zepi \ Web \ General \ Entity \ MenuEntry ( 'registration' , $ this -> translate ( 'Registration' , '\\Pmx\\Autopilot\\AccessControl' ) , '/register/' , 'mdi-account-circle' ) ; $ this -> getMenuManager ( ) -> addMenuEntry ( 'menu-right' , $ menuEntry ) ; } $ menuEntry = new \ Zepi \ Web \ General \ Entity \ MenuEntry ( 'login' , $ this -> translate ( 'Login' , '\\Zepi\\Web\\AccessControl' ) , 'login' , 'glyphicon-log-in' ) ; $ this -> getMenuManager ( ) -> addMenuEntry ( 'menu-right' , $ menuEntry , 100 ) ; } }
Registers the menu entries which are only accessable if the user is logged in
or not logged in, in example login or logout menu entry.

@access public
@param \Zepi\Turbo\Framework $framework
@param \Zepi\Turbo\Request\WebRequest $request
@param \Zepi\Turbo\Response\Response $response
Registers the menu entries which are only accessable if the user is logged in or not logged in in example login or logout menu entry .