static void getDefaultHandler(
String
$action
)
|
|
Static factory method to get the default action handler for a certain action.
When no action handler class can be found for the action, a default handler is instantiated and returned. The default handler assumes that the node has an action_.... method, that will be called when the actionhandler's handle() mehod is called.
Parameters:
|
String |
$action: |
The action for which an action handler should be retrieved. |
atkActionHandler atkActionHandler(
)
|
|
Default constructor.
void addRenderBoxVar(
string
$key, string
$value
)
|
|
Add a variable to the renderbox
Parameters:
|
string |
$key: |
|
|
string |
$value: |
|
boolean allowed(
array
$record
)
|
|
Current action allowed on the given record?
Parameters:
API Tags:
| Return: | is action allowed on record? |
Clear the recordlist cache
Output JavaScript to close the dialog.
Get/generate CSRF token for the current session stack.
http://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29_Prevention_Cheat_Sheet
API Tags:
| Return: | CSRF token |
| Access: | public |
Returns the node object.
API Tags:
Get the page instance for generating output.
API Tags:
| Return: | The active page instance. |
atkRecordListCache getRecordlistCache(
)
|
|
Get the cached recordlist
API Tags:
Get the reject info from the session This is used by the atkAddHandler and atkEditHandler to show the validation errors
API Tags:
Returns the render mode.
API Tags:
String getReturnBehaviour(
)
|
|
Get the returnbehaviour of this action
API Tags:
| Return: | the return behaviour |
Get the ui instance for drawing and templating purposes.
API Tags:
| Return: | An atkUi instance for drawing and templating. |
void handle(
&$node, String
$action,
&$postvars, atkNode
$node, array
$postvars
)
|
|
The handle() method handles the action.
The default implementation invokes an action_$action override (if present) and stores the postvars. Custom handlers may override this behavior. If there is no node action override and a partial is set for the action we don't invoke the action_$action override but instead let the partial method handle the action.
Parameters:
|
atkNode |
$node: |
The node on which the action should be performed. |
|
String |
$action: |
The action that is being performed. |
|
array |
$postvars: |
Any variables from the request |
|
|
&$node: |
|
|
|
&$postvars: |
|
mixed invoke(
String
$methodname
)
|
|
Generic method invoker.
Handler methods invoked with invoke() instead of directly, have a major advantage: the handler automatically searches for an override in the node. For example, If a handler calls its getSomething() method using the invoke method, the node may implement its own version of getSomething() and that method will then be called instead of the original. The handler is passed by reference to the override function as first parameter, so if necessary, you can call the original method from inside the override.
The function accepts a variable number of parameters. Any parameter that you would pass to the method, can be passed to invoke(), and invoke() will pass the parameters on to the method.
There is one limitation: you can't pass parameters by reference if you use invoke().
Example:
$handler->invoke("editPage", $record, $mode);
This will call editPage(&$handler, $record, $mode) on your node class if present, or editPage($record, $mode) in the handler if the node has no override.
Parameters:
|
String |
$methodname: |
The name of the method to call. |
API Tags:
| Return: | The method returns the return value of the invoked method. |
boolean isValidCSRFToken(
$token
)
|
|
Checks whatever the given CSRF token matches the one stored in the session stack.
Parameters:
API Tags:
| Return: | is valid CSRF token? |
| Access: | protected |
Modify grid.
Parameters:
API Tags:
void notify(
string
$action, array
$record
)
|
|
Notify the node that an action has occured
Parameters:
|
string |
$action: |
The action that occurred |
|
array |
$record: |
The record on which the action was performed |
void partial(
string
$partial
)
|
|
Handle partial.
Parameters:
|
string |
$partial: |
full partial |
String renderAccessDeniedDialog(
)
|
|
Render access denied dialog contents.
API Tags:
| Return: | The access denied page in a dialog |
void renderAccessDeniedPage(
)
|
|
Render access denied page.
String renderMessageDialog(
String
$message
)
|
|
Render message dialog contents.
Parameters:
|
String |
$message: |
The message to render in a dialog |
API Tags:
| Return: | The message dialog |
void setAction(
string
$action
)
|
|
Sets the current action.
Parameters:
|
string |
$action: |
The action name. |
void setBoxTemplate(
$tpl
)
|
|
Parameters:
void setNode(
&$node, atkNode
$node
)
|
|
Set the calling node of the current action.
Parameters:
|
atkNode |
$node: |
The node on which the action should be performed. |
|
|
&$node: |
|
Redefined in descendants as:
void setPostvars(
&$postvars, array
$postvars
)
|
|
Set postvars of the the calling node of the current action.
Parameters:
|
array |
$postvars: |
Postvars of the node on which the action should be performed. |
|
|
&$postvars: |
|
void setRejectInfo(
array
$data
)
|
|
Store the reject info in the session This is used by the atkSaveHandler and atkUpdateHandler to store the record if the record is not validated
Parameters:
|
array |
$data: |
The reject information |
void setRenderMode(
string
$mode
)
|
|
Sets the render mode ("box" or "dialog").
Parameters:
|
string |
$mode: |
render mode |
void setReturnBehaviour(
Integer
$returnbehaviour
)
|
|
Set the returnbehaviour of this action
Parameters:
|
Integer |
$returnbehaviour: |
The return behaviour (possible values: ATK_ACTION_BACK and ATK_ACTION_STAY) |
void updateDialog(
string
$content
)
|
|
Outputs JavaScript for updating the existing dialog contents.
Parameters:
String _getAccessDeniedPage(
)
|
|
Get the access denied page
API Tags:
| Return: | the HTML code of the access denied page |