src/Controller/IndexController.php
public function headerAction()
    {
        $melisKey = $this->params()->fromRoute('melisKey', '');
        $melisCoreAuth = $this->serviceLocator->get('MelisCoreAuth');

        if ($melisCoreAuth->hasIdentity())
        {
            $melisAppConfig = $this->getServiceLocator()->get('MelisCoreConfig');
            $appsConfigCenter = $melisAppConfig->getItem('/meliscore/interface/meliscore_center/');

            $melisCoreRights = $this->getServiceLocator()->get('MelisCoreRights');
            $xmlRights = $melisCoreAuth->getAuthRights();
            if (!empty($appsConfigCenter['interface']))
            {
                foreach ($appsConfigCenter['interface'] as $keyInterface => $interface)
                {
                    if (!empty($interface['conf']) && !empty($interface['conf']['type']))
                        $keyTempInterface = $interface['conf']['type'];
                    else
                        $keyTempInterface = $keyInterface;
                    $isAccessible = $melisCoreRights->isAccessible($xmlRights, MelisCoreRightsService::MELISCORE_PREFIX_INTERFACE, $keyTempInterface);
                    if (!$isAccessible)
                    {
                        unset($appsConfigCenter['interface'][$keyInterface]);
                    }
                }
            }
        }
        else
            $appsConfigCenter = array();

        $schemeSvc  = $this->getServiceLocator()->get('MelisCorePlatformSchemeService');
        $schemeData = $schemeSvc->getCurrentScheme();

        $view                   = new ViewModel();
        $view->melisKey         = $melisKey;
        $view->appsConfigCenter = $appsConfigCenter;
        $view->schemes          = $schemeData;

        return $view;
    }
public function headerAction()
    {
        $melisKey = $this->params()->fromRoute('melisKey', '');
        $melisCoreAuth = $this->serviceLocator->get('MelisCoreAuth');

        if ($melisCoreAuth->hasIdentity())
        {
            $melisAppConfig = $this->getServiceLocator()->get('MelisCoreConfig');
            $appsConfigCenter = $melisAppConfig->getItem('/meliscore/interface/meliscore_center/');

            $melisCoreRights = $this->getServiceLocator()->get('MelisCoreRights');
            $xmlRights = $melisCoreAuth->getAuthRights();
            if (!empty($appsConfigCenter['interface']))
            {
                foreach ($appsConfigCenter['interface'] as $keyInterface => $interface)
                {
                    if (!empty($interface['conf']) && !empty($interface['conf']['type']))
                        $keyTempInterface = $interface['conf']['type'];
                    else
                        $keyTempInterface = $keyInterface;
                    $isAccessible = $melisCoreRights->isAccessible($xmlRights, MelisCoreRightsService::MELISCORE_PREFIX_INTERFACE, $keyTempInterface);
                    if (!$isAccessible)
                    {
                        unset($appsConfigCenter['interface'][$keyInterface]);
                    }
                }
            }
        }
        else
            $appsConfigCenter = array();

        $schemeSvc  = $this->getServiceLocator()->get('MelisCorePlatformSchemeService');
        $schemeData = $schemeSvc->getCurrentScheme();

        $view                   = new ViewModel();
        $view->melisKey         = $melisKey;
        $view->appsConfigCenter = $appsConfigCenter;
        $view->schemes          = $schemeData;

        return $view;
    }
public function headerAction ( ) { $ melisKey = $ this -> params ( ) -> fromRoute ( 'melisKey' , '' ) ; $ melisCoreAuth = $ this -> serviceLocator -> get ( 'MelisCoreAuth' ) ; if ( $ melisCoreAuth -> hasIdentity ( ) ) { $ melisAppConfig = $ this -> getServiceLocator ( ) -> get ( 'MelisCoreConfig' ) ; $ appsConfigCenter = $ melisAppConfig -> getItem ( '/meliscore/interface/meliscore_center/' ) ; $ melisCoreRights = $ this -> getServiceLocator ( ) -> get ( 'MelisCoreRights' ) ; $ xmlRights = $ melisCoreAuth -> getAuthRights ( ) ; if ( ! empty ( $ appsConfigCenter [ 'interface' ] ) ) { foreach ( $ appsConfigCenter [ 'interface' ] as $ keyInterface => $ interface ) { if ( ! empty ( $ interface [ 'conf' ] ) && ! empty ( $ interface [ 'conf' ] [ 'type' ] ) ) $ keyTempInterface = $ interface [ 'conf' ] [ 'type' ] ; else $ keyTempInterface = $ keyInterface ; $ isAccessible = $ melisCoreRights -> isAccessible ( $ xmlRights , MelisCoreRightsService :: MELISCORE_PREFIX_INTERFACE , $ keyTempInterface ) ; if ( ! $ isAccessible ) { unset ( $ appsConfigCenter [ 'interface' ] [ $ keyInterface ] ) ; } } } } else $ appsConfigCenter = array ( ) ; $ schemeSvc = $ this -> getServiceLocator ( ) -> get ( 'MelisCorePlatformSchemeService' ) ; $ schemeData = $ schemeSvc -> getCurrentScheme ( ) ; $ view = new ViewModel ( ) ; $ view -> melisKey = $ melisKey ; $ view -> appsConfigCenter = $ appsConfigCenter ; $ view -> schemes = $ schemeData ; return $ view ; }
Shows the header section of Melis Platform

@return \Zend\View\Model\ViewModel
Shows the header section of Melis Platform