Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
GridHandler Class Reference
Inheritance diagram for GridHandler:
PKPHandler AddThisStatisticsGridHandler AnnouncementGridHandler ApprovedProofFilesGridHandler AuthorSignoffFilesGridHandler CategoryGridHandler ContextGridHandler ExportableUsersGridHandler IdentificationCodeGridHandler LanguageGridHandler ListbuilderHandler ManageSocialMediaGridHandler MarketsGridHandler NotificationsGridHandler PKPAuthorGridHandler PKPFilterGridHandler PublicationDateGridHandler PublicationFormatGridHandler ReviewerSelectGridHandler SalesRightsGridHandler ServerInfoGridHandler SetupGridHandler SubmissionEventLogGridHandler SubmissionFilesGridHandler SubmissionsListGridHandler UserGridHandler VersionInfoGridHandler

Public Member Functions

 addAction ($action, $position=GRID_ACTION_POSITION_ABOVE)
 
 addColumn ($column)
 
 authorize ($request, &$args, $roleAssignments, $enforceRestrictedSite=true)
 
 fetchCell (&$args, $request)
 
 fetchGrid ($args, $request)
 
 fetchRow (&$args, $request)
 
 getActions ($position=GRID_ACTION_POSITION_ABOVE)
 
 getColumn ($columnId)
 
getColumns ()
 
getColumnsByFlag ($flag)
 
 getColumnsCount ($flag)
 
 getDataElementSequence (&$gridDataElement)
 
 getDataProvider ()
 
 getEmptyRowText ()
 
 getFeatures ()
 
 getFootNote ()
 
getGridDataElements ($request)
 
 getGridRangeInfo ($request, $rangeName, $contextData=null)
 
 getInstructions ()
 
 getIsSubcomponent ()
 
 getItemIterator ()
 
 getJSHandler ()
 
 getPublishChangeEvents ()
 
 getRequestArg ($key)
 
 getRequestArgs ()
 
 getRequestedRow ($request, $args)
 
 getSelectName ()
 
 getTemplate ()
 
 getTitle ()
 
 getUrls ()
 
 GridHandler ($dataProvider=null)
 
 hasColumn ($columnId)
 
 hasGridDataElements ($request)
 
 initialize ($request, $args=null)
 
 isDataElementSelected ($gridDataElement)
 
 renderRow ($request, $row)
 
 saveSequence ($args, $request)
 
 setDataElementSequence ($request, $rowId, &$gridDataElement, $newSequence)
 
 setEmptyRowText ($emptyRowText)
 
 setFootNote ($footNote)
 
 setGridDataElements ($data)
 
 setInstructions ($instructions)
 
 setTemplate ($template)
 
 setTitle ($title)
 
 setUrls ($request, $extraUrls=array())
 
- Public Member Functions inherited from PKPHandler
 addCheck (&$handlerValidator)
 
 addPolicy ($authorizationPolicy, $addToTop=false)
 
 addRoleAssignment ($roleIds, $operations)
 
 authorize ($request, &$args, $roleAssignments, $enforceRestrictedSite=true)
 
getAuthorizedContext ()
 
getAuthorizedContextObject ($assocType)
 
getDispatcher ()
 
 getFirstUserContext ($user, $contexts)
 
 getId ()
 
 getLastAuthorizationMessage ()
 
 getLoginExemptions ()
 
 getRoleAssignment ($roleId)
 
 getRoleAssignments ()
 
 getWorkingContexts ($request)
 
 index ($args, $request)
 
 initialize ($request, $args=null)
 
 PKPHandler ()
 
 setDispatcher ($dispatcher)
 
 setId ($id)
 
 setupTemplate ($request)
 
 validate ($requiredContexts=null, $request=null)
 

Public Attributes

 $_actions = array(GRID_ACTION_POSITION_DEFAULT => array())
 
 $_columns = array()
 
 $_data
 
 $_emptyRowText = 'grid.noItems'
 
 $_features
 
 $_footNote = ''
 
 $_instructions = ''
 
 $_itemIterator
 
 $_template
 
 $_title = ''
 
 $_urls
 
- Public Attributes inherited from PKPHandler
 $_authorizationDecisionManager
 
 $_checks = array()
 
 $_dispatcher
 
 $_id
 
 $_roleAssignments = array()
 

Protected Member Functions

 callFeaturesHook ($hookName, $args)
 
 doSpecificFetchGridActions ($args, $request, $templateMgr)
 
getDataElementFromRequest ($request, &$elementId)
 
 getFilterForm ()
 
 getFilterSelectionData ($request)
 
 getRowDataElement ($request, $rowId)
 
 getRowInstance ()
 
 getRowsSequence ($request)
 
 initFeatures ($request, &$args)
 
 loadData ($request, $filter)
 
 noAutocompleteResults ()
 
 renderFilter ($request, $filterData=array())
 
 renderGridBodyPartsInternally ($request)
 
 renderRowInternally ($request, $row)
 
 renderRowsInternally ($request, &$elements)
 
 setFirstDataColumn ()
 

Additional Inherited Members

- Static Public Member Functions inherited from PKPHandler
static getPageParamName ($rangeName)
 
static getRangeInfo ($request, $rangeName, $contextData=null)
 
static hashPageContext ($request, $contextData=array())
 

Detailed Description

Class defining basic operations for handling HTML grids.

Definition at line 35 of file GridHandler.inc.php.

Member Function Documentation

GridHandler::authorize (   $request,
$args,
  $roleAssignments,
  $enforceRestrictedSite = true 
)

Authorize this request.

Routers will call this method automatically thereby enforcing authorization. This method will be called before the validate() method and before passing control on to the handler operation.

NB: This method will be called once for every request only.

Parameters
$requestRequest
$argsarray request arguments
$roleAssignmentsarray the operation role assignment, see getRoleAssignment() for more details.
$enforceRestrictedSiteboolean True iff site restrictions are to be enforced
Returns
boolean

Definition at line 596 of file GridHandler.inc.php.

References renderFilter(), and setUrls().

GridHandler::callFeaturesHook (   $hookName,
  $args 
)
protected

Call the passed hook in all attached features.

Parameters
$hookNamestring
$argsarray Arguments provided by this handler.

Definition at line 947 of file GridHandler.inc.php.

Referenced by getGridRangeInfo().

GridHandler::doSpecificFetchGridActions (   $args,
  $request,
  $templateMgr 
)
protected

Override this method if your subclass needs to perform different actions than the ones implemented here. This method is called by GridHandler::fetchGrid()

Parameters
$argsarray
$requestRequest

Definition at line 908 of file GridHandler.inc.php.

GridHandler::fetchCell ( $args,
  $request 
)

Render a cell and send it to the client

Parameters
$argsarray
$requestRequest
Returns
string the serialized cell JSON message

Definition at line 712 of file GridHandler.inc.php.

GridHandler::fetchGrid (   $args,
  $request 
)

Render the entire grid controller and send it to the client.

Parameters
$argsarray
$requestRequest
Returns
string the serialized grid JSON message

Definition at line 641 of file GridHandler.inc.php.

GridHandler::fetchRow ( $args,
  $request 
)

Render a row and send it to the client. If the row no longer exists then inform the client.

Parameters
$argsarray
$requestRequest
Returns
string the serialized row JSON message or a flag that indicates that the row has not been found.

Definition at line 681 of file GridHandler.inc.php.

GridHandler::getActions (   $position = GRID_ACTION_POSITION_ABOVE)

Get all actions for a given position within the grid.

Parameters
$positionstring The position of the actions.
Returns
array The LinkActions for the given position.

Definition at line 247 of file GridHandler.inc.php.

GridHandler::getColumn (   $columnId)

Retrieve a single column by id.

Parameters
$columnId
Returns
GridColumn

Definition at line 275 of file GridHandler.inc.php.

Referenced by MySubmissionsListGridHandler\initialize(), and FairCopyFilesGridHandler\initialize().

& GridHandler::getColumns ( )

Get all columns.

Returns
array An array of GridColumn instances.

Definition at line 266 of file GridHandler.inc.php.

& GridHandler::getColumnsByFlag (   $flag)

Get columns by flag.

Parameters
$flagstring
Returns
array

Definition at line 285 of file GridHandler.inc.php.

GridHandler::getColumnsCount (   $flag)

Get columns number. If a flag is passed, the columns using it will not be counted.

Parameters
$flagstring
Returns
int

Definition at line 302 of file GridHandler.inc.php.

References loadData(), and setGridDataElements().

& GridHandler::getDataElementFromRequest (   $request,
$elementId 
)
protected

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.

Parameters
$requestPKPRequest
$elementIdint Reference to be filled with element ID (if one is to be used)
Returns
object

Definition at line 787 of file GridHandler.inc.php.

GridHandler::getDataElementSequence ( $gridDataElement)

Override to return the data element sequence value.

Parameters
$gridDataElementmixed
Returns
int

Definition at line 481 of file GridHandler.inc.php.

References getRowDataElement().

GridHandler::getEmptyRowText ( )

Get the no items locale key

Definition at line 199 of file GridHandler.inc.php.

GridHandler::getFeatures ( )

Get all grid attached features.

Returns
array

Definition at line 445 of file GridHandler.inc.php.

GridHandler::getFilterForm ( )
protected

Returns a Form object or the path name of a filter template.

Returns
Form|string

Definition at line 833 of file GridHandler.inc.php.

GridHandler::getFilterSelectionData (   $request)
protected

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).

Parameters
$requestPKPRequest
Returns
array

Definition at line 844 of file GridHandler.inc.php.

GridHandler::getFootNote ( )

Get the grid foot note.

Returns
string locale key

Definition at line 230 of file GridHandler.inc.php.

References $_columns.

GridHandler::getInstructions ( )

Get the grid instructions.

Returns
string locale key

Definition at line 214 of file GridHandler.inc.php.

GridHandler::getIsSubcomponent ( )

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).

Returns
boolean

Definition at line 437 of file GridHandler.inc.php.

GridHandler::getItemIterator ( )

Get the item iterator that represents this grid data. Should only be used for retriving paging data. See #6498.

Returns
ItemIterator

Definition at line 455 of file GridHandler.inc.php.

GridHandler::getJSHandler ( )

Get the js handler for this component.

Returns
string

Definition at line 746 of file GridHandler.inc.php.

GridHandler::getPublishChangeEvents ( )

Get "publish data changed" event list.

Returns
array

Definition at line 463 of file GridHandler.inc.php.

GridHandler::getRequestArg (   $key)

Get a single grid request parameter.

See Also
getRequestArgs()
Parameters
$keystring The name of the parameter to retrieve.
Returns
mixed

Definition at line 174 of file GridHandler.inc.php.

Referenced by EditorReviewFilesGridHandler\selectFiles().

GridHandler::getRequestArgs ( )

Get the grid request parameters. These are the parameters that uniquely identify the data within a grid.

NB: You should make sure to authorize and/or validate parameters before you publish them through this interface. Callers will assume that data accessed through this method will not have to be sanitized.

The default implementation tries to retrieve request parameters from a data provider if there is one.

Returns
array

Definition at line 155 of file GridHandler.inc.php.

GridHandler::getRequestedRow (   $request,
  $args 
)

Tries to identify the data element in the grids data source that corresponds to the requested row id. Raises a fatal error if such an element cannot be found.

Parameters
$requestPKPRequest
$argsarray
Returns
GridRow the requested grid row, already configured with id and data or null if the row could not been found.

Definition at line 529 of file GridHandler.inc.php.

GridHandler::getRowDataElement (   $request,
  $rowId 
)
protected

Retrieve a single data element from the grid's data source corresponding to the given row id. If none is found then return null.

Parameters
$rowId
Returns
mixed

Definition at line 798 of file GridHandler.inc.php.

Referenced by GenreGridHandler\_getGenreFromArgs(), and getDataElementSequence().

GridHandler::getRowInstance ( )
protected

Get a new instance of a grid row. May be overridden by subclasses if they want to provide a custom row definition.

Returns
GridRow

Definition at line 773 of file GridHandler.inc.php.

GridHandler::getRowsSequence (   $request)
protected

Return the sequence map of the current loaded grid items. This is not the sequence value of the data represented by the row, it's just the mapping of the rows sequence, in the order that they are loaded. To handle grid items ordering, see OrderItemsFeature class.

Parameters
$requestPKPRequest
Returns
array

Definition at line 762 of file GridHandler.inc.php.

References getGridDataElements().

GridHandler::getSelectName ( )

Get the select parameter name to store the selected files.

Returns
string

Definition at line 514 of file GridHandler.inc.php.

GridHandler::getTemplate ( )

Get the grid template.

Returns
string

Definition at line 390 of file GridHandler.inc.php.

GridHandler::getTitle ( )

Get the grid title.

Returns
string locale key

Definition at line 184 of file GridHandler.inc.php.

GridHandler::getUrls ( )

Return all grid urls that will be used in JS handler.

Returns
array

Definition at line 411 of file GridHandler.inc.php.

GridHandler::GridHandler (   $dataProvider = null)

Constructor.

Parameters
$dataProviderGridDataProvider 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.

Definition at line 121 of file GridHandler.inc.php.

GridHandler::hasColumn (   $columnId)

Checks whether a column exists.

Parameters
$columnId
Returns
boolean

Definition at line 318 of file GridHandler.inc.php.

Referenced by FairCopyFilesGridHandler\initialize().

GridHandler::hasGridDataElements (   $request)

Check whether the grid has rows.

Returns
boolean

Definition at line 360 of file GridHandler.inc.php.

GridHandler::initFeatures (   $request,
$args 
)
protected

Override to init grid features. This method is called by GridHandler::initialize() method that use the returned array with the initialized features to add them to grid.

Parameters
$requestRequest
$argsarray
Returns
array Array with initialized grid features objects.

Definition at line 938 of file GridHandler.inc.php.

Referenced by getGridRangeInfo().

GridHandler::initialize (   $request,
  $args = null 
)
See Also
PKPHandler::initialize()
Parameters
$requestPKPRequest
$argsarray optional

Definition at line 617 of file GridHandler.inc.php.

GridHandler::isDataElementSelected (   $gridDataElement)

Returns the current selection state of the grid data element.

Parameters
$gridDataElementmixed
Returns
boolean

Definition at line 505 of file GridHandler.inc.php.

GridHandler::loadData (   $request,
  $filter 
)
protected

Implement this method to load data into the grid.

Parameters
$requestRequest
$filterarray 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.
Returns
grid data

Definition at line 815 of file GridHandler.inc.php.

Referenced by getColumnsCount().

GridHandler::noAutocompleteResults ( )
protected

Returns a common 'no matches' result when subclasses find no results for AJAX autocomplete requests.

Returns
string Serialized JSON object

Definition at line 893 of file GridHandler.inc.php.

GridHandler::renderFilter (   $request,
  $filterData = array() 
)
protected

Render the filter (a template or a Form).

Parameters
$requestPKPRequest
$filterDataArray Data to be used by the filter template.
Returns
string

Definition at line 854 of file GridHandler.inc.php.

Referenced by authorize().

GridHandler::renderGridBodyPartsInternally (   $request)
protected

Method that renders tbodys to go in the grid main body.

Parameters
Request$request
Returns
array

Definition at line 1015 of file GridHandler.inc.php.

GridHandler::renderRow (   $request,
  $row 
)

Render the passed row and return its markup.

Parameters
$requestPKPRequest
$rowGridRow
Returns
string

Definition at line 569 of file GridHandler.inc.php.

References PKPHandler\getAuthorizedContext().

GridHandler::renderRowInternally (   $request,
  $row 
)
protected

Method that renders a single row.

NB: You must have initialized the row before you call this method.

Parameters
$requestPKPRequest
$rowGridRow
Returns
string the row HTML

Definition at line 991 of file GridHandler.inc.php.

GridHandler::renderRowsInternally (   $request,
$elements 
)
protected

Cycle through the data and get generate the row HTML.

Parameters
$requestPKPRequest
$elementsarray The grid data elements to be rendered.
Returns
array of HTML Strings for Grid Rows.

Definition at line 966 of file GridHandler.inc.php.

GridHandler::saveSequence (   $args,
  $request 
)

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.

Parameters
$argsarray
$requestRequest

Definition at line 736 of file GridHandler.inc.php.

GridHandler::setDataElementSequence (   $request,
  $rowId,
$gridDataElement,
  $newSequence 
)

Override to set the data element new sequence.

Parameters
$requestPKPRequest
$rowIdint
$gridDataElementmixed
$newSequenceint

Definition at line 492 of file GridHandler.inc.php.

GridHandler::setEmptyRowText (   $emptyRowText)
GridHandler::setFirstDataColumn ( )
protected

Define the first column that will contain grid data.

Override this method to define a different column than the first one.

Definition at line 923 of file GridHandler.inc.php.

GridHandler::setFootNote (   $footNote)

Set the grid foot note.

Parameters
$footNotestring locale key

Definition at line 238 of file GridHandler.inc.php.

GridHandler::setGridDataElements (   $data)

Set the grid data.

Parameters
$datamixed an array or ItemIterator with element data

Definition at line 370 of file GridHandler.inc.php.

Referenced by getColumnsCount(), and ViewAnnouncementGridHandler\initialize().

GridHandler::setTemplate (   $template)

Set the grid template.

Parameters
$templatestring

Definition at line 402 of file GridHandler.inc.php.

Referenced by ListbuilderHandler\initialize(), and MultipleListsListbuilderHandler\MultipleListsListbuilderHandler().

GridHandler::setTitle (   $title)

Set the grid title.

Parameters
$titlestring locale key

Definition at line 192 of file GridHandler.inc.php.

Referenced by AuthorCopyeditingSignoffFilesGridHandler\AuthorCopyeditingSignoffFilesGridHandler(), PKPAuthorGridHandler\authorize(), PublicationFormatGridHandler\authorize(), MarketsGridHandler\authorize(), IdentificationCodeGridHandler\authorize(), PublicationDateGridHandler\authorize(), SalesRightsGridHandler\authorize(), AuthorReviewAttachmentsGridHandler\AuthorReviewAttachmentsGridHandler(), AuthorReviewRevisionsGridHandler\AuthorReviewRevisionsGridHandler(), EditorReviewFilesGridHandler\EditorReviewFilesGridHandler(), EditorSelectableReviewAttachmentsGridHandler\EditorSelectableReviewAttachmentsGridHandler(), EditorSubmissionDetailsFilesGridHandler\EditorSubmissionDetailsFilesGridHandler(), FinalDraftFilesGridHandler\FinalDraftFilesGridHandler(), MySubmissionsListGridHandler\getSubmissions(), SubmissionChecklistGridHandler\initialize(), AuthorProofingSignoffFilesGridHandler\initialize(), LanguageGridHandler\initialize(), SubmissionDetailsFilesGridHandler\initialize(), BlockPluginsListbuilderHandler\initialize(), AssignedSubmissionsListGridHandler\initialize(), UnassignedSubmissionsListGridHandler\initialize(), PluginGridHandler\initialize(), CopyeditingFilesListbuilderHandler\initialize(), ProofFilesListbuilderHandler\initialize(), ArchivedSubmissionsListGridHandler\initialize(), ProductionReadyFilesGridHandler\initialize(), FairCopyFilesGridHandler\initialize(), ExportableUsersGridHandler\initialize(), ServerInfoGridHandler\initialize(), VersionInfoGridHandler\initialize(), SystemInfoGridHandler\initialize(), UserGridHandler\initialize(), UserGroupGridHandler\initialize(), NotifyUsersListbuilderHandler\initialize(), CategoryCategoryGridHandler\initialize(), LimitReviewFilesGridHandler\LimitReviewFilesGridHandler(), ManageFinalDraftFilesGridHandler\ManageFinalDraftFilesGridHandler(), ReviewerReviewAttachmentsGridHandler\ReviewerReviewAttachmentsGridHandler(), ReviewerReviewFilesGridHandler\ReviewerReviewFilesGridHandler(), SelectableCopyeditingFilesGridHandler\SelectableCopyeditingFilesGridHandler(), SelectableReviewRevisionsGridHandler\SelectableReviewRevisionsGridHandler(), SelectableSubmissionDetailsFilesGridHandler\SelectableSubmissionDetailsFilesGridHandler(), SubmissionWizardFilesGridHandler\SubmissionWizardFilesGridHandler(), and WorkflowReviewRevisionsGridHandler\WorkflowReviewRevisionsGridHandler().

GridHandler::setUrls (   $request,
  $extraUrls = array() 
)

Define the urls that will be used in JS handler.

Parameters
$requestRequest
$extraUrlsarray Optional extra urls.

Definition at line 421 of file GridHandler.inc.php.

Referenced by authorize().

Member Data Documentation

array GridHandler::$_actions = array(GRID_ACTION_POSITION_DEFAULT => array())

Grid actions. The first key represents the position of the action in the grid, the second key represents the action id.

Definition at line 75 of file GridHandler.inc.php.

array GridHandler::$_columns = array()

The GridColumns of this grid.

Definition at line 81 of file GridHandler.inc.php.

Referenced by getFootNote().

Array GridHandler::$_data

The grid's data source.

Definition at line 87 of file GridHandler.inc.php.

string GridHandler::$_emptyRowText = 'grid.noItems'

empty row locale key

Definition at line 47 of file GridHandler.inc.php.

array GridHandler::$_features

The grid features.

Definition at line 111 of file GridHandler.inc.php.

string GridHandler::$_footNote = ''

Grid foot note locale key

Definition at line 59 of file GridHandler.inc.php.

string GridHandler::$_instructions = ''

Grid instructions locale key

Definition at line 53 of file GridHandler.inc.php.

ItemIterator GridHandler::$_itemIterator

The item iterator to be used for paging.

Definition at line 93 of file GridHandler.inc.php.

string GridHandler::$_template

The grid template.

Definition at line 99 of file GridHandler.inc.php.

Referenced by ListbuilderHandler\initialize().

string GridHandler::$_title = ''

grid title locale key

Definition at line 41 of file GridHandler.inc.php.

array GridHandler::$_urls

The urls that will be used in JS handler.

Definition at line 105 of file GridHandler.inc.php.


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