Stud.IP  4.2 Revision
WidgetInterface Interface Reference
Inheritance diagram for WidgetInterface:
Inheritance graph
Collaboration diagram for WidgetInterface:
Collaboration graph

Public Member Functions

 suitableForRange (Range $range, $scope=null)
 
 getId ()
 
 getName ()
 
 getDescription ()
 
 getTitle ()
 
 getContent (Range $range, $scope)
 
 connectWithElement (Element $element)
 
 getElement ()
 
 url_for ($to, $parameters=[])
 
 setOptions (array $options=[])
 
 getOptions ()
 
 hasLayout ()
 
 mayBeRemoved ()
 
 mayBeDuplicated ()
 
 getActions (Range $range, $scope)
 

Detailed Description

This interface defines all functions that a widget should offer.

Author
Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m GPL2 or any later version
Since
Stud.IP 4.1

Member Function Documentation

◆ connectWithElement()

connectWithElement ( Element  $element)

Connect this widget with an element. This is neccessary for the url generation from inside the widget. Otherwise, there are no means to retrieve the element and/or container the widget is used in.

Parameters
Element$elementElement to connect with

Implemented in Widget.

◆ getActions()

getActions ( Range  $range,
  $scope 
)

Returns a list of possible widget actions.

Returns
array of WidgetAction

Implemented in Widget, and LegacyWidget.

◆ getContent()

getContent ( Range  $range,
  $scope 
)

Returns the content of the widget (this is the actual content of the rendered widget).

Returns
string

Implemented in LegacyWidget.

◆ getDescription()

getDescription ( )

Returns the description of the widget.

Returns
string

Implemented in LegacyWidget, LatestFilesWidget, and MyPublicFilesWidget.

◆ getElement()

getElement ( )

Retrieves a previously connected element.

Returns
mixed Element or null if not element has been connected

Implemented in Widget.

◆ getId()

getId ( )

Returns the id of the widget.

Returns
int
Here is the caller graph for this function:

◆ getName()

getName ( )

Return the name of the widget.

Returns
string

Implemented in LegacyWidget, LatestFilesWidget, and MyPublicFilesWidget.

◆ getOptions()

getOptions ( )

Returns the options for this widget instance. This might and should be overwritten by a subclass.

Returns
mixed

Implemented in Widget.

◆ getTitle()

getTitle ( )

Returns the title of the widget (this is the actual header of the rendered widget.

Returns
string

Implemented in Widget, LegacyWidget, and MyPublicFilesWidget.

◆ hasLayout()

hasLayout ( )

Returns whether the widget should have a layout or not.

Returns
bool
Todo:
Really neccessary? Seems to got lost in development

Implemented in Widget, and LegacyWidget.

◆ mayBeDuplicated()

mayBeDuplicated ( )

Returns whether this widget instance may be duplicated or used more than once in a container.

Returns
bool

Implemented in Widget, LegacyWidget, LatestFilesWidget, and MyPublicFilesWidget.

◆ mayBeRemoved()

mayBeRemoved ( )

Returns whether this widget instance may be removed from a container.

Returns
bool

Implemented in Widget, LatestFilesWidget, and MyPublicFilesWidget.

Here is the caller graph for this function:

◆ setOptions()

setOptions ( array  $options = [])

Sets the defined options for this widget instance. This method is usually only called when a widget container is loaded and the elements are initialized.

Parameters
array$options

Implemented in Widget.

◆ suitableForRange()

suitableForRange ( Range  $range,
  $scope = null 
)

Returns whether the widget is suitable for the given range (and an optional scope).

Parameters
Range$range
mixed$scope
Returns
bool

Implemented in Widget.

◆ url_for()

url_for (   $to,
  $parameters = [] 
)

Create a url for a widget's action.

Parameters
string$toTarget
array$parametersOptional url parameters
Returns
string

Implemented in Widget, and LegacyWidget.


The documentation for this interface was generated from the following file: