components/AuthController.php
public function getItemTypeText($type, $plural = false)
    {
        // todo: change the default value for $plural to false.
        $n = $plural ? 2 : 1;
        switch ($type) {
            case CAuthItem::TYPE_OPERATION:
                $name = Yii::t('AuthModule.main', 'operation|operations', $n);
                break;

            case CAuthItem::TYPE_TASK:
                $name = Yii::t('AuthModule.main', 'task|tasks', $n);
                break;

            case CAuthItem::TYPE_ROLE:
                $name = Yii::t('AuthModule.main', 'role|roles', $n);
                break;

            default:
                throw new CException('Auth item type "' . $type . '" is valid.');
        }
        return $name;
    }
public function getItemTypeText($type, $plural = false)
    {
        // todo: change the default value for $plural to false.
        $n = $plural ? 2 : 1;
        switch ($type) {
            case CAuthItem::TYPE_OPERATION:
                $name = Yii::t('AuthModule.main', 'operation|operations', $n);
                break;

            case CAuthItem::TYPE_TASK:
                $name = Yii::t('AuthModule.main', 'task|tasks', $n);
                break;

            case CAuthItem::TYPE_ROLE:
                $name = Yii::t('AuthModule.main', 'role|roles', $n);
                break;

            default:
                throw new CException('Auth item type "' . $type . '" is valid.');
        }
        return $name;
    }
public function getItemTypeText ( $ type , $ plural = false ) { // todo: change the default value for $plural to false. $ n = $ plural ? 2 : 1 ; switch ( $ type ) { case CAuthItem :: TYPE_OPERATION : $ name = Yii :: t ( 'AuthModule.main' , 'operation|operations' , $ n ) ; break ; case CAuthItem :: TYPE_TASK : $ name = Yii :: t ( 'AuthModule.main' , 'task|tasks' , $ n ) ; break ; case CAuthItem :: TYPE_ROLE : $ name = Yii :: t ( 'AuthModule.main' , 'role|roles' , $ n ) ; break ; default : throw new CException ( 'Auth item type "' . $ type . '" is valid.' ) ; } return $ name ; }
Returns the authorization item type as a string.
@param string $type the item type (0=operation, 1=task, 2=role).
@param boolean $plural whether to return the name in plural.
@return string the text.
@throws CException if the item type is invalid.
Returns the authorization item type as a string .