Passed
Push — master ( 13b9f2...05232e )
by Aimeos
03:40
created

Standard::addData()   B

Complexity

Conditions 10
Paths 32

Size

Total Lines 101
Code Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 10
eloc 25
c 0
b 0
f 0
nc 32
nop 3
dl 0
loc 101
rs 7.6666

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Metaways Infosystems GmbH, 2013
6
 * @copyright Aimeos (aimeos.org), 2015-2020
7
 * @package Client
8
 * @subpackage Html
9
 */
10
11
12
namespace Aimeos\Client\Html\Checkout\Standard;
13
14
15
/**
16
 * Default implementation of standard checkout HTML client.
17
 *
18
 * @package Client
19
 * @subpackage Html
20
 */
21
class Standard
22
	extends \Aimeos\Client\Html\Common\Client\Factory\Base
23
	implements \Aimeos\Client\Html\Common\Client\Factory\Iface
24
{
25
	/** client/html/checkout/standard/standard/subparts
26
	 * List of HTML sub-clients rendered within the checkout standard section
27
	 *
28
	 * The output of the frontend is composed of the code generated by the HTML
29
	 * clients. Each HTML client can consist of serveral (or none) sub-clients
30
	 * that are responsible for rendering certain sub-parts of the output. The
31
	 * sub-clients can contain HTML clients themselves and therefore a
32
	 * hierarchical tree of HTML clients is composed. Each HTML client creates
33
	 * the output that is placed inside the container of its parent.
34
	 *
35
	 * At first, always the HTML code generated by the parent is printed, then
36
	 * the HTML code of its sub-clients. The order of the HTML sub-clients
37
	 * determines the order of the output of these sub-clients inside the parent
38
	 * container. If the configured list of clients is
39
	 *
40
	 *  array( "subclient1", "subclient2" )
41
	 *
42
	 * you can easily change the order of the output by reordering the subparts:
43
	 *
44
	 *  client/html/<clients>/subparts = array( "subclient1", "subclient2" )
45
	 *
46
	 * You can also remove one or more parts if they shouldn't be rendered:
47
	 *
48
	 *  client/html/<clients>/subparts = array( "subclient1" )
49
	 *
50
	 * As the clients only generates structural HTML, the layout defined via CSS
51
	 * should support adding, removing or reordering content by a fluid like
52
	 * design.
53
	 *
54
	 * @param array List of sub-client names
55
	 * @since 2014.03
56
	 * @category Developer
57
	 */
58
	private $subPartPath = 'client/html/checkout/standard/standard/subparts';
59
60
	/** client/html/checkout/standard/address/name
61
	 * Name of the address part used by the checkout standard client implementation
62
	 *
63
	 * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Address\Myname".
64
	 * The name is case-sensitive and you should avoid camel case names like "MyName".
65
	 *
66
	 * @param string Last part of the client class name
67
	 * @since 2014.03
68
	 * @category Developer
69
	 */
70
71
	/** client/html/checkout/standard/delivery/name
72
	 * Name of the delivery part used by the checkout standard client implementation
73
	 *
74
	 * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Delivery\Myname".
75
	 * The name is case-sensitive and you should avoid camel case names like "MyName".
76
	 *
77
	 * @param string Last part of the client class name
78
	 * @since 2014.03
79
	 * @category Developer
80
	 */
81
82
	/** client/html/checkout/standard/payment/name
83
	 * Name of the payment part used by the checkout standard client implementation
84
	 *
85
	 * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Payment\Myname".
86
	 * The name is case-sensitive and you should avoid camel case names like "MyName".
87
	 *
88
	 * @param string Last part of the client class name
89
	 * @since 2014.03
90
	 * @category Developer
91
	 */
92
93
	/** client/html/checkout/standard/summary/name
94
	 * Name of the summary part used by the checkout standard client implementation
95
	 *
96
	 * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Summary\Myname".
97
	 * The name is case-sensitive and you should avoid camel case names like "MyName".
98
	 *
99
	 * @param string Last part of the client class name
100
	 * @since 2014.03
101
	 * @category Developer
102
	 */
103
104
	/** client/html/checkout/standard/process/name
105
	 * Name of the process part used by the checkout standard client implementation
106
	 *
107
	 * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Process\Myname".
108
	 * The name is case-sensitive and you should avoid camel case names like "MyName".
109
	 *
110
	 * @param string Last part of the client class name
111
	 * @since 2015.07
112
	 * @category Developer
113
	 */
114
	private $subPartNames = array( 'address', 'delivery', 'payment', 'summary', 'process' );
115
	private $view;
116
117
118
	/**
119
	 * Returns the HTML code for insertion into the body.
120
	 *
121
	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
122
	 * @return string HTML code
123
	 */
124
	public function getBody( string $uid = '' ) : string
125
	{
126
		$context = $this->getContext();
127
		$view = $this->getView();
128
129
		try
130
		{
131
			if( !isset( $this->view ) ) {
132
				$view = $this->view = $this->getObject()->addData( $view );
133
			}
134
135
			$html = '';
136
			foreach( $this->getSubClients() as $subclient ) {
137
				$html .= $subclient->setView( $view )->getBody( $uid );
138
			}
139
			$view->standardBody = $html;
140
		}
141
		catch( \Aimeos\Client\Html\Exception $e )
142
		{
143
			$error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) );
144
			$view->standardErrorList = array_merge( $view->get( 'standardErrorList', [] ), $error );
145
		}
146
		catch( \Aimeos\Controller\Frontend\Exception $e )
147
		{
148
			$error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
149
			$view->standardErrorList = array_merge( $view->get( 'standardErrorList', [] ), $error );
150
		}
151
		catch( \Aimeos\MShop\Exception $e )
152
		{
153
			$error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
154
			$view->standardErrorList = array_merge( $view->get( 'standardErrorList', [] ), $error );
155
		}
156
		catch( \Exception $e )
157
		{
158
			$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
159
			$view->standardErrorList = array_merge( $view->get( 'standardErrorList', [] ), $error );
160
			$this->logException( $e );
161
		}
162
163
		/** client/html/checkout/standard/standard/template-body
164
		 * Relative path to the HTML body template of the checkout standard client.
165
		 *
166
		 * The template file contains the HTML code and processing instructions
167
		 * to generate the result shown in the body of the frontend. The
168
		 * configuration string is the path to the template file relative
169
		 * to the templates directory (usually in client/html/templates).
170
		 *
171
		 * You can overwrite the template file configuration in extensions and
172
		 * provide alternative templates. These alternative templates should be
173
		 * named like the default one but with the string "standard" replaced by
174
		 * an unique name. You may use the name of your project for this. If
175
		 * you've implemented an alternative client class as well, "standard"
176
		 * should be replaced by the name of the new class.
177
		 *
178
		 * @param string Relative path to the template creating code for the HTML page body
179
		 * @since 2014.03
180
		 * @category Developer
181
		 * @see client/html/checkout/standard/standard/template-header
182
		 */
183
		$tplconf = 'client/html/checkout/standard/standard/template-body';
184
		$default = 'checkout/standard/body-standard';
185
186
		return $view->render( $view->config( $tplconf, $default ) );
187
	}
188
189
190
	/**
191
	 * Returns the HTML string for insertion into the header.
192
	 *
193
	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
194
	 * @return string|null String including HTML tags for the header on error
195
	 */
196
	public function getHeader( string $uid = '' ) : ?string
197
	{
198
		$view = $this->getView();
199
200
		try
201
		{
202
			if( !isset( $this->view ) ) {
203
				$view = $this->view = $this->getObject()->addData( $view );
204
			}
205
206
			$html = '';
207
			foreach( $this->getSubClients() as $subclient ) {
208
				$html .= $subclient->setView( $view )->getHeader( $uid );
209
			}
210
			$view->standardHeader = $html;
211
212
			/** client/html/checkout/standard/standard/template-header
213
			 * Relative path to the HTML header template of the checkout standard client.
214
			 *
215
			 * The template file contains the HTML code and processing instructions
216
			 * to generate the HTML code that is inserted into the HTML page header
217
			 * of the rendered page in the frontend. The configuration string is the
218
			 * path to the template file relative to the templates directory (usually
219
			 * in client/html/templates).
220
			 *
221
			 * You can overwrite the template file configuration in extensions and
222
			 * provide alternative templates. These alternative templates should be
223
			 * named like the default one but with the string "standard" replaced by
224
			 * an unique name. You may use the name of your project for this. If
225
			 * you've implemented an alternative client class as well, "standard"
226
			 * should be replaced by the name of the new class.
227
			 *
228
			 * @param string Relative path to the template creating code for the HTML page head
229
			 * @since 2014.03
230
			 * @category Developer
231
			 * @see client/html/checkout/standard/standard/template-body
232
			 */
233
			$tplconf = 'client/html/checkout/standard/standard/template-header';
234
			$default = 'checkout/standard/header-standard';
235
236
			return $view->render( $view->config( $tplconf, $default ) );
237
		}
238
		catch( \Exception $e )
239
		{
240
			$this->logException( $e );
241
		}
242
243
		return null;
244
	}
245
246
247
	/**
248
	 * Returns the sub-client given by its name.
249
	 *
250
	 * @param string $type Name of the client type
251
	 * @param string|null $name Name of the sub-client (Default if null)
252
	 * @return \Aimeos\Client\Html\Iface Sub-client object
253
	 */
254
	public function getSubClient( string $type, string $name = null ) : \Aimeos\Client\Html\Iface
255
	{
256
		/** client/html/checkout/standard/decorators/excludes
257
		 * Excludes decorators added by the "common" option from the checkout standard html client
258
		 *
259
		 * Decorators extend the functionality of a class by adding new aspects
260
		 * (e.g. log what is currently done), executing the methods of the underlying
261
		 * class only in certain conditions (e.g. only for logged in users) or
262
		 * modify what is returned to the caller.
263
		 *
264
		 * This option allows you to remove a decorator added via
265
		 * "client/html/common/decorators/default" before they are wrapped
266
		 * around the html client.
267
		 *
268
		 *  client/html/checkout/standard/decorators/excludes = array( 'decorator1' )
269
		 *
270
		 * This would remove the decorator named "decorator1" from the list of
271
		 * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
272
		 * "client/html/common/decorators/default" to the html client.
273
		 *
274
		 * @param array List of decorator names
275
		 * @since 2014.05
276
		 * @category Developer
277
		 * @see client/html/common/decorators/default
278
		 * @see client/html/checkout/standard/decorators/global
279
		 * @see client/html/checkout/standard/decorators/local
280
		 */
281
282
		/** client/html/checkout/standard/decorators/global
283
		 * Adds a list of globally available decorators only to the checkout standard html client
284
		 *
285
		 * Decorators extend the functionality of a class by adding new aspects
286
		 * (e.g. log what is currently done), executing the methods of the underlying
287
		 * class only in certain conditions (e.g. only for logged in users) or
288
		 * modify what is returned to the caller.
289
		 *
290
		 * This option allows you to wrap global decorators
291
		 * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
292
		 *
293
		 *  client/html/checkout/standard/decorators/global = array( 'decorator1' )
294
		 *
295
		 * This would add the decorator named "decorator1" defined by
296
		 * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
297
		 *
298
		 * @param array List of decorator names
299
		 * @since 2014.05
300
		 * @category Developer
301
		 * @see client/html/common/decorators/default
302
		 * @see client/html/checkout/standard/decorators/excludes
303
		 * @see client/html/checkout/standard/decorators/local
304
		 */
305
306
		/** client/html/checkout/standard/decorators/local
307
		 * Adds a list of local decorators only to the checkout standard html client
308
		 *
309
		 * Decorators extend the functionality of a class by adding new aspects
310
		 * (e.g. log what is currently done), executing the methods of the underlying
311
		 * class only in certain conditions (e.g. only for logged in users) or
312
		 * modify what is returned to the caller.
313
		 *
314
		 * This option allows you to wrap local decorators
315
		 * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
316
		 *
317
		 *  client/html/checkout/standard/decorators/local = array( 'decorator2' )
318
		 *
319
		 * This would add the decorator named "decorator2" defined by
320
		 * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
321
		 *
322
		 * @param array List of decorator names
323
		 * @since 2014.05
324
		 * @category Developer
325
		 * @see client/html/common/decorators/default
326
		 * @see client/html/checkout/standard/decorators/excludes
327
		 * @see client/html/checkout/standard/decorators/global
328
		 */
329
330
		return $this->createSubClient( 'checkout/standard/' . $type, $name );
331
	}
332
333
334
	/**
335
	 * Processes the input, e.g. store given values.
336
	 *
337
	 * A view must be available and this method doesn't generate any output
338
	 * besides setting view variables.
339
	 */
340
	public function process()
341
	{
342
		$view = $this->getView();
343
		$context = $this->getContext();
344
345
		try
346
		{
347
			parent::process();
348
		}
349
		catch( \Aimeos\Client\Html\Exception $e )
350
		{
351
			$error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) );
352
			$view->standardErrorList = array_merge( $view->get( 'standardErrorList', [] ), $error );
353
		}
354
		catch( \Aimeos\Controller\Frontend\Exception $e )
355
		{
356
			$error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
357
			$view->standardErrorList = array_merge( $view->get( 'standardErrorList', [] ), $error );
358
		}
359
		catch( \Aimeos\MShop\Exception $e )
360
		{
361
			$error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
362
			$view->standardErrorList = array_merge( $view->get( 'standardErrorList', [] ), $error );
363
		}
364
		catch( \Exception $e )
365
		{
366
			$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
367
			$view->standardErrorList = array_merge( $view->get( 'standardErrorList', [] ), $error );
368
			$this->logException( $e );
369
		}
370
	}
371
372
373
	/**
374
	 * Returns the list of sub-client names configured for the client.
375
	 *
376
	 * @return array List of HTML client names
377
	 */
378
	protected function getSubClientNames() : array
379
	{
380
		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
381
	}
382
383
384
	/**
385
	 * Sets the necessary parameter values in the view.
386
	 *
387
	 * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
388
	 * @param array &$tags Result array for the list of tags that are associated to the output
389
	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
390
	 * @return \Aimeos\MW\View\Iface Modified view object
391
	 */
392
	public function addData( \Aimeos\MW\View\Iface $view, array &$tags = [], string &$expire = null ) : \Aimeos\MW\View\Iface
393
	{
394
		$context = $this->getContext();
395
396
		$basketCntl = \Aimeos\Controller\Frontend::create( $context, 'basket' );
397
		$view->standardBasket = $basketCntl->get();
398
399
400
		/** client/html/checkout/standard/url/step-active
401
		 * Name of the checkout process step to jump to if no previous step requires attention
402
		 *
403
		 * The checkout process consists of several steps which are usually
404
		 * displayed one by another to the customer. If the data of a step
405
		 * is already available, then that step is skipped. The active step
406
		 * is the one that is displayed if all other steps are skipped.
407
		 *
408
		 * If one of the previous steps misses some data the customer has
409
		 * to enter, then this step is displayed first. After providing
410
		 * the missing data, the whole series of steps are tested again
411
		 * and if no other step requests attention, the configured active
412
		 * step will be displayed.
413
		 *
414
		 * The order of the steps is determined by the order of sub-parts
415
		 * that are configured for the checkout client.
416
		 *
417
		 * @param string Name of the confirm standard HTML client
418
		 * @since 2014.07
419
		 * @category Developer
420
		 * @category User
421
		 * @see client/html/checkout/standard/standard/subparts
422
		 */
423
		$default = $view->config( 'client/html/checkout/standard/url/step-active', 'summary' );
424
425
		/** client/html/checkout/standard/onepage
426
		 * Shows all named checkout subparts at once for a one page checkout
427
		 *
428
		 * Normally, the checkout process is divided into several steps for entering
429
		 * addresses, select delivery and payment options as well as showing the
430
		 * summary page. This enables dependencies between two steps like showing
431
		 * delivery options based on the address entered by the customer. Furthermore,
432
		 * this is good way to limit the amount of information displayed which is
433
		 * preferred by mobile users.
434
		 *
435
		 * Contrary to that, a one page checkout displays all information on only
436
		 * one page and customers get an immediate overview of which information
437
		 * they have to enter and what options they can select from. This is an
438
		 * advantage if only a very limited amount of information must be entered
439
		 * or if there are almost no options to choose from and no dependencies
440
		 * between exist.
441
		 *
442
		 * Using this config options, shop developers are able to define which
443
		 * checkout subparts are combined to a one page view. Simply add the names
444
		 * of all checkout subparts to the list. Available checkout subparts for
445
		 * a one page checkout are:
446
		 * * address
447
		 * * delivery
448
		 * * payment
449
		 * * summary
450
		 *
451
		 * @param array List of checkout subparts name
452
		 * @since 2015.05
453
		 * @category Developer
454
		 */
455
		$onepage = $view->config( 'client/html/checkout/standard/onepage', [] );
456
		$onestep = ( !empty( $onepage ) ? array_shift( $onepage ) : $default ); // keep the first one page step
457
458
		$steps = (array) $context->getConfig()->get( $this->subPartPath, $this->subPartNames );
459
		$steps = array_diff( $steps, $onepage ); // remove all remaining steps in $onepage
460
461
		// use first step if default step isn't available
462
		$default = ( !in_array( $default, $steps ) ? reset( $steps ) : $default );
463
		$current = $view->param( 'c_step', $default );
464
465
		// use $onestep if the current step isn't available due to one page layout
466
		if( !in_array( $current, $steps ) ) {
467
			$current = $onestep;
468
		}
469
470
		// use $onestep if the active step isn't available due to one page layout
471
		if( isset( $view->standardStepActive ) && in_array( $view->standardStepActive, $onepage ) ) {
472
			$view->standardStepActive = $onestep;
473
		}
474
475
		$cpos = array_search( $current, $steps );
476
477
		if( !isset( $view->standardStepActive )
478
			|| ( ( $apos = array_search( $view->standardStepActive, $steps ) ) !== false
479
			&& $cpos !== false && $cpos < $apos )
480
		) {
481
			$view->standardStepActive = $current;
482
		}
483
484
		$cpos = (int) array_search( $view->standardStepActive, $steps );
485
486
		$view->standardStepsBefore = array_slice( $steps, 0, $cpos );
487
		$view->standardStepsAfter = array_slice( $steps, $cpos + 1 );
488
489
		$view = $this->addNavigationUrls( $view, $steps, $view->standardStepActive );
490
		$view->standardSteps = $steps;
491
492
		return parent::addData( $view, $tags, $expire );
493
	}
494
495
496
	/**
497
	 * Adds the "back" and "next" URLs to the view
498
	 *
499
	 * @param \Aimeos\MW\View\Iface $view View object
500
	 * @param array $steps List of checkout step names
501
	 * @param string $activeStep Name of the active step
502
	 * @return \Aimeos\MW\View\Iface Enhanced view object
503
	 * @since 2016.05
504
	 */
505
	protected function addNavigationUrls( \Aimeos\MW\View\Iface $view, array $steps, string $activeStep ) : \Aimeos\MW\View\Iface
506
	{
507
		/** client/html/checkout/standard/url/target
508
		 * Destination of the URL where the controller specified in the URL is known
509
		 *
510
		 * The destination can be a page ID like in a content management system or the
511
		 * module of a software development framework. This "target" must contain or know
512
		 * the controller that should be called by the generated URL.
513
		 *
514
		 * @param string Destination of the URL
515
		 * @since 2014.03
516
		 * @category Developer
517
		 * @see client/html/checkout/standard/url/controller
518
		 * @see client/html/checkout/standard/url/action
519
		 * @see client/html/checkout/standard/url/config
520
		 */
521
		$cTarget = $view->config( 'client/html/checkout/standard/url/target' );
522
523
		/** client/html/checkout/standard/url/controller
524
		 * Name of the controller whose action should be called
525
		 *
526
		 * In Model-View-Controller (MVC) applications, the controller contains the methods
527
		 * that create parts of the output displayed in the generated HTML page. Controller
528
		 * names are usually alpha-numeric.
529
		 *
530
		 * @param string Name of the controller
531
		 * @since 2014.03
532
		 * @category Developer
533
		 * @see client/html/checkout/standard/url/target
534
		 * @see client/html/checkout/standard/url/action
535
		 * @see client/html/checkout/standard/url/config
536
		 */
537
		$cCntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' );
538
539
		/** client/html/checkout/standard/url/action
540
		 * Name of the action that should create the output
541
		 *
542
		 * In Model-View-Controller (MVC) applications, actions are the methods of a
543
		 * controller that create parts of the output displayed in the generated HTML page.
544
		 * Action names are usually alpha-numeric.
545
		 *
546
		 * @param string Name of the action
547
		 * @since 2014.03
548
		 * @category Developer
549
		 * @see client/html/checkout/standard/url/target
550
		 * @see client/html/checkout/standard/url/controller
551
		 * @see client/html/checkout/standard/url/config
552
		 */
553
		$cAction = $view->config( 'client/html/checkout/standard/url/action', 'index' );
554
555
		/** client/html/checkout/standard/url/config
556
		 * Associative list of configuration options used for generating the URL
557
		 *
558
		 * You can specify additional options as key/value pairs used when generating
559
		 * the URLs, like
560
		 *
561
		 *  client/html/<clientname>/url/config = array( 'absoluteUri' => true )
562
		 *
563
		 * The available key/value pairs depend on the application that embeds the e-commerce
564
		 * framework. This is because the infrastructure of the application is used for
565
		 * generating the URLs. The full list of available config options is referenced
566
		 * in the "see also" section of this page.
567
		 *
568
		 * @param string Associative list of configuration options
569
		 * @since 2014.03
570
		 * @category Developer
571
		 * @see client/html/checkout/standard/url/target
572
		 * @see client/html/checkout/standard/url/controller
573
		 * @see client/html/checkout/standard/url/action
574
		 * @see client/html/url/config
575
		 */
576
		$cConfig = $view->config( 'client/html/checkout/standard/url/config', [] );
577
578
579
		$bTarget = $view->config( 'client/html/basket/standard/url/target' );
580
		$bCntl = $view->config( 'client/html/basket/standard/url/controller', 'basket' );
581
		$bAction = $view->config( 'client/html/basket/standard/url/action', 'index' );
582
		$bConfig = $view->config( 'client/html/basket/standard/url/config', [] );
583
584
585
		$step = null;
586
		do {
587
			$lastStep = $step;
588
		}
589
		while( ( $step = array_shift( $steps ) ) !== null && $step !== $activeStep );
590
591
592
		if( $lastStep !== null ) {
0 ignored issues
show
introduced by
The condition $lastStep !== null is always false.
Loading history...
593
			$param = array( 'c_step' => $lastStep );
594
			$view->standardUrlBack = $view->url( $cTarget, $cCntl, $cAction, $param, [], $cConfig );
595
		} else {
596
			$view->standardUrlBack = $view->url( $bTarget, $bCntl, $bAction, [], [], $bConfig );
597
		}
598
599
		if( !isset( $view->standardUrlNext ) && ( $nextStep = array_shift( $steps ) ) !== null ) {
600
			$param = array( 'c_step' => $nextStep );
601
			$view->standardUrlNext = $view->url( $cTarget, $cCntl, $cAction, $param, [], $cConfig );
602
		}
603
		// don't overwrite $view->standardUrlNext so process step URL is used
604
605
		return $view;
606
	}
607
}
608