Stud.IP  3.1 Revision 48552
 All Data Structures Namespaces Files Functions Variables Groups Pages
WidgetContainer Class Reference
Inheritance diagram for WidgetContainer:
Inheritance graph
Collaboration diagram for WidgetContainer:
Collaboration graph

Public Member Functions

 addWidget (Widget $widget, $index=null)
 insertWidget (Widget $widget, $before_index, $index=null)
 getWidget ($index)
 removeWidget ($index)
 hasWidgets ()
 render ()

Static Public Member Functions

static Get ()

Protected Member Functions

 __construct ()

Protected Attributes

 $widgets = array()

Static Protected Attributes

static $instances = null

Detailed Description

Generic widget container

Author
Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m GPL 2 or later
Since
3.1

Constructor & Destructor Documentation

__construct ( )
protected

Private constructor to ensure that the singleton Get() method is always used.

See Also
WidgetContainer::Get

Reimplemented in Helpbar, and Sidebar.

Member Function Documentation

addWidget ( Widget  $widget,
  $index = null 
)

Add a widget to the container.

Parameters
Widget$widgetThe actual widget
String$indexOptional index/name of the widget, defaults to class name without "widget"

Here is the caller graph for this function:

static Get ( )
static

Returns the instance of this container to ensure there is only one instance.

Returns
WidgetContainer The container instance

Here is the caller graph for this function:

getWidget (   $index)

Retrieve the widget at the specified position.

Parameters
String$indexIndex/name of the widget to retrieve.
Returns
WidgetElement The widget at the specified position.
Exceptions
Exceptionif the specified position is invalid
hasWidgets ( )

Returns whether this container has any widget.

Returns
bool True if the container has at least one widget, false otherwise.

Here is the caller graph for this function:

insertWidget ( Widget  $widget,
  $before_index,
  $index = null 
)

Insert a widget before a specific other widget or at the end of the list if the specified position is invalid.

Parameters
Widget$widgetThe actual widget
String$before_indexInsert widget before this widget
String$indexOptional index/name of the widget, defaults to class name without "widget"

Here is the caller graph for this function:

removeWidget (   $index)

Removes the widget at the specified position.

Parameters
String$indexIndex/name of the widget to remove.
Exceptions
Exceptionif the specified position is invalid
render ( )
abstract

Renders the container.

Reimplemented in Helpbar, and Sidebar.

Field Documentation

$instances = null
staticprotected

The singleton instance of the container

$widgets = array()
protected

Contains the widgets of the container


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