Detailed Description
SortController is used to change the order of nodes.
Nodes can either be sorted in a list of nodes of the same type (moveBefore action) or in a list of child nodes of a container node (insertBefore action).
The controller supports the following actions:
Parameter | Description |
---|---|
in insertOid | The object id of the object to insert/move |
in referenceOid | The object id of the object to insert the inserted object before. If the inserted object should be the last in the container order, the referenceOid contains the special value ORDER_BOTTOM |
Response Actions | |
ok | In all cases |
Parameter | Description |
---|---|
in containerOid | The oid of the container object |
in insertOid | The oid of the object to insert/move |
in referenceOid | The object id of the object to insert the inserted object before. If the inserted object should be the last in the container order, the referenceOid contains the special value ORDER_BOTTOM |
in role | The role, that the inserted object should have in the container object. |
Response Actions | |
ok | In all cases |
Definition at line 60 of file SortController.php.
Public Attributes | |
const | ORDER_BOTTOM = 'ORDER_BOTTOM' |
const | UNBOUND = 'UNBOUND' |
Public Attributes inherited from Controller | |
const | CSRF_TOKEN_PARAM = 'csrf_token' |
Protected Member Functions | |
validate () | |
doExecute ($method=null) | |
doMoveBefore () | |
doInsertBefore () | |
loadPreviousObject ($type, $sortkeyName, $sortkeyValue, $sortDirection) | |
loadLastObject ($type, $sortkeyName, $sortDirection) | |
checkObjects ($objectMap) | |
isOrderBotton ($request) | |
getSortkeyValue ($object, $valueName) | |
Protected Member Functions inherited from Controller | |
executeSubAction ($action) | |
redirect ($location, $key=null, $data=null) | |
getLogger () | |
getSession () | |
getPersistenceFacade () | |
getPermissionManager () | |
getActionMapper () | |
getLocalization () | |
getMessage () | |
getConfiguration () | |
requireTransaction () | |
endTransaction ($commit) | |
isLocalizedRequest () | |
checkLanguageParameter () | |
generateCsrfToken ($name, $refresh=true) | |
validateCsrfToken ($name, $invalidate=true) | |
getLocalSessionValue ($key, $default=null) | |
setLocalSessionValue ($key, $value) | |
clearLocalSessionValues () | |
Additional Inherited Members | |
Public Member Functions inherited from Controller | |
__construct (Session $session, PersistenceFacade $persistenceFacade, PermissionManager $permissionManager, ActionMapper $actionMapper, Localization $localization, Message $message, Configuration $configuration) | |
initialize (Request $request, Response $response) | |
execute ($method=null) | |
getRequest () | |
getResponse () | |
Member Function Documentation
◆ validate()
|
protected |
- See also
- Controller::validate()
Reimplemented from Controller.
Definition at line 68 of file SortController.php.
◆ doExecute()
|
protected |
- See also
- Controller::doExecute()
Reimplemented from Controller.
Definition at line 135 of file SortController.php.
◆ doMoveBefore()
|
protected |
Execute the moveBefore action.
Definition at line 154 of file SortController.php.
◆ doInsertBefore()
|
protected |
Execute the insertBefore action.
Definition at line 197 of file SortController.php.
◆ loadPreviousObject()
|
protected |
Load the object which order position is before the given sort value.
- Parameters
-
$type The type of objects $sortkeyName The name of the sortkey attribute $sortkeyValue The reference sortkey value $sortDirection The sort direction used with the sort key
Definition at line 249 of file SortController.php.
◆ loadLastObject()
|
protected |
Load the last object regarding the given sort key.
- Parameters
-
$type The type of objects $sortkeyName The name of the sortkey attribute $sortDirection The sort direction used with the sort key
Definition at line 264 of file SortController.php.
◆ checkObjects()
|
protected |
Check if all objects in the given array are not null and add an OID_INVALID error to the response, if at least one is.
- Parameters
-
$objectMap An associative array with the controller parameter names as keys and the objects to check as values
- Returns
- Boolean
Definition at line 279 of file SortController.php.
◆ isOrderBotton()
|
protected |
Check if the node should be moved to the bottom of the list.
- Parameters
-
$request The request
- Returns
- Boolean
Definition at line 300 of file SortController.php.
◆ getSortkeyValue()
|
protected |
Get the sortkey value of an object.
Defaults to the object's id, if the value is null
- Parameters
-
$object The object $valueName The name of the sortkey attribute
- Returns
- String
Definition at line 311 of file SortController.php.
Member Data Documentation
◆ ORDER_BOTTOM
const ORDER_BOTTOM = 'ORDER_BOTTOM' |
Definition at line 62 of file SortController.php.
◆ UNBOUND
const UNBOUND = 'UNBOUND' |
Definition at line 63 of file SortController.php.