PHP Class Prado\Web\UI\WebControls\TWizard

TWizard splits a large form and presents the user with a series of smaller forms to complete. TWizard is analogous to the installation wizard commonly used to install software in Windows. The smaller forms are called wizard steps ({@link TWizardStep}, which can be accessed via {@link getWizardSteps WizardSteps}. In template, wizard steps can be added into a wizard using the following syntax, content in step 1, may contain other controls content in step 2, may contain other controls Each wizard step can be one of the following types: - Start : the first step in the wizard. - Step : the internal steps in the wizard. - Finish : the last step that allows user interaction. - Complete : the step that shows a summary to user (no interaction is allowed). - Auto : the step type is determined by wizard automatically. At any time, only one step is visible to end-users, which can be obtained by {@link getActiveStep ActiveStep}. Its index in the step collection is given by {@link getActiveStepIndex ActiveStepIndex}. Wizard content can be customized in many ways. The layout of a wizard consists of four parts: header, step content, navigation and side bar. Their content are affected by the following properties, respectively, - header: {@link setHeaderText HeaderText} and {@link setHeaderTemplate HeaderTemplate}. If both are present, the latter takes precedence. - step: {@link getWizardSteps WizardSteps}. - navigation: {@link setStartNavigationTemplate StartNavigationTemplate}, {@link setStepNavigationTemplate StepNavigationTemplate}, {@link setFinishNavigationTemplate FinishNavigationTemplate}. Default templates will be used if above templates are not set. - side bar: {@link setSideBarTemplate SideBarTemplate}. A default template will be used if this template is not set. Its visibility is toggled by {@link setShowSideBar ShowSideBar}. The style of these wizard layout components can be customized via the following style properties, - header: {@link getHeaderStyle HeaderStyle}. - step: {@link getStepStyle StepStyle}. - navigation: {@link getNavigationStyle NavigationStyle}, {@link getStartNextButtonStyle StartNextButtonStyle}, {@link getStepNextButtonStyle StepNextButtonStyle}, {@link getStepPreviousButtonStyle StepPreviousButtonStyle}, {@link getFinishPreviousButtonStyle FinishPreviousButtonStyle}, {@link getFinishCompleteButtonStyle FinishCompleteButtonStyle}, {@link getCancelButtonStyle CancelButtonStyle}. - side bar: {@link getSideBarStyle SideBarStyle} and {@link getSideBarButtonStyle SideBarButtonStyle}.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends TWebControl, implements Prado\Web\UI\INamingContainer
Datei anzeigen Open project: pradosoft/prado Class Usage Examples

Public Methods

Method Description
addParsedObject ( $object ) Adds {@link TWizardStep} objects into step collection.
addedWizardStep ( $step ) Adds a wizard step to the multiview.
bubbleEvent ( $sender, $param ) Handles bubbled events.
createChildControls ( ) Creates child controls within the wizard
dataListItemCommand ( $sender, $param ) Event handler for sidebar datalist's OnItemCommand event.
dataListItemDataBound ( $sender, $param ) Event handler for sidebar datalist's OnItemDataBound event.
getActiveStep ( ) : TWizardStep
getActiveStepIndex ( ) : integer
getCancelButtonStyle ( ) : TWizardNavigationButtonStyle
getCancelDestinationUrl ( ) : string
getFinishCompleteButtonStyle ( ) : TWizardNavigationButtonStyle
getFinishDestinationUrl ( ) : string
getFinishNavigation ( ) : TWizardNavigationContainer
getFinishNavigationTemplate ( ) : ITemplate
getFinishPreviousButtonStyle ( ) : TWizardNavigationButtonStyle
getHeader ( ) : TPanel
getHeaderStyle ( ) : TPanelStyle
getHeaderTemplate ( ) : ITemplate
getHeaderText ( ) : string
getMultiView ( ) : TMultiView Returns the multiview that holds the wizard steps.
getNavigationButtonStyle ( ) : TStyle
getNavigationStyle ( ) : TPanelStyle
getShowCancelButton ( ) : boolean
getShowSideBar ( ) : boolean
getSideBar ( ) : TPanel
getSideBarButtonStyle ( ) : TStyle
getSideBarStyle ( ) : TPanelStyle
getSideBarTemplate ( ) : ITemplate
getStartNavigation ( ) : TWizardNavigationContainer
getStartNavigationTemplate ( ) : ITemplate
getStartNextButtonStyle ( ) : TWizardNavigationButtonStyle
getStepContent ( ) : TPanel
getStepNavigation ( ) : TWizardNavigationContainer
getStepNavigationTemplate ( ) : ITemplate
getStepNextButtonStyle ( ) : TWizardNavigationButtonStyle
getStepPreviousButtonStyle ( ) : TWizardNavigationButtonStyle
getStepStyle ( ) : TPanelStyle
getUseDefaultLayout ( ) : boolean
getWizardSteps ( ) : TWizardStepCollection
onActiveStepChanged ( $param ) Raises OnActiveStepChanged event.
onCancelButtonClick ( $param ) Raises OnCancelButtonClick event.
onCompleteButtonClick ( $param ) Raises OnCompleteButtonClick event.
onInit ( $param ) Creates the child controls of the wizard.
onNextButtonClick ( $param ) Raises OnNextButtonClick event.
onPreviousButtonClick ( $param ) Raises OnPreviousButtonClick event.
onSideBarButtonClick ( $param ) Raises OnSideBarButtonClick event.
removedWizardStep ( $step ) Removes a wizard step from the multiview.
render ( $writer ) Renders the wizard.
saveState ( ) Saves the current active step index into history.
setActiveStep ( $step )
setActiveStepIndex ( $value )
setCancelDestinationUrl ( $value )
setFinishDestinationUrl ( $value )
setFinishNavigationTemplate ( $value )
setHeaderTemplate ( $value )
setHeaderText ( $value )
setShowCancelButton ( $value )
setShowSideBar ( $value )
setSideBarTemplate ( $value )
setStartNavigationTemplate ( $value )
setStepNavigationTemplate ( $value )
setUseDefaultLayout ( $value )
wizardStepsChanged ( ) Updates the sidebar datalist if any.

Protected Methods

Method Description
allowNavigationToPreviousStep ( ) : boolean
allowNavigationToStep ( $index ) : boolean
applyControlProperties ( ) Applies various properties to the components of wizard
applyHeaderProperties ( ) Applies properties to the wizard header
applyNavigationProperties ( ) Apply properties to various navigation panels.
applySideBarProperties ( ) Applies properties to the wizard sidebar
applyStepContentProperties ( ) Applies properties to the wizard step content
createFinishNavigation ( ) Creates finish navigation panel.
createHeader ( ) Creates the wizard header.
createNavigation ( ) Creates navigation panel.
createSideBar ( ) Creates the wizard side bar
createStartNavigation ( ) Creates start navigation panel.
createStepContent ( ) Creates wizard step content.
createStepNavigation ( ) Creates step navigation panel.
getHistory ( ) : TStack
getPreviousStepIndex ( $popStack ) Determines the index of the previous step based on history.
getStepType ( $wizardStep ) : TWizardStepType Determines the type of the specified wizard step.
getTagName ( ) : string
requiresControlsRecreation ( ) Indicates the wizard needs to recreate all child controls.
reset ( ) Clears up everything within the wizard.

Method Details

addParsedObject() public method

This method overrides the parent implementation and is invoked when template is being instantiated.
public addParsedObject ( $object )

addedWizardStep() public method

This method should only be used by control developers. It is invoked when a step is added into the step collection of the wizard.
public addedWizardStep ( $step )

allowNavigationToPreviousStep() protected method

protected allowNavigationToPreviousStep ( ) : boolean
return boolean whether navigation to the previous step is allowed

allowNavigationToStep() protected method

protected allowNavigationToStep ( $index ) : boolean
return boolean whether navigation to the specified step is allowed

applyControlProperties() protected method

Applies various properties to the components of wizard
protected applyControlProperties ( )

applyHeaderProperties() protected method

Applies properties to the wizard header
protected applyHeaderProperties ( )

applyNavigationProperties() protected method

Apply properties to various navigation panels.

applySideBarProperties() protected method

Applies properties to the wizard sidebar
protected applySideBarProperties ( )

applyStepContentProperties() protected method

Applies properties to the wizard step content

bubbleEvent() public method

This method mainly translate certain command events into wizard-specific events.
public bubbleEvent ( $sender, $param )

createChildControls() public method

Creates child controls within the wizard
public createChildControls ( )

createFinishNavigation() protected method

Creates finish navigation panel.
protected createFinishNavigation ( )

createHeader() protected method

Creates the wizard header.
protected createHeader ( )

createNavigation() protected method

Creates navigation panel.
protected createNavigation ( )

createSideBar() protected method

Creates the wizard side bar
protected createSideBar ( )

createStartNavigation() protected method

Creates start navigation panel.
protected createStartNavigation ( )

createStepContent() protected method

Creates wizard step content.
protected createStepContent ( )

createStepNavigation() protected method

Creates step navigation panel.
protected createStepNavigation ( )

dataListItemCommand() public method

This method is used internally by wizard. It mainly sets the active step index according to the button clicked in the sidebar.
public dataListItemCommand ( $sender, $param )

dataListItemDataBound() public method

This method is used internally by wizard. It mainly configures the buttons in the sidebar datalist.
public dataListItemDataBound ( $sender, $param )

getActiveStep() public method

public getActiveStep ( ) : TWizardStep
return TWizardStep the currently active wizard step

getActiveStepIndex() public method

public getActiveStepIndex ( ) : integer
return integer the zero-based index of the active wizard step

getCancelButtonStyle() public method

public getCancelButtonStyle ( ) : TWizardNavigationButtonStyle
return TWizardNavigationButtonStyle the style for the cancel button

getCancelDestinationUrl() public method

public getCancelDestinationUrl ( ) : string
return string the URL that the browser will be redirected to if the cancel button in the wizard is clicked. Defaults to ''.

getFinishCompleteButtonStyle() public method

public getFinishCompleteButtonStyle ( ) : TWizardNavigationButtonStyle
return TWizardNavigationButtonStyle the style for the complete button in the finish wizard step.

getFinishDestinationUrl() public method

public getFinishDestinationUrl ( ) : string
return string the URL that the browser will be redirected to if the wizard finishes. Defaults to ''.

getFinishNavigation() public method

public getFinishNavigation ( ) : TWizardNavigationContainer
return TWizardNavigationContainer container of the finish navigation

getFinishNavigationTemplate() public method

public getFinishNavigationTemplate ( ) : ITemplate
return ITemplate navigation template for the finish step. Defaults to null.

getFinishPreviousButtonStyle() public method

public getFinishPreviousButtonStyle ( ) : TWizardNavigationButtonStyle
return TWizardNavigationButtonStyle the style for the previous button in the start wizard step.

getHeader() public method

public getHeader ( ) : TPanel
return TPanel container of the wizard header

getHeaderStyle() public method

public getHeaderStyle ( ) : TPanelStyle
return TPanelStyle the style for the header.

getHeaderTemplate() public method

public getHeaderTemplate ( ) : ITemplate
return ITemplate template for wizard header. Defaults to null.

getHeaderText() public method

public getHeaderText ( ) : string
return string header text. Defaults to ''.

getHistory() protected method

protected getHistory ( ) : TStack
return Prado\Collections\TStack history containing step indexes that were navigated before

getMultiView() public method

This method should only be used by control developers.
public getMultiView ( ) : TMultiView
return TMultiView the multiview holding wizard steps

getNavigationButtonStyle() public method

public getNavigationButtonStyle ( ) : TStyle
return TStyle the style common for all navigation buttons.

getNavigationStyle() public method

public getNavigationStyle ( ) : TPanelStyle
return TPanelStyle the style for the navigation panel.

getPreviousStepIndex() protected method

Determines the index of the previous step based on history.
protected getPreviousStepIndex ( $popStack )

getShowCancelButton() public method

public getShowCancelButton ( ) : boolean
return boolean whether to display a cancel button in each wizard step. Defaults to false.

getShowSideBar() public method

public getShowSideBar ( ) : boolean
return boolean whether to display a side bar that contains links to wizard steps. Defaults to true.

getSideBar() public method

public getSideBar ( ) : TPanel
return TPanel container of the wizard side bar

getSideBarButtonStyle() public method

public getSideBarButtonStyle ( ) : TStyle
return TStyle the style for the buttons displayed in the side bar.

getSideBarStyle() public method

public getSideBarStyle ( ) : TPanelStyle
return TPanelStyle the style for the side bar.

getSideBarTemplate() public method

public getSideBarTemplate ( ) : ITemplate
return ITemplate template for the side bar. Defaults to null.

getStartNavigation() public method

public getStartNavigation ( ) : TWizardNavigationContainer
return TWizardNavigationContainer container of the start navigation

getStartNavigationTemplate() public method

public getStartNavigationTemplate ( ) : ITemplate
return ITemplate navigation template for the start step. Defaults to null.

getStartNextButtonStyle() public method

public getStartNextButtonStyle ( ) : TWizardNavigationButtonStyle
return TWizardNavigationButtonStyle the style for the next button in the start wizard step.

getStepContent() public method

public getStepContent ( ) : TPanel
return TPanel container of the wizard step content

getStepNavigation() public method

public getStepNavigation ( ) : TWizardNavigationContainer
return TWizardNavigationContainer container of the step navigation

getStepNavigationTemplate() public method

public getStepNavigationTemplate ( ) : ITemplate
return ITemplate navigation template for internal steps. Defaults to null.

getStepNextButtonStyle() public method

public getStepNextButtonStyle ( ) : TWizardNavigationButtonStyle
return TWizardNavigationButtonStyle the style for the next button in each internal wizard step.

getStepPreviousButtonStyle() public method

public getStepPreviousButtonStyle ( ) : TWizardNavigationButtonStyle
return TWizardNavigationButtonStyle the style for the previous button in the start wizard step.

getStepStyle() public method

public getStepStyle ( ) : TPanelStyle
return TPanelStyle the style for each internal wizard step.

getStepType() protected method

Determines the type of the specified wizard step.
protected getStepType ( $wizardStep ) : TWizardStepType
return TWizardStepType type of the step

getTagName() protected method

protected getTagName ( ) : string
return string tag name for the wizard

getUseDefaultLayout() public method

public getUseDefaultLayout ( ) : boolean
return boolean whether to use default layout to arrange side bar and the rest wizard components. Defaults to true.

getWizardSteps() public method

public getWizardSteps ( ) : TWizardStepCollection
return TWizardStepCollection collection of wizard steps

onActiveStepChanged() public method

This event is raised when the current visible step is changed in the wizard.
public onActiveStepChanged ( $param )

onCancelButtonClick() public method

This event is raised when a cancel navigation button is clicked in the current active step.
public onCancelButtonClick ( $param )

onCompleteButtonClick() public method

This event is raised when a finish navigation button is clicked in the current active step.
public onCompleteButtonClick ( $param )

onInit() public method

This method overrides the parent implementation.
public onInit ( $param )

onNextButtonClick() public method

This event is raised when a next navigation button is clicked in the current active step.
public onNextButtonClick ( $param )

onPreviousButtonClick() public method

This event is raised when a previous navigation button is clicked in the current active step.
public onPreviousButtonClick ( $param )

onSideBarButtonClick() public method

This event is raised when a link button in the side bar is clicked.
public onSideBarButtonClick ( $param )

removedWizardStep() public method

This method should only be used by control developers. It is invoked when a step is removed from the step collection of the wizard.
public removedWizardStep ( $step )

render() public method

Renders the wizard.
public render ( $writer )

requiresControlsRecreation() protected method

Indicates the wizard needs to recreate all child controls.

reset() protected method

Clears up everything within the wizard.
protected reset ( )

saveState() public method

This method is invoked by the framework when the control state is being saved.
public saveState ( )

setActiveStep() public method

public setActiveStep ( $step )

setActiveStepIndex() public method

public setActiveStepIndex ( $value )

setCancelDestinationUrl() public method

public setCancelDestinationUrl ( $value )

setFinishDestinationUrl() public method

public setFinishDestinationUrl ( $value )

setFinishNavigationTemplate() public method

public setFinishNavigationTemplate ( $value )

setHeaderTemplate() public method

public setHeaderTemplate ( $value )

setHeaderText() public method

public setHeaderText ( $value )

setShowCancelButton() public method

public setShowCancelButton ( $value )

setShowSideBar() public method

public setShowSideBar ( $value )

setSideBarTemplate() public method

public setSideBarTemplate ( $value )

setStartNavigationTemplate() public method

public setStartNavigationTemplate ( $value )

setStepNavigationTemplate() public method

public setStepNavigationTemplate ( $value )

setUseDefaultLayout() public method

public setUseDefaultLayout ( $value )

wizardStepsChanged() public method

This method is invoked when any wizard step is changed.
public wizardStepsChanged ( )