CustomHtmlForm\Model\StepPageController
StepPage Controller.
A base name (field "basename") must be specified.
- Author: Sebastian Diel <sdiel@pixeltricks.de>
- Copyright: 2017 pixeltricks GmbH
- License: see license file in modules root directory
Synopsis
class StepPageController
extends PageController
{
- // members
- private static array $allowed_actions = ;
- protected integer $nrOfSteps = 1;
- protected DataList $stepList;
- protected integer $defaultStartStep = 1;
- protected $currentStep;
- protected CustomHtmlForm $currentFormInstance;
- protected array $basePreferences = ;
- protected array $stepMapping = ;
- protected string $initOutput = '';
- // methods
- public void init()
- public string getInitOutput()
- public CustomHtmlForm getCurrentFormInstance()
- public int getCurrentStep()
- public array getCompletedSteps()
- public void addCompletedStep()
- public void removeCompletedStep()
- public string InsertCustomHtmlForm()
- public void setStepData()
- public array|boolean getStepData()
- public array getCombinedStepData()
- public boolean stepDataChanged()
- public void fillFormFields()
- public integer getPreviousStep()
- public integer getNextStep()
- public void setCurrentStep()
- public string|boolean CustomHtmlFormStepLinkPrev()
- public string|boolean CustomHtmlFormStepLinkNext()
- public string|boolean CustomHtmlFormStepLinkCancel()
- public void NextStep()
- public void PreviousStep()
- public void GotoStep()
- public void Cancel()
- public void deleteSessionData()
- public string getStepName()
- public DataList getStepList()
- public type isStepVisible()
- public bool isStepCompleted()
- public bool isPreviousStepCompleted()
- protected CustomHtmlForm registerCurrentFormStep()
- protected void callMethodOnCurrentFormStep()
- protected void initialiseSessionData()
- protected integer getNumberOfSteps()
- protected integer getNumberOfVisibleSteps()
- public void generateStepMapping()
- public void resetStepMapping()
- private void getStepsFromModuleOrThemeDirectory()
- private void getStepsFromAdditionalDirectories()
- public boolean registerStepDirectory()
- protected string getTemplateDir()
Hierarchy
Extends
- PageController
Members
private
- $allowed_actions
—
array
Allowed URL actions
protected
-
$basePreferences
preferences for the step form - $currentFormInstance
—
CustomHtmlForm\Model\CustomHtmlForm
Contains the current form instance. - $currentStep
—
integer
number of current step - $defaultStartStep
—
integer
step to be shown if no step is specified - $initOutput
—
string
Contains the output of a CustomHtmlForm object that was rendered by this controller. - $nrOfSteps
—
integer
number of form objects; set by init() - $stepList
—
CustomHtmlForm\Model\DataList
Contains the list of steps as DataList. - $stepMapping
—
array
Contains a list of all steps, their titles, visibility, etc.
Methods
private
- getStepsFromAdditionalDirectories() — Fill class variable $stepMapping with steps from the additional directories.
- getStepsFromModuleOrThemeDirectory() — Fill class variable $stepMapping with steps from the module- or themedirectory.
protected
- callMethodOnCurrentFormStep() — Calls a method on the given form instance.
- getNumberOfSteps() — returns the number of form steps it will be determined like this: - does a template with name scheme {basename}{step}.ss exist? - does a class with name scheme {basename}{step}.php exist? the steps get counted by a loop. if one of those two conditions not true the loop will be aborted
- getNumberOfVisibleSteps() — returns the number of visible form steps
- getTemplateDir() — if the template directory is defined via preferences it will be returned
- initialiseSessionData() — stes the data structure for the CustomHtmlFormStep in the session
- registerCurrentFormStep() — registers form for the current step
public
- Cancel() — cancels all form data an redirects to the first step
- CustomHtmlFormStepLinkCancel() — returns the canel link
- CustomHtmlFormStepLinkNext() — returns the link to the next step
- CustomHtmlFormStepLinkPrev() — returns the link to the previous step
- GotoStep() — jumps to the defined step if it is compleated and relods the page
- InsertCustomHtmlForm() — call to the parent method; the corresponding parameters will be set Ruft die gleichnamige Methode der Elternseite auf und erstellt den passenden Parameter.
- NextStep() — increments the present step and reloads page
- PreviousStep() — decrements the current step an reloads the page
- addCompletedStep() — records a step to be completed
- deleteSessionData() — deletes all step data from session
- fillFormFields() — fills in the form fields with available session data
- generateStepMapping() — Generates a map of all steps with links, names, etc.
- getCombinedStepData() — returns all session data as an associative array
- getCompletedSteps() — returns the completed steps as a numeric array
- getCurrentFormInstance() — Returns the current form instance object
- getCurrentStep() — returns the id of the current step
- getInitOutput() — Returns the output of a form that was initialised by a StepPage object.
- getNextStep() — returns the id of the next step
- getPreviousStep() — returns the id of the previous step
- getStepData() — returns the data of the current step as an associative array; if there is no data false will be returned
- getStepList() — returns all steps as DataList
- getStepName() — returns the defined steps title
- init() — initializes the step form
- isPreviousStepCompleted() — has the previous step been completed?
- isStepCompleted() — Is the current or defined step completed?
- isStepVisible() — Returnst whether the given step is visible.
- registerStepDirectory() — Register an additional directory where CustomHtmlFormStepForms are located.
- removeCompletedStep() — removes a completed step
- resetStepMapping() — Clears the step mapping variable.
- setCurrentStep() — sets the id of the current step
- setStepData() — saves form data of the present step
- stepDataChanged() — Checks, whether the step data has changed.