PHP Class Backend\Core\Engine\DataGrid

..
Author: Davy Hellemans ([email protected])
Author: Tijs Verkoyen ([email protected])
Author: Dieter Vanden Eynde ([email protected])
Author: Jelmer Snoeck ([email protected])
Inheritance: extends SpoonDataGrid
Datei anzeigen Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
__construct ( SpoonDatagridSource $source )
addColumn ( string $name, string $label = null, string $value = null, string $url = null, string $title = null, string $image = null, integer $sequence = null ) Adds a new column
addColumnAction ( string $name, string $label = null, string $value = null, string $url = null, string $title = null, array $anchorAttributes = null, string $image = null, integer $sequence = null ) Adds a new column with a custom action button
enableGreyingOut ( ) Enable the grey out functionality. This will see if we have a column that matches our set.
enableSequenceByDragAndDrop ( ) Enable drag and drop for the current datagrid
getContent ( ) : string Retrieve the parsed output.
hasColumn ( string $column ) : boolean Checks whether a column is present in the datagrid
setActiveTab ( string $tab ) Sets the active tab for this datagrid
setColumnConfirm ( string $column, string $message, string $custom = null, string $title = null, string $uniqueId = '[id]' ) Set a custom column confirm message.
setColumnFunction ( mixed $function, mixed $arguments = null, mixed $columns, boolean $overwrite = true ) Sets the column function to be executed for every row
setMassAction ( SpoonFormDropdown $actionDropDown ) Sets the dropdown for the mass action
setMassActionCheckboxes ( string $column, string $value, array $excludedValues = null, array $checkedValues = null ) Sets the checkboxes for the mass action
setTooltip ( string $column, string $message ) Set a tooltip
setURL ( string $url, boolean $append = false ) Sets an URL, optionally only appending the provided piece

Private Methods

Method Description
decideIcon ( $name ) : null | string Decides what icon to use by given name
setSortingOptions ( ) Sets all the default settings needed when attempting to use sorting

Method Details

__construct() public method

public __construct ( SpoonDatagridSource $source )
$source SpoonDatagridSource

addColumn() public method

Adds a new column
public addColumn ( string $name, string $label = null, string $value = null, string $url = null, string $title = null, string $image = null, integer $sequence = null )
$name string The name for the new column.
$label string The label for the column.
$value string The value for the column.
$url string The URL for the link inside the column.
$title string A title for the image inside the column.
$image string An URL to the image inside the column.
$sequence integer The sequence for the column.

addColumnAction() public method

Adds a new column with a custom action button
public addColumnAction ( string $name, string $label = null, string $value = null, string $url = null, string $title = null, array $anchorAttributes = null, string $image = null, integer $sequence = null )
$name string The name for the new column.
$label string The label for the column.
$value string The value for the column.
$url string The URL for the link inside the column.
$title string The title for the link inside the column.
$anchorAttributes array The attributes for the anchor inside the column.
$image string An URL to the image inside the column.
$sequence integer The sequence for the column.

enableGreyingOut() public method

If so, it will call the BackendDatagridFunction with the type and value so we can parse the data.
public enableGreyingOut ( )

enableSequenceByDragAndDrop() public method

Enable drag and drop for the current datagrid

getContent() public method

Retrieve the parsed output.
public getContent ( ) : string
return string

hasColumn() public method

Checks whether a column is present in the datagrid
public hasColumn ( string $column ) : boolean
$column string
return boolean

setActiveTab() public method

Sets the active tab for this datagrid
public setActiveTab ( string $tab )
$tab string The name of the tab to show.

setColumnConfirm() public method

Set a custom column confirm message.
public setColumnConfirm ( string $column, string $message, string $custom = null, string $title = null, string $uniqueId = '[id]' )
$column string The name of the column to set the confirm for.
$message string The message to use as a confirm message.
$custom string Unused parameter.
$title string The title for the column.
$uniqueId string A unique ID that will be uses.

setColumnFunction() public method

Sets the column function to be executed for every row
public setColumnFunction ( mixed $function, mixed $arguments = null, mixed $columns, boolean $overwrite = true )
$function mixed The function to execute.
$arguments mixed The arguments to pass to the function.
$columns mixed The column wherein the result will be printed.
$overwrite boolean Should the original value be overwritten.

setMassAction() public method

Sets the dropdown for the mass action
public setMassAction ( SpoonFormDropdown $actionDropDown )
$actionDropDown SpoonFormDropdown A dropdown-instance.

setMassActionCheckboxes() public method

Sets the checkboxes for the mass action
public setMassActionCheckboxes ( string $column, string $value, array $excludedValues = null, array $checkedValues = null )
$column string The name for the column that will hold the checkboxes.
$value string The value for the checkbox.
$excludedValues array The values that should be excluded.
$checkedValues array The values that should be checked.

setTooltip() public method

Set a tooltip
public setTooltip ( string $column, string $message )
$column string The name of the column to set the tooltop for.
$message string The key for the message (will be parsed through BackendLanguage::msg).

setURL() public method

Sets an URL, optionally only appending the provided piece
public setURL ( string $url, boolean $append = false )
$url string The URL to set.
$append boolean Should it be appended to the existing URL.