\OCPApp

This class provides functions to manage apps in ownCloud

Summary

Methods
Properties
Constants
addNavigationEntry()
setActiveNavigationEntry()
registerPersonal()
registerAdmin()
getAppInfo()
isEnabled()
checkAppEnabled()
getAppVersion()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

addNavigationEntry()

addNavigationEntry(array  $data) : boolean

Adds an entry to the navigation

This function adds a new entry to the navigation visible to users. $data is an associative array. The following keys are required:

  • id: unique id for this entry ('addressbook_index')
  • href: link to the page
  • name: Human readable name ('Addressbook')

The following keys are optional:

  • icon: path to the icon of the app
  • order: integer, that influences the position of your application in the navigation. Lower values come first.

Parameters

array $data

containing the data

Returns

boolean

setActiveNavigationEntry()

setActiveNavigationEntry(string  $id) : boolean

Marks a navigation entry as active

Parameters

string $id

id of the entry

Returns

boolean —

This function sets a navigation entry as active and removes the 'active' property from all other entries. The templates can use this for highlighting the current position of the user.

registerPersonal()

registerPersonal(string  $app, string  $page) : void

Register a Configuration Screen that should appear in the personal settings section.

Parameters

string $app

appid

string $page

page to be included

registerAdmin()

registerAdmin(string  $app, string  $page) : void

Register a Configuration Screen that should appear in the Admin section.

Parameters

string $app

string appid

string $page

string page to be included

getAppInfo()

getAppInfo(string  $app, boolean  $path = false) : array|null

Read app metadata from the info.xml file

Parameters

string $app

id of the app or the path of the info.xml file

boolean $path

(optional)

Returns

array|null

isEnabled()

isEnabled(string  $app) : boolean

checks whether or not an app is enabled

Parameters

string $app

Returns

boolean —

This function checks whether or not an app is enabled.

checkAppEnabled()

checkAppEnabled(string  $app) : void

Check if the app is enabled, redirects to home if not

Parameters

string $app

getAppVersion()

getAppVersion(string  $app) : string

Get the last version of the app from appinfo/info.xml

Parameters

string $app

Returns

string