PHP Class Elgg\WidgetsService

Use the elgg_* versions instead.
Since: 1.9.0
ファイルを表示 Open project: elgg/elgg Class Usage Examples

Public Methods

Method Description
canEditLayout ( $context, $user_guid )
createWidget ( $owner_guid, $handler, $context, $access_id = null )
getAllTypes ( )
getNameById ( string $id, string $context = '', ElggEntity $container = null ) : string | boolean Returns widget name based on id
getTypes ( array $params = [] ) : WidgetDefinition[]
getWidgets ( $owner_guid, $context )
registerType ( WidgetDefinition $definition ) : boolean
unregisterType ( string $id ) : boolean
validateType ( string $id, string $context = null, ElggEntity $container = null ) Checks if a widget type exists for a given id

Method Details

canEditLayout() public method

See also: elgg_can_edit_widget_layout
Since: 1.9.0
public canEditLayout ( $context, $user_guid )

createWidget() public method

See also: elgg_create_widget
Since: 1.9.0
public createWidget ( $owner_guid, $handler, $context, $access_id = null )

getAllTypes() public method

Since: 1.9.0
public getAllTypes ( )

getNameById() public method

Returns widget name based on id
Since: 2.2.0
public getNameById ( string $id, string $context = '', ElggEntity $container = null ) : string | boolean
$id string Widget identifier
$context string Context to check
$container ElggEntity Optional limit widget definitions to a container
return string | boolean

getTypes() public method

Since: 1.9.0
public getTypes ( array $params = [] ) : WidgetDefinition[]
$params array Associative array of params used to determine what to return array ( 'context' => string (defaults to elgg_get_context()), 'container' => \ElggEntity (defaults to null) )
return WidgetDefinition[]

getWidgets() public method

See also: elgg_get_widgets
Since: 1.9.0
public getWidgets ( $owner_guid, $context )

registerType() public method

See also: elgg_register_widget_type
Since: 1.9.0
public registerType ( WidgetDefinition $definition ) : boolean
$definition WidgetDefinition
return boolean

unregisterType() public method

See also: elgg_unregister_widget_type
Since: 1.9.0
public unregisterType ( string $id ) : boolean
$id string
return boolean

validateType() public method

Checks if a widget type exists for a given id
See also: elgg_is_widget_type
Since: 1.9.0
public validateType ( string $id, string $context = null, ElggEntity $container = null )
$id string Widget identifier
$context string Optional context to check
$container ElggEntity Optional limit widget definitions to a container