Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -11,7 +11,7 @@
|
||||
namespace IPS\Helpers;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
@@ -100,7 +100,7 @@ class _Wizard
|
||||
unset( $_SESSION[ 'wizard-' . md5( $this->baseUrl ) . '-step' ] );
|
||||
unset( $_SESSION[ 'wizard-' . md5( $this->baseUrl ) . '-data' ] );
|
||||
|
||||
if ( !is_null( $initialData ) )
|
||||
if ( !\is_null( $initialData ) )
|
||||
{
|
||||
$_SESSION[ 'wizard-' . md5( $this->baseUrl ) . '-data' ] = $initialData;
|
||||
}
|
||||
@@ -119,6 +119,9 @@ class _Wizard
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
/* Don't cache for a short while to ensure sessions work */
|
||||
\IPS\Request::i()->setCookie( 'noCache', 1 );
|
||||
|
||||
try
|
||||
{
|
||||
$stepKeys = array_keys( $this->steps );
|
||||
@@ -136,7 +139,7 @@ class _Wizard
|
||||
{
|
||||
$activeStep = $_SESSION[ 'wizard-' . md5( $this->baseUrl ) . '-step' ];
|
||||
|
||||
if ( isset( \IPS\Request::i()->_step ) and in_array( \IPS\Request::i()->_step, $stepKeys ) )
|
||||
if ( isset( \IPS\Request::i()->_step ) and \in_array( \IPS\Request::i()->_step, $stepKeys ) )
|
||||
{
|
||||
foreach ( $stepKeys as $key )
|
||||
{
|
||||
@@ -161,7 +164,7 @@ class _Wizard
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( \IPS\Request::i()->_moveToStep ) and in_array( \IPS\Request::i()->_moveToStep, $stepKeys ) )
|
||||
if ( isset( \IPS\Request::i()->_moveToStep ) and \in_array( \IPS\Request::i()->_moveToStep, $stepKeys ) )
|
||||
{
|
||||
foreach ( $stepKeys as $key )
|
||||
{
|
||||
@@ -174,8 +177,9 @@ class _Wizard
|
||||
}
|
||||
|
||||
/* Get it's output */
|
||||
$output = call_user_func( $this->steps[ $activeStep ], $data );
|
||||
while ( is_array( $output ) )
|
||||
$activeStepFunction = $this->steps[ $activeStep ];
|
||||
$output = $activeStepFunction( $data );
|
||||
while ( \is_array( $output ) )
|
||||
{
|
||||
$data = array_merge( $data, $output );
|
||||
|
||||
@@ -210,11 +214,13 @@ class _Wizard
|
||||
unset( $_SESSION[ 'wizard-' . md5( $this->baseUrl ) . '-data' ] );
|
||||
}
|
||||
|
||||
$output = call_user_func( $this->steps[ $activeStep ], $data );
|
||||
$activeStepFunction = $this->steps[ $activeStep ];
|
||||
$output = $activeStepFunction( $data );
|
||||
}
|
||||
|
||||
/* Display */
|
||||
return call_user_func( $this->template, $stepKeys, $activeStep, $output, $this->baseUrl, $this->showSteps );
|
||||
$htmlTemplate = $this->template;
|
||||
return $htmlTemplate( $stepKeys, $activeStep, $output, $this->baseUrl, $this->showSteps );
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user