public static function toArray() { if (self::$_toArrayCache !== null) { return self::$_toArrayCache; } $user = JFactory::getUser(); $result = array(); $actions = self::getActions(); foreach ($actions as $action) { $access = $user->authorise($action, 'com_newsletter'); $result[$action] = $access !== null ? $access : self::$resultForNonsetAction; } self::$_toArrayCache = $result; return self::$_toArrayCache; }