Combu Server  3.1.1
PHP API Documentation
Public Member Functions | Static Public Member Functions | Data Fields
AddonModule Class Reference

Public Member Functions

 __construct ($folder)
 
 GetFolder ()
 
 GetFile ($fileRelativePath)
 
 GetMenuLink ($menu)
 
 GetTooltip ()
 
 GetProperties ()
 
 GetProperty ($name)
 
 SetProperty ($name, $value)
 
 AddAdminMenu ($displayText, $url)
 
 GetAdminMenu ()
 
 BlockUpdateUserCustomData ($dataKey)
 

Static Public Member Functions

static LoadAddons ()
 
static GetAddon ($addonName)
 
static IsBlockedUpdateUserCustomData ($dataKey)
 
static ProcessOutputUserCustomData ($user, &$customData)
 
static ProcessOutputUser (&$userData)
 
static NotifyUserCreate ($user)
 
static NotifyUserUpdate ($user)
 
static NotifyUserDelete ($user)
 
static NotifyUserLogout ($user)
 

Data Fields

 $Id = 0
 
 $Name = ""
 
 $Version = "1.0"
 
 $OnUserCreate = NULL
 
 $OnUserUpdate = NULL
 
 $OnUserDelete = NULL
 
 $OnUserCustomDataOutput = NULL
 
 $OnUserProcessOutput = NULL
 
 $OnUserLogout = NULL
 

Detailed Description

Class to handle add-on modules

Author
Skared Creations

Definition at line 10 of file AddonModule.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $folder)

Definition at line 27 of file AddonModule.php.

Member Function Documentation

◆ AddAdminMenu()

AddAdminMenu (   $displayText,
  $url 
)

Add a link in the Addon section of the admin console menu

Parameters
string$displayText
string$url

Definition at line 171 of file AddonModule.php.

◆ BlockUpdateUserCustomData()

BlockUpdateUserCustomData (   $dataKey)

Block an account custom data key from being updated by clients

Parameters
string$dataKey

Definition at line 188 of file AddonModule.php.

◆ GetAddon()

static GetAddon (   $addonName)
static

Get the installed addon if exists self[] $Addons

Parameters
string$addonName
Returns
self

Definition at line 93 of file AddonModule.php.

◆ GetAdminMenu()

GetAdminMenu ( )

Get the links in the Addon section of the admin console menu

Returns
array

Definition at line 180 of file AddonModule.php.

◆ GetFile()

GetFile (   $fileRelativePath)

Get the path to a file in the folder of this Addon

Parameters
string$fileRelativePath
Returns
string

Definition at line 115 of file AddonModule.php.

◆ GetFolder()

GetFolder ( )

Get the folder of this Addon

Returns
string

Definition at line 106 of file AddonModule.php.

◆ GetMenuLink()

GetMenuLink (   $menu)

Get the link to the specified menu for the admin console

Parameters
int$menu
Returns
type

Definition at line 126 of file AddonModule.php.

◆ GetProperties()

GetProperties ( )

Get all custom properties of this Addon as associative array

Returns
array

Definition at line 142 of file AddonModule.php.

◆ GetProperty()

GetProperty (   $name)

Get a custom property of this Addon

Parameters
type$name
Returns
object

Definition at line 151 of file AddonModule.php.

◆ GetTooltip()

GetTooltip ( )

Get the link tooltip of this addon

Returns
string The tooltip

Definition at line 134 of file AddonModule.php.

◆ IsBlockedUpdateUserCustomData()

static IsBlockedUpdateUserCustomData (   $dataKey)
static

Check if an account custom data key is blocked by this Addon self[] $Addons

Parameters
string$dataKey
Returns
boolean

Definition at line 199 of file AddonModule.php.

◆ LoadAddons()

static LoadAddons ( )
static

Load the admin modules installed

Returns
AddonModule[]

Definition at line 38 of file AddonModule.php.

◆ NotifyUserCreate()

static NotifyUserCreate (   $user)
static

This function is called when a new account is created self[] $Addons

Parameters
Account$user

Definition at line 243 of file AddonModule.php.

◆ NotifyUserDelete()

static NotifyUserDelete (   $user)
static

This function is called when an account is deleted self[] $Addons

Parameters
Account$user

Definition at line 269 of file AddonModule.php.

◆ NotifyUserLogout()

static NotifyUserLogout (   $user)
static

This function is called when an account logged out self[] $Addons

Parameters
Account$user

Definition at line 282 of file AddonModule.php.

◆ NotifyUserUpdate()

static NotifyUserUpdate (   $user)
static

This function is called when an account is updated self[] $Addons

Parameters
Account$user

Definition at line 256 of file AddonModule.php.

◆ ProcessOutputUser()

static ProcessOutputUser ( $userData)
static

This function is called in Account::ToArrayFiltered to filter the outgoing data of an account. Addons can use their own callback to add, remove or edit data that will be sent to the clients. self[] $Addons

Parameters
Account$user
array$customData

Definition at line 230 of file AddonModule.php.

◆ ProcessOutputUserCustomData()

static ProcessOutputUserCustomData (   $user,
$customData 
)
static

This function is called in Account::ToArrayFiltered to filter the outgoing custom data of an account. Addons can use their own callback to add, remove or edit custom data that will be sent to the clients. self[] $Addons

Parameters
Account$user
array$customData

Definition at line 215 of file AddonModule.php.

◆ SetProperty()

SetProperty (   $name,
  $value 
)

Set a custom property for this Addon

Parameters
string$name
object$value

Definition at line 162 of file AddonModule.php.

Field Documentation

◆ $Id

$Id = 0

Definition at line 12 of file AddonModule.php.

◆ $Name

$Name = ""

Definition at line 13 of file AddonModule.php.

◆ $OnUserCreate

$OnUserCreate = NULL

Definition at line 15 of file AddonModule.php.

◆ $OnUserCustomDataOutput

$OnUserCustomDataOutput = NULL

Definition at line 18 of file AddonModule.php.

◆ $OnUserDelete

$OnUserDelete = NULL

Definition at line 17 of file AddonModule.php.

◆ $OnUserLogout

$OnUserLogout = NULL

Definition at line 20 of file AddonModule.php.

◆ $OnUserProcessOutput

$OnUserProcessOutput = NULL

Definition at line 19 of file AddonModule.php.

◆ $OnUserUpdate

$OnUserUpdate = NULL

Definition at line 16 of file AddonModule.php.

◆ $Version

$Version = "1.0"

Definition at line 14 of file AddonModule.php.