public function addToolbarCommands()
    {
        $actor = $this->getController()->getItem();
        $viewer = get_viewer();
        $this->_use_post = true;
        $this->addListCommands();

        if ($actor->authorize('administration')) {
            $this->addCommand('edit-actor', array('label' => AnTranslator::_('LIB-AN-ACTION-EDIT'), 'entity' => $actor))
            ->getCommand('edit-actor')
            ->href($actor->getURL().'&get=settings');
        }

        if (get_viewer()->admin()) {
            $action = ($actor->verified) ? 'unverify' : 'verify';
            $this->addCommand($action.'-actor', array('label' => AnTranslator::_('COM-ACTORS-PROFILE-'.$action), 'entity' => $actor))
            ->getCommand($action.'-actor')
            ->href($actor->getURL().'&action='.$action)
            ->dataTrigger('PostLink');
        }

        if ($actor->authorize('changeEnabled')) {
            $action = ($actor->enabled) ? 'disable' : 'enable';
            $this->addCommand($action.'-actor', array('label' => AnTranslator::_('LIB-AN-ACTION-'.$action), 'entity' => $actor))
            ->getCommand($action.'-actor')
            ->href($actor->getURL().'&action='.$action)
            ->dataTrigger('PostLink');
        }

        if ($actor->authorize('access') && !$viewer->eql($actor) && $viewer->following($actor)) {
            $this->addCommand('notifications-settings', array('label' => AnTranslator::_('COM-ACTORS-NOTIFICATIONS-SETTING-EDIT')))
            ->getCommand('notifications-settings')
            ->href(route('option=notifications&view=settings&layout=modal&oid='.$actor->id));
        }
    }
public function addToolbarCommands()
    {
        $actor = $this->getController()->getItem();
        $viewer = get_viewer();
        $this->_use_post = true;
        $this->addListCommands();

        if ($actor->authorize('administration')) {
            $this->addCommand('edit-actor', array('label' => AnTranslator::_('LIB-AN-ACTION-EDIT'), 'entity' => $actor))
            ->getCommand('edit-actor')
            ->href($actor->getURL().'&get=settings');
        }

        if (get_viewer()->admin()) {
            $action = ($actor->verified) ? 'unverify' : 'verify';
            $this->addCommand($action.'-actor', array('label' => AnTranslator::_('COM-ACTORS-PROFILE-'.$action), 'entity' => $actor))
            ->getCommand($action.'-actor')
            ->href($actor->getURL().'&action='.$action)
            ->dataTrigger('PostLink');
        }

        if ($actor->authorize('changeEnabled')) {
            $action = ($actor->enabled) ? 'disable' : 'enable';
            $this->addCommand($action.'-actor', array('label' => AnTranslator::_('LIB-AN-ACTION-'.$action), 'entity' => $actor))
            ->getCommand($action.'-actor')
            ->href($actor->getURL().'&action='.$action)
            ->dataTrigger('PostLink');
        }

        if ($actor->authorize('access') && !$viewer->eql($actor) && $viewer->following($actor)) {
            $this->addCommand('notifications-settings', array('label' => AnTranslator::_('COM-ACTORS-NOTIFICATIONS-SETTING-EDIT')))
            ->getCommand('notifications-settings')
            ->href(route('option=notifications&view=settings&layout=modal&oid='.$actor->id));
        }
    }
public function addToolbarCommands ( ) { $ actor = $ this -> getController ( ) -> getItem ( ) ; $ viewer = get_viewer ( ) ; $ this -> _use_post = true ; $ this -> addListCommands ( ) ; if ( $ actor -> authorize ( 'administration' ) ) { $ this -> addCommand ( 'edit-actor' , array ( 'label' => AnTranslator :: _ ( 'LIB-AN-ACTION-EDIT' ) , 'entity' => $ actor ) ) -> getCommand ( 'edit-actor' ) -> href ( $ actor -> getURL ( ) . '&get=settings' ) ; } if ( get_viewer ( ) -> admin ( ) ) { $ action = ( $ actor -> verified ) ? 'unverify' : 'verify' ; $ this -> addCommand ( $ action . '-actor' , array ( 'label' => AnTranslator :: _ ( 'COM-ACTORS-PROFILE-' . $ action ) , 'entity' => $ actor ) ) -> getCommand ( $ action . '-actor' ) -> href ( $ actor -> getURL ( ) . '&action=' . $ action ) -> dataTrigger ( 'PostLink' ) ; } if ( $ actor -> authorize ( 'changeEnabled' ) ) { $ action = ( $ actor -> enabled ) ? 'disable' : 'enable' ; $ this -> addCommand ( $ action . '-actor' , array ( 'label' => AnTranslator :: _ ( 'LIB-AN-ACTION-' . $ action ) , 'entity' => $ actor ) ) -> getCommand ( $ action . '-actor' ) -> href ( $ actor -> getURL ( ) . '&action=' . $ action ) -> dataTrigger ( 'PostLink' ) ; } if ( $ actor -> authorize ( 'access' ) && ! $ viewer -> eql ( $ actor ) && $ viewer -> following ( $ actor ) ) { $ this -> addCommand ( 'notifications-settings' , array ( 'label' => AnTranslator :: _ ( 'COM-ACTORS-NOTIFICATIONS-SETTING-EDIT' ) ) ) -> getCommand ( 'notifications-settings' ) -> href ( route ( 'option=notifications&view=settings&layout=modal&oid=' . $ actor -> id ) ) ; } }
Called before toolbar commands.
Called before toolbar commands .