Stud.IP  4.2 Revision
ContentGroupMenu Class Reference
Collaboration diagram for ContentGroupMenu:
Collaboration graph

Public Member Functions

 condition ($state)
 
 conditionAll ($state)
 
 addLink ($link, $label, Icon $icon=null, array $attributes=[])
 
 addButton ($name, $label, Icon $icon=null, array $attributes=[])
 
 addMultiPersonSearch (MultiPersonSearch $mp)
 
 render ()
 
 setRows ($rows)
 
 setcolumns ($columns)
 
 setIcon ($menu_image)
 
 setLabel ($label)
 
 setAriaLabel ($label)
 
 countLinks ()
 

Static Public Member Functions

static get ()
 

Data Fields

const THRESHOLD = 1
 
const TEMPLATE_FILE_SINGLE = 'shared/action-menu-single.php'
 
const TEMPLATE_FILE_MULTIPLE = 'shared/action-menu.php'
 
const TEMPLATE_FILE_ROWS = 'shared/contentgroup-row.php'
 
const TEMPLATE_FILE_TABLE = 'shared/contentgroup-table.php'
 

Protected Member Functions

 checkCondition ()
 

Detailed Description

This class represents the a more flexible menu used to group actions.

Author
Timo Hartge hartg.nosp@m.e@da.nosp@m.ta-qu.nosp@m.est..nosp@m.de GPL2 or any later version
Since
Stud.IP 4.0

Member Function Documentation

◆ addButton()

addButton (   $name,
  $label,
Icon  $icon = null,
array  $attributes = [] 
)

Adds a button to the list of actions.

Parameters
String$nameButton name
String$labelTextual representation of the name
mixed$iconOptional icon (as Icon object)
array$attributesOptional attributes to add to the tag
Returns
ContentGroupMenu instance to allow chaining
Here is the call graph for this function:

◆ addLink()

addLink (   $link,
  $label,
Icon  $icon = null,
array  $attributes = [] 
)

Adds a link to the list of actions.

Parameters
String$linkLink target
String$labelTextual representation of the link
mixed$iconOptional icon (as Icon object)
array$attributesOptional attributes to add to the tag
Returns
ContentGroupMenu instance to allow chaining
Here is the call graph for this function:

◆ addMultiPersonSearch()

addMultiPersonSearch ( MultiPersonSearch  $mp)

Adds a MultiPersonSearch object to the list of actions.

Parameters
MultiPersonSearch$mpMultiPersonSearch object
Returns
ContentGroupMenu instance to allow chaining
Here is the call graph for this function:

◆ checkCondition()

checkCondition ( )
protected

Checks the condition. Takes global and local (conditionAll() & condition()) conditions into account.

Returns
bool indicating whether the condition is met or not
Here is the call graph for this function:
Here is the caller graph for this function:

◆ condition()

condition (   $state)

Set condition for the next added item. If condition is false, the item will not be added.

Parameters
bool$stateState of the condition
Returns
ContentGroupMenu instance to allow chaining
Here is the caller graph for this function:

◆ conditionAll()

conditionAll (   $state)

Set condition for all the next added items. If condition is false, no items will be added.

Parameters
bool$stateState of the condition
Returns
ContentGroupMenu instance to allow chaining

◆ countLinks()

countLinks ( )

Return the number of menu actions.

Returns
integer count actions

◆ get()

static get ( )
static

Returns an instance.

Returns
ContentGroupMenu

◆ render()

render ( )

Renders the action menu. If no item was added, an empty string will be returned. If a single item was added, the item itself will be displayed. Otherwise the whole menu will be rendered.

Returns
String containing the html representation of the action menu

◆ setAriaLabel()

setAriaLabel (   $label)

Sets the label of the menu.

Parameters
String$labellabel for the menu

◆ setcolumns()

setcolumns (   $columns)

Sets the number of columns to layout the elements.

Parameters
integer$columnsnumber of columns

◆ setIcon()

setIcon (   $menu_image)

Sets the icon of the menu.

Parameters
String$menu_imageimage html for the menu

◆ setLabel()

setLabel (   $label)

Sets the label of the menu.

Parameters
String$labellabel for the menu

◆ setRows()

setRows (   $rows)

Sets the number of rows to layout the elements.

Parameters
integer$rowsnumber of rows

Field Documentation

◆ TEMPLATE_FILE_MULTIPLE

const TEMPLATE_FILE_MULTIPLE = 'shared/action-menu.php'

◆ TEMPLATE_FILE_ROWS

const TEMPLATE_FILE_ROWS = 'shared/contentgroup-row.php'

◆ TEMPLATE_FILE_SINGLE

const TEMPLATE_FILE_SINGLE = 'shared/action-menu-single.php'

◆ TEMPLATE_FILE_TABLE

const TEMPLATE_FILE_TABLE = 'shared/contentgroup-table.php'

◆ THRESHOLD

const THRESHOLD = 1

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