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