protected function _layoutLogin(array $args = null)
    {
        // During error reporting the user or menu are not always known.
        if ($this->currentUser && $this->menu) {
            $div = \MUtil_Html::create('div', array('id' => 'login'), $args);

            $p = $div->p();
            if ($this->currentUser->isActive()) {
                $p->append(sprintf($this->_('You are logged in as %s'), $this->currentUser->getFullName()));
                $item = $this->menu->findController('index', 'logoff');
                $p->a($item->toHRefAttribute(), $this->_('Logoff'), array('class' => 'logout'));
                $item->set('visible', false);
            } else {
                $item = $this->menu->findController('index', 'login');
                $p->a($item->toHRefAttribute(), $this->_('You are not logged in'), array('class' => 'logout'));
            }

            return $div;
        }
    }
protected function _layoutLogin(array $args = null)
    {
        // During error reporting the user or menu are not always known.
        if ($this->currentUser && $this->menu) {
            $div = \MUtil_Html::create('div', array('id' => 'login'), $args);

            $p = $div->p();
            if ($this->currentUser->isActive()) {
                $p->append(sprintf($this->_('You are logged in as %s'), $this->currentUser->getFullName()));
                $item = $this->menu->findController('index', 'logoff');
                $p->a($item->toHRefAttribute(), $this->_('Logoff'), array('class' => 'logout'));
                $item->set('visible', false);
            } else {
                $item = $this->menu->findController('index', 'login');
                $p->a($item->toHRefAttribute(), $this->_('You are not logged in'), array('class' => 'logout'));
            }

            return $div;
        }
    }
protected function _layoutLogin ( array $ args = null ) { // During error reporting the user or menu are not always known. if ( $ this -> currentUser && $ this -> menu ) { $ div = \ MUtil_Html :: create ( 'div' , array ( 'id' => 'login' ) , $ args ) ; $ p = $ div -> p ( ) ; if ( $ this -> currentUser -> isActive ( ) ) { $ p -> append ( sprintf ( $ this -> _ ( 'You are logged in as %s' ) , $ this -> currentUser -> getFullName ( ) ) ) ; $ item = $ this -> menu -> findController ( 'index' , 'logoff' ) ; $ p -> a ( $ item -> toHRefAttribute ( ) , $ this -> _ ( 'Logoff' ) , array ( 'class' => 'logout' ) ) ; $ item -> set ( 'visible' , false ) ; } else { $ item = $ this -> menu -> findController ( 'index' , 'login' ) ; $ p -> a ( $ item -> toHRefAttribute ( ) , $ this -> _ ( 'You are not logged in' ) , array ( 'class' => 'logout' ) ) ; } return $ div ; } }
Display either a link to the login screen or displays the name of the current user
and a logoff link.

Function called if specified in the Project.ini layoutPrepare section before
the layout is drawn, but after the rest of the program has run it's course.

@return mixed If null nothing is set, otherwise the name of
the function is used as \Zend_View variable name.
Display either a link to the login screen or displays the name of the current user and a logoff link .