SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class Itemlist

Used to generate HTML for a table of database records.
This is usually used for the admin/contents/* route which provides the main
UI to operators for a given ManagedAdminController

Variables

NameVisibilityDescription
$actions 
$actions_classes 
$actions_func 
$aggregate 
$checkboxes 
$items 
$main_columns 
$ordering 
$row_classes_func 
$table_class 

Functions

NameVisibilityDescription
__toStringpublic 
addActionpublicAdds an action to this itemlist.
addAggregateColumnpublicAdd an aggregate which operates on the values of a column
addAggregateValuepublicAdd an aggregate which is just a single pre-computed value
calculateAggregateColumnprotected (static)Calculate the result of an aggregation
renderpublic 
renderItemprotected (static)Renders an itemlist definition
setActionsClassespublicSet link classes common for all actions
setActionsFuncpublicSet a function which should return content for the actions column
setCheckboxespublicDoes this itemlist support checkboxes?
setOrderingpublicDoes this itemlist support ordering?
setRowClassesFuncpublicSet a function which should return the classes to use on the row.
urlReplaceprivateDoes the parameter replacements on an action url

public __toString

unknown $Itemlist->__toString ( );

This function does not have a description

public addAction

void $Itemlist->addAction ( string $name , string $url [, string $classes [, callable $show_func ]] );

Adds an action to this itemlist.

The special action 'edit' is used when the row is clicked.

public addAggregateColumn

void $Itemlist->addAggregateColumn ( string $title , string $operation [, ColModifier $modifier ] );

Add an aggregate which operates on the values of a column

public addAggregateValue

void $Itemlist->addAggregateValue ( string $title , string $value );

Add an aggregate which is just a single pre-computed value

protected calculateAggregateColumn

mixed Itemlist::calculateAggregateColumn ( string $operation , array $values );

Calculate the result of an aggregation

public render

unknown $Itemlist->render ( );

This function does not have a description

protected renderItem

string Itemlist::renderItem ( mixed $defn , array $item_data );

Renders an itemlist definition

Definition can be one of:
 - A field name
 - An array with two indexes, 0 => ColModifier, 1 => field name
 - A Closure, which will receive one argument of the entire row as an array,
   and must return a string of HTML

The Closure result supports a subset of HTML, Text::limitedSubsetHtml for more details

public setActionsClasses

void $Itemlist->setActionsClasses ( string $classes );

Set link classes common for all actions
The default is "actions--link".

public setActionsFunc

void $Itemlist->setActionsFunc ( mixed $func );

Set a function which should return content for the actions column
The func should have this signature:

   string function mycallable(array $row)

The return value should be HTML with the links

public setCheckboxes

void $Itemlist->setCheckboxes ( mixed $checkboxes );

Does this itemlist support checkboxes?

public setOrdering

void $Itemlist->setOrdering ( mixed $ordering );

Does this itemlist support ordering?

public setRowClassesFunc

void $Itemlist->setRowClassesFunc ( callable $func );

Set a function which should return the classes to use on the row.

   string function mycallable(array $row)

The return value should be a string of class names

private urlReplace

unknown $Itemlist->urlReplace ( mixed $url , mixed $item );

Does the parameter replacements on an action url

Replaces %% with the id of the record.