wCMF
3.6
|
Public Member Functions | |
initialize (&$request, &$response) | |
hasView () | |
executeKernel () | |
getOIDs () | |
getDisplayText (&$node) | |
modifyModel (&$nodes) | |
getLength () | |
updateNavigation ($startIndex, $length, $total) | |
reset () | |
Public Member Functions inherited from Controller | |
Controller (&$delegate) | |
initialize (&$request, &$response) | |
validate () | |
hasView () | |
execute () | |
executeKernel () | |
getErrorMsg () | |
setErrorMsg ($msg) | |
appendErrorMsg ($msg) | |
& | getRequest () |
& | getResponse () |
& | getView () |
& | getDelegate () |
getViewTemplate ($controller, $context, $action) | |
getCacheId () | |
assignViewDefaults (&$view) | |
isLocalizedRequest () | |
Public Attributes | |
$OIDS_SESSION_VARNAME = 'PagingController.oids' | |
$INDEX_SESSION_VARNAME = 'PagingController.index' | |
$_allOIDs = array() | |
$_curOIDs = array() | |
$_total = 0 | |
$_hasPrev = true | |
$_hasNext = true | |
$_startIndex = 0 | |
$_size = 0 | |
Public Attributes inherited from Controller | |
$_request = null | |
$_response = null | |
$_errorMsg = '' | |
$_view = null | |
$_delegate = null | |
PagingController is a controller that allows to navigate lists.
wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH
Licensed under the terms of any of the following licenses at your choice:
See the license.txt file distributed with this work for additional information.
This is accomplished by loading all object ids of the items to display at the first call and always assign a part of them to the view. The object ids are provided by the getOIDs() method that must be implemented by subclasses. The getLength() method provides the number of items to show per call (The default implementation returns 20).
Actions 'jump', 'prev' and 'next' are used to navigate the list. If an oid is given in the data passed to the controller the controller tries to position the list according to that oid.
A possible configuration could be:
Input actions:
Output actions:
[in] | oid | The object id of the first object to display |
[out] | nodes | Array of Nodes (The current package) |
[out] | hasPrev | True/False whether prev navigation is possible |
[out] | hasNext | True/False whether next navigation is possible |
[out] | total | Total number of Nodes |
[out] | index | The start position of the current package |
[out] | size | The size of the current package |
[out] | packageStartOids | Array of package start oids |
Definition at line 67 of file class.PagingController.php.
PagingController::initialize | ( | & | $request, |
& | $response | ||
) |
Definition at line 89 of file class.PagingController.php.
References $_curOIDs, SessionData\getInstance(), getLength(), getOIDs(), WCMFException\throwEx(), and updateNavigation().
Referenced by reset().
PagingController::hasView | ( | ) |
Definition at line 159 of file class.PagingController.php.
PagingController::executeKernel | ( | ) |
Do processing and assign Node data to View.
Definition at line 168 of file class.PagingController.php.
References ACTION_READ, BUILDDEPTH_SINGLE, DATATYPE_IGNORE, getDisplayText(), PersistenceFacade\getInstance(), RightsManager\getInstance(), getLength(), and modifyModel().
PagingController::getOIDs | ( | ) |
Get oids of all items to display.
Definition at line 214 of file class.PagingController.php.
References WCMFException\throwEx().
Referenced by initialize().
PagingController::getDisplayText | ( | & | $node | ) |
Get the text to display for a given node in the list. This text will be assigned to the value 'displaytext' (DATATYPE_IGNORE) in the node.
Definition at line 224 of file class.PagingController.php.
References WCMFException\throwEx().
Referenced by executeKernel().
PagingController::modifyModel | ( | & | $nodes | ) |
Modify the model passed to the view.
nodes | A reference to the array of node references passed to the view |
Definition at line 233 of file class.PagingController.php.
Referenced by executeKernel().
PagingController::getLength | ( | ) |
Get the number of items to show per call.
Definition at line 240 of file class.PagingController.php.
Referenced by executeKernel(), and initialize().
PagingController::updateNavigation | ( | $startIndex, | |
$length, | |||
$total | |||
) |
Set the navigation variables (hasPrev, hasNext) according to the current position
startIndex | The position of the first item |
length | The number of items to show |
total | The number of all items |
Definition at line 250 of file class.PagingController.php.
Referenced by initialize().
PagingController::reset | ( | ) |
Resets the list (retrieves the oids, ...)
Definition at line 267 of file class.PagingController.php.
References SessionData\getInstance(), and initialize().
Referenced by NodeListController\initialize().
PagingController::$OIDS_SESSION_VARNAME = 'PagingController.oids' |
Definition at line 70 of file class.PagingController.php.
PagingController::$INDEX_SESSION_VARNAME = 'PagingController.index' |
Definition at line 71 of file class.PagingController.php.
PagingController::$_allOIDs = array() |
Definition at line 74 of file class.PagingController.php.
PagingController::$_curOIDs = array() |
Definition at line 76 of file class.PagingController.php.
Referenced by initialize().
PagingController::$_total = 0 |
Definition at line 79 of file class.PagingController.php.
PagingController::$_hasPrev = true |
Definition at line 81 of file class.PagingController.php.
PagingController::$_hasNext = true |
Definition at line 82 of file class.PagingController.php.
PagingController::$_startIndex = 0 |
Definition at line 83 of file class.PagingController.php.
PagingController::$_size = 0 |
Definition at line 84 of file class.PagingController.php.