IAppManager
in
Interface IAppManager
Tags
Table of Contents
Constants
- BACKEND_CALDAV = 'caldav'
Methods
- cleanAppId() : string
- Clean the appId from forbidden characters
- clearAppsCache() : void
- Clear the cached list of apps when enabling/disabling an app
- disableApp() : void
- Disable an app for every user
- enableApp() : void
- Enable an app for every user
- enableAppForGroups() : void
- Enable an app only for specific groups
- getAllAppsInAppsFolders() : array<int, string>
- Get a list of all apps in the apps folder
- getAlwaysEnabledApps() : array<string|int, string>
- getAppIcon() : string|null
- Returns the app icon or null if none is found
- getAppInfo() : array<string|int, mixed>|null
- Returns the app information from "appinfo/info.xml" for an app
- getAppInfoByPath() : array<string|int, mixed>|null
- Returns the app information from a given path ending with "/appinfo/info.xml"
- getAppPath() : string
- Get the directory for the given app.
- getAppRestriction() : array<string|int, string>
- getAppVersion() : string
- Returns the app information from "appinfo/info.xml".
- getAppWebPath() : string
- Get the web path for the given app.
- getDefaultAppForUser() : string
- Returns the id of the user's default app
- getDefaultApps() : array<string|int, string>
- Get the global default apps with fallbacks
- getDefaultEnabledApps() : array<string|int, string>
- getEnabledAppsForGroup() : array<string|int, string>
- getEnabledAppsForUser() : array<string|int, string>
- List all apps enabled for a user
- getInstalledApps() : array<string|int, string>
- List all installed apps
- hasProtectedAppType() : bool
- Whether a list of types contains a protected app type
- isAppLoaded() : bool
- Check if an app is loaded
- isBackendRequired() : bool
- Check whether the given backend is required by at least one app.
- isDefaultEnabled() : bool
- Check if an app should be enabled by default
- isEnabledForUser() : bool
- Check if an app is enabled for user
- isInstalled() : bool
- Check if an app is enabled in the instance
- isShipped() : bool
- isType() : bool
- Check if an app is of a specific type
- loadApp() : void
- Load an app, if not already loaded
- loadApps() : bool
- Loads all apps
- setDefaultApps() : void
- Set the global default apps with fallbacks
Constants
BACKEND_CALDAV
public
mixed
BACKEND_CALDAV
= 'caldav'
Tags
Methods
cleanAppId()
Clean the appId from forbidden characters
public
cleanAppId(string $app) : string
Parameters
- $app : string
Tags
Return values
stringclearAppsCache()
Clear the cached list of apps when enabling/disabling an app
public
clearAppsCache() : void
Tags
disableApp()
Disable an app for every user
public
disableApp(string $appId[, bool $automaticDisabled = false ]) : void
Parameters
- $appId : string
- $automaticDisabled : bool = false
Tags
enableApp()
Enable an app for every user
public
enableApp(string $appId[, bool $forceEnable = false ]) : void
Parameters
- $appId : string
- $forceEnable : bool = false
Tags
enableAppForGroups()
Enable an app only for specific groups
public
enableAppForGroups(string $appId, array<string|int, IGroup> $groups[, bool $forceEnable = false ]) : void
Parameters
- $appId : string
- $groups : array<string|int, IGroup>
- $forceEnable : bool = false
Tags
getAllAppsInAppsFolders()
Get a list of all apps in the apps folder
public
getAllAppsInAppsFolders() : array<int, string>
Tags
Return values
array<int, string> —an array of app names (string IDs)
getAlwaysEnabledApps()
public
getAlwaysEnabledApps() : array<string|int, string>
Tags
Return values
array<string|int, string>getAppIcon()
Returns the app icon or null if none is found
public
getAppIcon(string $appId[, bool $dark = false ]) : string|null
Parameters
- $appId : string
- $dark : bool = false
-
Enable to request a dark icon variant, default is a white icon
Tags
Return values
string|nullgetAppInfo()
Returns the app information from "appinfo/info.xml" for an app
public
getAppInfo(string $appId[, bool $path = false ][, string|null $lang = null ]) : array<string|int, mixed>|null
Parameters
- $appId : string
- $path : bool = false
- $lang : string|null = null
Tags
Return values
array<string|int, mixed>|nullgetAppInfoByPath()
Returns the app information from a given path ending with "/appinfo/info.xml"
public
getAppInfoByPath(string $path[, string|null $lang = null ]) : array<string|int, mixed>|null
Parameters
- $path : string
- $lang : string|null = null
Tags
Return values
array<string|int, mixed>|nullgetAppPath()
Get the directory for the given app.
public
getAppPath(string $appId) : string
Parameters
- $appId : string
Tags
Return values
stringgetAppRestriction()
public
getAppRestriction(string $appId) : array<string|int, string>
Parameters
- $appId : string
Tags
Return values
array<string|int, string>getAppVersion()
Returns the app information from "appinfo/info.xml".
public
getAppVersion(string $appId[, bool $useCache = true ]) : string
Parameters
- $appId : string
- $useCache : bool = true
Tags
Return values
stringgetAppWebPath()
Get the web path for the given app.
public
getAppWebPath(string $appId) : string
Parameters
- $appId : string
Tags
Return values
stringgetDefaultAppForUser()
Returns the id of the user's default app
public
getDefaultAppForUser([IUser|null $user = null ][, bool $withFallbacks = true ]) : string
Use @see \OCP\INavigationManager::getDefaultEntryIdForUser() instead
If user
is not passed, the currently logged in user will be used
Parameters
- $user : IUser|null = null
-
User to query default app for
- $withFallbacks : bool = true
-
Include fallback values if no default app was configured manually Before falling back to predefined default apps, the user defined app order is considered and the first app would be used as the fallback.
Tags
Return values
stringgetDefaultApps()
Get the global default apps with fallbacks
public
getDefaultApps() : array<string|int, string>
Use @see \OCP\INavigationManager::getDefaultEntryIds() instead
Tags
Return values
array<string|int, string> —The default applications
getDefaultEnabledApps()
public
getDefaultEnabledApps() : array<string|int, string>
Tags
Return values
array<string|int, string> —app IDs
getEnabledAppsForGroup()
public
getEnabledAppsForGroup(IGroup $group) : array<string|int, string>
Parameters
- $group : IGroup
Tags
Return values
array<string|int, string>getEnabledAppsForUser()
List all apps enabled for a user
public
getEnabledAppsForUser(IUser $user) : array<string|int, string>
Parameters
- $user : IUser
Tags
Return values
array<string|int, string>getInstalledApps()
List all installed apps
public
getInstalledApps() : array<string|int, string>
Tags
Return values
array<string|int, string>hasProtectedAppType()
Whether a list of types contains a protected app type
public
hasProtectedAppType(array<string|int, string> $types) : bool
Parameters
- $types : array<string|int, string>
Tags
Return values
boolisAppLoaded()
Check if an app is loaded
public
isAppLoaded(string $app) : bool
Parameters
- $app : string
-
app id
Tags
Return values
boolisBackendRequired()
Check whether the given backend is required by at least one app.
public
isBackendRequired(self::BACKEND_* $backend) : bool
Parameters
- $backend : self::BACKEND_*
-
Name of the backend, one of
self::BACKEND_*
Tags
Return values
bool —True if at least one app requires the backend
isDefaultEnabled()
Check if an app should be enabled by default
public
isDefaultEnabled(string $appId) : bool
Notice: This actually checks if the app should be enabled by default and not if currently installed/enabled
Parameters
- $appId : string
-
ID of the app
Tags
Return values
boolisEnabledForUser()
Check if an app is enabled for user
public
isEnabledForUser(string $appId[, IUser|null $user = null ]) : bool
Parameters
- $appId : string
- $user : IUser|null = null
-
(optional) if not defined, the currently loggedin user will be used
Tags
Return values
boolisInstalled()
Check if an app is enabled in the instance
public
isInstalled(string $appId) : bool
Notice: This actually checks if the app is enabled and not only if it is installed.
Parameters
- $appId : string
Tags
Return values
boolisShipped()
public
isShipped(string $appId) : bool
Parameters
- $appId : string
Tags
Return values
boolisType()
Check if an app is of a specific type
public
isType(string $app, array<string|int, mixed> $types) : bool
Parameters
- $app : string
- $types : array<string|int, mixed>
Tags
Return values
boolloadApp()
Load an app, if not already loaded
public
loadApp(string $app) : void
Parameters
- $app : string
-
app id
Tags
loadApps()
Loads all apps
public
loadApps([array<string|int, string> $types = [] ]) : bool
Parameters
- $types : array<string|int, string> = []
Tags
Return values
bool —This function walks through the Nextcloud directory and loads all apps
it can find. A directory contains an app if the file /appinfo/info.xml
exists.
if $types is set to non-empty array, only apps of those types will be loaded
setDefaultApps()
Set the global default apps with fallbacks
public
setDefaultApps(array<string|int, string> $defaultApps) : void
Use @see \OCP\INavigationManager::setDefaultEntryIds() instead
Parameters
- $defaultApps : array<string|int, string>