Property | Type | Description | |
---|---|---|---|
$_actions | Grid actions. The first key represents the position of the action in the grid, the second key represents the action id. | ||
$_columns | The GridColumns of this grid. | ||
$_data | The grid's data source. | ||
$_dataProvider | GridDataProvider | ||
$_emptyRowText | empty row locale key | ||
$_features | The grid features. | ||
$_footNote | Grid foot note locale key | ||
$_itemIterator | The item iterator to be used for paging. | ||
$_template | The grid template. | ||
$_title | grid title locale key | ||
$_urls | The urls that will be used in JS handler. |
Method | Description | |
---|---|---|
__construct ( $dataProvider = null ) | Constructor. | |
addAction ( $action, $position = GRID_ACTION_POSITION_ABOVE ) | Add an action. | |
addColumn ( $column ) | Add a column. | |
authorize ( $request, &$args, $roleAssignments, $enforceRestrictedSite = true ) | ||
fetchCell ( &$args, $request ) : JSONMessage | Render a cell and send it to the client | |
fetchGrid ( $args, $request ) : JSONMessage | Render the entire grid controller and send it to the client. | |
fetchRow ( &$args, $request ) : JSONMessage | Render a row and send it to the client. If the row no longer exists then inform the client. | |
fetchRows ( $args, $request ) : JSONMessage | Fetch all grid rows from loaded data. | |
getActions ( $position = GRID_ACTION_POSITION_ABOVE ) : array | Get all actions for a given position within the grid. | |
getColumn ( $columnId ) : GridColumn | Retrieve a single column by id. | |
getColumns ( ) : array | Get all columns. | |
getColumnsByFlag ( $flag ) : array | Get columns by flag. | |
getColumnsCount ( $flag = null ) : integer | Get columns number. If a flag is passed, the columns using it will not be counted. | |
getDataElementSequence ( &$gridDataElement ) : integer | Override to return the data element sequence value. | |
getDataProvider ( ) : FilesGridDataProvider | Get the data provider. | |
getEmptyRowText ( ) | Get the no items locale key | |
getFeatures ( ) : array | Get all grid attached features. | |
getFootNote ( ) : string | Get the grid foot note. | |
getGridDataElements ( $request ) : array | Get the grid data. | |
getGridRangeInfo ( $request, $rangeName, $contextData = null ) : DBResultRange | Get grid range info. | |
getIsSubcomponent ( ) : boolean | Override this method to return true if you want to use the grid within another component (e.g. to remove the title or change the layout accordingly). | |
getItemIterator ( ) : ItemIterator | Get the item iterator that represents this grid data. | |
getJSHandler ( ) : string | Get the js handler for this component. | |
getPublishChangeEvents ( ) : array | Get "publish data changed" event list. | |
getRequestArg ( $key ) : mixed | Get a single grid request parameter. | |
getRequestArgs ( ) : array | Get the grid request parameters. These are the parameters that uniquely identify the data within a grid. | |
getRequestedRow ( $request, $args ) : GridRow | Tries to identify the data element in the grids data source that corresponds to the requested row id. | |
getSelectName ( ) : string | Get the select parameter name to store the selected files. | |
getTemplate ( ) : string | Get the grid template. | |
getTitle ( ) : string | Get the grid title. | |
getUrls ( ) : array | Return all grid urls that will be used in JS handler. | |
hasColumn ( $columnId ) : boolean | Checks whether a column exists. | |
hasGridDataElements ( $request ) : boolean | Check whether the grid has rows. | |
initialize ( $request, $args = null ) | ||
isDataElementSelected ( $gridDataElement ) : boolean | Returns the current selection state of the grid data element. | |
renderRow ( $request, $row ) : string | Render the passed row and return its markup. | |
saveSequence ( $args, $request ) : JSONMessage | Hook oportunity for grid features to request a save items sequence operation. If no grid feature that implements the saveSequence hook is attached to this grid, this operation will only return the data changed event json message. | |
setDataElementSequence ( $request, $rowId, &$gridDataElement, $newSequence ) | Override to set the data element new sequence. | |
setEmptyRowText ( $emptyRowText ) | Set the no items locale key | |
setFootNote ( $footNote ) | Set the grid foot note. | |
setGridDataElements ( $data ) | Set the grid data. | |
setTemplate ( $template ) | Set the grid template. | |
setTitle ( $title ) | Set the grid title. | |
setUrls ( $request, $extraUrls = [] ) | Define the urls that will be used in JS handler. |
Method | Description | |
---|---|---|
callFeaturesHook ( $hookName, $args ) | Call the passed hook in all attached features. | |
doSpecificFetchGridActions ( $args, $request, $templateMgr ) | Override this method if your subclass needs to perform different actions than the ones implemented here. | |
getDataElementFromRequest ( $request, &$elementId ) : object | Create a data element from a request. This is used to format new rows prior to their insertion or existing rows that have been edited but not saved. | |
getFilterForm ( ) : Form | string | Returns a Form object or the path name of a filter template. | |
getFilterSelectionData ( $request ) : array | Method that extracts the user's filter selection from the request either by instantiating the filter's Form object or by reading the request directly (if using a simple filter template only). | |
getRowDataElement ( $request, &$rowId ) : mixed | Retrieve a single data element from the grid's data source corresponding to the given row id. If none is found then return null. | |
getRowInstance ( ) : GridRow | Get a new instance of a grid row. May be overridden by subclasses if they want to provide a custom row definition. | |
getRowsSequence ( $request ) : array | Return the sequence map of the current loaded grid items. | |
initFeatures ( $request, &$args ) : array | Override to init grid features. | |
isFilterFormCollapsible ( ) : boolean | Determine whether a filter form should be collapsible. | |
loadData ( $request, $filter ) : grid | Implement this method to load data into the grid. | |
noAutocompleteResults ( ) : JSONMessage | Returns a common 'no matches' result when subclasses find no results for AJAX autocomplete requests. | |
renderFilter ( $request, $filterData = [] ) : string | Render the filter (a template or a Form). | |
renderGridBodyPartsInternally ( Request $request ) : array | Method that renders tbodys to go in the grid main body. | |
renderRowInternally ( $request, $row ) : string | Method that renders a single row. | |
renderRowsInternally ( $request, &$elements ) : array | Cycle through the data and get generate the row HTML. | |
setFirstDataColumn ( ) | Define the first column that will contain grid data. |
Method | Description | |
---|---|---|
_addFeatures ( $features ) | Add grid features. | |
_fixColumnWidths ( ) | Method that grabs all the existing columns and makes sure the column widths add to exactly 100 N.B. We do some extra column fetching because PHP makes copies of arrays with foreach. | |
_getInitializedRowInstance ( $request, $elementId, &$element, $isModified = false ) : GridRow | Instantiate a new row. | |
_renderCellInternally ( $request, $row, $column ) : string | Method that renders a cell. |
public __construct ( $dataProvider = null ) | ||
$dataProvider | GridDataProvider An optional data provider for the grid. If no data provider is given then the grid assumes that child classes will override default method implementations. |
public addAction ( $action, $position = GRID_ACTION_POSITION_ABOVE ) | ||
$action | Mixed a single action. | |
$position | string The position of the action. |
public addColumn ( $column ) | ||
$column | mixed A single GridColumn instance. |
public authorize ( $request, &$args, $roleAssignments, $enforceRestrictedSite = true ) |
protected callFeaturesHook ( $hookName, $args ) | ||
$hookName | string | |
$args | array Arguments provided by this handler. |
protected doSpecificFetchGridActions ( $args, $request, $templateMgr ) | ||
$args | array | |
$request | Request |
public fetchCell ( &$args, $request ) : JSONMessage | ||
$args | array | |
$request | Request | |
return | JSONMessage | JSON object |
public fetchGrid ( $args, $request ) : JSONMessage | ||
$args | array | |
$request | Request | |
return | JSONMessage | JSON object |
public fetchRow ( &$args, $request ) : JSONMessage | ||
$args | array | |
$request | Request | |
return | JSONMessage | JSON object. |
public fetchRows ( $args, $request ) : JSONMessage | ||
$args | Array | |
$request | Request | |
return | JSONMessage | JSON object. |
public getActions ( $position = GRID_ACTION_POSITION_ABOVE ) : array | ||
$position | string The position of the actions. | |
return | array | The LinkActions for the given position. |
public getColumn ( $columnId ) : GridColumn | ||
$columnId | ||
return | GridColumn |
public getColumns ( ) : array | ||
return | array | An array of GridColumn instances. |
public getColumnsByFlag ( $flag ) : array | ||
$flag | string | |
return | array |
public getColumnsCount ( $flag = null ) : integer | ||
$flag | optional string | |
return | integer |
protected getDataElementFromRequest ( $request, &$elementId ) : object | ||
$request | PKPRequest | |
$elementId | int Reference to be filled with element ID (if one is to be used) | |
return | object |
public getDataElementSequence ( &$gridDataElement ) : integer | ||
$gridDataElement | mixed | |
return | integer |
public getDataProvider ( ) : FilesGridDataProvider | ||
return | FilesGridDataProvider |
public getFeatures ( ) : array | ||
return | array |
protected getFilterForm ( ) : Form | string | ||
return | Form | string |
protected getFilterSelectionData ( $request ) : array | ||
$request | PKPRequest | |
return | array |
public getFootNote ( ) : string | ||
return | string | locale key |
public getGridDataElements ( $request ) : array | ||
$request | PKPRequest | |
return | array |
public getGridRangeInfo ( $request, $rangeName, $contextData = null ) : DBResultRange | ||
$request | PKPRequest | |
$rangeName | string The grid id. | |
$contextData | mixed | |
return | DBResultRange |
public getIsSubcomponent ( ) : boolean | ||
return | boolean |
public getItemIterator ( ) : ItemIterator | ||
return | ItemIterator |
public getJSHandler ( ) : string | ||
return | string |
public getPublishChangeEvents ( ) : array | ||
return | array |
public getRequestArg ( $key ) : mixed | ||
$key | string The name of the parameter to retrieve. | |
return | mixed |
public getRequestArgs ( ) : array | ||
return | array |
public getRequestedRow ( $request, $args ) : GridRow | ||
$request | PKPRequest | |
$args | array | |
return | GridRow | the requested grid row, already configured with id and data or null if the row could not been found. |
protected getRowDataElement ( $request, &$rowId ) : mixed | ||
$rowId | string The row ID; reference permits modification. | |
return | mixed |
protected getRowInstance ( ) : GridRow | ||
return | GridRow |
protected getRowsSequence ( $request ) : array | ||
$request | PKPRequest | |
return | array |
public getSelectName ( ) : string | ||
return | string |
public hasGridDataElements ( $request ) : boolean | ||
return | boolean |
protected initFeatures ( $request, &$args ) : array | ||
$request | Request | |
$args | array | |
return | array | Array with initialized grid features objects. |
public initialize ( $request, $args = null ) | ||
$request | PKPRequest | |
$args | array optional |
public isDataElementSelected ( $gridDataElement ) : boolean | ||
$gridDataElement | mixed | |
return | boolean |
protected isFilterFormCollapsible ( ) : boolean | ||
return | boolean |
protected loadData ( $request, $filter ) : grid | ||
$request | Request | |
$filter | array An associative array with filter data as returned by getFilterSelectionData(). If no filter has been selected by the user then the array will be empty. | |
return | grid | data |
protected noAutocompleteResults ( ) : JSONMessage | ||
return | JSONMessage | JSON object |
protected renderFilter ( $request, $filterData = [] ) : string | ||
$request | PKPRequest | |
$filterData | Array Data to be used by the filter template. | |
return | string |
protected renderGridBodyPartsInternally ( Request $request ) : array | ||
$request | Request | |
return | array |
protected renderRowInternally ( $request, $row ) : string | ||
$request | PKPRequest | |
$row | GridRow | |
return | string | the row HTML |
protected renderRowsInternally ( $request, &$elements ) : array | ||
$request | PKPRequest | |
$elements | array The grid data elements to be rendered. | |
return | array | of HTML Strings for Grid Rows. |
public saveSequence ( $args, $request ) : JSONMessage | ||
$args | array | |
$request | Request | |
return | JSONMessage | JSON object |
public setDataElementSequence ( $request, $rowId, &$gridDataElement, $newSequence ) | ||
$request | PKPRequest | |
$rowId | int | |
$gridDataElement | mixed | |
$newSequence | int |
public setEmptyRowText ( $emptyRowText ) |
protected setFirstDataColumn ( ) |
public setFootNote ( $footNote ) | ||
$footNote | string locale key |
public setGridDataElements ( $data ) | ||
$data | mixed an array or ItemIterator with element data |
public setTemplate ( $template ) | ||
$template | string |
public setUrls ( $request, $extraUrls = [] ) | ||
$request | Request | |
$extraUrls | array Optional extra urls. |
public $_actions |