Completed
Push — master ( 8b8334...2005c2 )
by Aimeos
07:11
created
client/html/src/Client/Html/Checkout/Standard/Summary/Service/Standard.php 1 patch
Indentation   +235 added lines, -235 removed lines patch added patch discarded remove patch
@@ -19,263 +19,263 @@
 block discarded – undo
19 19
  * @subpackage Html
20 20
  */
21 21
 class Standard
22
-	extends \Aimeos\Client\Html\Common\Summary\Service\Base
23
-	implements \Aimeos\Client\Html\Common\Client\Factory\Iface
22
+    extends \Aimeos\Client\Html\Common\Summary\Service\Base
23
+    implements \Aimeos\Client\Html\Common\Client\Factory\Iface
24 24
 {
25
-	/** client/html/checkout/standard/summary/service/standard/subparts
26
-	 * List of HTML sub-clients rendered within the checkout standard summary service 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 2015.11
56
-	 * @category Developer
57
-	 */
58
-	private $subPartPath = 'client/html/checkout/standard/summary/service/standard/subparts';
59
-	private $subPartNames = array();
60
-	private $cache;
25
+    /** client/html/checkout/standard/summary/service/standard/subparts
26
+     * List of HTML sub-clients rendered within the checkout standard summary service 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 2015.11
56
+     * @category Developer
57
+     */
58
+    private $subPartPath = 'client/html/checkout/standard/summary/service/standard/subparts';
59
+    private $subPartNames = array();
60
+    private $cache;
61 61
 
62 62
 
63
-	/**
64
-	 * Returns the HTML code for insertion into the body.
65
-	 *
66
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
67
-	 * @param array &$tags Result array for the list of tags that are associated to the output
68
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
69
-	 * @return string HTML code
70
-	*/
71
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
72
-	{
73
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
63
+    /**
64
+     * Returns the HTML code for insertion into the body.
65
+     *
66
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
67
+     * @param array &$tags Result array for the list of tags that are associated to the output
68
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
69
+     * @return string HTML code
70
+     */
71
+    public function getBody( $uid = '', array &$tags = array(), &$expire = null )
72
+    {
73
+        $view = $this->setViewParams( $this->getView(), $tags, $expire );
74 74
 
75
-		$html = '';
76
-		foreach( $this->getSubClients() as $subclient ) {
77
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
78
-		}
79
-		$view->serviceBody = $html;
75
+        $html = '';
76
+        foreach( $this->getSubClients() as $subclient ) {
77
+            $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
78
+        }
79
+        $view->serviceBody = $html;
80 80
 
81
-		/** client/html/checkout/standard/summary/service/standard/template-body
82
-		 * Relative path to the HTML body template of the checkout standard summary service client.
83
-		 *
84
-		 * The template file contains the HTML code and processing instructions
85
-		 * to generate the result shown in the body of the frontend. The
86
-		 * configuration string is the path to the template file relative
87
-		 * to the templates directory (usually in client/html/templates).
88
-		 *
89
-		 * You can overwrite the template file configuration in extensions and
90
-		 * provide alternative templates. These alternative templates should be
91
-		 * named like the default one but with the string "standard" replaced by
92
-		 * an unique name. You may use the name of your project for this. If
93
-		 * you've implemented an alternative client class as well, "standard"
94
-		 * (second one) should be replaced by the name of the new class in lower
95
-		 * case.
96
-		 *
97
-		 * @param string Relative path to the template creating code for the HTML page body
98
-		 * @since 2015.11
99
-		 * @category Developer
100
-		 * @see client/html/checkout/standard/summary/service/standard/template-header
101
-		 */
102
-		$tplconf = 'client/html/checkout/standard/summary/service/standard/template-body';
103
-		$default = 'common/summary/service-body-default.php';
81
+        /** client/html/checkout/standard/summary/service/standard/template-body
82
+         * Relative path to the HTML body template of the checkout standard summary service client.
83
+         *
84
+         * The template file contains the HTML code and processing instructions
85
+         * to generate the result shown in the body of the frontend. The
86
+         * configuration string is the path to the template file relative
87
+         * to the templates directory (usually in client/html/templates).
88
+         *
89
+         * You can overwrite the template file configuration in extensions and
90
+         * provide alternative templates. These alternative templates should be
91
+         * named like the default one but with the string "standard" replaced by
92
+         * an unique name. You may use the name of your project for this. If
93
+         * you've implemented an alternative client class as well, "standard"
94
+         * (second one) should be replaced by the name of the new class in lower
95
+         * case.
96
+         *
97
+         * @param string Relative path to the template creating code for the HTML page body
98
+         * @since 2015.11
99
+         * @category Developer
100
+         * @see client/html/checkout/standard/summary/service/standard/template-header
101
+         */
102
+        $tplconf = 'client/html/checkout/standard/summary/service/standard/template-body';
103
+        $default = 'common/summary/service-body-default.php';
104 104
 
105
-		return $view->render( $view->config( $tplconf, $default ) );
106
-	}
105
+        return $view->render( $view->config( $tplconf, $default ) );
106
+    }
107 107
 
108 108
 
109
-	/**
110
-	 * Returns the HTML string for insertion into the header.
111
-	 *
112
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
113
-	 * @param array &$tags Result array for the list of tags that are associated to the output
114
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
115
-	 * @return string|null String including HTML tags for the header on error
116
-	 */
117
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
118
-	{
119
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
109
+    /**
110
+     * Returns the HTML string for insertion into the header.
111
+     *
112
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
113
+     * @param array &$tags Result array for the list of tags that are associated to the output
114
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
115
+     * @return string|null String including HTML tags for the header on error
116
+     */
117
+    public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
118
+    {
119
+        $view = $this->setViewParams( $this->getView(), $tags, $expire );
120 120
 
121
-		$html = '';
122
-		foreach( $this->getSubClients() as $subclient ) {
123
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
124
-		}
125
-		$view->serviceHeader = $html;
121
+        $html = '';
122
+        foreach( $this->getSubClients() as $subclient ) {
123
+            $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
124
+        }
125
+        $view->serviceHeader = $html;
126 126
 
127
-		/** client/html/checkout/standard/summary/service/standard/template-header
128
-		 * Relative path to the HTML header template of the checkout standard summary service client.
129
-		 *
130
-		 * The template file contains the HTML code and processing instructions
131
-		 * to generate the HTML code that is inserted into the HTML page header
132
-		 * of the rendered page in the frontend. The configuration string is the
133
-		 * path to the template file relative to the templates directory (usually
134
-		 * in client/html/templates).
135
-		 *
136
-		 * You can overwrite the template file configuration in extensions and
137
-		 * provide alternative templates. These alternative templates should be
138
-		 * named like the default one but with the string "standard" replaced by
139
-		 * an unique name. You may use the name of your project for this. If
140
-		 * you've implemented an alternative client class as well, "standard"
141
-		 * (second one) should be replaced by the name of the new class in lower
142
-		 * case.
143
-		 *
144
-		 * @param string Relative path to the template creating code for the HTML page head
145
-		 * @since 2015.11
146
-		 * @category Developer
147
-		 * @see client/html/checkout/standard/summary/service/standard/template-body
148
-		 */
149
-		$tplconf = 'client/html/checkout/standard/summary/service/standard/template-header';
150
-		$default = 'common/summary/service-header-default.php';
127
+        /** client/html/checkout/standard/summary/service/standard/template-header
128
+         * Relative path to the HTML header template of the checkout standard summary service client.
129
+         *
130
+         * The template file contains the HTML code and processing instructions
131
+         * to generate the HTML code that is inserted into the HTML page header
132
+         * of the rendered page in the frontend. The configuration string is the
133
+         * path to the template file relative to the templates directory (usually
134
+         * in client/html/templates).
135
+         *
136
+         * You can overwrite the template file configuration in extensions and
137
+         * provide alternative templates. These alternative templates should be
138
+         * named like the default one but with the string "standard" replaced by
139
+         * an unique name. You may use the name of your project for this. If
140
+         * you've implemented an alternative client class as well, "standard"
141
+         * (second one) should be replaced by the name of the new class in lower
142
+         * case.
143
+         *
144
+         * @param string Relative path to the template creating code for the HTML page head
145
+         * @since 2015.11
146
+         * @category Developer
147
+         * @see client/html/checkout/standard/summary/service/standard/template-body
148
+         */
149
+        $tplconf = 'client/html/checkout/standard/summary/service/standard/template-header';
150
+        $default = 'common/summary/service-header-default.php';
151 151
 
152
-		return $view->render( $view->config( $tplconf, $default ) );
153
-	}
152
+        return $view->render( $view->config( $tplconf, $default ) );
153
+    }
154 154
 
155 155
 
156
-	/**
157
-	 * Returns the sub-client given by its name.
158
-	 *
159
-	 * @param string $type Name of the client type
160
-	 * @param string|null $name Name of the sub-client (Default if null)
161
-	 * @return \Aimeos\Client\Html\Iface Sub-client object
162
-	 */
163
-	public function getSubClient( $type, $name = null )
164
-	{
165
-		/** client/html/checkout/standard/summary/service/decorators/excludes
166
-		 * Excludes decorators added by the "common" option from the checkout standard summary service html client
167
-		 *
168
-		 * Decorators extend the functionality of a class by adding new aspects
169
-		 * (e.g. log what is currently done), executing the methods of the underlying
170
-		 * class only in certain conditions (e.g. only for logged in users) or
171
-		 * modify what is returned to the caller.
172
-		 *
173
-		 * This option allows you to remove a decorator added via
174
-		 * "client/html/common/decorators/default" before they are wrapped
175
-		 * around the html client.
176
-		 *
177
-		 *  client/html/checkout/standard/summary/service/decorators/excludes = array( 'decorator1' )
178
-		 *
179
-		 * This would remove the decorator named "decorator1" from the list of
180
-		 * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
181
-		 * "client/html/common/decorators/default" to the html client.
182
-		 *
183
-		 * @param array List of decorator names
184
-		 * @since 2015.08
185
-		 * @category Developer
186
-		 * @see client/html/common/decorators/default
187
-		 * @see client/html/checkout/standard/summary/service/decorators/global
188
-		 * @see client/html/checkout/standard/summary/service/decorators/local
189
-		 */
156
+    /**
157
+     * Returns the sub-client given by its name.
158
+     *
159
+     * @param string $type Name of the client type
160
+     * @param string|null $name Name of the sub-client (Default if null)
161
+     * @return \Aimeos\Client\Html\Iface Sub-client object
162
+     */
163
+    public function getSubClient( $type, $name = null )
164
+    {
165
+        /** client/html/checkout/standard/summary/service/decorators/excludes
166
+         * Excludes decorators added by the "common" option from the checkout standard summary service html client
167
+         *
168
+         * Decorators extend the functionality of a class by adding new aspects
169
+         * (e.g. log what is currently done), executing the methods of the underlying
170
+         * class only in certain conditions (e.g. only for logged in users) or
171
+         * modify what is returned to the caller.
172
+         *
173
+         * This option allows you to remove a decorator added via
174
+         * "client/html/common/decorators/default" before they are wrapped
175
+         * around the html client.
176
+         *
177
+         *  client/html/checkout/standard/summary/service/decorators/excludes = array( 'decorator1' )
178
+         *
179
+         * This would remove the decorator named "decorator1" from the list of
180
+         * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
181
+         * "client/html/common/decorators/default" to the html client.
182
+         *
183
+         * @param array List of decorator names
184
+         * @since 2015.08
185
+         * @category Developer
186
+         * @see client/html/common/decorators/default
187
+         * @see client/html/checkout/standard/summary/service/decorators/global
188
+         * @see client/html/checkout/standard/summary/service/decorators/local
189
+         */
190 190
 
191
-		/** client/html/checkout/standard/summary/service/decorators/global
192
-		 * Adds a list of globally available decorators only to the checkout standard summary service html client
193
-		 *
194
-		 * Decorators extend the functionality of a class by adding new aspects
195
-		 * (e.g. log what is currently done), executing the methods of the underlying
196
-		 * class only in certain conditions (e.g. only for logged in users) or
197
-		 * modify what is returned to the caller.
198
-		 *
199
-		 * This option allows you to wrap global decorators
200
-		 * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
201
-		 *
202
-		 *  client/html/checkout/standard/summary/service/decorators/global = array( 'decorator1' )
203
-		 *
204
-		 * This would add the decorator named "decorator1" defined by
205
-		 * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
206
-		 *
207
-		 * @param array List of decorator names
208
-		 * @since 2015.08
209
-		 * @category Developer
210
-		 * @see client/html/common/decorators/default
211
-		 * @see client/html/checkout/standard/summary/service/decorators/excludes
212
-		 * @see client/html/checkout/standard/summary/service/decorators/local
213
-		 */
191
+        /** client/html/checkout/standard/summary/service/decorators/global
192
+         * Adds a list of globally available decorators only to the checkout standard summary service html client
193
+         *
194
+         * Decorators extend the functionality of a class by adding new aspects
195
+         * (e.g. log what is currently done), executing the methods of the underlying
196
+         * class only in certain conditions (e.g. only for logged in users) or
197
+         * modify what is returned to the caller.
198
+         *
199
+         * This option allows you to wrap global decorators
200
+         * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
201
+         *
202
+         *  client/html/checkout/standard/summary/service/decorators/global = array( 'decorator1' )
203
+         *
204
+         * This would add the decorator named "decorator1" defined by
205
+         * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
206
+         *
207
+         * @param array List of decorator names
208
+         * @since 2015.08
209
+         * @category Developer
210
+         * @see client/html/common/decorators/default
211
+         * @see client/html/checkout/standard/summary/service/decorators/excludes
212
+         * @see client/html/checkout/standard/summary/service/decorators/local
213
+         */
214 214
 
215
-		/** client/html/checkout/standard/summary/service/decorators/local
216
-		 * Adds a list of local decorators only to the checkout standard summary service html client
217
-		 *
218
-		 * Decorators extend the functionality of a class by adding new aspects
219
-		 * (e.g. log what is currently done), executing the methods of the underlying
220
-		 * class only in certain conditions (e.g. only for logged in users) or
221
-		 * modify what is returned to the caller.
222
-		 *
223
-		 * This option allows you to wrap local decorators
224
-		 * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
225
-		 *
226
-		 *  client/html/checkout/standard/summary/service/decorators/local = array( 'decorator2' )
227
-		 *
228
-		 * This would add the decorator named "decorator2" defined by
229
-		 * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
230
-		 *
231
-		 * @param array List of decorator names
232
-		 * @since 2015.08
233
-		 * @category Developer
234
-		 * @see client/html/common/decorators/default
235
-		 * @see client/html/checkout/standard/summary/service/decorators/excludes
236
-		 * @see client/html/checkout/standard/summary/service/decorators/global
237
-		 */
215
+        /** client/html/checkout/standard/summary/service/decorators/local
216
+         * Adds a list of local decorators only to the checkout standard summary service html client
217
+         *
218
+         * Decorators extend the functionality of a class by adding new aspects
219
+         * (e.g. log what is currently done), executing the methods of the underlying
220
+         * class only in certain conditions (e.g. only for logged in users) or
221
+         * modify what is returned to the caller.
222
+         *
223
+         * This option allows you to wrap local decorators
224
+         * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
225
+         *
226
+         *  client/html/checkout/standard/summary/service/decorators/local = array( 'decorator2' )
227
+         *
228
+         * This would add the decorator named "decorator2" defined by
229
+         * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
230
+         *
231
+         * @param array List of decorator names
232
+         * @since 2015.08
233
+         * @category Developer
234
+         * @see client/html/common/decorators/default
235
+         * @see client/html/checkout/standard/summary/service/decorators/excludes
236
+         * @see client/html/checkout/standard/summary/service/decorators/global
237
+         */
238 238
 
239
-		return $this->createSubClient( 'checkout/standard/summary/service/' . $type, $name );
240
-	}
239
+        return $this->createSubClient( 'checkout/standard/summary/service/' . $type, $name );
240
+    }
241 241
 
242 242
 
243
-	/**
244
-	 * Returns the list of sub-client names configured for the client.
245
-	 *
246
-	 * @return array List of HTML client names
247
-	 */
248
-	protected function getSubClientNames()
249
-	{
250
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
251
-	}
243
+    /**
244
+     * Returns the list of sub-client names configured for the client.
245
+     *
246
+     * @return array List of HTML client names
247
+     */
248
+    protected function getSubClientNames()
249
+    {
250
+        return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
251
+    }
252 252
 
253 253
 
254
-	/**
255
-	 * Sets the necessary parameter values in the view.
256
-	 *
257
-	 * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
258
-	 * @param array &$tags Result array for the list of tags that are associated to the output
259
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
260
-	 * @return \Aimeos\MW\View\Iface Modified view object
261
-	 */
262
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
263
-	{
264
-		$view = parent::setViewParams( $view, $tags, $expire );
254
+    /**
255
+     * Sets the necessary parameter values in the view.
256
+     *
257
+     * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
258
+     * @param array &$tags Result array for the list of tags that are associated to the output
259
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
260
+     * @return \Aimeos\MW\View\Iface Modified view object
261
+     */
262
+    protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
263
+    {
264
+        $view = parent::setViewParams( $view, $tags, $expire );
265 265
 
266
-		if( !isset( $this->cache ) )
267
-		{
268
-			$target = $view->config( 'client/html/checkout/standard/url/target' );
269
-			$cntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' );
270
-			$action = $view->config( 'client/html/checkout/standard/url/action', 'index' );
271
-			$config = $view->config( 'client/html/checkout/standard/url/config', array() );
266
+        if( !isset( $this->cache ) )
267
+        {
268
+            $target = $view->config( 'client/html/checkout/standard/url/target' );
269
+            $cntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' );
270
+            $action = $view->config( 'client/html/checkout/standard/url/action', 'index' );
271
+            $config = $view->config( 'client/html/checkout/standard/url/config', array() );
272 272
 
273
-			$view->summaryUrlServicePayment = $view->url( $target, $cntl, $action, array( 'c_step' => 'payment' ), array(), $config );
274
-			$view->summaryUrlServiceDelivery = $view->url( $target, $cntl, $action, array( 'c_step' => 'delivery' ), array(), $config );
273
+            $view->summaryUrlServicePayment = $view->url( $target, $cntl, $action, array( 'c_step' => 'payment' ), array(), $config );
274
+            $view->summaryUrlServiceDelivery = $view->url( $target, $cntl, $action, array( 'c_step' => 'delivery' ), array(), $config );
275 275
 
276
-			$this->cache = $view;
277
-		}
276
+            $this->cache = $view;
277
+        }
278 278
 
279
-		return $this->cache;
280
-	}
279
+        return $this->cache;
280
+    }
281 281
 }
282 282
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Standard/Summary/Option/Standard.php 1 patch
Indentation   +219 added lines, -219 removed lines patch added patch discarded remove patch
@@ -19,242 +19,242 @@
 block discarded – undo
19 19
  * @subpackage Html
20 20
  */
21 21
 class Standard
22
-	extends \Aimeos\Client\Html\Common\Client\Factory\Base
23
-	implements \Aimeos\Client\Html\Iface
22
+    extends \Aimeos\Client\Html\Common\Client\Factory\Base
23
+    implements \Aimeos\Client\Html\Iface
24 24
 {
25
-	/** client/html/checkout/standard/summary/option/standard/subparts
26
-	 * List of HTML sub-clients rendered within the checkout standard summary option 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/summary/option/standard/subparts';
25
+    /** client/html/checkout/standard/summary/option/standard/subparts
26
+     * List of HTML sub-clients rendered within the checkout standard summary option 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/summary/option/standard/subparts';
59 59
 
60
-	/** client/html/checkout/standard/summary/option/terms/name
61
-	 * Name of the terms part used by the checkout standard summary option client implementation
62
-	 *
63
-	 * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Summary\Option\Terms\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
-	private $subPartNames = array( 'terms' );
60
+    /** client/html/checkout/standard/summary/option/terms/name
61
+     * Name of the terms part used by the checkout standard summary option client implementation
62
+     *
63
+     * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Summary\Option\Terms\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
+    private $subPartNames = array( 'terms' );
71 71
 
72 72
 
73
-	/**
74
-	 * Returns the HTML code for insertion into the body.
75
-	 *
76
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
77
-	 * @param array &$tags Result array for the list of tags that are associated to the output
78
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
79
-	 * @return string HTML code
80
-	 */
81
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
82
-	{
83
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
73
+    /**
74
+     * Returns the HTML code for insertion into the body.
75
+     *
76
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
77
+     * @param array &$tags Result array for the list of tags that are associated to the output
78
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
79
+     * @return string HTML code
80
+     */
81
+    public function getBody( $uid = '', array &$tags = array(), &$expire = null )
82
+    {
83
+        $view = $this->setViewParams( $this->getView(), $tags, $expire );
84 84
 
85
-		$html = '';
86
-		foreach( $this->getSubClients() as $subclient ) {
87
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
88
-		}
89
-		$view->optionBody = $html;
85
+        $html = '';
86
+        foreach( $this->getSubClients() as $subclient ) {
87
+            $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
88
+        }
89
+        $view->optionBody = $html;
90 90
 
91
-		/** client/html/checkout/standard/summary/option/standard/template-body
92
-		 * Relative path to the HTML body template of the checkout standard summary option client.
93
-		 *
94
-		 * The template file contains the HTML code and processing instructions
95
-		 * to generate the result shown in the body of the frontend. The
96
-		 * configuration string is the path to the template file relative
97
-		 * to the templates directory (usually in client/html/templates).
98
-		 *
99
-		 * You can overwrite the template file configuration in extensions and
100
-		 * provide alternative templates. These alternative templates should be
101
-		 * named like the default one but with the string "standard" replaced by
102
-		 * an unique name. You may use the name of your project for this. If
103
-		 * you've implemented an alternative client class as well, "standard"
104
-		 * should be replaced by the name of the new class.
105
-		 *
106
-		 * @param string Relative path to the template creating code for the HTML page body
107
-		 * @since 2014.03
108
-		 * @category Developer
109
-		 * @see client/html/checkout/standard/summary/option/standard/template-header
110
-		 */
111
-		$tplconf = 'client/html/checkout/standard/summary/option/standard/template-body';
112
-		$default = 'checkout/standard/summary-option-body-default.php';
91
+        /** client/html/checkout/standard/summary/option/standard/template-body
92
+         * Relative path to the HTML body template of the checkout standard summary option client.
93
+         *
94
+         * The template file contains the HTML code and processing instructions
95
+         * to generate the result shown in the body of the frontend. The
96
+         * configuration string is the path to the template file relative
97
+         * to the templates directory (usually in client/html/templates).
98
+         *
99
+         * You can overwrite the template file configuration in extensions and
100
+         * provide alternative templates. These alternative templates should be
101
+         * named like the default one but with the string "standard" replaced by
102
+         * an unique name. You may use the name of your project for this. If
103
+         * you've implemented an alternative client class as well, "standard"
104
+         * should be replaced by the name of the new class.
105
+         *
106
+         * @param string Relative path to the template creating code for the HTML page body
107
+         * @since 2014.03
108
+         * @category Developer
109
+         * @see client/html/checkout/standard/summary/option/standard/template-header
110
+         */
111
+        $tplconf = 'client/html/checkout/standard/summary/option/standard/template-body';
112
+        $default = 'checkout/standard/summary-option-body-default.php';
113 113
 
114
-		return $view->render( $view->config( $tplconf, $default ) );
115
-	}
114
+        return $view->render( $view->config( $tplconf, $default ) );
115
+    }
116 116
 
117 117
 
118
-	/**
119
-	 * Returns the HTML string for insertion into the header.
120
-	 *
121
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
122
-	 * @param array &$tags Result array for the list of tags that are associated to the output
123
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
124
-	 * @return string|null String including HTML tags for the header on error
125
-	 */
126
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
127
-	{
128
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
118
+    /**
119
+     * Returns the HTML string for insertion into the header.
120
+     *
121
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
122
+     * @param array &$tags Result array for the list of tags that are associated to the output
123
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
124
+     * @return string|null String including HTML tags for the header on error
125
+     */
126
+    public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
127
+    {
128
+        $view = $this->setViewParams( $this->getView(), $tags, $expire );
129 129
 
130
-		$html = '';
131
-		foreach( $this->getSubClients() as $subclient ) {
132
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
133
-		}
134
-		$view->optionHeader = $html;
130
+        $html = '';
131
+        foreach( $this->getSubClients() as $subclient ) {
132
+            $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
133
+        }
134
+        $view->optionHeader = $html;
135 135
 
136
-		/** client/html/checkout/standard/summary/option/standard/template-header
137
-		 * Relative path to the HTML header template of the checkout standard summary option client.
138
-		 *
139
-		 * The template file contains the HTML code and processing instructions
140
-		 * to generate the HTML code that is inserted into the HTML page header
141
-		 * of the rendered page in the frontend. The configuration string is the
142
-		 * path to the template file relative to the templates directory (usually
143
-		 * in client/html/templates).
144
-		 *
145
-		 * You can overwrite the template file configuration in extensions and
146
-		 * provide alternative templates. These alternative templates should be
147
-		 * named like the default one but with the string "standard" replaced by
148
-		 * an unique name. You may use the name of your project for this. If
149
-		 * you've implemented an alternative client class as well, "standard"
150
-		 * should be replaced by the name of the new class.
151
-		 *
152
-		 * @param string Relative path to the template creating code for the HTML page head
153
-		 * @since 2014.03
154
-		 * @category Developer
155
-		 * @see client/html/checkout/standard/summary/option/standard/template-body
156
-		 */
157
-		$tplconf = 'client/html/checkout/standard/summary/option/standard/template-header';
158
-		$default = 'checkout/standard/summary-option-header-default.php';
136
+        /** client/html/checkout/standard/summary/option/standard/template-header
137
+         * Relative path to the HTML header template of the checkout standard summary option client.
138
+         *
139
+         * The template file contains the HTML code and processing instructions
140
+         * to generate the HTML code that is inserted into the HTML page header
141
+         * of the rendered page in the frontend. The configuration string is the
142
+         * path to the template file relative to the templates directory (usually
143
+         * in client/html/templates).
144
+         *
145
+         * You can overwrite the template file configuration in extensions and
146
+         * provide alternative templates. These alternative templates should be
147
+         * named like the default one but with the string "standard" replaced by
148
+         * an unique name. You may use the name of your project for this. If
149
+         * you've implemented an alternative client class as well, "standard"
150
+         * should be replaced by the name of the new class.
151
+         *
152
+         * @param string Relative path to the template creating code for the HTML page head
153
+         * @since 2014.03
154
+         * @category Developer
155
+         * @see client/html/checkout/standard/summary/option/standard/template-body
156
+         */
157
+        $tplconf = 'client/html/checkout/standard/summary/option/standard/template-header';
158
+        $default = 'checkout/standard/summary-option-header-default.php';
159 159
 
160
-		return $view->render( $view->config( $tplconf, $default ) );
161
-	}
160
+        return $view->render( $view->config( $tplconf, $default ) );
161
+    }
162 162
 
163 163
 
164
-	/**
165
-	 * Returns the sub-client given by its name.
166
-	 *
167
-	 * @param string $type Name of the client type
168
-	 * @param string|null $name Name of the sub-client (Default if null)
169
-	 * @return \Aimeos\Client\Html\Iface Sub-client object
170
-	 */
171
-	public function getSubClient( $type, $name = null )
172
-	{
173
-		/** client/html/checkout/standard/summary/option/decorators/excludes
174
-		 * Excludes decorators added by the "common" option from the checkout standard summary option html client
175
-		 *
176
-		 * Decorators extend the functionality of a class by adding new aspects
177
-		 * (e.g. log what is currently done), executing the methods of the underlying
178
-		 * class only in certain conditions (e.g. only for logged in users) or
179
-		 * modify what is returned to the caller.
180
-		 *
181
-		 * This option allows you to remove a decorator added via
182
-		 * "client/html/common/decorators/default" before they are wrapped
183
-		 * around the html client.
184
-		 *
185
-		 *  client/html/checkout/standard/summary/option/decorators/excludes = array( 'decorator1' )
186
-		 *
187
-		 * This would remove the decorator named "decorator1" from the list of
188
-		 * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
189
-		 * "client/html/common/decorators/default" to the html client.
190
-		 *
191
-		 * @param array List of decorator names
192
-		 * @since 2015.08
193
-		 * @category Developer
194
-		 * @see client/html/common/decorators/default
195
-		 * @see client/html/checkout/standard/summary/option/decorators/global
196
-		 * @see client/html/checkout/standard/summary/option/decorators/local
197
-		 */
164
+    /**
165
+     * Returns the sub-client given by its name.
166
+     *
167
+     * @param string $type Name of the client type
168
+     * @param string|null $name Name of the sub-client (Default if null)
169
+     * @return \Aimeos\Client\Html\Iface Sub-client object
170
+     */
171
+    public function getSubClient( $type, $name = null )
172
+    {
173
+        /** client/html/checkout/standard/summary/option/decorators/excludes
174
+         * Excludes decorators added by the "common" option from the checkout standard summary option html client
175
+         *
176
+         * Decorators extend the functionality of a class by adding new aspects
177
+         * (e.g. log what is currently done), executing the methods of the underlying
178
+         * class only in certain conditions (e.g. only for logged in users) or
179
+         * modify what is returned to the caller.
180
+         *
181
+         * This option allows you to remove a decorator added via
182
+         * "client/html/common/decorators/default" before they are wrapped
183
+         * around the html client.
184
+         *
185
+         *  client/html/checkout/standard/summary/option/decorators/excludes = array( 'decorator1' )
186
+         *
187
+         * This would remove the decorator named "decorator1" from the list of
188
+         * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
189
+         * "client/html/common/decorators/default" to the html client.
190
+         *
191
+         * @param array List of decorator names
192
+         * @since 2015.08
193
+         * @category Developer
194
+         * @see client/html/common/decorators/default
195
+         * @see client/html/checkout/standard/summary/option/decorators/global
196
+         * @see client/html/checkout/standard/summary/option/decorators/local
197
+         */
198 198
 
199
-		/** client/html/checkout/standard/summary/option/decorators/global
200
-		 * Adds a list of globally available decorators only to the checkout standard summary option html client
201
-		 *
202
-		 * Decorators extend the functionality of a class by adding new aspects
203
-		 * (e.g. log what is currently done), executing the methods of the underlying
204
-		 * class only in certain conditions (e.g. only for logged in users) or
205
-		 * modify what is returned to the caller.
206
-		 *
207
-		 * This option allows you to wrap global decorators
208
-		 * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
209
-		 *
210
-		 *  client/html/checkout/standard/summary/option/decorators/global = array( 'decorator1' )
211
-		 *
212
-		 * This would add the decorator named "decorator1" defined by
213
-		 * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
214
-		 *
215
-		 * @param array List of decorator names
216
-		 * @since 2015.08
217
-		 * @category Developer
218
-		 * @see client/html/common/decorators/default
219
-		 * @see client/html/checkout/standard/summary/option/decorators/excludes
220
-		 * @see client/html/checkout/standard/summary/option/decorators/local
221
-		 */
199
+        /** client/html/checkout/standard/summary/option/decorators/global
200
+         * Adds a list of globally available decorators only to the checkout standard summary option html client
201
+         *
202
+         * Decorators extend the functionality of a class by adding new aspects
203
+         * (e.g. log what is currently done), executing the methods of the underlying
204
+         * class only in certain conditions (e.g. only for logged in users) or
205
+         * modify what is returned to the caller.
206
+         *
207
+         * This option allows you to wrap global decorators
208
+         * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
209
+         *
210
+         *  client/html/checkout/standard/summary/option/decorators/global = array( 'decorator1' )
211
+         *
212
+         * This would add the decorator named "decorator1" defined by
213
+         * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
214
+         *
215
+         * @param array List of decorator names
216
+         * @since 2015.08
217
+         * @category Developer
218
+         * @see client/html/common/decorators/default
219
+         * @see client/html/checkout/standard/summary/option/decorators/excludes
220
+         * @see client/html/checkout/standard/summary/option/decorators/local
221
+         */
222 222
 
223
-		/** client/html/checkout/standard/summary/option/decorators/local
224
-		 * Adds a list of local decorators only to the checkout standard summary option html client
225
-		 *
226
-		 * Decorators extend the functionality of a class by adding new aspects
227
-		 * (e.g. log what is currently done), executing the methods of the underlying
228
-		 * class only in certain conditions (e.g. only for logged in users) or
229
-		 * modify what is returned to the caller.
230
-		 *
231
-		 * This option allows you to wrap local decorators
232
-		 * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
233
-		 *
234
-		 *  client/html/checkout/standard/summary/option/decorators/local = array( 'decorator2' )
235
-		 *
236
-		 * This would add the decorator named "decorator2" defined by
237
-		 * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
238
-		 *
239
-		 * @param array List of decorator names
240
-		 * @since 2015.08
241
-		 * @category Developer
242
-		 * @see client/html/common/decorators/default
243
-		 * @see client/html/checkout/standard/summary/option/decorators/excludes
244
-		 * @see client/html/checkout/standard/summary/option/decorators/global
245
-		 */
223
+        /** client/html/checkout/standard/summary/option/decorators/local
224
+         * Adds a list of local decorators only to the checkout standard summary option html client
225
+         *
226
+         * Decorators extend the functionality of a class by adding new aspects
227
+         * (e.g. log what is currently done), executing the methods of the underlying
228
+         * class only in certain conditions (e.g. only for logged in users) or
229
+         * modify what is returned to the caller.
230
+         *
231
+         * This option allows you to wrap local decorators
232
+         * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
233
+         *
234
+         *  client/html/checkout/standard/summary/option/decorators/local = array( 'decorator2' )
235
+         *
236
+         * This would add the decorator named "decorator2" defined by
237
+         * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
238
+         *
239
+         * @param array List of decorator names
240
+         * @since 2015.08
241
+         * @category Developer
242
+         * @see client/html/common/decorators/default
243
+         * @see client/html/checkout/standard/summary/option/decorators/excludes
244
+         * @see client/html/checkout/standard/summary/option/decorators/global
245
+         */
246 246
 
247
-		return $this->createSubClient( 'checkout/standard/summary/option/' . $type, $name );
248
-	}
247
+        return $this->createSubClient( 'checkout/standard/summary/option/' . $type, $name );
248
+    }
249 249
 
250 250
 
251
-	/**
252
-	 * Returns the list of sub-client names configured for the client.
253
-	 *
254
-	 * @return array List of HTML client names
255
-	 */
256
-	protected function getSubClientNames()
257
-	{
258
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
259
-	}
251
+    /**
252
+     * Returns the list of sub-client names configured for the client.
253
+     *
254
+     * @return array List of HTML client names
255
+     */
256
+    protected function getSubClientNames()
257
+    {
258
+        return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
259
+    }
260 260
 }
261 261
\ No newline at end of file
Please login to merge, or discard this patch.
html/src/Client/Html/Checkout/Standard/Summary/Option/Terms/Standard.php 1 patch
Indentation   +230 added lines, -230 removed lines patch added patch discarded remove patch
@@ -19,258 +19,258 @@
 block discarded – undo
19 19
  * @subpackage Html
20 20
  */
21 21
 class Standard
22
-	extends \Aimeos\Client\Html\Common\Client\Factory\Base
23
-	implements \Aimeos\Client\Html\Iface
22
+    extends \Aimeos\Client\Html\Common\Client\Factory\Base
23
+    implements \Aimeos\Client\Html\Iface
24 24
 {
25
-	/** client/html/checkout/standard/summary/option/terms/standard/subparts
26
-	 * List of HTML sub-clients rendered within the checkout standard summary option terms 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/summary/option/terms/standard/subparts';
59
-	private $subPartNames = array();
25
+    /** client/html/checkout/standard/summary/option/terms/standard/subparts
26
+     * List of HTML sub-clients rendered within the checkout standard summary option terms 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/summary/option/terms/standard/subparts';
59
+    private $subPartNames = array();
60 60
 
61 61
 
62
-	/**
63
-	 * Returns the HTML code for insertion into the body.
64
-	 *
65
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
66
-	 * @param array &$tags Result array for the list of tags that are associated to the output
67
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
68
-	 * @return string HTML code
69
-	 */
70
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
71
-	{
72
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
62
+    /**
63
+     * Returns the HTML code for insertion into the body.
64
+     *
65
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
66
+     * @param array &$tags Result array for the list of tags that are associated to the output
67
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
68
+     * @return string HTML code
69
+     */
70
+    public function getBody( $uid = '', array &$tags = array(), &$expire = null )
71
+    {
72
+        $view = $this->setViewParams( $this->getView(), $tags, $expire );
73 73
 
74
-		$html = '';
75
-		foreach( $this->getSubClients() as $subclient ) {
76
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
77
-		}
78
-		$view->optionBody = $html;
74
+        $html = '';
75
+        foreach( $this->getSubClients() as $subclient ) {
76
+            $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
77
+        }
78
+        $view->optionBody = $html;
79 79
 
80
-		/** client/html/checkout/standard/summary/option/terms/standard/template-body
81
-		 * Relative path to the HTML body template of the checkout standard summary option terms client.
82
-		 *
83
-		 * The template file contains the HTML code and processing instructions
84
-		 * to generate the result shown in the body of the frontend. The
85
-		 * configuration string is the path to the template file relative
86
-		 * to the templates directory (usually in client/html/templates).
87
-		 *
88
-		 * You can overwrite the template file configuration in extensions and
89
-		 * provide alternative templates. These alternative templates should be
90
-		 * named like the default one but with the string "standard" replaced by
91
-		 * an unique name. You may use the name of your project for this. If
92
-		 * you've implemented an alternative client class as well, "standard"
93
-		 * should be replaced by the name of the new class.
94
-		 *
95
-		 * @param string Relative path to the template creating code for the HTML page body
96
-		 * @since 2014.03
97
-		 * @category Developer
98
-		 * @see client/html/checkout/standard/summary/option/terms/standard/template-header
99
-		 */
100
-		$tplconf = 'client/html/checkout/standard/summary/option/terms/standard/template-body';
101
-		$default = 'checkout/standard/summary-option-terms-body-default.php';
80
+        /** client/html/checkout/standard/summary/option/terms/standard/template-body
81
+         * Relative path to the HTML body template of the checkout standard summary option terms client.
82
+         *
83
+         * The template file contains the HTML code and processing instructions
84
+         * to generate the result shown in the body of the frontend. The
85
+         * configuration string is the path to the template file relative
86
+         * to the templates directory (usually in client/html/templates).
87
+         *
88
+         * You can overwrite the template file configuration in extensions and
89
+         * provide alternative templates. These alternative templates should be
90
+         * named like the default one but with the string "standard" replaced by
91
+         * an unique name. You may use the name of your project for this. If
92
+         * you've implemented an alternative client class as well, "standard"
93
+         * should be replaced by the name of the new class.
94
+         *
95
+         * @param string Relative path to the template creating code for the HTML page body
96
+         * @since 2014.03
97
+         * @category Developer
98
+         * @see client/html/checkout/standard/summary/option/terms/standard/template-header
99
+         */
100
+        $tplconf = 'client/html/checkout/standard/summary/option/terms/standard/template-body';
101
+        $default = 'checkout/standard/summary-option-terms-body-default.php';
102 102
 
103
-		return $view->render( $view->config( $tplconf, $default ) );
104
-	}
103
+        return $view->render( $view->config( $tplconf, $default ) );
104
+    }
105 105
 
106 106
 
107
-	/**
108
-	 * Returns the HTML string for insertion into the header.
109
-	 *
110
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
111
-	 * @param array &$tags Result array for the list of tags that are associated to the output
112
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
113
-	 * @return string|null String including HTML tags for the header on error
114
-	 */
115
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
116
-	{
117
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
107
+    /**
108
+     * Returns the HTML string for insertion into the header.
109
+     *
110
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
111
+     * @param array &$tags Result array for the list of tags that are associated to the output
112
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
113
+     * @return string|null String including HTML tags for the header on error
114
+     */
115
+    public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
116
+    {
117
+        $view = $this->setViewParams( $this->getView(), $tags, $expire );
118 118
 
119
-		$html = '';
120
-		foreach( $this->getSubClients() as $subclient ) {
121
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
122
-		}
123
-		$view->optionHeader = $html;
119
+        $html = '';
120
+        foreach( $this->getSubClients() as $subclient ) {
121
+            $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
122
+        }
123
+        $view->optionHeader = $html;
124 124
 
125
-		/** client/html/checkout/standard/summary/option/terms/standard/template-header
126
-		 * Relative path to the HTML header template of the checkout standard summary option terms client.
127
-		 *
128
-		 * The template file contains the HTML code and processing instructions
129
-		 * to generate the HTML code that is inserted into the HTML page header
130
-		 * of the rendered page in the frontend. The configuration string is the
131
-		 * path to the template file relative to the templates directory (usually
132
-		 * in client/html/templates).
133
-		 *
134
-		 * You can overwrite the template file configuration in extensions and
135
-		 * provide alternative templates. These alternative templates should be
136
-		 * named like the default one but with the string "standard" replaced by
137
-		 * an unique name. You may use the name of your project for this. If
138
-		 * you've implemented an alternative client class as well, "standard"
139
-		 * should be replaced by the name of the new class.
140
-		 *
141
-		 * @param string Relative path to the template creating code for the HTML page head
142
-		 * @since 2014.03
143
-		 * @category Developer
144
-		 * @see client/html/checkout/standard/summary/option/terms/standard/template-body
145
-		 */
146
-		$tplconf = 'client/html/checkout/standard/summary/option/terms/standard/template-header';
147
-		$default = 'checkout/standard/summary-option-terms-header-default.php';
125
+        /** client/html/checkout/standard/summary/option/terms/standard/template-header
126
+         * Relative path to the HTML header template of the checkout standard summary option terms client.
127
+         *
128
+         * The template file contains the HTML code and processing instructions
129
+         * to generate the HTML code that is inserted into the HTML page header
130
+         * of the rendered page in the frontend. The configuration string is the
131
+         * path to the template file relative to the templates directory (usually
132
+         * in client/html/templates).
133
+         *
134
+         * You can overwrite the template file configuration in extensions and
135
+         * provide alternative templates. These alternative templates should be
136
+         * named like the default one but with the string "standard" replaced by
137
+         * an unique name. You may use the name of your project for this. If
138
+         * you've implemented an alternative client class as well, "standard"
139
+         * should be replaced by the name of the new class.
140
+         *
141
+         * @param string Relative path to the template creating code for the HTML page head
142
+         * @since 2014.03
143
+         * @category Developer
144
+         * @see client/html/checkout/standard/summary/option/terms/standard/template-body
145
+         */
146
+        $tplconf = 'client/html/checkout/standard/summary/option/terms/standard/template-header';
147
+        $default = 'checkout/standard/summary-option-terms-header-default.php';
148 148
 
149
-		return $view->render( $view->config( $tplconf, $default ) );
150
-	}
149
+        return $view->render( $view->config( $tplconf, $default ) );
150
+    }
151 151
 
152 152
 
153
-	/**
154
-	 * Returns the sub-client given by its name.
155
-	 *
156
-	 * @param string $type Name of the client type
157
-	 * @param string|null $name Name of the sub-client (Default if null)
158
-	 * @return \Aimeos\Client\Html\Iface Sub-client object
159
-	 */
160
-	public function getSubClient( $type, $name = null )
161
-	{
162
-		/** client/html/checkout/standard/summary/option/terms/decorators/excludes
163
-		 * Excludes decorators added by the "common" option from the checkout standard summary option terms html client
164
-		 *
165
-		 * Decorators extend the functionality of a class by adding new aspects
166
-		 * (e.g. log what is currently done), executing the methods of the underlying
167
-		 * class only in certain conditions (e.g. only for logged in users) or
168
-		 * modify what is returned to the caller.
169
-		 *
170
-		 * This option allows you to remove a decorator added via
171
-		 * "client/html/common/decorators/default" before they are wrapped
172
-		 * around the html client.
173
-		 *
174
-		 *  client/html/checkout/standard/summary/option/terms/decorators/excludes = array( 'decorator1' )
175
-		 *
176
-		 * This would remove the decorator named "decorator1" from the list of
177
-		 * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
178
-		 * "client/html/common/decorators/default" to the html client.
179
-		 *
180
-		 * @param array List of decorator names
181
-		 * @since 2015.08
182
-		 * @category Developer
183
-		 * @see client/html/common/decorators/default
184
-		 * @see client/html/checkout/standard/summary/option/terms/decorators/global
185
-		 * @see client/html/checkout/standard/summary/option/terms/decorators/local
186
-		 */
153
+    /**
154
+     * Returns the sub-client given by its name.
155
+     *
156
+     * @param string $type Name of the client type
157
+     * @param string|null $name Name of the sub-client (Default if null)
158
+     * @return \Aimeos\Client\Html\Iface Sub-client object
159
+     */
160
+    public function getSubClient( $type, $name = null )
161
+    {
162
+        /** client/html/checkout/standard/summary/option/terms/decorators/excludes
163
+         * Excludes decorators added by the "common" option from the checkout standard summary option terms html client
164
+         *
165
+         * Decorators extend the functionality of a class by adding new aspects
166
+         * (e.g. log what is currently done), executing the methods of the underlying
167
+         * class only in certain conditions (e.g. only for logged in users) or
168
+         * modify what is returned to the caller.
169
+         *
170
+         * This option allows you to remove a decorator added via
171
+         * "client/html/common/decorators/default" before they are wrapped
172
+         * around the html client.
173
+         *
174
+         *  client/html/checkout/standard/summary/option/terms/decorators/excludes = array( 'decorator1' )
175
+         *
176
+         * This would remove the decorator named "decorator1" from the list of
177
+         * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
178
+         * "client/html/common/decorators/default" to the html client.
179
+         *
180
+         * @param array List of decorator names
181
+         * @since 2015.08
182
+         * @category Developer
183
+         * @see client/html/common/decorators/default
184
+         * @see client/html/checkout/standard/summary/option/terms/decorators/global
185
+         * @see client/html/checkout/standard/summary/option/terms/decorators/local
186
+         */
187 187
 
188
-		/** client/html/checkout/standard/summary/option/terms/decorators/global
189
-		 * Adds a list of globally available decorators only to the checkout standard summary option terms html client
190
-		 *
191
-		 * Decorators extend the functionality of a class by adding new aspects
192
-		 * (e.g. log what is currently done), executing the methods of the underlying
193
-		 * class only in certain conditions (e.g. only for logged in users) or
194
-		 * modify what is returned to the caller.
195
-		 *
196
-		 * This option allows you to wrap global decorators
197
-		 * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
198
-		 *
199
-		 *  client/html/checkout/standard/summary/option/terms/decorators/global = array( 'decorator1' )
200
-		 *
201
-		 * This would add the decorator named "decorator1" defined by
202
-		 * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
203
-		 *
204
-		 * @param array List of decorator names
205
-		 * @since 2015.08
206
-		 * @category Developer
207
-		 * @see client/html/common/decorators/default
208
-		 * @see client/html/checkout/standard/summary/option/terms/decorators/excludes
209
-		 * @see client/html/checkout/standard/summary/option/terms/decorators/local
210
-		 */
188
+        /** client/html/checkout/standard/summary/option/terms/decorators/global
189
+         * Adds a list of globally available decorators only to the checkout standard summary option terms html client
190
+         *
191
+         * Decorators extend the functionality of a class by adding new aspects
192
+         * (e.g. log what is currently done), executing the methods of the underlying
193
+         * class only in certain conditions (e.g. only for logged in users) or
194
+         * modify what is returned to the caller.
195
+         *
196
+         * This option allows you to wrap global decorators
197
+         * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
198
+         *
199
+         *  client/html/checkout/standard/summary/option/terms/decorators/global = array( 'decorator1' )
200
+         *
201
+         * This would add the decorator named "decorator1" defined by
202
+         * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
203
+         *
204
+         * @param array List of decorator names
205
+         * @since 2015.08
206
+         * @category Developer
207
+         * @see client/html/common/decorators/default
208
+         * @see client/html/checkout/standard/summary/option/terms/decorators/excludes
209
+         * @see client/html/checkout/standard/summary/option/terms/decorators/local
210
+         */
211 211
 
212
-		/** client/html/checkout/standard/summary/option/terms/decorators/local
213
-		 * Adds a list of local decorators only to the checkout standard summary option terms html client
214
-		 *
215
-		 * Decorators extend the functionality of a class by adding new aspects
216
-		 * (e.g. log what is currently done), executing the methods of the underlying
217
-		 * class only in certain conditions (e.g. only for logged in users) or
218
-		 * modify what is returned to the caller.
219
-		 *
220
-		 * This option allows you to wrap local decorators
221
-		 * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
222
-		 *
223
-		 *  client/html/checkout/standard/summary/option/terms/decorators/local = array( 'decorator2' )
224
-		 *
225
-		 * This would add the decorator named "decorator2" defined by
226
-		 * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
227
-		 *
228
-		 * @param array List of decorator names
229
-		 * @since 2015.08
230
-		 * @category Developer
231
-		 * @see client/html/common/decorators/default
232
-		 * @see client/html/checkout/standard/summary/option/terms/decorators/excludes
233
-		 * @see client/html/checkout/standard/summary/option/terms/decorators/global
234
-		 */
212
+        /** client/html/checkout/standard/summary/option/terms/decorators/local
213
+         * Adds a list of local decorators only to the checkout standard summary option terms html client
214
+         *
215
+         * Decorators extend the functionality of a class by adding new aspects
216
+         * (e.g. log what is currently done), executing the methods of the underlying
217
+         * class only in certain conditions (e.g. only for logged in users) or
218
+         * modify what is returned to the caller.
219
+         *
220
+         * This option allows you to wrap local decorators
221
+         * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
222
+         *
223
+         *  client/html/checkout/standard/summary/option/terms/decorators/local = array( 'decorator2' )
224
+         *
225
+         * This would add the decorator named "decorator2" defined by
226
+         * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
227
+         *
228
+         * @param array List of decorator names
229
+         * @since 2015.08
230
+         * @category Developer
231
+         * @see client/html/common/decorators/default
232
+         * @see client/html/checkout/standard/summary/option/terms/decorators/excludes
233
+         * @see client/html/checkout/standard/summary/option/terms/decorators/global
234
+         */
235 235
 
236
-		return $this->createSubClient( 'checkout/standard/summary/option/terms/' . $type, $name );
237
-	}
236
+        return $this->createSubClient( 'checkout/standard/summary/option/terms/' . $type, $name );
237
+    }
238 238
 
239 239
 
240
-	/**
241
-	 * Processes the input, e.g. store given values.
242
-	 * A view must be available and this method doesn't generate any output
243
-	 * besides setting view variables.
244
-	 */
245
-	public function process()
246
-	{
247
-		$view = $this->getView();
240
+    /**
241
+     * Processes the input, e.g. store given values.
242
+     * A view must be available and this method doesn't generate any output
243
+     * besides setting view variables.
244
+     */
245
+    public function process()
246
+    {
247
+        $view = $this->getView();
248 248
 
249
-		// only start if there's something to do
250
-		if( ( $option = $view->param( 'cs_option_terms', null ) ) === null ) {
251
-			return;
252
-		}
249
+        // only start if there's something to do
250
+        if( ( $option = $view->param( 'cs_option_terms', null ) ) === null ) {
251
+            return;
252
+        }
253 253
 
254
-		if( ( $option = $view->param( 'cs_option_terms_value', 0 ) ) != 1 )
255
-		{
256
-			$view->standardStepActive = 'summary';
257
-			$view->termsError = true;
254
+        if( ( $option = $view->param( 'cs_option_terms_value', 0 ) ) != 1 )
255
+        {
256
+            $view->standardStepActive = 'summary';
257
+            $view->termsError = true;
258 258
 
259
-			$error = array( $view->translate( 'client', 'Please accept the terms and conditions' ) );
260
-			$view->standardErrorList = $error + $view->get( 'standardErrorList', array() );
261
-		}
259
+            $error = array( $view->translate( 'client', 'Please accept the terms and conditions' ) );
260
+            $view->standardErrorList = $error + $view->get( 'standardErrorList', array() );
261
+        }
262 262
 
263
-		parent::process();
264
-	}
263
+        parent::process();
264
+    }
265 265
 
266 266
 
267
-	/**
268
-	 * Returns the list of sub-client names configured for the client.
269
-	 *
270
-	 * @return array List of HTML client names
271
-	 */
272
-	protected function getSubClientNames()
273
-	{
274
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
275
-	}
267
+    /**
268
+     * Returns the list of sub-client names configured for the client.
269
+     *
270
+     * @return array List of HTML client names
271
+     */
272
+    protected function getSubClientNames()
273
+    {
274
+        return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
275
+    }
276 276
 }
277 277
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Standard/Summary/Coupon/Standard.php 1 patch
Indentation   +235 added lines, -235 removed lines patch added patch discarded remove patch
@@ -19,263 +19,263 @@
 block discarded – undo
19 19
  * @subpackage Html
20 20
  */
21 21
 class Standard
22
-	extends \Aimeos\Client\Html\Common\Summary\Coupon\Base
23
-	implements \Aimeos\Client\Html\Common\Client\Factory\Iface
22
+    extends \Aimeos\Client\Html\Common\Summary\Coupon\Base
23
+    implements \Aimeos\Client\Html\Common\Client\Factory\Iface
24 24
 {
25
-	/** client/html/checkout/standard/summary/coupon/standard/subparts
26
-	 * List of HTML sub-clients rendered within the checkout standard summary coupon 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 2015.11
56
-	 * @category Developer
57
-	 */
58
-	private $subPartPath = 'client/html/checkout/standard/summary/coupon/standard/subparts';
59
-	private $subPartNames = array();
60
-	private $cache;
25
+    /** client/html/checkout/standard/summary/coupon/standard/subparts
26
+     * List of HTML sub-clients rendered within the checkout standard summary coupon 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 2015.11
56
+     * @category Developer
57
+     */
58
+    private $subPartPath = 'client/html/checkout/standard/summary/coupon/standard/subparts';
59
+    private $subPartNames = array();
60
+    private $cache;
61 61
 
62 62
 
63
-	/**
64
-	 * Returns the HTML code for insertion into the body.
65
-	 *
66
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
67
-	 * @param array &$tags Result array for the list of tags that are associated to the output
68
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
69
-	 * @return string HTML code
70
-	*/
71
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
72
-	{
73
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
63
+    /**
64
+     * Returns the HTML code for insertion into the body.
65
+     *
66
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
67
+     * @param array &$tags Result array for the list of tags that are associated to the output
68
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
69
+     * @return string HTML code
70
+     */
71
+    public function getBody( $uid = '', array &$tags = array(), &$expire = null )
72
+    {
73
+        $view = $this->setViewParams( $this->getView(), $tags, $expire );
74 74
 
75
-		$html = '';
76
-		foreach( $this->getSubClients() as $subclient ) {
77
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
78
-		}
79
-		$view->couponBody = $html;
75
+        $html = '';
76
+        foreach( $this->getSubClients() as $subclient ) {
77
+            $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
78
+        }
79
+        $view->couponBody = $html;
80 80
 
81
-		/** client/html/checkout/standard/summary/coupon/standard/template-body
82
-		 * Relative path to the HTML body template of the checkout standard summary coupon client.
83
-		 *
84
-		 * The template file contains the HTML code and processing instructions
85
-		 * to generate the result shown in the body of the frontend. The
86
-		 * configuration string is the path to the template file relative
87
-		 * to the templates directory (usually in client/html/templates).
88
-		 *
89
-		 * You can overwrite the template file configuration in extensions and
90
-		 * provide alternative templates. These alternative templates should be
91
-		 * named like the default one but with the string "standard" replaced by
92
-		 * an unique name. You may use the name of your project for this. If
93
-		 * you've implemented an alternative client class as well, "standard"
94
-		 * (second one) should be replaced by the name of the new class in lower
95
-		 * case.
96
-		 *
97
-		 * @param string Relative path to the template creating code for the HTML page body
98
-		 * @since 2015.11
99
-		 * @category Developer
100
-		 * @see client/html/checkout/standard/summary/coupon/standard/template-header
101
-		 */
102
-		$tplconf = 'client/html/checkout/standard/summary/coupon/standard/template-body';
103
-		$default = 'common/summary/coupon-body-default.php';
81
+        /** client/html/checkout/standard/summary/coupon/standard/template-body
82
+         * Relative path to the HTML body template of the checkout standard summary coupon client.
83
+         *
84
+         * The template file contains the HTML code and processing instructions
85
+         * to generate the result shown in the body of the frontend. The
86
+         * configuration string is the path to the template file relative
87
+         * to the templates directory (usually in client/html/templates).
88
+         *
89
+         * You can overwrite the template file configuration in extensions and
90
+         * provide alternative templates. These alternative templates should be
91
+         * named like the default one but with the string "standard" replaced by
92
+         * an unique name. You may use the name of your project for this. If
93
+         * you've implemented an alternative client class as well, "standard"
94
+         * (second one) should be replaced by the name of the new class in lower
95
+         * case.
96
+         *
97
+         * @param string Relative path to the template creating code for the HTML page body
98
+         * @since 2015.11
99
+         * @category Developer
100
+         * @see client/html/checkout/standard/summary/coupon/standard/template-header
101
+         */
102
+        $tplconf = 'client/html/checkout/standard/summary/coupon/standard/template-body';
103
+        $default = 'common/summary/coupon-body-default.php';
104 104
 
105
-		return $view->render( $view->config( $tplconf, $default ) );
106
-	}
105
+        return $view->render( $view->config( $tplconf, $default ) );
106
+    }
107 107
 
108 108
 
109
-	/**
110
-	 * Returns the HTML string for insertion into the header.
111
-	 *
112
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
113
-	 * @param array &$tags Result array for the list of tags that are associated to the output
114
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
115
-	 * @return string|null String including HTML tags for the header on error
116
-	 */
117
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
118
-	{
119
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
109
+    /**
110
+     * Returns the HTML string for insertion into the header.
111
+     *
112
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
113
+     * @param array &$tags Result array for the list of tags that are associated to the output
114
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
115
+     * @return string|null String including HTML tags for the header on error
116
+     */
117
+    public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
118
+    {
119
+        $view = $this->setViewParams( $this->getView(), $tags, $expire );
120 120
 
121
-		$html = '';
122
-		foreach( $this->getSubClients() as $subclient ) {
123
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
124
-		}
125
-		$view->couponHeader = $html;
121
+        $html = '';
122
+        foreach( $this->getSubClients() as $subclient ) {
123
+            $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
124
+        }
125
+        $view->couponHeader = $html;
126 126
 
127
-		/** client/html/checkout/standard/summary/coupon/standard/template-header
128
-		 * Relative path to the HTML header template of the checkout standard summary coupon client.
129
-		 *
130
-		 * The template file contains the HTML code and processing instructions
131
-		 * to generate the HTML code that is inserted into the HTML page header
132
-		 * of the rendered page in the frontend. The configuration string is the
133
-		 * path to the template file relative to the templates directory (usually
134
-		 * in client/html/templates).
135
-		 *
136
-		 * You can overwrite the template file configuration in extensions and
137
-		 * provide alternative templates. These alternative templates should be
138
-		 * named like the default one but with the string "standard" replaced by
139
-		 * an unique name. You may use the name of your project for this. If
140
-		 * you've implemented an alternative client class as well, "standard"
141
-		 * (second one) should be replaced by the name of the new class in lower
142
-		 * case.
143
-		 *
144
-		 * @param string Relative path to the template creating code for the HTML page head
145
-		 * @since 2015.11
146
-		 * @category Developer
147
-		 * @see client/html/checkout/standard/summary/coupon/standard/template-body
148
-		 */
149
-		$tplconf = 'client/html/checkout/standard/summary/coupon/standard/template-header';
150
-		$default = 'common/summary/coupon-header-default.php';
127
+        /** client/html/checkout/standard/summary/coupon/standard/template-header
128
+         * Relative path to the HTML header template of the checkout standard summary coupon client.
129
+         *
130
+         * The template file contains the HTML code and processing instructions
131
+         * to generate the HTML code that is inserted into the HTML page header
132
+         * of the rendered page in the frontend. The configuration string is the
133
+         * path to the template file relative to the templates directory (usually
134
+         * in client/html/templates).
135
+         *
136
+         * You can overwrite the template file configuration in extensions and
137
+         * provide alternative templates. These alternative templates should be
138
+         * named like the default one but with the string "standard" replaced by
139
+         * an unique name. You may use the name of your project for this. If
140
+         * you've implemented an alternative client class as well, "standard"
141
+         * (second one) should be replaced by the name of the new class in lower
142
+         * case.
143
+         *
144
+         * @param string Relative path to the template creating code for the HTML page head
145
+         * @since 2015.11
146
+         * @category Developer
147
+         * @see client/html/checkout/standard/summary/coupon/standard/template-body
148
+         */
149
+        $tplconf = 'client/html/checkout/standard/summary/coupon/standard/template-header';
150
+        $default = 'common/summary/coupon-header-default.php';
151 151
 
152
-		return $view->render( $view->config( $tplconf, $default ) );
153
-	}
152
+        return $view->render( $view->config( $tplconf, $default ) );
153
+    }
154 154
 
155 155
 
156
-	/**
157
-	 * Returns the sub-client given by its name.
158
-	 *
159
-	 * @param string $type Name of the client type
160
-	 * @param string|null $name Name of the sub-client (Default if null)
161
-	 * @return \Aimeos\Client\Html\Iface Sub-client object
162
-	 */
163
-	public function getSubClient( $type, $name = null )
164
-	{
165
-		/** client/html/checkout/standard/summary/coupon/decorators/excludes
166
-		 * Excludes decorators added by the "common" option from the checkout standard summary coupon html client
167
-		 *
168
-		 * Decorators extend the functionality of a class by adding new aspects
169
-		 * (e.g. log what is currently done), executing the methods of the underlying
170
-		 * class only in certain conditions (e.g. only for logged in users) or
171
-		 * modify what is returned to the caller.
172
-		 *
173
-		 * This option allows you to remove a decorator added via
174
-		 * "client/html/common/decorators/default" before they are wrapped
175
-		 * around the html client.
176
-		 *
177
-		 *  client/html/checkout/standard/summary/coupon/decorators/excludes = array( 'decorator1' )
178
-		 *
179
-		 * This would remove the decorator named "decorator1" from the list of
180
-		 * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
181
-		 * "client/html/common/decorators/default" to the html client.
182
-		 *
183
-		 * @param array List of decorator names
184
-		 * @since 2015.08
185
-		 * @category Developer
186
-		 * @see client/html/common/decorators/default
187
-		 * @see client/html/checkout/standard/summary/coupon/decorators/global
188
-		 * @see client/html/checkout/standard/summary/coupon/decorators/local
189
-		 */
156
+    /**
157
+     * Returns the sub-client given by its name.
158
+     *
159
+     * @param string $type Name of the client type
160
+     * @param string|null $name Name of the sub-client (Default if null)
161
+     * @return \Aimeos\Client\Html\Iface Sub-client object
162
+     */
163
+    public function getSubClient( $type, $name = null )
164
+    {
165
+        /** client/html/checkout/standard/summary/coupon/decorators/excludes
166
+         * Excludes decorators added by the "common" option from the checkout standard summary coupon html client
167
+         *
168
+         * Decorators extend the functionality of a class by adding new aspects
169
+         * (e.g. log what is currently done), executing the methods of the underlying
170
+         * class only in certain conditions (e.g. only for logged in users) or
171
+         * modify what is returned to the caller.
172
+         *
173
+         * This option allows you to remove a decorator added via
174
+         * "client/html/common/decorators/default" before they are wrapped
175
+         * around the html client.
176
+         *
177
+         *  client/html/checkout/standard/summary/coupon/decorators/excludes = array( 'decorator1' )
178
+         *
179
+         * This would remove the decorator named "decorator1" from the list of
180
+         * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
181
+         * "client/html/common/decorators/default" to the html client.
182
+         *
183
+         * @param array List of decorator names
184
+         * @since 2015.08
185
+         * @category Developer
186
+         * @see client/html/common/decorators/default
187
+         * @see client/html/checkout/standard/summary/coupon/decorators/global
188
+         * @see client/html/checkout/standard/summary/coupon/decorators/local
189
+         */
190 190
 
191
-		/** client/html/checkout/standard/summary/coupon/decorators/global
192
-		 * Adds a list of globally available decorators only to the checkout standard summary coupon html client
193
-		 *
194
-		 * Decorators extend the functionality of a class by adding new aspects
195
-		 * (e.g. log what is currently done), executing the methods of the underlying
196
-		 * class only in certain conditions (e.g. only for logged in users) or
197
-		 * modify what is returned to the caller.
198
-		 *
199
-		 * This option allows you to wrap global decorators
200
-		 * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
201
-		 *
202
-		 *  client/html/checkout/standard/summary/coupon/decorators/global = array( 'decorator1' )
203
-		 *
204
-		 * This would add the decorator named "decorator1" defined by
205
-		 * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
206
-		 *
207
-		 * @param array List of decorator names
208
-		 * @since 2015.08
209
-		 * @category Developer
210
-		 * @see client/html/common/decorators/default
211
-		 * @see client/html/checkout/standard/summary/coupon/decorators/excludes
212
-		 * @see client/html/checkout/standard/summary/coupon/decorators/local
213
-		 */
191
+        /** client/html/checkout/standard/summary/coupon/decorators/global
192
+         * Adds a list of globally available decorators only to the checkout standard summary coupon html client
193
+         *
194
+         * Decorators extend the functionality of a class by adding new aspects
195
+         * (e.g. log what is currently done), executing the methods of the underlying
196
+         * class only in certain conditions (e.g. only for logged in users) or
197
+         * modify what is returned to the caller.
198
+         *
199
+         * This option allows you to wrap global decorators
200
+         * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
201
+         *
202
+         *  client/html/checkout/standard/summary/coupon/decorators/global = array( 'decorator1' )
203
+         *
204
+         * This would add the decorator named "decorator1" defined by
205
+         * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
206
+         *
207
+         * @param array List of decorator names
208
+         * @since 2015.08
209
+         * @category Developer
210
+         * @see client/html/common/decorators/default
211
+         * @see client/html/checkout/standard/summary/coupon/decorators/excludes
212
+         * @see client/html/checkout/standard/summary/coupon/decorators/local
213
+         */
214 214
 
215
-		/** client/html/checkout/standard/summary/coupon/decorators/local
216
-		 * Adds a list of local decorators only to the checkout standard summary coupon html client
217
-		 *
218
-		 * Decorators extend the functionality of a class by adding new aspects
219
-		 * (e.g. log what is currently done), executing the methods of the underlying
220
-		 * class only in certain conditions (e.g. only for logged in users) or
221
-		 * modify what is returned to the caller.
222
-		 *
223
-		 * This option allows you to wrap local decorators
224
-		 * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
225
-		 *
226
-		 *  client/html/checkout/standard/summary/coupon/decorators/local = array( 'decorator2' )
227
-		 *
228
-		 * This would add the decorator named "decorator2" defined by
229
-		 * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
230
-		 *
231
-		 * @param array List of decorator names
232
-		 * @since 2015.08
233
-		 * @category Developer
234
-		 * @see client/html/common/decorators/default
235
-		 * @see client/html/checkout/standard/summary/coupon/decorators/excludes
236
-		 * @see client/html/checkout/standard/summary/coupon/decorators/global
237
-		 */
215
+        /** client/html/checkout/standard/summary/coupon/decorators/local
216
+         * Adds a list of local decorators only to the checkout standard summary coupon html client
217
+         *
218
+         * Decorators extend the functionality of a class by adding new aspects
219
+         * (e.g. log what is currently done), executing the methods of the underlying
220
+         * class only in certain conditions (e.g. only for logged in users) or
221
+         * modify what is returned to the caller.
222
+         *
223
+         * This option allows you to wrap local decorators
224
+         * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
225
+         *
226
+         *  client/html/checkout/standard/summary/coupon/decorators/local = array( 'decorator2' )
227
+         *
228
+         * This would add the decorator named "decorator2" defined by
229
+         * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
230
+         *
231
+         * @param array List of decorator names
232
+         * @since 2015.08
233
+         * @category Developer
234
+         * @see client/html/common/decorators/default
235
+         * @see client/html/checkout/standard/summary/coupon/decorators/excludes
236
+         * @see client/html/checkout/standard/summary/coupon/decorators/global
237
+         */
238 238
 
239
-		return $this->createSubClient( 'checkout/standard/summary/coupon/' . $type, $name );
240
-	}
239
+        return $this->createSubClient( 'checkout/standard/summary/coupon/' . $type, $name );
240
+    }
241 241
 
242 242
 
243
-	/**
244
-	 * Returns the list of sub-client names configured for the client.
245
-	 *
246
-	 * @return array List of HTML client names
247
-	 */
248
-	protected function getSubClientNames()
249
-	{
250
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
251
-	}
243
+    /**
244
+     * Returns the list of sub-client names configured for the client.
245
+     *
246
+     * @return array List of HTML client names
247
+     */
248
+    protected function getSubClientNames()
249
+    {
250
+        return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
251
+    }
252 252
 
253 253
 
254
-	/**
255
-	 * Sets the necessary parameter values in the view.
256
-	 *
257
-	 * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
258
-	 * @param array &$tags Result array for the list of tags that are associated to the output
259
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
260
-	 * @return \Aimeos\MW\View\Iface Modified view object
261
-	 */
262
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
263
-	{
264
-		$view = parent::setViewParams( $view, $tags, $expire );
254
+    /**
255
+     * Sets the necessary parameter values in the view.
256
+     *
257
+     * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
258
+     * @param array &$tags Result array for the list of tags that are associated to the output
259
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
260
+     * @return \Aimeos\MW\View\Iface Modified view object
261
+     */
262
+    protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
263
+    {
264
+        $view = parent::setViewParams( $view, $tags, $expire );
265 265
 
266
-		if( !isset( $this->cache ) )
267
-		{
268
-			$target = $view->config( 'client/html/basket/standard/url/target' );
269
-			$cntl = $view->config( 'client/html/basket/standard/url/controller', 'basket' );
270
-			$action = $view->config( 'client/html/basket/standard/url/action', 'index' );
271
-			$config = $view->config( 'client/html/basket/standard/url/config', array() );
266
+        if( !isset( $this->cache ) )
267
+        {
268
+            $target = $view->config( 'client/html/basket/standard/url/target' );
269
+            $cntl = $view->config( 'client/html/basket/standard/url/controller', 'basket' );
270
+            $action = $view->config( 'client/html/basket/standard/url/action', 'index' );
271
+            $config = $view->config( 'client/html/basket/standard/url/config', array() );
272 272
 
273
-			$view->summaryUrlCoupon = $view->url( $target, $cntl, $action, array(), array(), $config );
274
-			$view->summaryBasket = $view->standardBasket;
273
+            $view->summaryUrlCoupon = $view->url( $target, $cntl, $action, array(), array(), $config );
274
+            $view->summaryBasket = $view->standardBasket;
275 275
 
276
-			$this->cache = $view;
277
-		}
276
+            $this->cache = $view;
277
+        }
278 278
 
279
-		return $this->cache;
280
-	}
279
+        return $this->cache;
280
+    }
281 281
 }
282 282
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Standard/Summary/Detail/Standard.php 1 patch
Indentation   +243 added lines, -243 removed lines patch added patch discarded remove patch
@@ -19,273 +19,273 @@
 block discarded – undo
19 19
  * @subpackage Html
20 20
  */
21 21
 class Standard
22
-	extends \Aimeos\Client\Html\Common\Summary\Detail\Base
23
-	implements \Aimeos\Client\Html\Common\Client\Factory\Iface
22
+    extends \Aimeos\Client\Html\Common\Summary\Detail\Base
23
+    implements \Aimeos\Client\Html\Common\Client\Factory\Iface
24 24
 {
25
-	/** client/html/checkout/standard/summary/detail/standard/subparts
26
-	 * List of HTML sub-clients rendered within the checkout standard summary detail 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 2015.11
56
-	 * @category Developer
57
-	 */
58
-	private $subPartPath = 'client/html/checkout/standard/summary/detail/standard/subparts';
59
-	private $subPartNames = array();
60
-	private $cache;
25
+    /** client/html/checkout/standard/summary/detail/standard/subparts
26
+     * List of HTML sub-clients rendered within the checkout standard summary detail 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 2015.11
56
+     * @category Developer
57
+     */
58
+    private $subPartPath = 'client/html/checkout/standard/summary/detail/standard/subparts';
59
+    private $subPartNames = array();
60
+    private $cache;
61 61
 
62 62
 
63
-	/**
64
-	 * Returns the HTML code for insertion into the body.
65
-	 *
66
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
67
-	 * @param array &$tags Result array for the list of tags that are associated to the output
68
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
69
-	 * @return string HTML code
70
-	*/
71
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
72
-	{
73
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
63
+    /**
64
+     * Returns the HTML code for insertion into the body.
65
+     *
66
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
67
+     * @param array &$tags Result array for the list of tags that are associated to the output
68
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
69
+     * @return string HTML code
70
+     */
71
+    public function getBody( $uid = '', array &$tags = array(), &$expire = null )
72
+    {
73
+        $view = $this->setViewParams( $this->getView(), $tags, $expire );
74 74
 
75
-		$html = '';
76
-		foreach( $this->getSubClients() as $subclient ) {
77
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
78
-		}
79
-		$view->detailBody = $html;
75
+        $html = '';
76
+        foreach( $this->getSubClients() as $subclient ) {
77
+            $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
78
+        }
79
+        $view->detailBody = $html;
80 80
 
81
-		/** client/html/checkout/standard/summary/detail/standard/template-body
82
-		 * Relative path to the HTML body template of the checkout standard summary detail client.
83
-		 *
84
-		 * The template file contains the HTML code and processing instructions
85
-		 * to generate the result shown in the body of the frontend. The
86
-		 * configuration string is the path to the template file relative
87
-		 * to the templates directory (usually in client/html/templates).
88
-		 *
89
-		 * You can overwrite the template file configuration in extensions and
90
-		 * provide alternative templates. These alternative templates should be
91
-		 * named like the default one but with the string "standard" replaced by
92
-		 * an unique name. You may use the name of your project for this. If
93
-		 * you've implemented an alternative client class as well, "standard"
94
-		 * (second one) should be replaced by the name of the new class in lower
95
-		 * case.
96
-		 *
97
-		 * @param string Relative path to the template creating code for the HTML page body
98
-		 * @since 2015.11
99
-		 * @category Developer
100
-		 * @see client/html/checkout/standard/summary/detail/standard/template-header
101
-		 */
102
-		$tplconf = 'client/html/checkout/standard/summary/detail/standard/template-body';
103
-		$default = 'common/summary/detail-body-default.php';
81
+        /** client/html/checkout/standard/summary/detail/standard/template-body
82
+         * Relative path to the HTML body template of the checkout standard summary detail client.
83
+         *
84
+         * The template file contains the HTML code and processing instructions
85
+         * to generate the result shown in the body of the frontend. The
86
+         * configuration string is the path to the template file relative
87
+         * to the templates directory (usually in client/html/templates).
88
+         *
89
+         * You can overwrite the template file configuration in extensions and
90
+         * provide alternative templates. These alternative templates should be
91
+         * named like the default one but with the string "standard" replaced by
92
+         * an unique name. You may use the name of your project for this. If
93
+         * you've implemented an alternative client class as well, "standard"
94
+         * (second one) should be replaced by the name of the new class in lower
95
+         * case.
96
+         *
97
+         * @param string Relative path to the template creating code for the HTML page body
98
+         * @since 2015.11
99
+         * @category Developer
100
+         * @see client/html/checkout/standard/summary/detail/standard/template-header
101
+         */
102
+        $tplconf = 'client/html/checkout/standard/summary/detail/standard/template-body';
103
+        $default = 'common/summary/detail-body-default.php';
104 104
 
105
-		return $view->render( $view->config( $tplconf, $default ) );
106
-	}
105
+        return $view->render( $view->config( $tplconf, $default ) );
106
+    }
107 107
 
108 108
 
109
-	/**
110
-	 * Returns the HTML string for insertion into the header.
111
-	 *
112
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
113
-	 * @param array &$tags Result array for the list of tags that are associated to the output
114
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
115
-	 * @return string|null String including HTML tags for the header on error
116
-	 */
117
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
118
-	{
119
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
109
+    /**
110
+     * Returns the HTML string for insertion into the header.
111
+     *
112
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
113
+     * @param array &$tags Result array for the list of tags that are associated to the output
114
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
115
+     * @return string|null String including HTML tags for the header on error
116
+     */
117
+    public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
118
+    {
119
+        $view = $this->setViewParams( $this->getView(), $tags, $expire );
120 120
 
121
-		$html = '';
122
-		foreach( $this->getSubClients() as $subclient ) {
123
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
124
-		}
125
-		$view->detailHeader = $html;
121
+        $html = '';
122
+        foreach( $this->getSubClients() as $subclient ) {
123
+            $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
124
+        }
125
+        $view->detailHeader = $html;
126 126
 
127
-		/** client/html/checkout/standard/summary/detail/standard/template-header
128
-		 * Relative path to the HTML header template of the checkout standard summary detail client.
129
-		 *
130
-		 * The template file contains the HTML code and processing instructions
131
-		 * to generate the HTML code that is inserted into the HTML page header
132
-		 * of the rendered page in the frontend. The configuration string is the
133
-		 * path to the template file relative to the templates directory (usually
134
-		 * in client/html/templates).
135
-		 *
136
-		 * You can overwrite the template file configuration in extensions and
137
-		 * provide alternative templates. These alternative templates should be
138
-		 * named like the default one but with the string "standard" replaced by
139
-		 * an unique name. You may use the name of your project for this. If
140
-		 * you've implemented an alternative client class as well, "standard"
141
-		 * (second one) should be replaced by the name of the new class in lower
142
-		 * case.
143
-		 *
144
-		 * @param string Relative path to the template creating code for the HTML page head
145
-		 * @since 2015.11
146
-		 * @category Developer
147
-		 * @see client/html/checkout/standard/summary/detail/standard/template-body
148
-		 */
149
-		$tplconf = 'client/html/checkout/standard/summary/detail/standard/template-header';
150
-		$default = 'common/summary/detail-header-default.php';
127
+        /** client/html/checkout/standard/summary/detail/standard/template-header
128
+         * Relative path to the HTML header template of the checkout standard summary detail client.
129
+         *
130
+         * The template file contains the HTML code and processing instructions
131
+         * to generate the HTML code that is inserted into the HTML page header
132
+         * of the rendered page in the frontend. The configuration string is the
133
+         * path to the template file relative to the templates directory (usually
134
+         * in client/html/templates).
135
+         *
136
+         * You can overwrite the template file configuration in extensions and
137
+         * provide alternative templates. These alternative templates should be
138
+         * named like the default one but with the string "standard" replaced by
139
+         * an unique name. You may use the name of your project for this. If
140
+         * you've implemented an alternative client class as well, "standard"
141
+         * (second one) should be replaced by the name of the new class in lower
142
+         * case.
143
+         *
144
+         * @param string Relative path to the template creating code for the HTML page head
145
+         * @since 2015.11
146
+         * @category Developer
147
+         * @see client/html/checkout/standard/summary/detail/standard/template-body
148
+         */
149
+        $tplconf = 'client/html/checkout/standard/summary/detail/standard/template-header';
150
+        $default = 'common/summary/detail-header-default.php';
151 151
 
152
-		return $view->render( $view->config( $tplconf, $default ) );
153
-	}
152
+        return $view->render( $view->config( $tplconf, $default ) );
153
+    }
154 154
 
155 155
 
156
-	/**
157
-	 * Returns the sub-client given by its name.
158
-	 *
159
-	 * @param string $type Name of the client type
160
-	 * @param string|null $name Name of the sub-client (Default if null)
161
-	 * @return \Aimeos\Client\Html\Iface Sub-client object
162
-	 */
163
-	public function getSubClient( $type, $name = null )
164
-	{
165
-		/** client/html/checkout/standard/summary/detail/decorators/excludes
166
-		 * Excludes decorators added by the "common" option from the checkout standard summary detail html client
167
-		 *
168
-		 * Decorators extend the functionality of a class by adding new aspects
169
-		 * (e.g. log what is currently done), executing the methods of the underlying
170
-		 * class only in certain conditions (e.g. only for logged in users) or
171
-		 * modify what is returned to the caller.
172
-		 *
173
-		 * This option allows you to remove a decorator added via
174
-		 * "client/html/common/decorators/default" before they are wrapped
175
-		 * around the html client.
176
-		 *
177
-		 *  client/html/checkout/standard/summary/detail/decorators/excludes = array( 'decorator1' )
178
-		 *
179
-		 * This would remove the decorator named "decorator1" from the list of
180
-		 * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
181
-		 * "client/html/common/decorators/default" to the html client.
182
-		 *
183
-		 * @param array List of decorator names
184
-		 * @since 2015.08
185
-		 * @category Developer
186
-		 * @see client/html/common/decorators/default
187
-		 * @see client/html/checkout/standard/summary/detail/decorators/global
188
-		 * @see client/html/checkout/standard/summary/detail/decorators/local
189
-		 */
156
+    /**
157
+     * Returns the sub-client given by its name.
158
+     *
159
+     * @param string $type Name of the client type
160
+     * @param string|null $name Name of the sub-client (Default if null)
161
+     * @return \Aimeos\Client\Html\Iface Sub-client object
162
+     */
163
+    public function getSubClient( $type, $name = null )
164
+    {
165
+        /** client/html/checkout/standard/summary/detail/decorators/excludes
166
+         * Excludes decorators added by the "common" option from the checkout standard summary detail html client
167
+         *
168
+         * Decorators extend the functionality of a class by adding new aspects
169
+         * (e.g. log what is currently done), executing the methods of the underlying
170
+         * class only in certain conditions (e.g. only for logged in users) or
171
+         * modify what is returned to the caller.
172
+         *
173
+         * This option allows you to remove a decorator added via
174
+         * "client/html/common/decorators/default" before they are wrapped
175
+         * around the html client.
176
+         *
177
+         *  client/html/checkout/standard/summary/detail/decorators/excludes = array( 'decorator1' )
178
+         *
179
+         * This would remove the decorator named "decorator1" from the list of
180
+         * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
181
+         * "client/html/common/decorators/default" to the html client.
182
+         *
183
+         * @param array List of decorator names
184
+         * @since 2015.08
185
+         * @category Developer
186
+         * @see client/html/common/decorators/default
187
+         * @see client/html/checkout/standard/summary/detail/decorators/global
188
+         * @see client/html/checkout/standard/summary/detail/decorators/local
189
+         */
190 190
 
191
-		/** client/html/checkout/standard/summary/detail/decorators/global
192
-		 * Adds a list of globally available decorators only to the checkout standard summary detail html client
193
-		 *
194
-		 * Decorators extend the functionality of a class by adding new aspects
195
-		 * (e.g. log what is currently done), executing the methods of the underlying
196
-		 * class only in certain conditions (e.g. only for logged in users) or
197
-		 * modify what is returned to the caller.
198
-		 *
199
-		 * This option allows you to wrap global decorators
200
-		 * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
201
-		 *
202
-		 *  client/html/checkout/standard/summary/detail/decorators/global = array( 'decorator1' )
203
-		 *
204
-		 * This would add the decorator named "decorator1" defined by
205
-		 * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
206
-		 *
207
-		 * @param array List of decorator names
208
-		 * @since 2015.08
209
-		 * @category Developer
210
-		 * @see client/html/common/decorators/default
211
-		 * @see client/html/checkout/standard/summary/detail/decorators/excludes
212
-		 * @see client/html/checkout/standard/summary/detail/decorators/local
213
-		 */
191
+        /** client/html/checkout/standard/summary/detail/decorators/global
192
+         * Adds a list of globally available decorators only to the checkout standard summary detail html client
193
+         *
194
+         * Decorators extend the functionality of a class by adding new aspects
195
+         * (e.g. log what is currently done), executing the methods of the underlying
196
+         * class only in certain conditions (e.g. only for logged in users) or
197
+         * modify what is returned to the caller.
198
+         *
199
+         * This option allows you to wrap global decorators
200
+         * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
201
+         *
202
+         *  client/html/checkout/standard/summary/detail/decorators/global = array( 'decorator1' )
203
+         *
204
+         * This would add the decorator named "decorator1" defined by
205
+         * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
206
+         *
207
+         * @param array List of decorator names
208
+         * @since 2015.08
209
+         * @category Developer
210
+         * @see client/html/common/decorators/default
211
+         * @see client/html/checkout/standard/summary/detail/decorators/excludes
212
+         * @see client/html/checkout/standard/summary/detail/decorators/local
213
+         */
214 214
 
215
-		/** client/html/checkout/standard/summary/detail/decorators/local
216
-		 * Adds a list of local decorators only to the checkout standard summary detail html client
217
-		 *
218
-		 * Decorators extend the functionality of a class by adding new aspects
219
-		 * (e.g. log what is currently done), executing the methods of the underlying
220
-		 * class only in certain conditions (e.g. only for logged in users) or
221
-		 * modify what is returned to the caller.
222
-		 *
223
-		 * This option allows you to wrap local decorators
224
-		 * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
225
-		 *
226
-		 *  client/html/checkout/standard/summary/detail/decorators/local = array( 'decorator2' )
227
-		 *
228
-		 * This would add the decorator named "decorator2" defined by
229
-		 * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
230
-		 *
231
-		 * @param array List of decorator names
232
-		 * @since 2015.08
233
-		 * @category Developer
234
-		 * @see client/html/common/decorators/default
235
-		 * @see client/html/checkout/standard/summary/detail/decorators/excludes
236
-		 * @see client/html/checkout/standard/summary/detail/decorators/global
237
-		 */
215
+        /** client/html/checkout/standard/summary/detail/decorators/local
216
+         * Adds a list of local decorators only to the checkout standard summary detail html client
217
+         *
218
+         * Decorators extend the functionality of a class by adding new aspects
219
+         * (e.g. log what is currently done), executing the methods of the underlying
220
+         * class only in certain conditions (e.g. only for logged in users) or
221
+         * modify what is returned to the caller.
222
+         *
223
+         * This option allows you to wrap local decorators
224
+         * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
225
+         *
226
+         *  client/html/checkout/standard/summary/detail/decorators/local = array( 'decorator2' )
227
+         *
228
+         * This would add the decorator named "decorator2" defined by
229
+         * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
230
+         *
231
+         * @param array List of decorator names
232
+         * @since 2015.08
233
+         * @category Developer
234
+         * @see client/html/common/decorators/default
235
+         * @see client/html/checkout/standard/summary/detail/decorators/excludes
236
+         * @see client/html/checkout/standard/summary/detail/decorators/global
237
+         */
238 238
 
239
-		return $this->createSubClient( 'checkout/standard/summary/detail/' . $type, $name );
240
-	}
239
+        return $this->createSubClient( 'checkout/standard/summary/detail/' . $type, $name );
240
+    }
241 241
 
242 242
 
243
-	/**
244
-	 * Returns the list of sub-client names configured for the client.
245
-	 *
246
-	 * @return array List of HTML client names
247
-	 */
248
-	protected function getSubClientNames()
249
-	{
250
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
251
-	}
243
+    /**
244
+     * Returns the list of sub-client names configured for the client.
245
+     *
246
+     * @return array List of HTML client names
247
+     */
248
+    protected function getSubClientNames()
249
+    {
250
+        return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
251
+    }
252 252
 
253 253
 
254
-	/**
255
-	 * Sets the necessary parameter values in the view.
256
-	 *
257
-	 * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
258
-	 * @param array &$tags Result array for the list of tags that are associated to the output
259
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
260
-	 * @return \Aimeos\MW\View\Iface Modified view object
261
-	 */
262
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
263
-	{
264
-		$view = parent::setViewParams( $view, $tags, $expire );
254
+    /**
255
+     * Sets the necessary parameter values in the view.
256
+     *
257
+     * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
258
+     * @param array &$tags Result array for the list of tags that are associated to the output
259
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
260
+     * @return \Aimeos\MW\View\Iface Modified view object
261
+     */
262
+    protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
263
+    {
264
+        $view = parent::setViewParams( $view, $tags, $expire );
265 265
 
266
-		if( !isset( $this->cache ) )
267
-		{
268
-			$basket = $view->standardBasket;
266
+        if( !isset( $this->cache ) )
267
+        {
268
+            $basket = $view->standardBasket;
269 269
 
270
-			$bTarget = $view->config( 'client/html/basket/standard/url/target' );
271
-			$bCntl = $view->config( 'client/html/basket/standard/url/controller', 'basket' );
272
-			$bAction = $view->config( 'client/html/basket/standard/url/action', 'index' );
273
-			$bConfig = $view->config( 'client/html/basket/standard/url/config', array() );
270
+            $bTarget = $view->config( 'client/html/basket/standard/url/target' );
271
+            $bCntl = $view->config( 'client/html/basket/standard/url/controller', 'basket' );
272
+            $bAction = $view->config( 'client/html/basket/standard/url/action', 'index' );
273
+            $bConfig = $view->config( 'client/html/basket/standard/url/config', array() );
274 274
 
275
-			$target = $view->config( 'client/html/checkout/standard/url/target' );
276
-			$cntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' );
277
-			$action = $view->config( 'client/html/checkout/standard/url/action', 'index' );
278
-			$config = $view->config( 'client/html/checkout/standard/url/config', array() );
275
+            $target = $view->config( 'client/html/checkout/standard/url/target' );
276
+            $cntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' );
277
+            $action = $view->config( 'client/html/checkout/standard/url/action', 'index' );
278
+            $config = $view->config( 'client/html/checkout/standard/url/config', array() );
279 279
 
280
-			$view->summaryUrlServicePayment = $view->url( $target, $cntl, $action, array( 'c_step' => 'payment' ), array(), $config );
281
-			$view->summaryUrlServiceDelivery = $view->url( $target, $cntl, $action, array( 'c_step' => 'delivery' ), array(), $config );
282
-			$view->summaryUrlBasket = $view->url( $bTarget, $bCntl, $bAction, array(), array(), $bConfig );
283
-			$view->summaryTaxRates = $this->getTaxRates( $basket );
284
-			$view->summaryBasket = $basket;
280
+            $view->summaryUrlServicePayment = $view->url( $target, $cntl, $action, array( 'c_step' => 'payment' ), array(), $config );
281
+            $view->summaryUrlServiceDelivery = $view->url( $target, $cntl, $action, array( 'c_step' => 'delivery' ), array(), $config );
282
+            $view->summaryUrlBasket = $view->url( $bTarget, $bCntl, $bAction, array(), array(), $bConfig );
283
+            $view->summaryTaxRates = $this->getTaxRates( $basket );
284
+            $view->summaryBasket = $basket;
285 285
 
286
-			$this->cache = $view;
287
-		}
286
+            $this->cache = $view;
287
+        }
288 288
 
289
-		return $this->cache;
290
-	}
289
+        return $this->cache;
290
+    }
291 291
 }
292 292
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Standard/Summary/Standard.php 1 patch
Indentation   +325 added lines, -325 removed lines patch added patch discarded remove patch
@@ -23,330 +23,330 @@
 block discarded – undo
23 23
  * @subpackage Html
24 24
  */
25 25
 class Standard
26
-	extends \Aimeos\Client\Html\Common\Client\Factory\Base
27
-	implements \Aimeos\Client\Html\Common\Client\Factory\Iface
26
+    extends \Aimeos\Client\Html\Common\Client\Factory\Base
27
+    implements \Aimeos\Client\Html\Common\Client\Factory\Iface
28 28
 {
29
-	/** client/html/checkout/standard/summary/standard/subparts
30
-	 * List of HTML sub-clients rendered within the checkout standard summary section
31
-	 *
32
-	 * The output of the frontend is composed of the code generated by the HTML
33
-	 * clients. Each HTML client can consist of serveral (or none) sub-clients
34
-	 * that are responsible for rendering certain sub-parts of the output. The
35
-	 * sub-clients can contain HTML clients themselves and therefore a
36
-	 * hierarchical tree of HTML clients is composed. Each HTML client creates
37
-	 * the output that is placed inside the container of its parent.
38
-	 *
39
-	 * At first, always the HTML code generated by the parent is printed, then
40
-	 * the HTML code of its sub-clients. The order of the HTML sub-clients
41
-	 * determines the order of the output of these sub-clients inside the parent
42
-	 * container. If the configured list of clients is
43
-	 *
44
-	 *  array( "subclient1", "subclient2" )
45
-	 *
46
-	 * you can easily change the order of the output by reordering the subparts:
47
-	 *
48
-	 *  client/html/<clients>/subparts = array( "subclient1", "subclient2" )
49
-	 *
50
-	 * You can also remove one or more parts if they shouldn't be rendered:
51
-	 *
52
-	 *  client/html/<clients>/subparts = array( "subclient1" )
53
-	 *
54
-	 * As the clients only generates structural HTML, the layout defined via CSS
55
-	 * should support adding, removing or reordering content by a fluid like
56
-	 * design.
57
-	 *
58
-	 * @param array List of sub-client names
59
-	 * @since 2014.03
60
-	 * @category Developer
61
-	 */
62
-	private $subPartPath = 'client/html/checkout/standard/summary/standard/subparts';
63
-
64
-	/** client/html/checkout/standard/summary/address/name
65
-	 * Name of the address part used by the checkout standard summary client implementation
66
-	 *
67
-	 * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Summary\Address\Myname".
68
-	 * The name is case-sensitive and you should avoid camel case names like "MyName".
69
-	 *
70
-	 * @param string Last part of the client class name
71
-	 * @since 2014.03
72
-	 * @category Developer
73
-	 */
74
-
75
-	/** client/html/checkout/standard/summary/service/name
76
-	 * Name of the service part used by the checkout standard summary client implementation
77
-	 *
78
-	 * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Summary\Service\Myname".
79
-	 * The name is case-sensitive and you should avoid camel case names like "MyName".
80
-	 *
81
-	 * @param string Last part of the client class name
82
-	 * @since 2014.03
83
-	 * @category Developer
84
-	 */
85
-
86
-	/** client/html/checkout/standard/summary/coupon/name
87
-	 * Name of the coupon part used by the checkout standard summary client implementation
88
-	 *
89
-	 * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Summary\Coupon\Myname".
90
-	 * The name is case-sensitive and you should avoid camel case names like "MyName".
91
-	 *
92
-	 * @param string Last part of the client class name
93
-	 * @since 2014.03
94
-	 * @category Developer
95
-	 */
96
-
97
-	/** client/html/checkout/standard/summary/option/name
98
-	 * Name of the option part used by the checkout standard summary client implementation
99
-	 *
100
-	 * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Summary\Option\Myname".
101
-	 * The name is case-sensitive and you should avoid camel case names like "MyName".
102
-	 *
103
-	 * @param string Last part of the client class name
104
-	 * @since 2014.03
105
-	 * @category Developer
106
-	 */
107
-
108
-	/** client/html/checkout/standard/summary/detail/name
109
-	 * Name of the detail part used by the checkout standard summary client implementation
110
-	 *
111
-	 * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Summary\Detail\Myname".
112
-	 * The name is case-sensitive and you should avoid camel case names like "MyName".
113
-	 *
114
-	 * @param string Last part of the client class name
115
-	 * @since 2014.03
116
-	 * @category Developer
117
-	 */
118
-	private $subPartNames = array( 'address', 'service', 'coupon', 'option', 'detail' );
119
-
120
-
121
-	/**
122
-	 * Returns the HTML code for insertion into the body.
123
-	 *
124
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
125
-	 * @param array &$tags Result array for the list of tags that are associated to the output
126
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
127
-	 * @return string HTML code
128
-	 */
129
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
130
-	{
131
-		$view = $this->getView();
132
-		$step = $view->get( 'standardStepActive' );
133
-		$onepage = $view->config( 'client/html/checkout/standard/onepage', array() );
134
-
135
-		if( $step != 'summary' && !( in_array( 'summary', $onepage ) && in_array( $step, $onepage ) ) ) {
136
-			return '';
137
-		}
138
-
139
-		$view = $this->setViewParams( $view, $tags, $expire );
140
-
141
-		$html = '';
142
-		foreach( $this->getSubClients() as $subclient ) {
143
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
144
-		}
145
-		$view->summaryBody = $html;
146
-
147
-		/** client/html/checkout/standard/summary/standard/template-body
148
-		 * Relative path to the HTML body template of the checkout standard summary client.
149
-		 *
150
-		 * The template file contains the HTML code and processing instructions
151
-		 * to generate the result shown in the body of the frontend. The
152
-		 * configuration string is the path to the template file relative
153
-		 * to the templates directory (usually in client/html/templates).
154
-		 *
155
-		 * You can overwrite the template file configuration in extensions and
156
-		 * provide alternative templates. These alternative templates should be
157
-		 * named like the default one but with the string "standard" replaced by
158
-		 * an unique name. You may use the name of your project for this. If
159
-		 * you've implemented an alternative client class as well, "standard"
160
-		 * should be replaced by the name of the new class.
161
-		 *
162
-		 * @param string Relative path to the template creating code for the HTML page body
163
-		 * @since 2014.03
164
-		 * @category Developer
165
-		 * @see client/html/checkout/standard/summary/standard/template-header
166
-		 */
167
-		$tplconf = 'client/html/checkout/standard/summary/standard/template-body';
168
-		$default = 'checkout/standard/summary-body-default.php';
169
-
170
-		return $view->render( $view->config( $tplconf, $default ) );
171
-	}
172
-
173
-
174
-	/**
175
-	 * Returns the HTML string for insertion into the header.
176
-	 *
177
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
178
-	 * @param array &$tags Result array for the list of tags that are associated to the output
179
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
180
-	 * @return string|null String including HTML tags for the header on error
181
-	 */
182
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
183
-	{
184
-		$view = $this->getView();
185
-		$step = $view->get( 'standardStepActive' );
186
-		$onepage = $view->config( 'client/html/checkout/standard/onepage', array() );
187
-
188
-		if( $step != 'summary' && !( in_array( 'summary', $onepage ) && in_array( $step, $onepage ) ) ) {
189
-			return '';
190
-		}
191
-
192
-		$view = $this->setViewParams( $view, $tags, $expire );
193
-
194
-		$html = '';
195
-		foreach( $this->getSubClients() as $subclient ) {
196
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
197
-		}
198
-		$view->summaryHeader = $html;
199
-
200
-		/** client/html/checkout/standard/summary/standard/template-header
201
-		 * Relative path to the HTML header template of the checkout standard summary client.
202
-		 *
203
-		 * The template file contains the HTML code and processing instructions
204
-		 * to generate the HTML code that is inserted into the HTML page header
205
-		 * of the rendered page in the frontend. The configuration string is the
206
-		 * path to the template file relative to the templates directory (usually
207
-		 * in client/html/templates).
208
-		 *
209
-		 * You can overwrite the template file configuration in extensions and
210
-		 * provide alternative templates. These alternative templates should be
211
-		 * named like the default one but with the string "standard" replaced by
212
-		 * an unique name. You may use the name of your project for this. If
213
-		 * you've implemented an alternative client class as well, "standard"
214
-		 * should be replaced by the name of the new class.
215
-		 *
216
-		 * @param string Relative path to the template creating code for the HTML page head
217
-		 * @since 2014.03
218
-		 * @category Developer
219
-		 * @see client/html/checkout/standard/summary/standard/template-body
220
-		 */
221
-		$tplconf = 'client/html/checkout/standard/summary/standard/template-header';
222
-		$default = 'checkout/standard/summary-header-default.php';
223
-
224
-		return $view->render( $view->config( $tplconf, $default ) );
225
-	}
226
-
227
-
228
-	/**
229
-	 * Returns the sub-client given by its name.
230
-	 *
231
-	 * @param string $type Name of the client type
232
-	 * @param string|null $name Name of the sub-client (Default if null)
233
-	 * @return \Aimeos\Client\Html\Iface Sub-client object
234
-	 */
235
-	public function getSubClient( $type, $name = null )
236
-	{
237
-		/** client/html/checkout/standard/summary/decorators/excludes
238
-		 * Excludes decorators added by the "common" option from the checkout standard summary html client
239
-		 *
240
-		 * Decorators extend the functionality of a class by adding new aspects
241
-		 * (e.g. log what is currently done), executing the methods of the underlying
242
-		 * class only in certain conditions (e.g. only for logged in users) or
243
-		 * modify what is returned to the caller.
244
-		 *
245
-		 * This option allows you to remove a decorator added via
246
-		 * "client/html/common/decorators/default" before they are wrapped
247
-		 * around the html client.
248
-		 *
249
-		 *  client/html/checkout/standard/summary/decorators/excludes = array( 'decorator1' )
250
-		 *
251
-		 * This would remove the decorator named "decorator1" from the list of
252
-		 * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
253
-		 * "client/html/common/decorators/default" to the html client.
254
-		 *
255
-		 * @param array List of decorator names
256
-		 * @since 2015.08
257
-		 * @category Developer
258
-		 * @see client/html/common/decorators/default
259
-		 * @see client/html/checkout/standard/summary/decorators/global
260
-		 * @see client/html/checkout/standard/summary/decorators/local
261
-		 */
262
-
263
-		/** client/html/checkout/standard/summary/decorators/global
264
-		 * Adds a list of globally available decorators only to the checkout standard summary html client
265
-		 *
266
-		 * Decorators extend the functionality of a class by adding new aspects
267
-		 * (e.g. log what is currently done), executing the methods of the underlying
268
-		 * class only in certain conditions (e.g. only for logged in users) or
269
-		 * modify what is returned to the caller.
270
-		 *
271
-		 * This option allows you to wrap global decorators
272
-		 * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
273
-		 *
274
-		 *  client/html/checkout/standard/summary/decorators/global = array( 'decorator1' )
275
-		 *
276
-		 * This would add the decorator named "decorator1" defined by
277
-		 * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
278
-		 *
279
-		 * @param array List of decorator names
280
-		 * @since 2015.08
281
-		 * @category Developer
282
-		 * @see client/html/common/decorators/default
283
-		 * @see client/html/checkout/standard/summary/decorators/excludes
284
-		 * @see client/html/checkout/standard/summary/decorators/local
285
-		 */
286
-
287
-		/** client/html/checkout/standard/summary/decorators/local
288
-		 * Adds a list of local decorators only to the checkout standard summary html client
289
-		 *
290
-		 * Decorators extend the functionality of a class by adding new aspects
291
-		 * (e.g. log what is currently done), executing the methods of the underlying
292
-		 * class only in certain conditions (e.g. only for logged in users) or
293
-		 * modify what is returned to the caller.
294
-		 *
295
-		 * This option allows you to wrap local decorators
296
-		 * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
297
-		 *
298
-		 *  client/html/checkout/standard/summary/decorators/local = array( 'decorator2' )
299
-		 *
300
-		 * This would add the decorator named "decorator2" defined by
301
-		 * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
302
-		 *
303
-		 * @param array List of decorator names
304
-		 * @since 2015.08
305
-		 * @category Developer
306
-		 * @see client/html/common/decorators/default
307
-		 * @see client/html/checkout/standard/summary/decorators/excludes
308
-		 * @see client/html/checkout/standard/summary/decorators/global
309
-		 */
310
-
311
-		return $this->createSubClient( 'checkout/standard/summary/' . $type, $name );
312
-	}
313
-
314
-
315
-	/**
316
-	 * Processes the input, e.g. store given values.
317
-	 * A view must be available and this method doesn't generate any output
318
-	 * besides setting view variables.
319
-	 */
320
-	public function process()
321
-	{
322
-		$view = $this->getView();
323
-
324
-		if( $view->param( 'cs_order', null ) === null ) {
325
-			return;
326
-		}
327
-
328
-		try
329
-		{
330
-			$controller = \Aimeos\Controller\Frontend\Factory::createController( $this->getContext(), 'basket' );
331
-			$controller->get()->check( \Aimeos\MShop\Order\Item\Base\Base::PARTS_ALL );
332
-
333
-			parent::process();
334
-		}
335
-		catch( \Exception $e )
336
-		{
337
-			$view->standardStepActive = 'summary';
338
-			throw $e;
339
-		}
340
-	}
341
-
342
-
343
-	/**
344
-	 * Returns the list of sub-client names configured for the client.
345
-	 *
346
-	 * @return array List of HTML client names
347
-	 */
348
-	protected function getSubClientNames()
349
-	{
350
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
351
-	}
29
+    /** client/html/checkout/standard/summary/standard/subparts
30
+     * List of HTML sub-clients rendered within the checkout standard summary section
31
+     *
32
+     * The output of the frontend is composed of the code generated by the HTML
33
+     * clients. Each HTML client can consist of serveral (or none) sub-clients
34
+     * that are responsible for rendering certain sub-parts of the output. The
35
+     * sub-clients can contain HTML clients themselves and therefore a
36
+     * hierarchical tree of HTML clients is composed. Each HTML client creates
37
+     * the output that is placed inside the container of its parent.
38
+     *
39
+     * At first, always the HTML code generated by the parent is printed, then
40
+     * the HTML code of its sub-clients. The order of the HTML sub-clients
41
+     * determines the order of the output of these sub-clients inside the parent
42
+     * container. If the configured list of clients is
43
+     *
44
+     *  array( "subclient1", "subclient2" )
45
+     *
46
+     * you can easily change the order of the output by reordering the subparts:
47
+     *
48
+     *  client/html/<clients>/subparts = array( "subclient1", "subclient2" )
49
+     *
50
+     * You can also remove one or more parts if they shouldn't be rendered:
51
+     *
52
+     *  client/html/<clients>/subparts = array( "subclient1" )
53
+     *
54
+     * As the clients only generates structural HTML, the layout defined via CSS
55
+     * should support adding, removing or reordering content by a fluid like
56
+     * design.
57
+     *
58
+     * @param array List of sub-client names
59
+     * @since 2014.03
60
+     * @category Developer
61
+     */
62
+    private $subPartPath = 'client/html/checkout/standard/summary/standard/subparts';
63
+
64
+    /** client/html/checkout/standard/summary/address/name
65
+     * Name of the address part used by the checkout standard summary client implementation
66
+     *
67
+     * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Summary\Address\Myname".
68
+     * The name is case-sensitive and you should avoid camel case names like "MyName".
69
+     *
70
+     * @param string Last part of the client class name
71
+     * @since 2014.03
72
+     * @category Developer
73
+     */
74
+
75
+    /** client/html/checkout/standard/summary/service/name
76
+     * Name of the service part used by the checkout standard summary client implementation
77
+     *
78
+     * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Summary\Service\Myname".
79
+     * The name is case-sensitive and you should avoid camel case names like "MyName".
80
+     *
81
+     * @param string Last part of the client class name
82
+     * @since 2014.03
83
+     * @category Developer
84
+     */
85
+
86
+    /** client/html/checkout/standard/summary/coupon/name
87
+     * Name of the coupon part used by the checkout standard summary client implementation
88
+     *
89
+     * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Summary\Coupon\Myname".
90
+     * The name is case-sensitive and you should avoid camel case names like "MyName".
91
+     *
92
+     * @param string Last part of the client class name
93
+     * @since 2014.03
94
+     * @category Developer
95
+     */
96
+
97
+    /** client/html/checkout/standard/summary/option/name
98
+     * Name of the option part used by the checkout standard summary client implementation
99
+     *
100
+     * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Summary\Option\Myname".
101
+     * The name is case-sensitive and you should avoid camel case names like "MyName".
102
+     *
103
+     * @param string Last part of the client class name
104
+     * @since 2014.03
105
+     * @category Developer
106
+     */
107
+
108
+    /** client/html/checkout/standard/summary/detail/name
109
+     * Name of the detail part used by the checkout standard summary client implementation
110
+     *
111
+     * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Summary\Detail\Myname".
112
+     * The name is case-sensitive and you should avoid camel case names like "MyName".
113
+     *
114
+     * @param string Last part of the client class name
115
+     * @since 2014.03
116
+     * @category Developer
117
+     */
118
+    private $subPartNames = array( 'address', 'service', 'coupon', 'option', 'detail' );
119
+
120
+
121
+    /**
122
+     * Returns the HTML code for insertion into the body.
123
+     *
124
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
125
+     * @param array &$tags Result array for the list of tags that are associated to the output
126
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
127
+     * @return string HTML code
128
+     */
129
+    public function getBody( $uid = '', array &$tags = array(), &$expire = null )
130
+    {
131
+        $view = $this->getView();
132
+        $step = $view->get( 'standardStepActive' );
133
+        $onepage = $view->config( 'client/html/checkout/standard/onepage', array() );
134
+
135
+        if( $step != 'summary' && !( in_array( 'summary', $onepage ) && in_array( $step, $onepage ) ) ) {
136
+            return '';
137
+        }
138
+
139
+        $view = $this->setViewParams( $view, $tags, $expire );
140
+
141
+        $html = '';
142
+        foreach( $this->getSubClients() as $subclient ) {
143
+            $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
144
+        }
145
+        $view->summaryBody = $html;
146
+
147
+        /** client/html/checkout/standard/summary/standard/template-body
148
+         * Relative path to the HTML body template of the checkout standard summary client.
149
+         *
150
+         * The template file contains the HTML code and processing instructions
151
+         * to generate the result shown in the body of the frontend. The
152
+         * configuration string is the path to the template file relative
153
+         * to the templates directory (usually in client/html/templates).
154
+         *
155
+         * You can overwrite the template file configuration in extensions and
156
+         * provide alternative templates. These alternative templates should be
157
+         * named like the default one but with the string "standard" replaced by
158
+         * an unique name. You may use the name of your project for this. If
159
+         * you've implemented an alternative client class as well, "standard"
160
+         * should be replaced by the name of the new class.
161
+         *
162
+         * @param string Relative path to the template creating code for the HTML page body
163
+         * @since 2014.03
164
+         * @category Developer
165
+         * @see client/html/checkout/standard/summary/standard/template-header
166
+         */
167
+        $tplconf = 'client/html/checkout/standard/summary/standard/template-body';
168
+        $default = 'checkout/standard/summary-body-default.php';
169
+
170
+        return $view->render( $view->config( $tplconf, $default ) );
171
+    }
172
+
173
+
174
+    /**
175
+     * Returns the HTML string for insertion into the header.
176
+     *
177
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
178
+     * @param array &$tags Result array for the list of tags that are associated to the output
179
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
180
+     * @return string|null String including HTML tags for the header on error
181
+     */
182
+    public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
183
+    {
184
+        $view = $this->getView();
185
+        $step = $view->get( 'standardStepActive' );
186
+        $onepage = $view->config( 'client/html/checkout/standard/onepage', array() );
187
+
188
+        if( $step != 'summary' && !( in_array( 'summary', $onepage ) && in_array( $step, $onepage ) ) ) {
189
+            return '';
190
+        }
191
+
192
+        $view = $this->setViewParams( $view, $tags, $expire );
193
+
194
+        $html = '';
195
+        foreach( $this->getSubClients() as $subclient ) {
196
+            $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
197
+        }
198
+        $view->summaryHeader = $html;
199
+
200
+        /** client/html/checkout/standard/summary/standard/template-header
201
+         * Relative path to the HTML header template of the checkout standard summary client.
202
+         *
203
+         * The template file contains the HTML code and processing instructions
204
+         * to generate the HTML code that is inserted into the HTML page header
205
+         * of the rendered page in the frontend. The configuration string is the
206
+         * path to the template file relative to the templates directory (usually
207
+         * in client/html/templates).
208
+         *
209
+         * You can overwrite the template file configuration in extensions and
210
+         * provide alternative templates. These alternative templates should be
211
+         * named like the default one but with the string "standard" replaced by
212
+         * an unique name. You may use the name of your project for this. If
213
+         * you've implemented an alternative client class as well, "standard"
214
+         * should be replaced by the name of the new class.
215
+         *
216
+         * @param string Relative path to the template creating code for the HTML page head
217
+         * @since 2014.03
218
+         * @category Developer
219
+         * @see client/html/checkout/standard/summary/standard/template-body
220
+         */
221
+        $tplconf = 'client/html/checkout/standard/summary/standard/template-header';
222
+        $default = 'checkout/standard/summary-header-default.php';
223
+
224
+        return $view->render( $view->config( $tplconf, $default ) );
225
+    }
226
+
227
+
228
+    /**
229
+     * Returns the sub-client given by its name.
230
+     *
231
+     * @param string $type Name of the client type
232
+     * @param string|null $name Name of the sub-client (Default if null)
233
+     * @return \Aimeos\Client\Html\Iface Sub-client object
234
+     */
235
+    public function getSubClient( $type, $name = null )
236
+    {
237
+        /** client/html/checkout/standard/summary/decorators/excludes
238
+         * Excludes decorators added by the "common" option from the checkout standard summary html client
239
+         *
240
+         * Decorators extend the functionality of a class by adding new aspects
241
+         * (e.g. log what is currently done), executing the methods of the underlying
242
+         * class only in certain conditions (e.g. only for logged in users) or
243
+         * modify what is returned to the caller.
244
+         *
245
+         * This option allows you to remove a decorator added via
246
+         * "client/html/common/decorators/default" before they are wrapped
247
+         * around the html client.
248
+         *
249
+         *  client/html/checkout/standard/summary/decorators/excludes = array( 'decorator1' )
250
+         *
251
+         * This would remove the decorator named "decorator1" from the list of
252
+         * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
253
+         * "client/html/common/decorators/default" to the html client.
254
+         *
255
+         * @param array List of decorator names
256
+         * @since 2015.08
257
+         * @category Developer
258
+         * @see client/html/common/decorators/default
259
+         * @see client/html/checkout/standard/summary/decorators/global
260
+         * @see client/html/checkout/standard/summary/decorators/local
261
+         */
262
+
263
+        /** client/html/checkout/standard/summary/decorators/global
264
+         * Adds a list of globally available decorators only to the checkout standard summary html client
265
+         *
266
+         * Decorators extend the functionality of a class by adding new aspects
267
+         * (e.g. log what is currently done), executing the methods of the underlying
268
+         * class only in certain conditions (e.g. only for logged in users) or
269
+         * modify what is returned to the caller.
270
+         *
271
+         * This option allows you to wrap global decorators
272
+         * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
273
+         *
274
+         *  client/html/checkout/standard/summary/decorators/global = array( 'decorator1' )
275
+         *
276
+         * This would add the decorator named "decorator1" defined by
277
+         * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
278
+         *
279
+         * @param array List of decorator names
280
+         * @since 2015.08
281
+         * @category Developer
282
+         * @see client/html/common/decorators/default
283
+         * @see client/html/checkout/standard/summary/decorators/excludes
284
+         * @see client/html/checkout/standard/summary/decorators/local
285
+         */
286
+
287
+        /** client/html/checkout/standard/summary/decorators/local
288
+         * Adds a list of local decorators only to the checkout standard summary html client
289
+         *
290
+         * Decorators extend the functionality of a class by adding new aspects
291
+         * (e.g. log what is currently done), executing the methods of the underlying
292
+         * class only in certain conditions (e.g. only for logged in users) or
293
+         * modify what is returned to the caller.
294
+         *
295
+         * This option allows you to wrap local decorators
296
+         * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
297
+         *
298
+         *  client/html/checkout/standard/summary/decorators/local = array( 'decorator2' )
299
+         *
300
+         * This would add the decorator named "decorator2" defined by
301
+         * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
302
+         *
303
+         * @param array List of decorator names
304
+         * @since 2015.08
305
+         * @category Developer
306
+         * @see client/html/common/decorators/default
307
+         * @see client/html/checkout/standard/summary/decorators/excludes
308
+         * @see client/html/checkout/standard/summary/decorators/global
309
+         */
310
+
311
+        return $this->createSubClient( 'checkout/standard/summary/' . $type, $name );
312
+    }
313
+
314
+
315
+    /**
316
+     * Processes the input, e.g. store given values.
317
+     * A view must be available and this method doesn't generate any output
318
+     * besides setting view variables.
319
+     */
320
+    public function process()
321
+    {
322
+        $view = $this->getView();
323
+
324
+        if( $view->param( 'cs_order', null ) === null ) {
325
+            return;
326
+        }
327
+
328
+        try
329
+        {
330
+            $controller = \Aimeos\Controller\Frontend\Factory::createController( $this->getContext(), 'basket' );
331
+            $controller->get()->check( \Aimeos\MShop\Order\Item\Base\Base::PARTS_ALL );
332
+
333
+            parent::process();
334
+        }
335
+        catch( \Exception $e )
336
+        {
337
+            $view->standardStepActive = 'summary';
338
+            throw $e;
339
+        }
340
+    }
341
+
342
+
343
+    /**
344
+     * Returns the list of sub-client names configured for the client.
345
+     *
346
+     * @return array List of HTML client names
347
+     */
348
+    protected function getSubClientNames()
349
+    {
350
+        return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
351
+    }
352 352
 }
353 353
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Standard/Summary/Address/Standard.php 1 patch
Indentation   +237 added lines, -237 removed lines patch added patch discarded remove patch
@@ -19,266 +19,266 @@
 block discarded – undo
19 19
  * @subpackage Html
20 20
  */
21 21
 class Standard
22
-	extends \Aimeos\Client\Html\Common\Summary\Address\Base
23
-	implements \Aimeos\Client\Html\Common\Client\Factory\Iface
22
+    extends \Aimeos\Client\Html\Common\Summary\Address\Base
23
+    implements \Aimeos\Client\Html\Common\Client\Factory\Iface
24 24
 {
25
-	/** client/html/checkout/standard/summary/address/standard/subparts
26
-	 * List of HTML sub-clients rendered within the checkout standard summary address 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 2015.11
56
-	 * @category Developer
57
-	 */
58
-	private $subPartPath = 'client/html/checkout/standard/summary/address/standard/subparts';
59
-	private $subPartNames = array();
60
-	private $cache;
25
+    /** client/html/checkout/standard/summary/address/standard/subparts
26
+     * List of HTML sub-clients rendered within the checkout standard summary address 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 2015.11
56
+     * @category Developer
57
+     */
58
+    private $subPartPath = 'client/html/checkout/standard/summary/address/standard/subparts';
59
+    private $subPartNames = array();
60
+    private $cache;
61 61
 
62 62
 
63
-	/**
64
-	 * Returns the HTML code for insertion into the body.
65
-	 *
66
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
67
-	 * @param array &$tags Result array for the list of tags that are associated to the output
68
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
69
-	 * @return string HTML code
70
-	*/
71
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
72
-	{
73
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
63
+    /**
64
+     * Returns the HTML code for insertion into the body.
65
+     *
66
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
67
+     * @param array &$tags Result array for the list of tags that are associated to the output
68
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
69
+     * @return string HTML code
70
+     */
71
+    public function getBody( $uid = '', array &$tags = array(), &$expire = null )
72
+    {
73
+        $view = $this->setViewParams( $this->getView(), $tags, $expire );
74 74
 
75
-		$html = '';
76
-		foreach( $this->getSubClients() as $subclient ) {
77
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
78
-		}
79
-		$view->addressBody = $html;
75
+        $html = '';
76
+        foreach( $this->getSubClients() as $subclient ) {
77
+            $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
78
+        }
79
+        $view->addressBody = $html;
80 80
 
81
-		/** client/html/checkout/standard/summary/address/standard/template-body
82
-		 * Relative path to the HTML body template of the checkout standard summary address client.
83
-		 *
84
-		 * The template file contains the HTML code and processing instructions
85
-		 * to generate the result shown in the body of the frontend. The
86
-		 * configuration string is the path to the template file relative
87
-		 * to the templates directory (usually in client/html/templates).
88
-		 *
89
-		 * You can overwrite the template file configuration in extensions and
90
-		 * provide alternative templates. These alternative templates should be
91
-		 * named like the default one but with the string "standard" replaced by
92
-		 * an unique name. You may use the name of your project for this. If
93
-		 * you've implemented an alternative client class as well, "standard"
94
-		 * (second one) should be replaced by the name of the new class in lower
95
-		 * case.
96
-		 *
97
-		 * @param string Relative path to the template creating code for the HTML page body
98
-		 * @since 2015.11
99
-		 * @category Developer
100
-		 * @see client/html/checkout/standard/summary/address/standard/template-header
101
-		 */
102
-		$tplconf = 'client/html/checkout/standard/summary/address/standard/template-body';
103
-		$default = 'common/summary/address-body-default.php';
81
+        /** client/html/checkout/standard/summary/address/standard/template-body
82
+         * Relative path to the HTML body template of the checkout standard summary address client.
83
+         *
84
+         * The template file contains the HTML code and processing instructions
85
+         * to generate the result shown in the body of the frontend. The
86
+         * configuration string is the path to the template file relative
87
+         * to the templates directory (usually in client/html/templates).
88
+         *
89
+         * You can overwrite the template file configuration in extensions and
90
+         * provide alternative templates. These alternative templates should be
91
+         * named like the default one but with the string "standard" replaced by
92
+         * an unique name. You may use the name of your project for this. If
93
+         * you've implemented an alternative client class as well, "standard"
94
+         * (second one) should be replaced by the name of the new class in lower
95
+         * case.
96
+         *
97
+         * @param string Relative path to the template creating code for the HTML page body
98
+         * @since 2015.11
99
+         * @category Developer
100
+         * @see client/html/checkout/standard/summary/address/standard/template-header
101
+         */
102
+        $tplconf = 'client/html/checkout/standard/summary/address/standard/template-body';
103
+        $default = 'common/summary/address-body-default.php';
104 104
 
105
-		return $view->render( $view->config( $tplconf, $default ) );
106
-	}
105
+        return $view->render( $view->config( $tplconf, $default ) );
106
+    }
107 107
 
108 108
 
109
-	/**
110
-	 * Returns the HTML string for insertion into the header.
111
-	 *
112
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
113
-	 * @param array &$tags Result array for the list of tags that are associated to the output
114
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
115
-	 * @return string|null String including HTML tags for the header on error
116
-	 */
117
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
118
-	{
119
-		$view = $this->setViewParams( $this->getView(), $tags, $expire );
109
+    /**
110
+     * Returns the HTML string for insertion into the header.
111
+     *
112
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
113
+     * @param array &$tags Result array for the list of tags that are associated to the output
114
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
115
+     * @return string|null String including HTML tags for the header on error
116
+     */
117
+    public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
118
+    {
119
+        $view = $this->setViewParams( $this->getView(), $tags, $expire );
120 120
 
121
-		$html = '';
122
-		foreach( $this->getSubClients() as $subclient ) {
123
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
124
-		}
125
-		$view->addressHeader = $html;
121
+        $html = '';
122
+        foreach( $this->getSubClients() as $subclient ) {
123
+            $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
124
+        }
125
+        $view->addressHeader = $html;
126 126
 
127
-		/** client/html/checkout/standard/summary/address/standard/template-header
128
-		 * Relative path to the HTML header template of the checkout standard summary address client.
129
-		 *
130
-		 * The template file contains the HTML code and processing instructions
131
-		 * to generate the HTML code that is inserted into the HTML page header
132
-		 * of the rendered page in the frontend. The configuration string is the
133
-		 * path to the template file relative to the templates directory (usually
134
-		 * in client/html/templates).
135
-		 *
136
-		 * You can overwrite the template file configuration in extensions and
137
-		 * provide alternative templates. These alternative templates should be
138
-		 * named like the default one but with the string "standard" replaced by
139
-		 * an unique name. You may use the name of your project for this. If
140
-		 * you've implemented an alternative client class as well, "standard"
141
-		 * (second one) should be replaced by the name of the new class in lower
142
-		 * case.
143
-		 *
144
-		 * @param string Relative path to the template creating code for the HTML page head
145
-		 * @since 2015.11
146
-		 * @category Developer
147
-		 * @see client/html/checkout/standard/summary/address/standard/template-body
148
-		 */
149
-		$tplconf = 'client/html/checkout/standard/summary/address/standard/template-header';
150
-		$default = 'common/summary/address-header-default.php';
127
+        /** client/html/checkout/standard/summary/address/standard/template-header
128
+         * Relative path to the HTML header template of the checkout standard summary address client.
129
+         *
130
+         * The template file contains the HTML code and processing instructions
131
+         * to generate the HTML code that is inserted into the HTML page header
132
+         * of the rendered page in the frontend. The configuration string is the
133
+         * path to the template file relative to the templates directory (usually
134
+         * in client/html/templates).
135
+         *
136
+         * You can overwrite the template file configuration in extensions and
137
+         * provide alternative templates. These alternative templates should be
138
+         * named like the default one but with the string "standard" replaced by
139
+         * an unique name. You may use the name of your project for this. If
140
+         * you've implemented an alternative client class as well, "standard"
141
+         * (second one) should be replaced by the name of the new class in lower
142
+         * case.
143
+         *
144
+         * @param string Relative path to the template creating code for the HTML page head
145
+         * @since 2015.11
146
+         * @category Developer
147
+         * @see client/html/checkout/standard/summary/address/standard/template-body
148
+         */
149
+        $tplconf = 'client/html/checkout/standard/summary/address/standard/template-header';
150
+        $default = 'common/summary/address-header-default.php';
151 151
 
152
-		return $view->render( $view->config( $tplconf, $default ) );
153
-	}
152
+        return $view->render( $view->config( $tplconf, $default ) );
153
+    }
154 154
 
155 155
 
156
-	/**
157
-	 * Returns the sub-client given by its name.
158
-	 *
159
-	 * @param string $type Name of the client type
160
-	 * @param string|null $name Name of the sub-client (Default if null)
161
-	 * @return \Aimeos\Client\Html\Iface Sub-client object
162
-	 */
163
-	public function getSubClient( $type, $name = null )
164
-	{
165
-		/** client/html/checkout/standard/summary/address/decorators/excludes
166
-		 * Excludes decorators added by the "common" option from the checkout standard summary address html client
167
-		 *
168
-		 * Decorators extend the functionality of a class by adding new aspects
169
-		 * (e.g. log what is currently done), executing the methods of the underlying
170
-		 * class only in certain conditions (e.g. only for logged in users) or
171
-		 * modify what is returned to the caller.
172
-		 *
173
-		 * This option allows you to remove a decorator added via
174
-		 * "client/html/common/decorators/default" before they are wrapped
175
-		 * around the html client.
176
-		 *
177
-		 *  client/html/checkout/standard/summary/address/decorators/excludes = array( 'decorator1' )
178
-		 *
179
-		 * This would remove the decorator named "decorator1" from the list of
180
-		 * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
181
-		 * "client/html/common/decorators/default" to the html client.
182
-		 *
183
-		 * @param array List of decorator names
184
-		 * @since 2015.08
185
-		 * @category Developer
186
-		 * @see client/html/common/decorators/default
187
-		 * @see client/html/checkout/standard/summary/address/decorators/global
188
-		 * @see client/html/checkout/standard/summary/address/decorators/local
189
-		 */
156
+    /**
157
+     * Returns the sub-client given by its name.
158
+     *
159
+     * @param string $type Name of the client type
160
+     * @param string|null $name Name of the sub-client (Default if null)
161
+     * @return \Aimeos\Client\Html\Iface Sub-client object
162
+     */
163
+    public function getSubClient( $type, $name = null )
164
+    {
165
+        /** client/html/checkout/standard/summary/address/decorators/excludes
166
+         * Excludes decorators added by the "common" option from the checkout standard summary address html client
167
+         *
168
+         * Decorators extend the functionality of a class by adding new aspects
169
+         * (e.g. log what is currently done), executing the methods of the underlying
170
+         * class only in certain conditions (e.g. only for logged in users) or
171
+         * modify what is returned to the caller.
172
+         *
173
+         * This option allows you to remove a decorator added via
174
+         * "client/html/common/decorators/default" before they are wrapped
175
+         * around the html client.
176
+         *
177
+         *  client/html/checkout/standard/summary/address/decorators/excludes = array( 'decorator1' )
178
+         *
179
+         * This would remove the decorator named "decorator1" from the list of
180
+         * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
181
+         * "client/html/common/decorators/default" to the html client.
182
+         *
183
+         * @param array List of decorator names
184
+         * @since 2015.08
185
+         * @category Developer
186
+         * @see client/html/common/decorators/default
187
+         * @see client/html/checkout/standard/summary/address/decorators/global
188
+         * @see client/html/checkout/standard/summary/address/decorators/local
189
+         */
190 190
 
191
-		/** client/html/checkout/standard/summary/address/decorators/global
192
-		 * Adds a list of globally available decorators only to the checkout standard summary address html client
193
-		 *
194
-		 * Decorators extend the functionality of a class by adding new aspects
195
-		 * (e.g. log what is currently done), executing the methods of the underlying
196
-		 * class only in certain conditions (e.g. only for logged in users) or
197
-		 * modify what is returned to the caller.
198
-		 *
199
-		 * This option allows you to wrap global decorators
200
-		 * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
201
-		 *
202
-		 *  client/html/checkout/standard/summary/address/decorators/global = array( 'decorator1' )
203
-		 *
204
-		 * This would add the decorator named "decorator1" defined by
205
-		 * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
206
-		 *
207
-		 * @param array List of decorator names
208
-		 * @since 2015.08
209
-		 * @category Developer
210
-		 * @see client/html/common/decorators/default
211
-		 * @see client/html/checkout/standard/summary/address/decorators/excludes
212
-		 * @see client/html/checkout/standard/summary/address/decorators/local
213
-		 */
191
+        /** client/html/checkout/standard/summary/address/decorators/global
192
+         * Adds a list of globally available decorators only to the checkout standard summary address html client
193
+         *
194
+         * Decorators extend the functionality of a class by adding new aspects
195
+         * (e.g. log what is currently done), executing the methods of the underlying
196
+         * class only in certain conditions (e.g. only for logged in users) or
197
+         * modify what is returned to the caller.
198
+         *
199
+         * This option allows you to wrap global decorators
200
+         * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
201
+         *
202
+         *  client/html/checkout/standard/summary/address/decorators/global = array( 'decorator1' )
203
+         *
204
+         * This would add the decorator named "decorator1" defined by
205
+         * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
206
+         *
207
+         * @param array List of decorator names
208
+         * @since 2015.08
209
+         * @category Developer
210
+         * @see client/html/common/decorators/default
211
+         * @see client/html/checkout/standard/summary/address/decorators/excludes
212
+         * @see client/html/checkout/standard/summary/address/decorators/local
213
+         */
214 214
 
215
-		/** client/html/checkout/standard/summary/address/decorators/local
216
-		 * Adds a list of local decorators only to the checkout standard summary address html client
217
-		 *
218
-		 * Decorators extend the functionality of a class by adding new aspects
219
-		 * (e.g. log what is currently done), executing the methods of the underlying
220
-		 * class only in certain conditions (e.g. only for logged in users) or
221
-		 * modify what is returned to the caller.
222
-		 *
223
-		 * This option allows you to wrap local decorators
224
-		 * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
225
-		 *
226
-		 *  client/html/checkout/standard/summary/address/decorators/local = array( 'decorator2' )
227
-		 *
228
-		 * This would add the decorator named "decorator2" defined by
229
-		 * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
230
-		 *
231
-		 * @param array List of decorator names
232
-		 * @since 2015.08
233
-		 * @category Developer
234
-		 * @see client/html/common/decorators/default
235
-		 * @see client/html/checkout/standard/summary/address/decorators/excludes
236
-		 * @see client/html/checkout/standard/summary/address/decorators/global
237
-		 */
215
+        /** client/html/checkout/standard/summary/address/decorators/local
216
+         * Adds a list of local decorators only to the checkout standard summary address html client
217
+         *
218
+         * Decorators extend the functionality of a class by adding new aspects
219
+         * (e.g. log what is currently done), executing the methods of the underlying
220
+         * class only in certain conditions (e.g. only for logged in users) or
221
+         * modify what is returned to the caller.
222
+         *
223
+         * This option allows you to wrap local decorators
224
+         * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
225
+         *
226
+         *  client/html/checkout/standard/summary/address/decorators/local = array( 'decorator2' )
227
+         *
228
+         * This would add the decorator named "decorator2" defined by
229
+         * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
230
+         *
231
+         * @param array List of decorator names
232
+         * @since 2015.08
233
+         * @category Developer
234
+         * @see client/html/common/decorators/default
235
+         * @see client/html/checkout/standard/summary/address/decorators/excludes
236
+         * @see client/html/checkout/standard/summary/address/decorators/global
237
+         */
238 238
 
239
-		return $this->createSubClient( 'checkout/standard/summary/address/' . $type, $name );
240
-	}
239
+        return $this->createSubClient( 'checkout/standard/summary/address/' . $type, $name );
240
+    }
241 241
 
242 242
 
243
-	/**
244
-	 * Returns the list of sub-client names configured for the client.
245
-	 *
246
-	 * @return array List of HTML client names
247
-	 */
248
-	protected function getSubClientNames()
249
-	{
250
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
251
-	}
243
+    /**
244
+     * Returns the list of sub-client names configured for the client.
245
+     *
246
+     * @return array List of HTML client names
247
+     */
248
+    protected function getSubClientNames()
249
+    {
250
+        return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
251
+    }
252 252
 
253 253
 
254
-	/**
255
-	 * Sets the necessary parameter values in the view.
256
-	 *
257
-	 * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
258
-	 * @param array &$tags Result array for the list of tags that are associated to the output
259
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
260
-	 * @return \Aimeos\MW\View\Iface Modified view object
261
-	 */
262
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
263
-	{
264
-		$view = parent::setViewParams( $view, $tags, $expire );
254
+    /**
255
+     * Sets the necessary parameter values in the view.
256
+     *
257
+     * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
258
+     * @param array &$tags Result array for the list of tags that are associated to the output
259
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
260
+     * @return \Aimeos\MW\View\Iface Modified view object
261
+     */
262
+    protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
263
+    {
264
+        $view = parent::setViewParams( $view, $tags, $expire );
265 265
 
266
-		if( !isset( $this->cache ) )
267
-		{
268
-			$target = $view->config( 'client/html/checkout/standard/url/target' );
269
-			$cntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' );
270
-			$action = $view->config( 'client/html/checkout/standard/url/action', 'index' );
271
-			$config = $view->config( 'client/html/checkout/standard/url/config', array() );
266
+        if( !isset( $this->cache ) )
267
+        {
268
+            $target = $view->config( 'client/html/checkout/standard/url/target' );
269
+            $cntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' );
270
+            $action = $view->config( 'client/html/checkout/standard/url/action', 'index' );
271
+            $config = $view->config( 'client/html/checkout/standard/url/config', array() );
272 272
 
273
-			$url = $view->url( $target, $cntl, $action, array( 'c_step' => 'address' ), array(), $config );
273
+            $url = $view->url( $target, $cntl, $action, array( 'c_step' => 'address' ), array(), $config );
274 274
 
275
-			$view->summaryUrlAddressBilling = $url;
276
-			$view->summaryUrlAddressDelivery = $url;
277
-			$view->summaryBasket = $view->standardBasket;
275
+            $view->summaryUrlAddressBilling = $url;
276
+            $view->summaryUrlAddressDelivery = $url;
277
+            $view->summaryBasket = $view->standardBasket;
278 278
 
279
-			$this->cache = $view;
280
-		}
279
+            $this->cache = $view;
280
+        }
281 281
 
282
-		return $this->cache;
283
-	}
282
+        return $this->cache;
283
+    }
284 284
 }
285 285
\ No newline at end of file
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Standard/Factory.php 1 patch
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -19,69 +19,69 @@
 block discarded – undo
19 19
  * @subpackage Html
20 20
  */
21 21
 class Factory
22
-	extends \Aimeos\Client\Html\Common\Factory\Base
23
-	implements \Aimeos\Client\Html\Common\Factory\Iface
22
+    extends \Aimeos\Client\Html\Common\Factory\Base
23
+    implements \Aimeos\Client\Html\Common\Factory\Iface
24 24
 {
25
-	/**
26
-	 * Creates a standard checkout client object.
27
-	 *
28
-	 * @param \Aimeos\MShop\Context\Item\Iface $context Shop context instance with necessary objects
29
-	 * @param array $templatePaths List of file system paths where the templates are stored
30
-	 * @param string|null $name Client name (default: "Standard")
31
-	 * @return \Aimeos\Client\Html\Iface Filter part implementing \Aimeos\Client\Html\Iface
32
-	 * @throws \Aimeos\Client\Html\Exception If requested client implementation couldn't be found or initialisation fails
33
-	 */
34
-	public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null )
35
-	{
36
-		/** client/html/checkout/standard/name
37
-		 * Class name of the used checkout standard client implementation
38
-		 *
39
-		 * Each default HTML client can be replace by an alternative imlementation.
40
-		 * To use this implementation, you have to set the last part of the class
41
-		 * name as configuration value so the client factory knows which class it
42
-		 * has to instantiate.
43
-		 *
44
-		 * For example, if the name of the default class is
45
-		 *
46
-		 *  \Aimeos\Client\Html\Checkout\Standard\Standard
47
-		 *
48
-		 * and you want to replace it with your own version named
49
-		 *
50
-		 *  \Aimeos\Client\Html\Checkout\Standard\Mycheckout
51
-		 *
52
-		 * then you have to set the this configuration option:
53
-		 *
54
-		 *  client/html/checkout/standard/name = Mycheckout
55
-		 *
56
-		 * The value is the last part of your own class name and it's case sensitive,
57
-		 * so take care that the configuration value is exactly named like the last
58
-		 * part of the class name.
59
-		 *
60
-		 * The allowed characters of the class name are A-Z, a-z and 0-9. No other
61
-		 * characters are possible! You should always start the last part of the class
62
-		 * name with an upper case character and continue only with lower case characters
63
-		 * or numbers. Avoid chamel case names like "MyCheckout"!
64
-		 *
65
-		 * @param string Last part of the class name
66
-		 * @since 2014.03
67
-		 * @category Developer
68
-		 */
69
-		if( $name === null ) {
70
-			$name = $context->getConfig()->get( 'client/html/checkout/standard/name', 'Standard' );
71
-		}
25
+    /**
26
+     * Creates a standard checkout client object.
27
+     *
28
+     * @param \Aimeos\MShop\Context\Item\Iface $context Shop context instance with necessary objects
29
+     * @param array $templatePaths List of file system paths where the templates are stored
30
+     * @param string|null $name Client name (default: "Standard")
31
+     * @return \Aimeos\Client\Html\Iface Filter part implementing \Aimeos\Client\Html\Iface
32
+     * @throws \Aimeos\Client\Html\Exception If requested client implementation couldn't be found or initialisation fails
33
+     */
34
+    public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null )
35
+    {
36
+        /** client/html/checkout/standard/name
37
+         * Class name of the used checkout standard client implementation
38
+         *
39
+         * Each default HTML client can be replace by an alternative imlementation.
40
+         * To use this implementation, you have to set the last part of the class
41
+         * name as configuration value so the client factory knows which class it
42
+         * has to instantiate.
43
+         *
44
+         * For example, if the name of the default class is
45
+         *
46
+         *  \Aimeos\Client\Html\Checkout\Standard\Standard
47
+         *
48
+         * and you want to replace it with your own version named
49
+         *
50
+         *  \Aimeos\Client\Html\Checkout\Standard\Mycheckout
51
+         *
52
+         * then you have to set the this configuration option:
53
+         *
54
+         *  client/html/checkout/standard/name = Mycheckout
55
+         *
56
+         * The value is the last part of your own class name and it's case sensitive,
57
+         * so take care that the configuration value is exactly named like the last
58
+         * part of the class name.
59
+         *
60
+         * The allowed characters of the class name are A-Z, a-z and 0-9. No other
61
+         * characters are possible! You should always start the last part of the class
62
+         * name with an upper case character and continue only with lower case characters
63
+         * or numbers. Avoid chamel case names like "MyCheckout"!
64
+         *
65
+         * @param string Last part of the class name
66
+         * @since 2014.03
67
+         * @category Developer
68
+         */
69
+        if( $name === null ) {
70
+            $name = $context->getConfig()->get( 'client/html/checkout/standard/name', 'Standard' );
71
+        }
72 72
 
73
-		if( ctype_alnum( $name ) === false )
74
-		{
75
-			$classname = is_string( $name ) ? '\\Aimeos\\Client\\Html\\Checkout\\Standard\\' . $name : '<not a string>';
76
-			throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
77
-		}
73
+        if( ctype_alnum( $name ) === false )
74
+        {
75
+            $classname = is_string( $name ) ? '\\Aimeos\\Client\\Html\\Checkout\\Standard\\' . $name : '<not a string>';
76
+            throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
77
+        }
78 78
 
79
-		$iface = '\\Aimeos\\Client\\Html\\Iface';
80
-		$classname = '\\Aimeos\\Client\\Html\\Checkout\\Standard\\' . $name;
79
+        $iface = '\\Aimeos\\Client\\Html\\Iface';
80
+        $classname = '\\Aimeos\\Client\\Html\\Checkout\\Standard\\' . $name;
81 81
 
82
-		$client = self::createClientBase( $context, $classname, $iface, $templatePaths );
82
+        $client = self::createClientBase( $context, $classname, $iface, $templatePaths );
83 83
 
84
-		return self::addClientDecorators( $context, $client, $templatePaths, 'checkout/standard' );
85
-	}
84
+        return self::addClientDecorators( $context, $client, $templatePaths, 'checkout/standard' );
85
+    }
86 86
 }
87 87
 
Please login to merge, or discard this patch.
client/html/src/Client/Html/Checkout/Standard/Delivery/Standard.php 1 patch
Indentation   +340 added lines, -340 removed lines patch added patch discarded remove patch
@@ -23,345 +23,345 @@
 block discarded – undo
23 23
  * @subpackage Html
24 24
  */
25 25
 class Standard
26
-	extends \Aimeos\Client\Html\Common\Client\Factory\Base
27
-	implements \Aimeos\Client\Html\Common\Client\Factory\Iface
26
+    extends \Aimeos\Client\Html\Common\Client\Factory\Base
27
+    implements \Aimeos\Client\Html\Common\Client\Factory\Iface
28 28
 {
29
-	/** client/html/checkout/standard/delivery/standard/subparts
30
-	 * List of HTML sub-clients rendered within the checkout standard delivery section
31
-	 *
32
-	 * The output of the frontend is composed of the code generated by the HTML
33
-	 * clients. Each HTML client can consist of serveral (or none) sub-clients
34
-	 * that are responsible for rendering certain sub-parts of the output. The
35
-	 * sub-clients can contain HTML clients themselves and therefore a
36
-	 * hierarchical tree of HTML clients is composed. Each HTML client creates
37
-	 * the output that is placed inside the container of its parent.
38
-	 *
39
-	 * At first, always the HTML code generated by the parent is printed, then
40
-	 * the HTML code of its sub-clients. The order of the HTML sub-clients
41
-	 * determines the order of the output of these sub-clients inside the parent
42
-	 * container. If the configured list of clients is
43
-	 *
44
-	 *  array( "subclient1", "subclient2" )
45
-	 *
46
-	 * you can easily change the order of the output by reordering the subparts:
47
-	 *
48
-	 *  client/html/<clients>/subparts = array( "subclient1", "subclient2" )
49
-	 *
50
-	 * You can also remove one or more parts if they shouldn't be rendered:
51
-	 *
52
-	 *  client/html/<clients>/subparts = array( "subclient1" )
53
-	 *
54
-	 * As the clients only generates structural HTML, the layout defined via CSS
55
-	 * should support adding, removing or reordering content by a fluid like
56
-	 * design.
57
-	 *
58
-	 * @param array List of sub-client names
59
-	 * @since 2014.03
60
-	 * @category Developer
61
-	 */
62
-	private $subPartPath = 'client/html/checkout/standard/delivery/standard/subparts';
63
-	private $subPartNames = array();
64
-	private $cache;
65
-
66
-
67
-	/**
68
-	 * Returns the HTML code for insertion into the body.
69
-	 *
70
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
71
-	 * @param array &$tags Result array for the list of tags that are associated to the output
72
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
73
-	 * @return string HTML code
74
-	 */
75
-	public function getBody( $uid = '', array &$tags = array(), &$expire = null )
76
-	{
77
-		$view = $this->getView();
78
-		$step = $view->get( 'standardStepActive' );
79
-		$onepage = $view->config( 'client/html/checkout/standard/onepage', array() );
80
-
81
-		if( $step != 'delivery' && !( in_array( 'delivery', $onepage ) && in_array( $step, $onepage ) ) ) {
82
-			return '';
83
-		}
84
-
85
-		$view = $this->setViewParams( $view, $tags, $expire );
86
-
87
-		$html = '';
88
-		foreach( $this->getSubClients() as $subclient ) {
89
-			$html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
90
-		}
91
-		$view->deliveryBody = $html;
92
-
93
-		/** client/html/checkout/standard/delivery/standard/template-body
94
-		 * Relative path to the HTML body template of the checkout standard delivery client.
95
-		 *
96
-		 * The template file contains the HTML code and processing instructions
97
-		 * to generate the result shown in the body of the frontend. The
98
-		 * configuration string is the path to the template file relative
99
-		 * to the templates directory (usually in client/html/templates).
100
-		 *
101
-		 * You can overwrite the template file configuration in extensions and
102
-		 * provide alternative templates. These alternative templates should be
103
-		 * named like the default one but with the string "standard" replaced by
104
-		 * an unique name. You may use the name of your project for this. If
105
-		 * you've implemented an alternative client class as well, "standard"
106
-		 * should be replaced by the name of the new class.
107
-		 *
108
-		 * @param string Relative path to the template creating code for the HTML page body
109
-		 * @since 2014.03
110
-		 * @category Developer
111
-		 * @see client/html/checkout/standard/delivery/standard/template-header
112
-		 */
113
-		$tplconf = 'client/html/checkout/standard/delivery/standard/template-body';
114
-		$default = 'checkout/standard/delivery-body-default.php';
115
-
116
-		return $view->render( $view->config( $tplconf, $default ) );
117
-	}
118
-
119
-
120
-	/**
121
-	 * Returns the HTML string for insertion into the header.
122
-	 *
123
-	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
124
-	 * @param array &$tags Result array for the list of tags that are associated to the output
125
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
126
-	 * @return string|null String including HTML tags for the header on error
127
-	 */
128
-	public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
129
-	{
130
-		$view = $this->getView();
131
-		$step = $view->get( 'standardStepActive' );
132
-		$onepage = $view->config( 'client/html/checkout/standard/onepage', array() );
133
-
134
-		if( $step != 'delivery' && !( in_array( 'delivery', $onepage ) && in_array( $step, $onepage ) ) ) {
135
-			return '';
136
-		}
137
-
138
-		$view = $this->setViewParams( $view, $tags, $expire );
139
-
140
-		$html = '';
141
-		foreach( $this->getSubClients() as $subclient ) {
142
-			$html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
143
-		}
144
-		$view->deliveryHeader = $html;
145
-
146
-		/** client/html/checkout/standard/delivery/standard/template-header
147
-		 * Relative path to the HTML header template of the checkout standard delivery client.
148
-		 *
149
-		 * The template file contains the HTML code and processing instructions
150
-		 * to generate the HTML code that is inserted into the HTML page header
151
-		 * of the rendered page in the frontend. The configuration string is the
152
-		 * path to the template file relative to the templates directory (usually
153
-		 * in client/html/templates).
154
-		 *
155
-		 * You can overwrite the template file configuration in extensions and
156
-		 * provide alternative templates. These alternative templates should be
157
-		 * named like the default one but with the string "standard" replaced by
158
-		 * an unique name. You may use the name of your project for this. If
159
-		 * you've implemented an alternative client class as well, "standard"
160
-		 * should be replaced by the name of the new class.
161
-		 *
162
-		 * @param string Relative path to the template creating code for the HTML page head
163
-		 * @since 2014.03
164
-		 * @category Developer
165
-		 * @see client/html/checkout/standard/delivery/standard/template-body
166
-		 */
167
-		$tplconf = 'client/html/checkout/standard/delivery/standard/template-header';
168
-		$default = 'checkout/standard/delivery-header-default.php';
169
-
170
-		return $view->render( $view->config( $tplconf, $default ) );
171
-	}
172
-
173
-
174
-	/**
175
-	 * Returns the sub-client given by its name.
176
-	 *
177
-	 * @param string $type Name of the client type
178
-	 * @param string|null $name Name of the sub-client (Default if null)
179
-	 * @return \Aimeos\Client\Html\Iface Sub-client object
180
-	 */
181
-	public function getSubClient( $type, $name = null )
182
-	{
183
-		/** client/html/checkout/standard/delivery/decorators/excludes
184
-		 * Excludes decorators added by the "common" option from the checkout standard delivery html client
185
-		 *
186
-		 * Decorators extend the functionality of a class by adding new aspects
187
-		 * (e.g. log what is currently done), executing the methods of the underlying
188
-		 * class only in certain conditions (e.g. only for logged in users) or
189
-		 * modify what is returned to the caller.
190
-		 *
191
-		 * This option allows you to remove a decorator added via
192
-		 * "client/html/common/decorators/default" before they are wrapped
193
-		 * around the html client.
194
-		 *
195
-		 *  client/html/checkout/standard/delivery/decorators/excludes = array( 'decorator1' )
196
-		 *
197
-		 * This would remove the decorator named "decorator1" from the list of
198
-		 * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
199
-		 * "client/html/common/decorators/default" to the html client.
200
-		 *
201
-		 * @param array List of decorator names
202
-		 * @since 2015.08
203
-		 * @category Developer
204
-		 * @see client/html/common/decorators/default
205
-		 * @see client/html/checkout/standard/delivery/decorators/global
206
-		 * @see client/html/checkout/standard/delivery/decorators/local
207
-		 */
208
-
209
-		/** client/html/checkout/standard/delivery/decorators/global
210
-		 * Adds a list of globally available decorators only to the checkout standard delivery html client
211
-		 *
212
-		 * Decorators extend the functionality of a class by adding new aspects
213
-		 * (e.g. log what is currently done), executing the methods of the underlying
214
-		 * class only in certain conditions (e.g. only for logged in users) or
215
-		 * modify what is returned to the caller.
216
-		 *
217
-		 * This option allows you to wrap global decorators
218
-		 * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
219
-		 *
220
-		 *  client/html/checkout/standard/delivery/decorators/global = array( 'decorator1' )
221
-		 *
222
-		 * This would add the decorator named "decorator1" defined by
223
-		 * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
224
-		 *
225
-		 * @param array List of decorator names
226
-		 * @since 2015.08
227
-		 * @category Developer
228
-		 * @see client/html/common/decorators/default
229
-		 * @see client/html/checkout/standard/delivery/decorators/excludes
230
-		 * @see client/html/checkout/standard/delivery/decorators/local
231
-		 */
232
-
233
-		/** client/html/checkout/standard/delivery/decorators/local
234
-		 * Adds a list of local decorators only to the checkout standard delivery html client
235
-		 *
236
-		 * Decorators extend the functionality of a class by adding new aspects
237
-		 * (e.g. log what is currently done), executing the methods of the underlying
238
-		 * class only in certain conditions (e.g. only for logged in users) or
239
-		 * modify what is returned to the caller.
240
-		 *
241
-		 * This option allows you to wrap local decorators
242
-		 * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
243
-		 *
244
-		 *  client/html/checkout/standard/delivery/decorators/local = array( 'decorator2' )
245
-		 *
246
-		 * This would add the decorator named "decorator2" defined by
247
-		 * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
248
-		 *
249
-		 * @param array List of decorator names
250
-		 * @since 2015.08
251
-		 * @category Developer
252
-		 * @see client/html/common/decorators/default
253
-		 * @see client/html/checkout/standard/delivery/decorators/excludes
254
-		 * @see client/html/checkout/standard/delivery/decorators/global
255
-		 */
256
-
257
-		return $this->createSubClient( 'checkout/standard/delivery/' . $type, $name );
258
-	}
259
-
260
-
261
-	/**
262
-	 * Processes the input, e.g. store given values.
263
-	 * A view must be available and this method doesn't generate any output
264
-	 * besides setting view variables.
265
-	 */
266
-	public function process()
267
-	{
268
-		$view = $this->getView();
269
-
270
-		try
271
-		{
272
-			$context = $this->getContext();
273
-			$basketCtrl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' );
274
-
275
-			// only start if there's something to do
276
-			if( ( $serviceId = $view->param( 'c_deliveryoption', null ) ) !== null )
277
-			{
278
-				$serviceCtrl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'service' );
279
-
280
-				$attributes = $view->param( 'c_delivery/' . $serviceId, array() );
281
-				$errors = $serviceCtrl->checkServiceAttributes( 'delivery', $serviceId, $attributes );
282
-
283
-				foreach( $errors as $key => $msg )
284
-				{
285
-					if( $msg === null ) {
286
-						unset( $errors[$key] );
287
-					}
288
-				}
289
-
290
-				if( count( $errors ) === 0 ) {
291
-					$basketCtrl->setService( 'delivery', $serviceId, $attributes );
292
-				} else {
293
-					$view->standardStepActive = 'delivery';
294
-				}
295
-
296
-				$view->deliveryError = $errors;
297
-			}
298
-
299
-
300
-			parent::process();
301
-
302
-
303
-			// Test if delivery service is available
304
-			$services = $basketCtrl->get()->getServices();
305
-			if( !isset( $view->standardStepActive ) && !array_key_exists( 'delivery', $services ) )
306
-			{
307
-				$view->standardStepActive = 'delivery';
308
-				return false;
309
-			}
310
-		}
311
-		catch( \Exception $e )
312
-		{
313
-			$view->standardStepActive = 'delivery';
314
-			throw $e;
315
-		}
316
-	}
317
-
318
-
319
-	/**
320
-	 * Returns the list of sub-client names configured for the client.
321
-	 *
322
-	 * @return array List of HTML client names
323
-	 */
324
-	protected function getSubClientNames()
325
-	{
326
-		return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
327
-	}
328
-
329
-
330
-	/**
331
-	 * Sets the necessary parameter values in the view.
332
-	 *
333
-	 * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
334
-	 * @param array &$tags Result array for the list of tags that are associated to the output
335
-	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
336
-	 * @return \Aimeos\MW\View\Iface Modified view object
337
-	 */
338
-	protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
339
-	{
340
-		if( !isset( $this->cache ) )
341
-		{
342
-			$context = $this->getContext();
343
-
344
-			$basketCntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' );
345
-			$serviceCntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'service' );
346
-
347
-			$basket = $basketCntl->get();
348
-
349
-			$services = $serviceCntl->getServices( 'delivery', $basket );
350
-			$serviceAttributes = $servicePrices = array();
351
-
352
-			foreach( $services as $id => $service )
353
-			{
354
-				$serviceAttributes[$id] = $serviceCntl->getServiceAttributes( 'delivery', $id, $basket );
355
-				$servicePrices[$id] = $serviceCntl->getServicePrice( 'delivery', $id, $basket );
356
-			}
357
-
358
-			$view->deliveryServices = $services;
359
-			$view->deliveryServiceAttributes = $serviceAttributes;
360
-			$view->deliveryServicePrices = $servicePrices;
361
-
362
-			$this->cache = $view;
363
-		}
364
-
365
-		return $this->cache;
366
-	}
29
+    /** client/html/checkout/standard/delivery/standard/subparts
30
+     * List of HTML sub-clients rendered within the checkout standard delivery section
31
+     *
32
+     * The output of the frontend is composed of the code generated by the HTML
33
+     * clients. Each HTML client can consist of serveral (or none) sub-clients
34
+     * that are responsible for rendering certain sub-parts of the output. The
35
+     * sub-clients can contain HTML clients themselves and therefore a
36
+     * hierarchical tree of HTML clients is composed. Each HTML client creates
37
+     * the output that is placed inside the container of its parent.
38
+     *
39
+     * At first, always the HTML code generated by the parent is printed, then
40
+     * the HTML code of its sub-clients. The order of the HTML sub-clients
41
+     * determines the order of the output of these sub-clients inside the parent
42
+     * container. If the configured list of clients is
43
+     *
44
+     *  array( "subclient1", "subclient2" )
45
+     *
46
+     * you can easily change the order of the output by reordering the subparts:
47
+     *
48
+     *  client/html/<clients>/subparts = array( "subclient1", "subclient2" )
49
+     *
50
+     * You can also remove one or more parts if they shouldn't be rendered:
51
+     *
52
+     *  client/html/<clients>/subparts = array( "subclient1" )
53
+     *
54
+     * As the clients only generates structural HTML, the layout defined via CSS
55
+     * should support adding, removing or reordering content by a fluid like
56
+     * design.
57
+     *
58
+     * @param array List of sub-client names
59
+     * @since 2014.03
60
+     * @category Developer
61
+     */
62
+    private $subPartPath = 'client/html/checkout/standard/delivery/standard/subparts';
63
+    private $subPartNames = array();
64
+    private $cache;
65
+
66
+
67
+    /**
68
+     * Returns the HTML code for insertion into the body.
69
+     *
70
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
71
+     * @param array &$tags Result array for the list of tags that are associated to the output
72
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
73
+     * @return string HTML code
74
+     */
75
+    public function getBody( $uid = '', array &$tags = array(), &$expire = null )
76
+    {
77
+        $view = $this->getView();
78
+        $step = $view->get( 'standardStepActive' );
79
+        $onepage = $view->config( 'client/html/checkout/standard/onepage', array() );
80
+
81
+        if( $step != 'delivery' && !( in_array( 'delivery', $onepage ) && in_array( $step, $onepage ) ) ) {
82
+            return '';
83
+        }
84
+
85
+        $view = $this->setViewParams( $view, $tags, $expire );
86
+
87
+        $html = '';
88
+        foreach( $this->getSubClients() as $subclient ) {
89
+            $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire );
90
+        }
91
+        $view->deliveryBody = $html;
92
+
93
+        /** client/html/checkout/standard/delivery/standard/template-body
94
+         * Relative path to the HTML body template of the checkout standard delivery client.
95
+         *
96
+         * The template file contains the HTML code and processing instructions
97
+         * to generate the result shown in the body of the frontend. The
98
+         * configuration string is the path to the template file relative
99
+         * to the templates directory (usually in client/html/templates).
100
+         *
101
+         * You can overwrite the template file configuration in extensions and
102
+         * provide alternative templates. These alternative templates should be
103
+         * named like the default one but with the string "standard" replaced by
104
+         * an unique name. You may use the name of your project for this. If
105
+         * you've implemented an alternative client class as well, "standard"
106
+         * should be replaced by the name of the new class.
107
+         *
108
+         * @param string Relative path to the template creating code for the HTML page body
109
+         * @since 2014.03
110
+         * @category Developer
111
+         * @see client/html/checkout/standard/delivery/standard/template-header
112
+         */
113
+        $tplconf = 'client/html/checkout/standard/delivery/standard/template-body';
114
+        $default = 'checkout/standard/delivery-body-default.php';
115
+
116
+        return $view->render( $view->config( $tplconf, $default ) );
117
+    }
118
+
119
+
120
+    /**
121
+     * Returns the HTML string for insertion into the header.
122
+     *
123
+     * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
124
+     * @param array &$tags Result array for the list of tags that are associated to the output
125
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
126
+     * @return string|null String including HTML tags for the header on error
127
+     */
128
+    public function getHeader( $uid = '', array &$tags = array(), &$expire = null )
129
+    {
130
+        $view = $this->getView();
131
+        $step = $view->get( 'standardStepActive' );
132
+        $onepage = $view->config( 'client/html/checkout/standard/onepage', array() );
133
+
134
+        if( $step != 'delivery' && !( in_array( 'delivery', $onepage ) && in_array( $step, $onepage ) ) ) {
135
+            return '';
136
+        }
137
+
138
+        $view = $this->setViewParams( $view, $tags, $expire );
139
+
140
+        $html = '';
141
+        foreach( $this->getSubClients() as $subclient ) {
142
+            $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire );
143
+        }
144
+        $view->deliveryHeader = $html;
145
+
146
+        /** client/html/checkout/standard/delivery/standard/template-header
147
+         * Relative path to the HTML header template of the checkout standard delivery client.
148
+         *
149
+         * The template file contains the HTML code and processing instructions
150
+         * to generate the HTML code that is inserted into the HTML page header
151
+         * of the rendered page in the frontend. The configuration string is the
152
+         * path to the template file relative to the templates directory (usually
153
+         * in client/html/templates).
154
+         *
155
+         * You can overwrite the template file configuration in extensions and
156
+         * provide alternative templates. These alternative templates should be
157
+         * named like the default one but with the string "standard" replaced by
158
+         * an unique name. You may use the name of your project for this. If
159
+         * you've implemented an alternative client class as well, "standard"
160
+         * should be replaced by the name of the new class.
161
+         *
162
+         * @param string Relative path to the template creating code for the HTML page head
163
+         * @since 2014.03
164
+         * @category Developer
165
+         * @see client/html/checkout/standard/delivery/standard/template-body
166
+         */
167
+        $tplconf = 'client/html/checkout/standard/delivery/standard/template-header';
168
+        $default = 'checkout/standard/delivery-header-default.php';
169
+
170
+        return $view->render( $view->config( $tplconf, $default ) );
171
+    }
172
+
173
+
174
+    /**
175
+     * Returns the sub-client given by its name.
176
+     *
177
+     * @param string $type Name of the client type
178
+     * @param string|null $name Name of the sub-client (Default if null)
179
+     * @return \Aimeos\Client\Html\Iface Sub-client object
180
+     */
181
+    public function getSubClient( $type, $name = null )
182
+    {
183
+        /** client/html/checkout/standard/delivery/decorators/excludes
184
+         * Excludes decorators added by the "common" option from the checkout standard delivery html client
185
+         *
186
+         * Decorators extend the functionality of a class by adding new aspects
187
+         * (e.g. log what is currently done), executing the methods of the underlying
188
+         * class only in certain conditions (e.g. only for logged in users) or
189
+         * modify what is returned to the caller.
190
+         *
191
+         * This option allows you to remove a decorator added via
192
+         * "client/html/common/decorators/default" before they are wrapped
193
+         * around the html client.
194
+         *
195
+         *  client/html/checkout/standard/delivery/decorators/excludes = array( 'decorator1' )
196
+         *
197
+         * This would remove the decorator named "decorator1" from the list of
198
+         * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
199
+         * "client/html/common/decorators/default" to the html client.
200
+         *
201
+         * @param array List of decorator names
202
+         * @since 2015.08
203
+         * @category Developer
204
+         * @see client/html/common/decorators/default
205
+         * @see client/html/checkout/standard/delivery/decorators/global
206
+         * @see client/html/checkout/standard/delivery/decorators/local
207
+         */
208
+
209
+        /** client/html/checkout/standard/delivery/decorators/global
210
+         * Adds a list of globally available decorators only to the checkout standard delivery html client
211
+         *
212
+         * Decorators extend the functionality of a class by adding new aspects
213
+         * (e.g. log what is currently done), executing the methods of the underlying
214
+         * class only in certain conditions (e.g. only for logged in users) or
215
+         * modify what is returned to the caller.
216
+         *
217
+         * This option allows you to wrap global decorators
218
+         * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
219
+         *
220
+         *  client/html/checkout/standard/delivery/decorators/global = array( 'decorator1' )
221
+         *
222
+         * This would add the decorator named "decorator1" defined by
223
+         * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
224
+         *
225
+         * @param array List of decorator names
226
+         * @since 2015.08
227
+         * @category Developer
228
+         * @see client/html/common/decorators/default
229
+         * @see client/html/checkout/standard/delivery/decorators/excludes
230
+         * @see client/html/checkout/standard/delivery/decorators/local
231
+         */
232
+
233
+        /** client/html/checkout/standard/delivery/decorators/local
234
+         * Adds a list of local decorators only to the checkout standard delivery html client
235
+         *
236
+         * Decorators extend the functionality of a class by adding new aspects
237
+         * (e.g. log what is currently done), executing the methods of the underlying
238
+         * class only in certain conditions (e.g. only for logged in users) or
239
+         * modify what is returned to the caller.
240
+         *
241
+         * This option allows you to wrap local decorators
242
+         * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
243
+         *
244
+         *  client/html/checkout/standard/delivery/decorators/local = array( 'decorator2' )
245
+         *
246
+         * This would add the decorator named "decorator2" defined by
247
+         * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
248
+         *
249
+         * @param array List of decorator names
250
+         * @since 2015.08
251
+         * @category Developer
252
+         * @see client/html/common/decorators/default
253
+         * @see client/html/checkout/standard/delivery/decorators/excludes
254
+         * @see client/html/checkout/standard/delivery/decorators/global
255
+         */
256
+
257
+        return $this->createSubClient( 'checkout/standard/delivery/' . $type, $name );
258
+    }
259
+
260
+
261
+    /**
262
+     * Processes the input, e.g. store given values.
263
+     * A view must be available and this method doesn't generate any output
264
+     * besides setting view variables.
265
+     */
266
+    public function process()
267
+    {
268
+        $view = $this->getView();
269
+
270
+        try
271
+        {
272
+            $context = $this->getContext();
273
+            $basketCtrl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' );
274
+
275
+            // only start if there's something to do
276
+            if( ( $serviceId = $view->param( 'c_deliveryoption', null ) ) !== null )
277
+            {
278
+                $serviceCtrl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'service' );
279
+
280
+                $attributes = $view->param( 'c_delivery/' . $serviceId, array() );
281
+                $errors = $serviceCtrl->checkServiceAttributes( 'delivery', $serviceId, $attributes );
282
+
283
+                foreach( $errors as $key => $msg )
284
+                {
285
+                    if( $msg === null ) {
286
+                        unset( $errors[$key] );
287
+                    }
288
+                }
289
+
290
+                if( count( $errors ) === 0 ) {
291
+                    $basketCtrl->setService( 'delivery', $serviceId, $attributes );
292
+                } else {
293
+                    $view->standardStepActive = 'delivery';
294
+                }
295
+
296
+                $view->deliveryError = $errors;
297
+            }
298
+
299
+
300
+            parent::process();
301
+
302
+
303
+            // Test if delivery service is available
304
+            $services = $basketCtrl->get()->getServices();
305
+            if( !isset( $view->standardStepActive ) && !array_key_exists( 'delivery', $services ) )
306
+            {
307
+                $view->standardStepActive = 'delivery';
308
+                return false;
309
+            }
310
+        }
311
+        catch( \Exception $e )
312
+        {
313
+            $view->standardStepActive = 'delivery';
314
+            throw $e;
315
+        }
316
+    }
317
+
318
+
319
+    /**
320
+     * Returns the list of sub-client names configured for the client.
321
+     *
322
+     * @return array List of HTML client names
323
+     */
324
+    protected function getSubClientNames()
325
+    {
326
+        return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames );
327
+    }
328
+
329
+
330
+    /**
331
+     * Sets the necessary parameter values in the view.
332
+     *
333
+     * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
334
+     * @param array &$tags Result array for the list of tags that are associated to the output
335
+     * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
336
+     * @return \Aimeos\MW\View\Iface Modified view object
337
+     */
338
+    protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null )
339
+    {
340
+        if( !isset( $this->cache ) )
341
+        {
342
+            $context = $this->getContext();
343
+
344
+            $basketCntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' );
345
+            $serviceCntl = \Aimeos\Controller\Frontend\Factory::createController( $context, 'service' );
346
+
347
+            $basket = $basketCntl->get();
348
+
349
+            $services = $serviceCntl->getServices( 'delivery', $basket );
350
+            $serviceAttributes = $servicePrices = array();
351
+
352
+            foreach( $services as $id => $service )
353
+            {
354
+                $serviceAttributes[$id] = $serviceCntl->getServiceAttributes( 'delivery', $id, $basket );
355
+                $servicePrices[$id] = $serviceCntl->getServicePrice( 'delivery', $id, $basket );
356
+            }
357
+
358
+            $view->deliveryServices = $services;
359
+            $view->deliveryServiceAttributes = $serviceAttributes;
360
+            $view->deliveryServicePrices = $servicePrices;
361
+
362
+            $this->cache = $view;
363
+        }
364
+
365
+        return $this->cache;
366
+    }
367 367
 }
368 368
\ No newline at end of file
Please login to merge, or discard this patch.