Version 4.1.2

This commit is contained in:
Neo committed 2025-12-19 05:32:19 -08:00
1 parent 3ba79295ee
commit 28bd025b35
1131 files changed
+63658 -20579

No files matched your search

+16 -7
View File
@@ -29,7 +29,7 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
$form = new \IPS\Helpers\Form;
$form->add( ... );
if ( $values = $form->values )
if ( $values = $form->values() )
{
return $values;
}
@@ -41,7 +41,7 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
// $data contains the form values from the previous step
}
),
\IPS\Http\Url::internal( 'app=example&module=example&controller=example&do=wizard' );
\IPS\Http\Url::internal( 'app=example&module=example&controller=example&do=wizard' )
);
* @endcode
*/
@@ -75,11 +75,12 @@ class _Wizard
/**
* Constructor
*
* @param array $steps An array of callback functions. Each function should return either a string to output or (if the step is done) an array (which can be blank) of arbitrary data to retain between steps (which will be passed to each callback function). The keys should be langauge keys for the title of the step.
* @param \IPS\Http\Url $baseUrl The base URL (used when moving between steps)
* @param array $steps An array of callback functions. Each function should return either a string to output or (if the step is done) an array (which can be blank) of arbitrary data to retain between steps (which will be passed to each callback function). The keys should be langauge keys for the title of the step.
* @param \IPS\Http\Url $baseUrl The base URL (used when moving between steps)
* @param array $initialData The initial data
* @return void
*/
public function __construct( $steps, $baseUrl, $showSteps=TRUE )
public function __construct( $steps, $baseUrl, $showSteps=TRUE, $initialData=NULL )
{
$this->steps = $steps;
$this->baseUrl = $baseUrl;
@@ -90,8 +91,16 @@ class _Wizard
{
unset( $_SESSION[ 'wizard-' . md5( $this->baseUrl ) . '-step' ] );
unset( $_SESSION[ 'wizard-' . md5( $this->baseUrl ) . '-data' ] );
\IPS\Output::i()->redirect( $baseUrl );
if ( !is_null( $initialData ) )
{
$_SESSION[ 'wizard-' . md5( $this->baseUrl ) . '-data' ] = $initialData;
}
if ( !\IPS\Request::i()->isAjax() )
{
\IPS\Output::i()->redirect( $baseUrl );
}
}
}