protected function _commandEnable($command)
    {
        $entity = $this->getController()->getItem();

        $label = AnTranslator::_('COM-TODOS-ACTION-'.strtoupper($entity->enabled ? 'disable' : 'enable'));

        $action = ($entity->enabled) ? 'disable' : 'enable';

        $command->append(array('label' => $label));

        if ($command->ajax) {
            $command
            ->href($entity->getURL().'&layout=list')
            ->setAttribute('data-action', $action);
        } else {
            $command
            ->href($entity->getURL().'&action='.$action)
            ->setAttribute('data-trigger', 'PostLink');
        }
    }
protected function _commandEnable($command)
    {
        $entity = $this->getController()->getItem();

        $label = AnTranslator::_('COM-TODOS-ACTION-'.strtoupper($entity->enabled ? 'disable' : 'enable'));

        $action = ($entity->enabled) ? 'disable' : 'enable';

        $command->append(array('label' => $label));

        if ($command->ajax) {
            $command
            ->href($entity->getURL().'&layout=list')
            ->setAttribute('data-action', $action);
        } else {
            $command
            ->href($entity->getURL().'&action='.$action)
            ->setAttribute('data-trigger', 'PostLink');
        }
    }
protected function _commandEnable ( $ command ) { $ entity = $ this -> getController ( ) -> getItem ( ) ; $ label = AnTranslator :: _ ( 'COM-TODOS-ACTION-' . strtoupper ( $ entity -> enabled ? 'disable' : 'enable' ) ) ; $ action = ( $ entity -> enabled ) ? 'disable' : 'enable' ; $ command -> append ( array ( 'label' => $ label ) ) ; if ( $ command -> ajax ) { $ command -> href ( $ entity -> getURL ( ) . '&layout=list' ) -> setAttribute ( 'data-action' , $ action ) ; } else { $ command -> href ( $ entity -> getURL ( ) . '&action=' . $ action ) -> setAttribute ( 'data-trigger' , 'PostLink' ) ; } }
Enable Action for an entity.

@param LibBaseTemplateObject $command Command Object
Enable Action for an entity .