Abstract controller for admin actions.
Controllers should implement methods named actionX with no arguments. These will be called by the dispatcher based on the requested route. They should return the object returned by responseReroute(), responseError(), or responseView(),.
All responses can take paramaters that will be passed to the container view (ie, two-phase view), if there is one.
package | XenForo_Mvc |
---|
__construct(\Zend_Controller_Request_Http $request, \Zend_Controller_Response_Http $response, \XenForo_RouteMatch $routeMatch)
inherited_from | \XenForo_Controller::__construct() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::__construct() |
\Zend_Controller_Request_Http
\Zend_Controller_Response_Http
\XenForo_RouteMatch
actionAdmin()
actionModerator()
actionServerError()
actionServerErrorClear()
actionServerErrorDelete()
assertAdmin()
inherited_from | \XenForo_ControllerAdmin_Abstract::assertAdmin() |
---|
assertAdminPermission(string $permissionId)
inherited_from | \XenForo_ControllerAdmin_Abstract::assertAdminPermission() |
---|
string
assertDebugMode()
inherited_from | \XenForo_ControllerAdmin_Abstract::assertDebugMode() |
---|
assertSuperAdmin()
inherited_from | \XenForo_ControllerAdmin_Abstract::assertSuperAdmin() |
---|
canUpdateSessionActivity(string $controllerName, string $action, string $newState) : boolean
Override this in specific controllers if you want action-specific behaviour.
inherited_from | \XenForo_Controller::canUpdateSessionActivity() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::canUpdateSessionActivity() |
string
string
string
boolean
canonicalizePageNumber(integer $page, integer $perPage, integer $total, string $linkType, mixed $linkData)
If it's not valid, the page is redirected to the last valid page (via a response exception).
inherited_from | \XenForo_Controller::canonicalizePageNumber() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::canonicalizePageNumber() |
integer
integer
integer
string
mixed
canonicalizeRequestUrl(string $linkUrl)
Canonicalization will only happen when requesting an HTML page, as it is primarily an SEO benefit.
A response exception will be thrown is redirection is required.
inherited_from | \XenForo_Controller::canonicalizeRequestUrl() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::canonicalizeRequestUrl() |
string
getDynamicRedirect(string | false $fallbackUrl, boolean $useReferrer) : string
inherited_from | \XenForo_Controller::getDynamicRedirect() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::getDynamicRedirect() |
string
false
Fallback if no redirect or referrer is available; if false, uses index
boolean
True uses the referrer if no redirect param is available
string
getErrorOrNoPermissionResponseException(string | \XenForo_Phrase | mixed $errorPhraseKey, boolean $stringToPhrase) : \XenForo_ControllerResponse_Exception
If the first param is a string and $stringToPhrase is true, it will be treated as a phrase key and turned into a phrase.
If a specific phrase is requested, a general error will be thrown. Otherwise, a generic no permission error will be shown.
inherited_from | \XenForo_Controller::getErrorOrNoPermissionResponseException() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::getErrorOrNoPermissionResponseException() |
string
\XenForo_Phrase
mixed
A phrase key, a phrase object, or hard coded text. Or, may be empty.
boolean
If true and the $errorPhraseKey is a string, $errorPhraseKey is treated as the name of a phrase.
getHelper(string $class) : \XenForo_ControllerHelper_Abstract
If no underscore is present in the class name, "XenForo_ControllerHelper_" is prefixed. Otherwise, a full class name is assumed.
inherited_from | \XenForo_Controller::getHelper() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::getHelper() |
string
Full class name, or partial suffix (if no underscore)
getInput() : \XenForo_Input
inherited_from | \XenForo_Controller::getInput() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::getInput() |
getLastHash(mixed $id) : string
inherited_from | \XenForo_ControllerAdmin_Abstract::getLastHash() |
---|
mixed
string
getModelFromCache(string $class) : \XenForo_Model
If it does not exist, it will be instantiated.
inherited_from | \XenForo_Controller::getModelFromCache() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::getModelFromCache() |
string
Name of the class to load
getNoPermissionResponseException() : \XenForo_ControllerResponse_Exception
inherited_from | \XenForo_Controller::getNoPermissionResponseException() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::getNoPermissionResponseException() |
getRecordOrError(mixed $id, \XenForo_Model $model, string $method, string $errorPhraseKey) : array
inherited_from | \XenForo_Controller::getRecordOrError() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::getRecordOrError() |
mixed
ID of the record to get
string
Method to call in the model object
string
Key of error phrase to use when not found
array
getRequest() : \Zend_Controller_Request_Http
inherited_from | \XenForo_Controller::getRequest() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::getRequest() |
\Zend_Controller_Request_Http
getResponseType() : string
inherited_from | \XenForo_Controller::getResponseType() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::getResponseType() |
string
getRouteMatch() : \XenForo_RouteMatch
This can be modified to change the response type, and the major/minor sections that will be used to setup navigation.
inherited_from | \XenForo_Controller::getRouteMatch() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::getRouteMatch() |
getSessionActivityDetailsForList(array $activities) : mixed
This must check the visiting user's permissions before returning item info. Return value may be: * false - means page is unknown * string/XenForo_Phrase - gives description for all, but no item details * array (keyed by activity keys) of strings/XenForo_Phrase objects - individual description, no item details * array (keyed by activity keys) of arrays. Sub-arrays keys: 0 = description, 1 = specific item title, 2 = specific item url.
inherited_from | \XenForo_Controller::getSessionActivityDetailsForList() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::getSessionActivityDetailsForList() |
array
List of activity records
mixed
See above.getViewStateChanges() : array
inherited_from | \XenForo_Controller::getViewStateChanges() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::getViewStateChanges() |
array
Key-value pairsipMatch(string | array $checkIps, array $ipList) : boolean
inherited_from | \XenForo_Controller::ipMatch() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::ipMatch() |
string
array
IP address(es)
array
List of IP addresses
boolean
isConfirmedPost() : boolean
inherited_from | \XenForo_Controller::isConfirmedPost() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::isConfirmedPost() |
boolean
postDispatch(mixed $controllerResponse, string $controllerName, string $action)
inherited_from | \XenForo_Controller::postDispatch() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::postDispatch() |
mixed
The response from the controller. Generally, a XenForo_ControllerResponse_Abstract object.
string
The name of the final controller that was invoked
string
The name of the final action that was invoked
preDispatch(string $action)
inherited_from | \XenForo_Controller::preDispatch() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::preDispatch() |
string
Action that is requested
responseCaptchaFailed() : \XenForo_ControllerResponse_Error
inherited_from | \XenForo_Controller::responseCaptchaFailed() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::responseCaptchaFailed() |
responseError(string | array $error, integer $responseCode, array $containerParams) : \XenForo_ControllerResponse_Error
inherited_from | \XenForo_Controller::responseError() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::responseError() |
string
array
Error text to be use
integer
An optional HTTP response code to output
array
Key-value pairs of parameters to pass to the container view
responseException(\XenForo_ControllerResponse_Abstract $controllerResponse, integer $responseCode) : \XenForo_ControllerResponse_Exception
This object cannot be returned from the controller; an exception must be thrown with it.
This allows any type of controller response to be invoked via an exception.
inherited_from | \XenForo_Controller::responseException() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::responseException() |
integer
HTTP response code
responseFlooding(integer $floodSeconds) : \XenForo_ControllerResponse_Error
inherited_from | \XenForo_Controller::responseFlooding() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::responseFlooding() |
integer
Numbers of seconds the user must wait to perform the action
responseMessage(string $message, array $containerParams) : \XenForo_ControllerResponse_Message
inherited_from | \XenForo_Controller::responseMessage() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::responseMessage() |
string
Error text to be use
array
Key-value pairs of parameters to pass to the container view
responseNoPermission() : \XenForo_ControllerResponse_Error
inherited_from | \XenForo_ControllerAdmin_Abstract::responseNoPermission() |
---|
responseRedirect(integer $redirectType, string $redirectTarget, mixed $redirectMessage, array $redirectParams) : \XenForo_ControllerResponse_Redirect
This will happen in a separate request.
inherited_from | \XenForo_Controller::responseRedirect() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::responseRedirect() |
integer
See {@link XenForo_ControllerResponse_Redirect}
string
Target to redirect to
mixed
Message with which to redirect
array
Extra parameters for the redirect
responseReroute(string $controllerName, string $action, array $containerParams) : \XenForo_ControllerResponse_Reroute
inherited_from | \XenForo_Controller::responseReroute() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::responseReroute() |
string
Name of the controller to reroute to
string
Name of the action to reroute to
array
Key-value pairs of parameters to pass to the container view
responseView(string $viewName, string $templateName, array $params, array $containerParams) : \XenForo_ControllerResponse_View
inherited_from | \XenForo_Controller::responseView() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::responseView() |
string
Name of the view class to be rendered
string
Name of the template that should be displayed (may be ignored by view)
array
Key-value pairs of parameters to pass to the view
array
Key-value pairs of parameters to pass to the container view
setViewStateChange(string $state, mixed $data)
inherited_from | \XenForo_Controller::setViewStateChange() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::setViewStateChange() |
string
Name of state to change
mixed
updateSession(mixed $controllerResponse, string $controllerName, string $action)
This should run on all pages, provided they not rerouting to another controller. Session saving should handle double calls, if they happen.
inherited_from | \XenForo_Controller::updateSession() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::updateSession() |
mixed
The response from the controller. Generally, a XenForo_ControllerResponse_Abstract object.
string
string
updateSessionActivity(mixed $controllerResponse, string $controllerName, string $action)
inherited_from | \XenForo_ControllerAdmin_Abstract::updateSessionActivity() |
---|
mixed
The response from the controller. Generally, a XenForo_ControllerResponse_Abstract object.
string
string
_assertCorrectVersion(string $action)
inherited_from | \XenForo_ControllerAdmin_Abstract::_assertCorrectVersion() |
---|
string
_assertInstallLocked($action)
inherited_from | \XenForo_ControllerAdmin_Abstract::_assertInstallLocked() |
---|
_assertPostOnly()
Throws an exception if the request is not via POST.
inherited_from | \XenForo_Controller::_assertPostOnly() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::_assertPostOnly() |
_buildLink(string $type, mixed $data, array $params) : string
As of this writing, only canonicalizePageNumber uses this function.
inherited_from | \XenForo_ControllerAdmin_Abstract::_buildLink() |
---|
string
mixed
array
string
URL for link_checkCsrf(string $action)
This is only checked for POST requests (with session info) that aren't Ajax requests (relies on browser-level cross-domain policies).
The token is retrieved from the "_xfToken" request param.
inherited_from | \XenForo_Controller::_checkCsrf() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::_checkCsrf() |
string
_checkCsrfFromToken(string $token, boolean $throw) : boolean
Throws an exception if a CSRF issue is detected.
inherited_from | \XenForo_Controller::_checkCsrfFromToken() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::_checkCsrfFromToken() |
string
Format:
boolean
If true, an exception is thrown when failing; otherwise, a return is used
boolean
True if passed, false otherwise; only applies when $throw is false_deleteData(string $dataWriterName, string | array $existingDataKeyName, string $redirectLink, string $redirectMessage)
inherited_from | \XenForo_Controller::_deleteData() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::_deleteData() |
string
Name of DataWriter class that will perform the deletion
string
array
Name of input parameter that contains the existing data key OR array containing the keys for a multi-key parameter
string
URL to which to redirect on success
string
Redirection message to show on successful deletion
_getClientIps() :
inherited_from | \XenForo_Controller::_getClientIps() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::_getClientIps() |
_getFieldValidationInputParams() : array
Primarily used for AJAX autovalidation actions of single fields.
inherited_from | \XenForo_Controller::_getFieldValidationInputParams() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::_getFieldValidationInputParams() |
array
[name, value, existingDataKey]_getInputFromSerialized(string $varname, boolean $throw, string $errorPhraseKey) : \XenForo_Input | false
inherited_from | \XenForo_Controller::_getInputFromSerialized() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::_getInputFromSerialized() |
string
Name of index to fetch from $this->_input
boolean
On error, throw an exception or return false
string
\XenForo_Input
false
_getToggleResponse(array $items, string $dwName, string $redirectTarget, string $activeFieldName) : \XenForo_ControllerResponse_Abstract
inherited_from | \XenForo_ControllerAdmin_Abstract::_getToggleResponse() |
---|
array
All items of this type
string
Name of data writer for this item type
string
Target for the redirection
string
Name of the DB field that determines active state
_handlePost(string $action)
inherited_from | \XenForo_Controller::_handlePost() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::_handlePost() |
string
_logAdminRequest($controllerResponse, $controllerName, $action)
inherited_from | \XenForo_ControllerAdmin_Abstract::_logAdminRequest() |
---|
_noRedirect() : boolean
inherited_from | \XenForo_Controller::_noRedirect() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::_noRedirect() |
boolean
_postDispatch(mixed $controllerResponse, string $controllerName, string $action)
inherited_from | \XenForo_Controller::_postDispatch() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::_postDispatch() |
mixed
The response from the controller. Generally, a XenForo_ControllerResponse_Abstract object.
string
The name of the final controller that was invoked
string
The name of the final action that was invoked
_postDispatchType(mixed $controllerResponse, string $controllerName, string $action)
This differs from _postDispatch() in that it is designed for abstract controller type classes to override. Specific controllers should override _postDispatch instead.
inherited_from | \XenForo_ControllerAdmin_Abstract::_postDispatchType() |
---|
mixed
The response from the controller. Generally, a XenForo_ControllerResponse_Abstract object.
string
The name of the final controller that was invoked
string
The name of the final action that was invoked
_preDispatch(string $action)
This method should only be overridden by specific, concrete controllers.
string
Action that is requested
_preDispatchFirst(string $action)
inherited_from | \XenForo_Controller::_preDispatchFirst() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::_preDispatchFirst() |
string
_preDispatchType(string $action)
This differs from _preDispatch() in that it is designed for abstract controller type classes to override. Specific controllers should override _preDispatch instead.
inherited_from | \XenForo_ControllerAdmin_Abstract::_preDispatchType() |
---|
string
Action that is requested
_setupSession(string $action)
inherited_from | \XenForo_ControllerAdmin_Abstract::_setupSession() |
---|
string
_validateField(string $dataWriterName, array $data, array $options, array $extraData) : \XenForo_ControllerResponse_Redirect | \XenForo_ControllerResponse_Error
Expects 'name' and 'value' keys to be present in the request.
inherited_from | \XenForo_Controller::_validateField() |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::_validateField() |
string
Name of DataWriter against which this field will be validated
array
Array containing name, value or existingDataKey, which will override those fetched from _getFieldValidationInputParams
array
Key-value pairs of options to set
array
Key-value pairs of extra data to set
$_executed : array
inherited_from | \XenForo_Controller::$$_executed |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::$$_executed |
$_input : \XenForo_Input
inherited_from | \XenForo_Controller::$$_input |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::$$_input |
$_modelCache : array
inherited_from | \XenForo_Controller::$$_modelCache |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::$$_modelCache |
$_request : \Zend_Controller_Request_Http
inherited_from | \XenForo_Controller::$$_request |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::$$_request |
$_response : \Zend_Controller_Response_Http
inherited_from | \XenForo_Controller::$$_response |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::$$_response |
$_routeMatch : \XenForo_RouteMatch
inherited_from | \XenForo_Controller::$$_routeMatch |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::$$_routeMatch |
$_viewStateChanges : array
View state changes are specific to the dependency manager, but may include things like changing the styleId.
inherited_from | \XenForo_Controller::$$_viewStateChanges |
---|---|
inherited_from | \XenForo_ControllerAdmin_Abstract::$$_viewStateChanges |