|
atkWizard class which is capable of using atknodes as wizardpanels. This class makes the distinction between update/save and navigation actions from the wizard and respondis correspondingly. atkWizard's highest baseclass is atkController. When an atkWizard is created and becomes the controller of the atkapp, it will stay the controller untill we take a non wizard specific action. Located in /wizard/class.atkwizard.inc [line 51] atkController | --atkWizardBase | --atkWizardAuthor(s):
|
| Inherited Properties | Inherited Methods |
|---|---|
|
Inherited From atkController |
Inherited From atkWizardBase
Inherited From atkController
|
| array | $m_currentPanelIndex | Index of panel which is currently shown or processed |
| array | $m_hiddenParams | Key-value array which will be added as hidden value in edit/add forms |
| bool | $m_isWizardInitiated | It can com in handy to know if we are at the start of the wizard and have not performed any wizard actions. |
| array | $m_mode | The mode in which the wizard is run (add/edit). |
| int | $m_page_flags | Value needed by atkPage to render the content of a page. Default we need to render a complete html page, but it might be necesary to only render the content part. |
| array | $m_panelIndex | Key/value array containing panel name as key and index as value |
| array | $m_panelList | Array of panels First item is first to show in wizard |
| array | $m_redirectParams | Key-value array which will be url when redirecting to a new page |
| object | $m_self | We use a reference to ourselfs because we pass data to the wizardpanel which has a reference to its wizard parent. |
| string | $m_wizardAction | Action to perform in the wizard. Actions can be: next, finish, saveandnext, saveandaddnew. |
| string | actionPageTitle() | Return the title to be show on top of an Action Page. This is an override of the atkController::actionPageTitle function. |
| void | addPanel() | Add wizardpanel to the wizard. Only objects of type atkWizardPanel can be added. The order of additions to the wizard determines order in which the panels are shown. |
| void | checkWizardInitiationStatus() | This function is called from the constructor to check if the wizard goes through the initialisation. This means that the first panel is shown and no wizard actions have been taken. |
| void | collectWizardSessionData() | This function is called from the constructor. Its basic function is to collect wizard information from the session stack. To run the wizard we need to be able to use atk's session stack. Default it is turned on, but it might be turned off explicitly. |
| void | finish() | Finish the wizard |
| object of | &getCurrentPanel() | Return the current active panel object. |
| array | getHiddenParam() | Return the hidden params |
| define | getMode() | Get the wizard mode |
| string | getWizardAction() | Return the current wizardaction |
| String | handleRequest() | Main execution function (start of the wizard). Every page load will go through this function. This function overrides atkController::handleRequest but it always calls its parent in the end. |
| bool | isFinishPanel() | Return if this panel is the last one in the wizard |
| bool | save() | We are saving a newly added record. On success or failure ATK will redirect. |
| void | setHiddenParam() | Collect the variables which should be set as hidden input fields in forms. |
| void | setHtmlTitle() | Set the value of the html meta tag. This is an override of the atkcontroller::setHtmlTitle. |
| void | setMode() | Set the wizard mode. Options: WIZARD_MODE_ADD (default), WIZARD_MODE_EDIT |
| void | setPageFlags() | Set a defined value needed by atkPage to render the content of a page. Default we need to render a complete html (HTML_ALL) page, but it might be necesary to only render the content part. |
| void | setRedirectParam() | Collect the variables which should be added to the redirect url. |
| void | wizardDispatch() | Determine the wizardPanel to load and let the wizardpanel do some dispatching too. |
Index of panel which is currently shown or processed
API Tags:| Access: | private |
Key-value array which will be added as hidden value in edit/add forms
API Tags:| Access: | private |
It can com in handy to know if we are at the start of the wizard and have not performed any wizard actions.
The mode in which the wizard is run (add/edit).
Default is add
API Tags:| Access: | private |
Value needed by atkPage to render the content of a page. Default we need to render a complete html page, but it might be necesary to only render the content part.
Key/value array containing panel name as key and index as value
API Tags:| Access: | private |
Array of panels First item is first to show in wizard
API Tags:| Access: | private |
Key-value array which will be url when redirecting to a new page
API Tags:| Access: | private |
We use a reference to ourselfs because we pass data to the wizardpanel which has a reference to its wizard parent.
API Tags:| Access: | private |
Action to perform in the wizard. Actions can be: next, finish, saveandnext, saveandaddnew.
|
Return the title to be show on top of an Action Page. This is an override of the atkController::actionPageTitle function.
We now want to show the wizard name, wizard panel and which step we are at.
| Return: | The title |
| Access: | public |
|
Add wizardpanel to the wizard. Only objects of type atkWizardPanel can be added. The order of additions to the wizard determines order in which the panels are shown.
Parameters:| object | $atkWizardPanel: | |
| &$atkWizardPanel: |
| Access: | public |
|
This function is called from the constructor to check if the wizard goes through the initialisation. This means that the first panel is shown and no wizard actions have been taken.
We check this by saving searching the sessing for the var 'wizard_initiation_level'. If it does not exist we fill it with the current atkLevel.
| Access: | private |
|
This function is called from the constructor. Its basic function is to collect wizard information from the session stack. To run the wizard we need to be able to use atk's session stack. Default it is turned on, but it might be turned off explicitly.
| Access: | private |
|
Finish the wizard
This function can be overriden in the your extended wizard class.
TODO/FIXME It would be even more cool if wizardpanels could listen to the finish action and be notified of this action/event.
| Access: | protected |
|
Return the current active panel object.
| Return: | type atkWizardPanel |
| Access: | public |
|
Return the hidden params
| Access: | public |
|
Get the wizard mode
| Return: | value |
| Access: | public |
|
Return the current wizardaction
| Return: | wizardaction (eg next, saveandnext, saveandaddnew, finish). |
| Access: | public |
|
Main execution function (start of the wizard). Every page load will go through this function. This function overrides atkController::handleRequest but it always calls its parent in the end.
| Return: | The html output |
| Access: | public |
|
Return if this panel is the last one in the wizard
Parameters:| string | $name: |
| Access: | public |
|
We are saving a newly added record. On success or failure ATK will redirect.
On failure the session stack of the previous level is loaded to show the same wizardpanel again (now with error message). On succes we need to set some redirect vars to make sure we go to the next wizardpanel.
Parameters:| string | $atkwizardaction: | The wizard action for redirecting |
| Return: | on successfully executing this function |
| Access: | protected |
|
Collect the variables which should be set as hidden input fields in forms.
Save them in a key/value array.
Parameters:| string | $key: | |
| mixed | $value: |
| Access: | public |
|
Set the value of the html meta tag. This is an override of the atkcontroller::setHtmlTitle.
We now want to show the wizard name, wizard panel and which step we are at.
| Access: | public |
|
Set the wizard mode. Options: WIZARD_MODE_ADD (default), WIZARD_MODE_EDIT
Parameters:| integer | $mode: |
| Access: | public |
|
Set a defined value needed by atkPage to render the content of a page. Default we need to render a complete html (HTML_ALL) page, but it might be necesary to only render the content part.
Parameters:| define | $flag: |
| Access: | public |
|
Collect the variables which should be added to the redirect url.
Save them in a key/value array.
Parameters:| string | $key: | |
| mixed | $value: |
| Access: | public |
|
Determine the wizardPanel to load and let the wizardpanel do some dispatching too.
Parameters:| String | $atkWizardaction: |
| Access: | protected |