@@ -19,254 +19,254 @@ |
||
| 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/email/delivery/html/summary/detail/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the summary detail section of the delivery HTML e-mail |
|
| 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/email/delivery/html/summary/detail/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 25 | + /** client/html/email/delivery/html/summary/detail/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the summary detail section of the delivery HTML e-mail |
|
| 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/email/delivery/html/summary/detail/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->detailBody = $html; |
|
| 74 | + $html = ''; |
|
| 75 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | + $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | + } |
|
| 78 | + $view->detailBody = $html; |
|
| 79 | 79 | |
| 80 | - /** client/html/email/delivery/html/summary/detail/standard/template-body |
|
| 81 | - * Relative path to the HTML body template of the summary detail section of the delivery HTML e-mail 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 | - * (second one) should be replaced by the name of the new class in lower |
|
| 94 | - * case. |
|
| 95 | - * |
|
| 96 | - * @param string Relative path to the template creating code for the HTML page body |
|
| 97 | - * @since 2015.11 |
|
| 98 | - * @category Developer |
|
| 99 | - * @see client/html/email/delivery/html/summary/detail/standard/template-header |
|
| 100 | - */ |
|
| 101 | - $tplconf = 'client/html/email/delivery/html/summary/detail/standard/template-body'; |
|
| 102 | - $default = 'common/summary/detail-body-default.php'; |
|
| 80 | + /** client/html/email/delivery/html/summary/detail/standard/template-body |
|
| 81 | + * Relative path to the HTML body template of the summary detail section of the delivery HTML e-mail 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 | + * (second one) should be replaced by the name of the new class in lower |
|
| 94 | + * case. |
|
| 95 | + * |
|
| 96 | + * @param string Relative path to the template creating code for the HTML page body |
|
| 97 | + * @since 2015.11 |
|
| 98 | + * @category Developer |
|
| 99 | + * @see client/html/email/delivery/html/summary/detail/standard/template-header |
|
| 100 | + */ |
|
| 101 | + $tplconf = 'client/html/email/delivery/html/summary/detail/standard/template-body'; |
|
| 102 | + $default = 'common/summary/detail-body-default.php'; |
|
| 103 | 103 | |
| 104 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 105 | - } |
|
| 104 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 105 | + } |
|
| 106 | 106 | |
| 107 | 107 | |
| 108 | - /** |
|
| 109 | - * Returns the HTML string for insertion into the header. |
|
| 110 | - * |
|
| 111 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 112 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 113 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 114 | - * @return string|null String including HTML tags for the header on error |
|
| 115 | - */ |
|
| 116 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 117 | - { |
|
| 118 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 108 | + /** |
|
| 109 | + * Returns the HTML string for insertion into the header. |
|
| 110 | + * |
|
| 111 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 112 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 113 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 114 | + * @return string|null String including HTML tags for the header on error |
|
| 115 | + */ |
|
| 116 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 117 | + { |
|
| 118 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 119 | 119 | |
| 120 | - $html = ''; |
|
| 121 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 122 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 123 | - } |
|
| 124 | - $view->detailHeader = $html; |
|
| 120 | + $html = ''; |
|
| 121 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 122 | + $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 123 | + } |
|
| 124 | + $view->detailHeader = $html; |
|
| 125 | 125 | |
| 126 | - /** client/html/email/delivery/html/summary/detail/standard/template-header |
|
| 127 | - * Relative path to the HTML header template of the summary detail section of the delivery HTML e-mail client. |
|
| 128 | - * |
|
| 129 | - * The template file contains the HTML code and processing instructions |
|
| 130 | - * to generate the HTML code that is inserted into the HTML page header |
|
| 131 | - * of the rendered page in the frontend. The configuration string is the |
|
| 132 | - * path to the template file relative to the templates directory (usually |
|
| 133 | - * in client/html/templates). |
|
| 134 | - * |
|
| 135 | - * You can overwrite the template file configuration in extensions and |
|
| 136 | - * provide alternative templates. These alternative templates should be |
|
| 137 | - * named like the default one but with the string "standard" replaced by |
|
| 138 | - * an unique name. You may use the name of your project for this. If |
|
| 139 | - * you've implemented an alternative client class as well, "standard" |
|
| 140 | - * (second one) should be replaced by the name of the new class in lower |
|
| 141 | - * case. |
|
| 142 | - * |
|
| 143 | - * @param string Relative path to the template creating code for the HTML page head |
|
| 144 | - * @since 2015.11 |
|
| 145 | - * @category Developer |
|
| 146 | - * @see client/html/email/delivery/html/summary/detail/standard/template-body |
|
| 147 | - */ |
|
| 148 | - $tplconf = 'client/html/email/delivery/html/summary/detail/standard/template-header'; |
|
| 149 | - $default = 'common/summary/detail-header-default.php'; |
|
| 126 | + /** client/html/email/delivery/html/summary/detail/standard/template-header |
|
| 127 | + * Relative path to the HTML header template of the summary detail section of the delivery HTML e-mail client. |
|
| 128 | + * |
|
| 129 | + * The template file contains the HTML code and processing instructions |
|
| 130 | + * to generate the HTML code that is inserted into the HTML page header |
|
| 131 | + * of the rendered page in the frontend. The configuration string is the |
|
| 132 | + * path to the template file relative to the templates directory (usually |
|
| 133 | + * in client/html/templates). |
|
| 134 | + * |
|
| 135 | + * You can overwrite the template file configuration in extensions and |
|
| 136 | + * provide alternative templates. These alternative templates should be |
|
| 137 | + * named like the default one but with the string "standard" replaced by |
|
| 138 | + * an unique name. You may use the name of your project for this. If |
|
| 139 | + * you've implemented an alternative client class as well, "standard" |
|
| 140 | + * (second one) should be replaced by the name of the new class in lower |
|
| 141 | + * case. |
|
| 142 | + * |
|
| 143 | + * @param string Relative path to the template creating code for the HTML page head |
|
| 144 | + * @since 2015.11 |
|
| 145 | + * @category Developer |
|
| 146 | + * @see client/html/email/delivery/html/summary/detail/standard/template-body |
|
| 147 | + */ |
|
| 148 | + $tplconf = 'client/html/email/delivery/html/summary/detail/standard/template-header'; |
|
| 149 | + $default = 'common/summary/detail-header-default.php'; |
|
| 150 | 150 | |
| 151 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 152 | - } |
|
| 151 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 152 | + } |
|
| 153 | 153 | |
| 154 | 154 | |
| 155 | - /** |
|
| 156 | - * Returns the sub-client given by its name. |
|
| 157 | - * |
|
| 158 | - * @param string $type Name of the client type |
|
| 159 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 160 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 161 | - */ |
|
| 162 | - public function getSubClient( $type, $name = null ) |
|
| 163 | - { |
|
| 164 | - /** client/html/email/delivery/html/summary/detail/decorators/excludes |
|
| 165 | - * Excludes decorators added by the "common" option from the email delivery html summary detail html client |
|
| 166 | - * |
|
| 167 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 168 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 169 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 170 | - * modify what is returned to the caller. |
|
| 171 | - * |
|
| 172 | - * This option allows you to remove a decorator added via |
|
| 173 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 174 | - * around the html client. |
|
| 175 | - * |
|
| 176 | - * client/html/email/delivery/html/summary/detail/decorators/excludes = array( 'decorator1' ) |
|
| 177 | - * |
|
| 178 | - * This would remove the decorator named "decorator1" from the list of |
|
| 179 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 180 | - * "client/html/common/decorators/default" to the html client. |
|
| 181 | - * |
|
| 182 | - * @param array List of decorator names |
|
| 183 | - * @since 2015.08 |
|
| 184 | - * @category Developer |
|
| 185 | - * @see client/html/common/decorators/default |
|
| 186 | - * @see client/html/email/delivery/html/summary/detail/decorators/global |
|
| 187 | - * @see client/html/email/delivery/html/summary/detail/decorators/local |
|
| 188 | - */ |
|
| 155 | + /** |
|
| 156 | + * Returns the sub-client given by its name. |
|
| 157 | + * |
|
| 158 | + * @param string $type Name of the client type |
|
| 159 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 160 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 161 | + */ |
|
| 162 | + public function getSubClient( $type, $name = null ) |
|
| 163 | + { |
|
| 164 | + /** client/html/email/delivery/html/summary/detail/decorators/excludes |
|
| 165 | + * Excludes decorators added by the "common" option from the email delivery html summary detail html client |
|
| 166 | + * |
|
| 167 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 168 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 169 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 170 | + * modify what is returned to the caller. |
|
| 171 | + * |
|
| 172 | + * This option allows you to remove a decorator added via |
|
| 173 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 174 | + * around the html client. |
|
| 175 | + * |
|
| 176 | + * client/html/email/delivery/html/summary/detail/decorators/excludes = array( 'decorator1' ) |
|
| 177 | + * |
|
| 178 | + * This would remove the decorator named "decorator1" from the list of |
|
| 179 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 180 | + * "client/html/common/decorators/default" to the html client. |
|
| 181 | + * |
|
| 182 | + * @param array List of decorator names |
|
| 183 | + * @since 2015.08 |
|
| 184 | + * @category Developer |
|
| 185 | + * @see client/html/common/decorators/default |
|
| 186 | + * @see client/html/email/delivery/html/summary/detail/decorators/global |
|
| 187 | + * @see client/html/email/delivery/html/summary/detail/decorators/local |
|
| 188 | + */ |
|
| 189 | 189 | |
| 190 | - /** client/html/email/delivery/html/summary/detail/decorators/global |
|
| 191 | - * Adds a list of globally available decorators only to the email delivery html summary detail html client |
|
| 192 | - * |
|
| 193 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 194 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 195 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 196 | - * modify what is returned to the caller. |
|
| 197 | - * |
|
| 198 | - * This option allows you to wrap global decorators |
|
| 199 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 200 | - * |
|
| 201 | - * client/html/email/delivery/html/summary/detail/decorators/global = array( 'decorator1' ) |
|
| 202 | - * |
|
| 203 | - * This would add the decorator named "decorator1" defined by |
|
| 204 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 205 | - * |
|
| 206 | - * @param array List of decorator names |
|
| 207 | - * @since 2015.08 |
|
| 208 | - * @category Developer |
|
| 209 | - * @see client/html/common/decorators/default |
|
| 210 | - * @see client/html/email/delivery/html/summary/detail/decorators/excludes |
|
| 211 | - * @see client/html/email/delivery/html/summary/detail/decorators/local |
|
| 212 | - */ |
|
| 190 | + /** client/html/email/delivery/html/summary/detail/decorators/global |
|
| 191 | + * Adds a list of globally available decorators only to the email delivery html summary detail html client |
|
| 192 | + * |
|
| 193 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 194 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 195 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 196 | + * modify what is returned to the caller. |
|
| 197 | + * |
|
| 198 | + * This option allows you to wrap global decorators |
|
| 199 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 200 | + * |
|
| 201 | + * client/html/email/delivery/html/summary/detail/decorators/global = array( 'decorator1' ) |
|
| 202 | + * |
|
| 203 | + * This would add the decorator named "decorator1" defined by |
|
| 204 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 205 | + * |
|
| 206 | + * @param array List of decorator names |
|
| 207 | + * @since 2015.08 |
|
| 208 | + * @category Developer |
|
| 209 | + * @see client/html/common/decorators/default |
|
| 210 | + * @see client/html/email/delivery/html/summary/detail/decorators/excludes |
|
| 211 | + * @see client/html/email/delivery/html/summary/detail/decorators/local |
|
| 212 | + */ |
|
| 213 | 213 | |
| 214 | - /** client/html/email/delivery/html/summary/detail/decorators/local |
|
| 215 | - * Adds a list of local decorators only to the email delivery html summary detail html client |
|
| 216 | - * |
|
| 217 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 218 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 219 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 220 | - * modify what is returned to the caller. |
|
| 221 | - * |
|
| 222 | - * This option allows you to wrap local decorators |
|
| 223 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 224 | - * |
|
| 225 | - * client/html/email/delivery/html/summary/detail/decorators/local = array( 'decorator2' ) |
|
| 226 | - * |
|
| 227 | - * This would add the decorator named "decorator2" defined by |
|
| 228 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 229 | - * |
|
| 230 | - * @param array List of decorator names |
|
| 231 | - * @since 2015.08 |
|
| 232 | - * @category Developer |
|
| 233 | - * @see client/html/common/decorators/default |
|
| 234 | - * @see client/html/email/delivery/html/summary/detail/decorators/excludes |
|
| 235 | - * @see client/html/email/delivery/html/summary/detail/decorators/global |
|
| 236 | - */ |
|
| 214 | + /** client/html/email/delivery/html/summary/detail/decorators/local |
|
| 215 | + * Adds a list of local decorators only to the email delivery html summary detail html client |
|
| 216 | + * |
|
| 217 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 218 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 219 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 220 | + * modify what is returned to the caller. |
|
| 221 | + * |
|
| 222 | + * This option allows you to wrap local decorators |
|
| 223 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 224 | + * |
|
| 225 | + * client/html/email/delivery/html/summary/detail/decorators/local = array( 'decorator2' ) |
|
| 226 | + * |
|
| 227 | + * This would add the decorator named "decorator2" defined by |
|
| 228 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 229 | + * |
|
| 230 | + * @param array List of decorator names |
|
| 231 | + * @since 2015.08 |
|
| 232 | + * @category Developer |
|
| 233 | + * @see client/html/common/decorators/default |
|
| 234 | + * @see client/html/email/delivery/html/summary/detail/decorators/excludes |
|
| 235 | + * @see client/html/email/delivery/html/summary/detail/decorators/global |
|
| 236 | + */ |
|
| 237 | 237 | |
| 238 | - return $this->createSubClient( 'email/delivery/html/summary/detail/' . $type, $name ); |
|
| 239 | - } |
|
| 238 | + return $this->createSubClient( 'email/delivery/html/summary/detail/' . $type, $name ); |
|
| 239 | + } |
|
| 240 | 240 | |
| 241 | 241 | |
| 242 | - /** |
|
| 243 | - * Returns the list of sub-client names configured for the client. |
|
| 244 | - * |
|
| 245 | - * @return array List of HTML client names |
|
| 246 | - */ |
|
| 247 | - protected function getSubClientNames() |
|
| 248 | - { |
|
| 249 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 250 | - } |
|
| 242 | + /** |
|
| 243 | + * Returns the list of sub-client names configured for the client. |
|
| 244 | + * |
|
| 245 | + * @return array List of HTML client names |
|
| 246 | + */ |
|
| 247 | + protected function getSubClientNames() |
|
| 248 | + { |
|
| 249 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 250 | + } |
|
| 251 | 251 | |
| 252 | 252 | |
| 253 | - /** |
|
| 254 | - * Sets the necessary parameter values in the view. |
|
| 255 | - * |
|
| 256 | - * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output |
|
| 257 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 258 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 259 | - * @return \Aimeos\MW\View\Iface Modified view object |
|
| 260 | - */ |
|
| 261 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 262 | - { |
|
| 263 | - // we can't cache the calculation because the same client object is used for all e-mails |
|
| 264 | - $view->summaryTaxRates = $this->getTaxRates( $view->extOrderBaseItem ); |
|
| 253 | + /** |
|
| 254 | + * Sets the necessary parameter values in the view. |
|
| 255 | + * |
|
| 256 | + * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output |
|
| 257 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 258 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 259 | + * @return \Aimeos\MW\View\Iface Modified view object |
|
| 260 | + */ |
|
| 261 | + protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 262 | + { |
|
| 263 | + // we can't cache the calculation because the same client object is used for all e-mails |
|
| 264 | + $view->summaryTaxRates = $this->getTaxRates( $view->extOrderBaseItem ); |
|
| 265 | 265 | |
| 266 | - if( $view->extOrderItem->getPaymentStatus() >= $this->getDownloadPaymentStatus() ) { |
|
| 267 | - $view->summaryShowDownloadAttributes = true; |
|
| 268 | - } |
|
| 266 | + if( $view->extOrderItem->getPaymentStatus() >= $this->getDownloadPaymentStatus() ) { |
|
| 267 | + $view->summaryShowDownloadAttributes = true; |
|
| 268 | + } |
|
| 269 | 269 | |
| 270 | - return $view; |
|
| 271 | - } |
|
| 270 | + return $view; |
|
| 271 | + } |
|
| 272 | 272 | } |
@@ -19,291 +19,291 @@ |
||
| 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/email/delivery/html/summary/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email delivery html summary 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/email/delivery/html/summary/standard/subparts'; |
|
| 25 | + /** client/html/email/delivery/html/summary/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email delivery html summary 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/email/delivery/html/summary/standard/subparts'; |
|
| 59 | 59 | |
| 60 | - /** client/html/email/delivery/html/summary/address/name |
|
| 61 | - * Name of the address part used by the email delivery html client implementation |
|
| 62 | - * |
|
| 63 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Summary\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 | - */ |
|
| 60 | + /** client/html/email/delivery/html/summary/address/name |
|
| 61 | + * Name of the address part used by the email delivery html client implementation |
|
| 62 | + * |
|
| 63 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Summary\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 | 70 | |
| 71 | - /** client/html/email/delivery/html/summary/service/name |
|
| 72 | - * Name of the service part used by the email delivery html client implementation |
|
| 73 | - * |
|
| 74 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Summary\Service\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 | - */ |
|
| 71 | + /** client/html/email/delivery/html/summary/service/name |
|
| 72 | + * Name of the service part used by the email delivery html client implementation |
|
| 73 | + * |
|
| 74 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Summary\Service\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 | 81 | |
| 82 | - /** client/html/email/delivery/html/summary/coupon/name |
|
| 83 | - * Name of the coupon part used by the email delivery html client implementation |
|
| 84 | - * |
|
| 85 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Summary\Coupon\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.05 |
|
| 90 | - * @category Developer |
|
| 91 | - */ |
|
| 82 | + /** client/html/email/delivery/html/summary/coupon/name |
|
| 83 | + * Name of the coupon part used by the email delivery html client implementation |
|
| 84 | + * |
|
| 85 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Summary\Coupon\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.05 |
|
| 90 | + * @category Developer |
|
| 91 | + */ |
|
| 92 | 92 | |
| 93 | - /** client/html/email/delivery/html/summary/detail/name |
|
| 94 | - * Name of the detail part used by the email delivery html client implementation |
|
| 95 | - * |
|
| 96 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Detail\Address\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 | - private $subPartNames = array( 'address', 'service', 'coupon', 'detail' ); |
|
| 93 | + /** client/html/email/delivery/html/summary/detail/name |
|
| 94 | + * Name of the detail part used by the email delivery html client implementation |
|
| 95 | + * |
|
| 96 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Detail\Address\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 | + private $subPartNames = array( 'address', 'service', 'coupon', 'detail' ); |
|
| 104 | 104 | |
| 105 | 105 | |
| 106 | - /** |
|
| 107 | - * Returns the HTML code for insertion into the body. |
|
| 108 | - * |
|
| 109 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 110 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 111 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 112 | - * @return string HTML code |
|
| 113 | - */ |
|
| 114 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 115 | - { |
|
| 116 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 106 | + /** |
|
| 107 | + * Returns the HTML code for insertion into the body. |
|
| 108 | + * |
|
| 109 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 110 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 111 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 112 | + * @return string HTML code |
|
| 113 | + */ |
|
| 114 | + public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 115 | + { |
|
| 116 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 117 | 117 | |
| 118 | - $content = ''; |
|
| 119 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 120 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 121 | - } |
|
| 122 | - $view->summaryBody = $content; |
|
| 118 | + $content = ''; |
|
| 119 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 120 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 121 | + } |
|
| 122 | + $view->summaryBody = $content; |
|
| 123 | 123 | |
| 124 | - /** client/html/email/delivery/html/summary/standard/template-body |
|
| 125 | - * Relative path to the HTML body template of the email delivery html summary client. |
|
| 126 | - * |
|
| 127 | - * The template file contains the HTML code and processing instructions |
|
| 128 | - * to generate the result shown in the body of the e-mail. The |
|
| 129 | - * configuration string is the path to the template file relative |
|
| 130 | - * to the templates directory (usually in client/html/templates). |
|
| 131 | - * |
|
| 132 | - * You can overwrite the template file configuration in extensions and |
|
| 133 | - * provide alternative templates. These alternative templates should be |
|
| 134 | - * named like the default one but with the string "standard" replaced by |
|
| 135 | - * an unique name. You may use the name of your project for this. If |
|
| 136 | - * you've implemented an alternative client class as well, "standard" |
|
| 137 | - * should be replaced by the name of the new class. |
|
| 138 | - * |
|
| 139 | - * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 140 | - * @since 2014.03 |
|
| 141 | - * @category Developer |
|
| 142 | - * @see client/html/email/delivery/html/summary/standard/template-header |
|
| 143 | - */ |
|
| 144 | - $tplconf = 'client/html/email/delivery/html/summary/standard/template-body'; |
|
| 145 | - $default = 'email/common/html-summary-body-default.php'; |
|
| 124 | + /** client/html/email/delivery/html/summary/standard/template-body |
|
| 125 | + * Relative path to the HTML body template of the email delivery html summary client. |
|
| 126 | + * |
|
| 127 | + * The template file contains the HTML code and processing instructions |
|
| 128 | + * to generate the result shown in the body of the e-mail. The |
|
| 129 | + * configuration string is the path to the template file relative |
|
| 130 | + * to the templates directory (usually in client/html/templates). |
|
| 131 | + * |
|
| 132 | + * You can overwrite the template file configuration in extensions and |
|
| 133 | + * provide alternative templates. These alternative templates should be |
|
| 134 | + * named like the default one but with the string "standard" replaced by |
|
| 135 | + * an unique name. You may use the name of your project for this. If |
|
| 136 | + * you've implemented an alternative client class as well, "standard" |
|
| 137 | + * should be replaced by the name of the new class. |
|
| 138 | + * |
|
| 139 | + * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 140 | + * @since 2014.03 |
|
| 141 | + * @category Developer |
|
| 142 | + * @see client/html/email/delivery/html/summary/standard/template-header |
|
| 143 | + */ |
|
| 144 | + $tplconf = 'client/html/email/delivery/html/summary/standard/template-body'; |
|
| 145 | + $default = 'email/common/html-summary-body-default.php'; |
|
| 146 | 146 | |
| 147 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 148 | - } |
|
| 147 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 148 | + } |
|
| 149 | 149 | |
| 150 | 150 | |
| 151 | - /** |
|
| 152 | - * Returns the HTML string for insertion into the header. |
|
| 153 | - * |
|
| 154 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 155 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 156 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 157 | - * @return string|null String including HTML tags for the header on error |
|
| 158 | - */ |
|
| 159 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 160 | - { |
|
| 161 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 151 | + /** |
|
| 152 | + * Returns the HTML string for insertion into the header. |
|
| 153 | + * |
|
| 154 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 155 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 156 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 157 | + * @return string|null String including HTML tags for the header on error |
|
| 158 | + */ |
|
| 159 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 160 | + { |
|
| 161 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 162 | 162 | |
| 163 | - $content = ''; |
|
| 164 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 165 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 166 | - } |
|
| 167 | - $view->summaryHeader = $content; |
|
| 163 | + $content = ''; |
|
| 164 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 165 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 166 | + } |
|
| 167 | + $view->summaryHeader = $content; |
|
| 168 | 168 | |
| 169 | - /** client/html/email/delivery/html/summary/standard/template-header |
|
| 170 | - * Relative path to the HTML header template of the email delivery html summary client. |
|
| 171 | - * |
|
| 172 | - * The template file contains the HTML code and processing instructions |
|
| 173 | - * to generate the HTML code that is inserted into the header |
|
| 174 | - * of the e-mail. The configuration string is the |
|
| 175 | - * path to the template file relative to the templates directory (usually |
|
| 176 | - * in client/html/templates). |
|
| 177 | - * |
|
| 178 | - * You can overwrite the template file configuration in extensions and |
|
| 179 | - * provide alternative templates. These alternative templates should be |
|
| 180 | - * named like the default one but with the string "standard" replaced by |
|
| 181 | - * an unique name. You may use the name of your project for this. If |
|
| 182 | - * you've implemented an alternative client class as well, "standard" |
|
| 183 | - * should be replaced by the name of the new class. |
|
| 184 | - * |
|
| 185 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 186 | - * @since 2014.03 |
|
| 187 | - * @category Developer |
|
| 188 | - * @see client/html/email/delivery/html/summary/standard/template-body |
|
| 189 | - */ |
|
| 190 | - $tplconf = 'client/html/email/delivery/html/summary/standard/template-header'; |
|
| 191 | - $default = 'email/common/html-summary-header-default.php'; |
|
| 169 | + /** client/html/email/delivery/html/summary/standard/template-header |
|
| 170 | + * Relative path to the HTML header template of the email delivery html summary client. |
|
| 171 | + * |
|
| 172 | + * The template file contains the HTML code and processing instructions |
|
| 173 | + * to generate the HTML code that is inserted into the header |
|
| 174 | + * of the e-mail. The configuration string is the |
|
| 175 | + * path to the template file relative to the templates directory (usually |
|
| 176 | + * in client/html/templates). |
|
| 177 | + * |
|
| 178 | + * You can overwrite the template file configuration in extensions and |
|
| 179 | + * provide alternative templates. These alternative templates should be |
|
| 180 | + * named like the default one but with the string "standard" replaced by |
|
| 181 | + * an unique name. You may use the name of your project for this. If |
|
| 182 | + * you've implemented an alternative client class as well, "standard" |
|
| 183 | + * should be replaced by the name of the new class. |
|
| 184 | + * |
|
| 185 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 186 | + * @since 2014.03 |
|
| 187 | + * @category Developer |
|
| 188 | + * @see client/html/email/delivery/html/summary/standard/template-body |
|
| 189 | + */ |
|
| 190 | + $tplconf = 'client/html/email/delivery/html/summary/standard/template-header'; |
|
| 191 | + $default = 'email/common/html-summary-header-default.php'; |
|
| 192 | 192 | |
| 193 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 194 | - } |
|
| 193 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 194 | + } |
|
| 195 | 195 | |
| 196 | 196 | |
| 197 | - /** |
|
| 198 | - * Returns the sub-client given by its name. |
|
| 199 | - * |
|
| 200 | - * @param string $type Name of the client type |
|
| 201 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 202 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 203 | - */ |
|
| 204 | - public function getSubClient( $type, $name = null ) |
|
| 205 | - { |
|
| 206 | - /** client/html/email/delivery/html/summary/decorators/excludes |
|
| 207 | - * Excludes decorators added by the "common" option from the email delivery html summary html client |
|
| 208 | - * |
|
| 209 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 210 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 211 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 212 | - * modify what is returned to the caller. |
|
| 213 | - * |
|
| 214 | - * This option allows you to remove a decorator added via |
|
| 215 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 216 | - * around the html client. |
|
| 217 | - * |
|
| 218 | - * client/html/email/delivery/html/summary/decorators/excludes = array( 'decorator1' ) |
|
| 219 | - * |
|
| 220 | - * This would remove the decorator named "decorator1" from the list of |
|
| 221 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 222 | - * "client/html/common/decorators/default" to the html client. |
|
| 223 | - * |
|
| 224 | - * @param array List of decorator names |
|
| 225 | - * @since 2015.08 |
|
| 226 | - * @category Developer |
|
| 227 | - * @see client/html/common/decorators/default |
|
| 228 | - * @see client/html/email/delivery/html/summary/decorators/global |
|
| 229 | - * @see client/html/email/delivery/html/summary/decorators/local |
|
| 230 | - */ |
|
| 197 | + /** |
|
| 198 | + * Returns the sub-client given by its name. |
|
| 199 | + * |
|
| 200 | + * @param string $type Name of the client type |
|
| 201 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 202 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 203 | + */ |
|
| 204 | + public function getSubClient( $type, $name = null ) |
|
| 205 | + { |
|
| 206 | + /** client/html/email/delivery/html/summary/decorators/excludes |
|
| 207 | + * Excludes decorators added by the "common" option from the email delivery html summary html client |
|
| 208 | + * |
|
| 209 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 210 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 211 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 212 | + * modify what is returned to the caller. |
|
| 213 | + * |
|
| 214 | + * This option allows you to remove a decorator added via |
|
| 215 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 216 | + * around the html client. |
|
| 217 | + * |
|
| 218 | + * client/html/email/delivery/html/summary/decorators/excludes = array( 'decorator1' ) |
|
| 219 | + * |
|
| 220 | + * This would remove the decorator named "decorator1" from the list of |
|
| 221 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 222 | + * "client/html/common/decorators/default" to the html client. |
|
| 223 | + * |
|
| 224 | + * @param array List of decorator names |
|
| 225 | + * @since 2015.08 |
|
| 226 | + * @category Developer |
|
| 227 | + * @see client/html/common/decorators/default |
|
| 228 | + * @see client/html/email/delivery/html/summary/decorators/global |
|
| 229 | + * @see client/html/email/delivery/html/summary/decorators/local |
|
| 230 | + */ |
|
| 231 | 231 | |
| 232 | - /** client/html/email/delivery/html/summary/decorators/global |
|
| 233 | - * Adds a list of globally available decorators only to the email delivery html summary html client |
|
| 234 | - * |
|
| 235 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 236 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 237 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 238 | - * modify what is returned to the caller. |
|
| 239 | - * |
|
| 240 | - * This option allows you to wrap global decorators |
|
| 241 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 242 | - * |
|
| 243 | - * client/html/email/delivery/html/summary/decorators/global = array( 'decorator1' ) |
|
| 244 | - * |
|
| 245 | - * This would add the decorator named "decorator1" defined by |
|
| 246 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 247 | - * |
|
| 248 | - * @param array List of decorator names |
|
| 249 | - * @since 2015.08 |
|
| 250 | - * @category Developer |
|
| 251 | - * @see client/html/common/decorators/default |
|
| 252 | - * @see client/html/email/delivery/html/summary/decorators/excludes |
|
| 253 | - * @see client/html/email/delivery/html/summary/decorators/local |
|
| 254 | - */ |
|
| 232 | + /** client/html/email/delivery/html/summary/decorators/global |
|
| 233 | + * Adds a list of globally available decorators only to the email delivery html summary html client |
|
| 234 | + * |
|
| 235 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 236 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 237 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 238 | + * modify what is returned to the caller. |
|
| 239 | + * |
|
| 240 | + * This option allows you to wrap global decorators |
|
| 241 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 242 | + * |
|
| 243 | + * client/html/email/delivery/html/summary/decorators/global = array( 'decorator1' ) |
|
| 244 | + * |
|
| 245 | + * This would add the decorator named "decorator1" defined by |
|
| 246 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 247 | + * |
|
| 248 | + * @param array List of decorator names |
|
| 249 | + * @since 2015.08 |
|
| 250 | + * @category Developer |
|
| 251 | + * @see client/html/common/decorators/default |
|
| 252 | + * @see client/html/email/delivery/html/summary/decorators/excludes |
|
| 253 | + * @see client/html/email/delivery/html/summary/decorators/local |
|
| 254 | + */ |
|
| 255 | 255 | |
| 256 | - /** client/html/email/delivery/html/summary/decorators/local |
|
| 257 | - * Adds a list of local decorators only to the email delivery html summary html client |
|
| 258 | - * |
|
| 259 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 260 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 261 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 262 | - * modify what is returned to the caller. |
|
| 263 | - * |
|
| 264 | - * This option allows you to wrap local decorators |
|
| 265 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 266 | - * |
|
| 267 | - * client/html/email/delivery/html/summary/decorators/local = array( 'decorator2' ) |
|
| 268 | - * |
|
| 269 | - * This would add the decorator named "decorator2" defined by |
|
| 270 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 271 | - * |
|
| 272 | - * @param array List of decorator names |
|
| 273 | - * @since 2015.08 |
|
| 274 | - * @category Developer |
|
| 275 | - * @see client/html/common/decorators/default |
|
| 276 | - * @see client/html/email/delivery/html/summary/decorators/excludes |
|
| 277 | - * @see client/html/email/delivery/html/summary/decorators/global |
|
| 278 | - */ |
|
| 256 | + /** client/html/email/delivery/html/summary/decorators/local |
|
| 257 | + * Adds a list of local decorators only to the email delivery html summary html client |
|
| 258 | + * |
|
| 259 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 260 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 261 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 262 | + * modify what is returned to the caller. |
|
| 263 | + * |
|
| 264 | + * This option allows you to wrap local decorators |
|
| 265 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 266 | + * |
|
| 267 | + * client/html/email/delivery/html/summary/decorators/local = array( 'decorator2' ) |
|
| 268 | + * |
|
| 269 | + * This would add the decorator named "decorator2" defined by |
|
| 270 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 271 | + * |
|
| 272 | + * @param array List of decorator names |
|
| 273 | + * @since 2015.08 |
|
| 274 | + * @category Developer |
|
| 275 | + * @see client/html/common/decorators/default |
|
| 276 | + * @see client/html/email/delivery/html/summary/decorators/excludes |
|
| 277 | + * @see client/html/email/delivery/html/summary/decorators/global |
|
| 278 | + */ |
|
| 279 | 279 | |
| 280 | - return $this->createSubClient( 'email/delivery/html/summary/' . $type, $name ); |
|
| 281 | - } |
|
| 280 | + return $this->createSubClient( 'email/delivery/html/summary/' . $type, $name ); |
|
| 281 | + } |
|
| 282 | 282 | |
| 283 | 283 | |
| 284 | - /** |
|
| 285 | - * Returns the list of sub-client names configured for the client. |
|
| 286 | - * |
|
| 287 | - * @return array List of HTML client names |
|
| 288 | - */ |
|
| 289 | - protected function getSubClientNames() |
|
| 290 | - { |
|
| 291 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 292 | - } |
|
| 284 | + /** |
|
| 285 | + * Returns the list of sub-client names configured for the client. |
|
| 286 | + * |
|
| 287 | + * @return array List of HTML client names |
|
| 288 | + */ |
|
| 289 | + protected function getSubClientNames() |
|
| 290 | + { |
|
| 291 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 292 | + } |
|
| 293 | 293 | |
| 294 | 294 | |
| 295 | - /** |
|
| 296 | - * Sets the necessary parameter values in the view. |
|
| 297 | - * |
|
| 298 | - * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output |
|
| 299 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 300 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 301 | - * @return \Aimeos\MW\View\Iface Modified view object |
|
| 302 | - */ |
|
| 303 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 304 | - { |
|
| 305 | - $view->summaryBasket = $view->extOrderBaseItem; |
|
| 295 | + /** |
|
| 296 | + * Sets the necessary parameter values in the view. |
|
| 297 | + * |
|
| 298 | + * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output |
|
| 299 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 300 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 301 | + * @return \Aimeos\MW\View\Iface Modified view object |
|
| 302 | + */ |
|
| 303 | + protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 304 | + { |
|
| 305 | + $view->summaryBasket = $view->extOrderBaseItem; |
|
| 306 | 306 | |
| 307 | - return $view; |
|
| 308 | - } |
|
| 307 | + return $view; |
|
| 308 | + } |
|
| 309 | 309 | } |
| 310 | 310 | \ No newline at end of file |
@@ -19,233 +19,233 @@ |
||
| 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/email/delivery/html/summary/address/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the summary address section of the delivery HTML e-mail |
|
| 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/email/delivery/html/summary/address/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 60 | - |
|
| 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 ); |
|
| 73 | - |
|
| 74 | - $html = ''; |
|
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | - } |
|
| 78 | - $view->addressBody = $html; |
|
| 79 | - |
|
| 80 | - /** client/html/email/delivery/html/summary/address/standard/template-body |
|
| 81 | - * Relative path to the HTML body template of the summary address section of the delivery HTML e-mail 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 | - * (second one) should be replaced by the name of the new class in lower |
|
| 94 | - * case. |
|
| 95 | - * |
|
| 96 | - * @param string Relative path to the template creating code for the HTML page body |
|
| 97 | - * @since 2015.11 |
|
| 98 | - * @category Developer |
|
| 99 | - * @see client/html/email/delivery/html/summary/address/standard/template-header |
|
| 100 | - */ |
|
| 101 | - $tplconf = 'client/html/email/delivery/html/summary/address/standard/template-body'; |
|
| 102 | - $default = 'common/summary/address-body-default.php'; |
|
| 103 | - |
|
| 104 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - |
|
| 108 | - /** |
|
| 109 | - * Returns the HTML string for insertion into the header. |
|
| 110 | - * |
|
| 111 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 112 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 113 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 114 | - * @return string|null String including HTML tags for the header on error |
|
| 115 | - */ |
|
| 116 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 117 | - { |
|
| 118 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 119 | - |
|
| 120 | - $html = ''; |
|
| 121 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 122 | - $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 123 | - } |
|
| 124 | - $view->addressHeader = $html; |
|
| 125 | - |
|
| 126 | - /** client/html/email/delivery/html/summary/address/standard/template-header |
|
| 127 | - * Relative path to the HTML header template of the summary address section of the delivery HTML e-mail client. |
|
| 128 | - * |
|
| 129 | - * The template file contains the HTML code and processing instructions |
|
| 130 | - * to generate the HTML code that is inserted into the HTML page header |
|
| 131 | - * of the rendered page in the frontend. The configuration string is the |
|
| 132 | - * path to the template file relative to the templates directory (usually |
|
| 133 | - * in client/html/templates). |
|
| 134 | - * |
|
| 135 | - * You can overwrite the template file configuration in extensions and |
|
| 136 | - * provide alternative templates. These alternative templates should be |
|
| 137 | - * named like the default one but with the string "standard" replaced by |
|
| 138 | - * an unique name. You may use the name of your project for this. If |
|
| 139 | - * you've implemented an alternative client class as well, "standard" |
|
| 140 | - * (second one) should be replaced by the name of the new class in lower |
|
| 141 | - * case. |
|
| 142 | - * |
|
| 143 | - * @param string Relative path to the template creating code for the HTML page head |
|
| 144 | - * @since 2015.11 |
|
| 145 | - * @category Developer |
|
| 146 | - * @see client/html/email/delivery/html/summary/address/standard/template-body |
|
| 147 | - */ |
|
| 148 | - $tplconf = 'client/html/email/delivery/html/summary/address/standard/template-header'; |
|
| 149 | - $default = 'common/summary/address-header-default.php'; |
|
| 150 | - |
|
| 151 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 152 | - } |
|
| 153 | - |
|
| 154 | - |
|
| 155 | - /** |
|
| 156 | - * Returns the sub-client given by its name. |
|
| 157 | - * |
|
| 158 | - * @param string $type Name of the client type |
|
| 159 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 160 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 161 | - */ |
|
| 162 | - public function getSubClient( $type, $name = null ) |
|
| 163 | - { |
|
| 164 | - /** client/html/email/delivery/html/summary/address/decorators/excludes |
|
| 165 | - * Excludes decorators added by the "common" option from the email delivery html summary address html client |
|
| 166 | - * |
|
| 167 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 168 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 169 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 170 | - * modify what is returned to the caller. |
|
| 171 | - * |
|
| 172 | - * This option allows you to remove a decorator added via |
|
| 173 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 174 | - * around the html client. |
|
| 175 | - * |
|
| 176 | - * client/html/email/delivery/html/summary/address/decorators/excludes = array( 'decorator1' ) |
|
| 177 | - * |
|
| 178 | - * This would remove the decorator named "decorator1" from the list of |
|
| 179 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 180 | - * "client/html/common/decorators/default" to the html client. |
|
| 181 | - * |
|
| 182 | - * @param array List of decorator names |
|
| 183 | - * @since 2015.08 |
|
| 184 | - * @category Developer |
|
| 185 | - * @see client/html/common/decorators/default |
|
| 186 | - * @see client/html/email/delivery/html/summary/address/decorators/global |
|
| 187 | - * @see client/html/email/delivery/html/summary/address/decorators/local |
|
| 188 | - */ |
|
| 189 | - |
|
| 190 | - /** client/html/email/delivery/html/summary/address/decorators/global |
|
| 191 | - * Adds a list of globally available decorators only to the email delivery html summary address html client |
|
| 192 | - * |
|
| 193 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 194 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 195 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 196 | - * modify what is returned to the caller. |
|
| 197 | - * |
|
| 198 | - * This option allows you to wrap global decorators |
|
| 199 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 200 | - * |
|
| 201 | - * client/html/email/delivery/html/summary/address/decorators/global = array( 'decorator1' ) |
|
| 202 | - * |
|
| 203 | - * This would add the decorator named "decorator1" defined by |
|
| 204 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 205 | - * |
|
| 206 | - * @param array List of decorator names |
|
| 207 | - * @since 2015.08 |
|
| 208 | - * @category Developer |
|
| 209 | - * @see client/html/common/decorators/default |
|
| 210 | - * @see client/html/email/delivery/html/summary/address/decorators/excludes |
|
| 211 | - * @see client/html/email/delivery/html/summary/address/decorators/local |
|
| 212 | - */ |
|
| 213 | - |
|
| 214 | - /** client/html/email/delivery/html/summary/address/decorators/local |
|
| 215 | - * Adds a list of local decorators only to the email delivery html summary address html client |
|
| 216 | - * |
|
| 217 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 218 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 219 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 220 | - * modify what is returned to the caller. |
|
| 221 | - * |
|
| 222 | - * This option allows you to wrap local decorators |
|
| 223 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 224 | - * |
|
| 225 | - * client/html/email/delivery/html/summary/address/decorators/local = array( 'decorator2' ) |
|
| 226 | - * |
|
| 227 | - * This would add the decorator named "decorator2" defined by |
|
| 228 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 229 | - * |
|
| 230 | - * @param array List of decorator names |
|
| 231 | - * @since 2015.08 |
|
| 232 | - * @category Developer |
|
| 233 | - * @see client/html/common/decorators/default |
|
| 234 | - * @see client/html/email/delivery/html/summary/address/decorators/excludes |
|
| 235 | - * @see client/html/email/delivery/html/summary/address/decorators/global |
|
| 236 | - */ |
|
| 237 | - |
|
| 238 | - return $this->createSubClient( 'email/delivery/html/summary/address/' . $type, $name ); |
|
| 239 | - } |
|
| 240 | - |
|
| 241 | - |
|
| 242 | - /** |
|
| 243 | - * Returns the list of sub-client names configured for the client. |
|
| 244 | - * |
|
| 245 | - * @return array List of HTML client names |
|
| 246 | - */ |
|
| 247 | - protected function getSubClientNames() |
|
| 248 | - { |
|
| 249 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 250 | - } |
|
| 25 | + /** client/html/email/delivery/html/summary/address/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the summary address section of the delivery HTML e-mail |
|
| 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/email/delivery/html/summary/address/standard/subparts'; |
|
| 59 | + private $subPartNames = array(); |
|
| 60 | + |
|
| 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 ); |
|
| 73 | + |
|
| 74 | + $html = ''; |
|
| 75 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | + $html .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | + } |
|
| 78 | + $view->addressBody = $html; |
|
| 79 | + |
|
| 80 | + /** client/html/email/delivery/html/summary/address/standard/template-body |
|
| 81 | + * Relative path to the HTML body template of the summary address section of the delivery HTML e-mail 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 | + * (second one) should be replaced by the name of the new class in lower |
|
| 94 | + * case. |
|
| 95 | + * |
|
| 96 | + * @param string Relative path to the template creating code for the HTML page body |
|
| 97 | + * @since 2015.11 |
|
| 98 | + * @category Developer |
|
| 99 | + * @see client/html/email/delivery/html/summary/address/standard/template-header |
|
| 100 | + */ |
|
| 101 | + $tplconf = 'client/html/email/delivery/html/summary/address/standard/template-body'; |
|
| 102 | + $default = 'common/summary/address-body-default.php'; |
|
| 103 | + |
|
| 104 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + |
|
| 108 | + /** |
|
| 109 | + * Returns the HTML string for insertion into the header. |
|
| 110 | + * |
|
| 111 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 112 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 113 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 114 | + * @return string|null String including HTML tags for the header on error |
|
| 115 | + */ |
|
| 116 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 117 | + { |
|
| 118 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 119 | + |
|
| 120 | + $html = ''; |
|
| 121 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 122 | + $html .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 123 | + } |
|
| 124 | + $view->addressHeader = $html; |
|
| 125 | + |
|
| 126 | + /** client/html/email/delivery/html/summary/address/standard/template-header |
|
| 127 | + * Relative path to the HTML header template of the summary address section of the delivery HTML e-mail client. |
|
| 128 | + * |
|
| 129 | + * The template file contains the HTML code and processing instructions |
|
| 130 | + * to generate the HTML code that is inserted into the HTML page header |
|
| 131 | + * of the rendered page in the frontend. The configuration string is the |
|
| 132 | + * path to the template file relative to the templates directory (usually |
|
| 133 | + * in client/html/templates). |
|
| 134 | + * |
|
| 135 | + * You can overwrite the template file configuration in extensions and |
|
| 136 | + * provide alternative templates. These alternative templates should be |
|
| 137 | + * named like the default one but with the string "standard" replaced by |
|
| 138 | + * an unique name. You may use the name of your project for this. If |
|
| 139 | + * you've implemented an alternative client class as well, "standard" |
|
| 140 | + * (second one) should be replaced by the name of the new class in lower |
|
| 141 | + * case. |
|
| 142 | + * |
|
| 143 | + * @param string Relative path to the template creating code for the HTML page head |
|
| 144 | + * @since 2015.11 |
|
| 145 | + * @category Developer |
|
| 146 | + * @see client/html/email/delivery/html/summary/address/standard/template-body |
|
| 147 | + */ |
|
| 148 | + $tplconf = 'client/html/email/delivery/html/summary/address/standard/template-header'; |
|
| 149 | + $default = 'common/summary/address-header-default.php'; |
|
| 150 | + |
|
| 151 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 152 | + } |
|
| 153 | + |
|
| 154 | + |
|
| 155 | + /** |
|
| 156 | + * Returns the sub-client given by its name. |
|
| 157 | + * |
|
| 158 | + * @param string $type Name of the client type |
|
| 159 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 160 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 161 | + */ |
|
| 162 | + public function getSubClient( $type, $name = null ) |
|
| 163 | + { |
|
| 164 | + /** client/html/email/delivery/html/summary/address/decorators/excludes |
|
| 165 | + * Excludes decorators added by the "common" option from the email delivery html summary address html client |
|
| 166 | + * |
|
| 167 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 168 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 169 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 170 | + * modify what is returned to the caller. |
|
| 171 | + * |
|
| 172 | + * This option allows you to remove a decorator added via |
|
| 173 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 174 | + * around the html client. |
|
| 175 | + * |
|
| 176 | + * client/html/email/delivery/html/summary/address/decorators/excludes = array( 'decorator1' ) |
|
| 177 | + * |
|
| 178 | + * This would remove the decorator named "decorator1" from the list of |
|
| 179 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 180 | + * "client/html/common/decorators/default" to the html client. |
|
| 181 | + * |
|
| 182 | + * @param array List of decorator names |
|
| 183 | + * @since 2015.08 |
|
| 184 | + * @category Developer |
|
| 185 | + * @see client/html/common/decorators/default |
|
| 186 | + * @see client/html/email/delivery/html/summary/address/decorators/global |
|
| 187 | + * @see client/html/email/delivery/html/summary/address/decorators/local |
|
| 188 | + */ |
|
| 189 | + |
|
| 190 | + /** client/html/email/delivery/html/summary/address/decorators/global |
|
| 191 | + * Adds a list of globally available decorators only to the email delivery html summary address html client |
|
| 192 | + * |
|
| 193 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 194 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 195 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 196 | + * modify what is returned to the caller. |
|
| 197 | + * |
|
| 198 | + * This option allows you to wrap global decorators |
|
| 199 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 200 | + * |
|
| 201 | + * client/html/email/delivery/html/summary/address/decorators/global = array( 'decorator1' ) |
|
| 202 | + * |
|
| 203 | + * This would add the decorator named "decorator1" defined by |
|
| 204 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 205 | + * |
|
| 206 | + * @param array List of decorator names |
|
| 207 | + * @since 2015.08 |
|
| 208 | + * @category Developer |
|
| 209 | + * @see client/html/common/decorators/default |
|
| 210 | + * @see client/html/email/delivery/html/summary/address/decorators/excludes |
|
| 211 | + * @see client/html/email/delivery/html/summary/address/decorators/local |
|
| 212 | + */ |
|
| 213 | + |
|
| 214 | + /** client/html/email/delivery/html/summary/address/decorators/local |
|
| 215 | + * Adds a list of local decorators only to the email delivery html summary address html client |
|
| 216 | + * |
|
| 217 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 218 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 219 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 220 | + * modify what is returned to the caller. |
|
| 221 | + * |
|
| 222 | + * This option allows you to wrap local decorators |
|
| 223 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 224 | + * |
|
| 225 | + * client/html/email/delivery/html/summary/address/decorators/local = array( 'decorator2' ) |
|
| 226 | + * |
|
| 227 | + * This would add the decorator named "decorator2" defined by |
|
| 228 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 229 | + * |
|
| 230 | + * @param array List of decorator names |
|
| 231 | + * @since 2015.08 |
|
| 232 | + * @category Developer |
|
| 233 | + * @see client/html/common/decorators/default |
|
| 234 | + * @see client/html/email/delivery/html/summary/address/decorators/excludes |
|
| 235 | + * @see client/html/email/delivery/html/summary/address/decorators/global |
|
| 236 | + */ |
|
| 237 | + |
|
| 238 | + return $this->createSubClient( 'email/delivery/html/summary/address/' . $type, $name ); |
|
| 239 | + } |
|
| 240 | + |
|
| 241 | + |
|
| 242 | + /** |
|
| 243 | + * Returns the list of sub-client names configured for the client. |
|
| 244 | + * |
|
| 245 | + * @return array List of HTML client names |
|
| 246 | + */ |
|
| 247 | + protected function getSubClientNames() |
|
| 248 | + { |
|
| 249 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 250 | + } |
|
| 251 | 251 | } |
@@ -19,306 +19,306 @@ |
||
| 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/email/delivery/html/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email delivery html 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/email/delivery/html/standard/subparts'; |
|
| 25 | + /** client/html/email/delivery/html/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email delivery html 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/email/delivery/html/standard/subparts'; |
|
| 59 | 59 | |
| 60 | - /** client/html/email/delivery/html/salutation/name |
|
| 61 | - * Name of the salutation part used by the email delivery html client implementation |
|
| 62 | - * |
|
| 63 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Salutation\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 | - */ |
|
| 60 | + /** client/html/email/delivery/html/salutation/name |
|
| 61 | + * Name of the salutation part used by the email delivery html client implementation |
|
| 62 | + * |
|
| 63 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Salutation\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 | 70 | |
| 71 | - /** client/html/email/delivery/html/intro/name |
|
| 72 | - * Name of the introduction part used by the email delivery html client implementation |
|
| 73 | - * |
|
| 74 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Intro\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 | - */ |
|
| 71 | + /** client/html/email/delivery/html/intro/name |
|
| 72 | + * Name of the introduction part used by the email delivery html client implementation |
|
| 73 | + * |
|
| 74 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Intro\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 | 81 | |
| 82 | - /** client/html/email/delivery/html/summary/name |
|
| 83 | - * Name of the summary part used by the email delivery html client implementation |
|
| 84 | - * |
|
| 85 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Summary\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 | - */ |
|
| 82 | + /** client/html/email/delivery/html/summary/name |
|
| 83 | + * Name of the summary part used by the email delivery html client implementation |
|
| 84 | + * |
|
| 85 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Summary\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 | 92 | |
| 93 | - /** client/html/email/delivery/html/outro/name |
|
| 94 | - * Name of the footer part used by the email delivery html client implementation |
|
| 95 | - * |
|
| 96 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Outro\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 | - */ |
|
| 93 | + /** client/html/email/delivery/html/outro/name |
|
| 94 | + * Name of the footer part used by the email delivery html client implementation |
|
| 95 | + * |
|
| 96 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Outro\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 | 103 | |
| 104 | - /** client/html/email/delivery/html/legal/name |
|
| 105 | - * Name of the legal part used by the email delivery html client implementation |
|
| 106 | - * |
|
| 107 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Legal\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 | - private $subPartNames = array( 'salutation', 'intro', 'summary', 'outro', 'legal' ); |
|
| 104 | + /** client/html/email/delivery/html/legal/name |
|
| 105 | + * Name of the legal part used by the email delivery html client implementation |
|
| 106 | + * |
|
| 107 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Html\Legal\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 | + private $subPartNames = array( 'salutation', 'intro', 'summary', 'outro', 'legal' ); |
|
| 115 | 115 | |
| 116 | 116 | |
| 117 | - /** |
|
| 118 | - * Returns the HTML code for insertion into the body. |
|
| 119 | - * |
|
| 120 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 121 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 122 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 123 | - * @return string HTML code |
|
| 124 | - */ |
|
| 125 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 126 | - { |
|
| 127 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 117 | + /** |
|
| 118 | + * Returns the HTML code for insertion into the body. |
|
| 119 | + * |
|
| 120 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 121 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 122 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 123 | + * @return string HTML code |
|
| 124 | + */ |
|
| 125 | + public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 126 | + { |
|
| 127 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 128 | 128 | |
| 129 | - $content = ''; |
|
| 130 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 131 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 132 | - } |
|
| 133 | - $view->htmlBody = $content; |
|
| 129 | + $content = ''; |
|
| 130 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 131 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 132 | + } |
|
| 133 | + $view->htmlBody = $content; |
|
| 134 | 134 | |
| 135 | - /** client/html/email/delivery/html/standard/template-body |
|
| 136 | - * Relative path to the HTML body template of the email delivery html client. |
|
| 137 | - * |
|
| 138 | - * The template file contains the HTML code and processing instructions |
|
| 139 | - * to generate the result shown in the body of the e-mail. The |
|
| 140 | - * configuration string is the path to the template file relative |
|
| 141 | - * to the templates directory (usually in client/html/templates). |
|
| 142 | - * |
|
| 143 | - * You can overwrite the template file configuration in extensions and |
|
| 144 | - * provide alternative templates. These alternative templates should be |
|
| 145 | - * named like the default one but with the string "standard" replaced by |
|
| 146 | - * an unique name. You may use the name of your project for this. If |
|
| 147 | - * you've implemented an alternative client class as well, "standard" |
|
| 148 | - * should be replaced by the name of the new class. |
|
| 149 | - * |
|
| 150 | - * The email delivery html client allows to use a different template for |
|
| 151 | - * each delivery status value. You can create a template for each delivery |
|
| 152 | - * status and store it in the "email/delivery/<status number>/" directory |
|
| 153 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 154 | - * specific layout template is found, the common template in the |
|
| 155 | - * "email/delivery/" directory is used. |
|
| 156 | - * |
|
| 157 | - * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 158 | - * @since 2014.03 |
|
| 159 | - * @category Developer |
|
| 160 | - * @see client/html/email/delivery/html/standard/template-header |
|
| 161 | - */ |
|
| 162 | - $tplconf = 'client/html/email/delivery/html/standard/template-body'; |
|
| 135 | + /** client/html/email/delivery/html/standard/template-body |
|
| 136 | + * Relative path to the HTML body template of the email delivery html client. |
|
| 137 | + * |
|
| 138 | + * The template file contains the HTML code and processing instructions |
|
| 139 | + * to generate the result shown in the body of the e-mail. The |
|
| 140 | + * configuration string is the path to the template file relative |
|
| 141 | + * to the templates directory (usually in client/html/templates). |
|
| 142 | + * |
|
| 143 | + * You can overwrite the template file configuration in extensions and |
|
| 144 | + * provide alternative templates. These alternative templates should be |
|
| 145 | + * named like the default one but with the string "standard" replaced by |
|
| 146 | + * an unique name. You may use the name of your project for this. If |
|
| 147 | + * you've implemented an alternative client class as well, "standard" |
|
| 148 | + * should be replaced by the name of the new class. |
|
| 149 | + * |
|
| 150 | + * The email delivery html client allows to use a different template for |
|
| 151 | + * each delivery status value. You can create a template for each delivery |
|
| 152 | + * status and store it in the "email/delivery/<status number>/" directory |
|
| 153 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 154 | + * specific layout template is found, the common template in the |
|
| 155 | + * "email/delivery/" directory is used. |
|
| 156 | + * |
|
| 157 | + * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 158 | + * @since 2014.03 |
|
| 159 | + * @category Developer |
|
| 160 | + * @see client/html/email/delivery/html/standard/template-header |
|
| 161 | + */ |
|
| 162 | + $tplconf = 'client/html/email/delivery/html/standard/template-body'; |
|
| 163 | 163 | |
| 164 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 165 | - $default = array( 'email/delivery/' . $status . '/html-body-default.php', 'email/common/html-body-default.php' ); |
|
| 164 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 165 | + $default = array( 'email/delivery/' . $status . '/html-body-default.php', 'email/common/html-body-default.php' ); |
|
| 166 | 166 | |
| 167 | - $html = $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | - $view->mail()->setBodyHtml( $html ); |
|
| 169 | - return $html; |
|
| 170 | - } |
|
| 167 | + $html = $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | + $view->mail()->setBodyHtml( $html ); |
|
| 169 | + return $html; |
|
| 170 | + } |
|
| 171 | 171 | |
| 172 | 172 | |
| 173 | - /** |
|
| 174 | - * Returns the HTML string for insertion into the header. |
|
| 175 | - * |
|
| 176 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 177 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 178 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 179 | - * @return string|null String including HTML tags for the header on error |
|
| 180 | - */ |
|
| 181 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 182 | - { |
|
| 183 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 173 | + /** |
|
| 174 | + * Returns the HTML string for insertion into the header. |
|
| 175 | + * |
|
| 176 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 177 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 178 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 179 | + * @return string|null String including HTML tags for the header on error |
|
| 180 | + */ |
|
| 181 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 182 | + { |
|
| 183 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 184 | 184 | |
| 185 | - $content = ''; |
|
| 186 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 187 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 188 | - } |
|
| 189 | - $view->htmlHeader = $content; |
|
| 185 | + $content = ''; |
|
| 186 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 187 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 188 | + } |
|
| 189 | + $view->htmlHeader = $content; |
|
| 190 | 190 | |
| 191 | - /** client/html/email/delivery/html/standard/template-header |
|
| 192 | - * Relative path to the HTML header template of the email delivery html client. |
|
| 193 | - * |
|
| 194 | - * The template file contains the HTML code and processing instructions |
|
| 195 | - * to generate the HTML code that is inserted into the header |
|
| 196 | - * of the e-mail. The configuration string is the |
|
| 197 | - * path to the template file relative to the templates directory (usually |
|
| 198 | - * in client/html/templates). |
|
| 199 | - * |
|
| 200 | - * You can overwrite the template file configuration in extensions and |
|
| 201 | - * provide alternative templates. These alternative templates should be |
|
| 202 | - * named like the default one but with the string "standard" replaced by |
|
| 203 | - * an unique name. You may use the name of your project for this. If |
|
| 204 | - * you've implemented an alternative client class as well, "standard" |
|
| 205 | - * should be replaced by the name of the new class. |
|
| 206 | - * |
|
| 207 | - * The email payment HTML client allows to use a different template for |
|
| 208 | - * each payment status value. You can create a template for each payment |
|
| 209 | - * status and store it in the "email/payment/<status number>/" directory |
|
| 210 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 211 | - * specific layout template is found, the common template in the |
|
| 212 | - * "email/payment/" directory is used. |
|
| 213 | - * |
|
| 214 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 215 | - * @since 2014.03 |
|
| 216 | - * @category Developer |
|
| 217 | - * @see client/html/email/delivery/html/standard/template-body |
|
| 218 | - */ |
|
| 219 | - $tplconf = 'client/html/email/delivery/html/standard/template-header'; |
|
| 191 | + /** client/html/email/delivery/html/standard/template-header |
|
| 192 | + * Relative path to the HTML header template of the email delivery html client. |
|
| 193 | + * |
|
| 194 | + * The template file contains the HTML code and processing instructions |
|
| 195 | + * to generate the HTML code that is inserted into the header |
|
| 196 | + * of the e-mail. The configuration string is the |
|
| 197 | + * path to the template file relative to the templates directory (usually |
|
| 198 | + * in client/html/templates). |
|
| 199 | + * |
|
| 200 | + * You can overwrite the template file configuration in extensions and |
|
| 201 | + * provide alternative templates. These alternative templates should be |
|
| 202 | + * named like the default one but with the string "standard" replaced by |
|
| 203 | + * an unique name. You may use the name of your project for this. If |
|
| 204 | + * you've implemented an alternative client class as well, "standard" |
|
| 205 | + * should be replaced by the name of the new class. |
|
| 206 | + * |
|
| 207 | + * The email payment HTML client allows to use a different template for |
|
| 208 | + * each payment status value. You can create a template for each payment |
|
| 209 | + * status and store it in the "email/payment/<status number>/" directory |
|
| 210 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 211 | + * specific layout template is found, the common template in the |
|
| 212 | + * "email/payment/" directory is used. |
|
| 213 | + * |
|
| 214 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 215 | + * @since 2014.03 |
|
| 216 | + * @category Developer |
|
| 217 | + * @see client/html/email/delivery/html/standard/template-body |
|
| 218 | + */ |
|
| 219 | + $tplconf = 'client/html/email/delivery/html/standard/template-header'; |
|
| 220 | 220 | |
| 221 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 222 | - $default = array( 'email/delivery/' . $status . '/html-header-default.php', 'email/common/html-header-default.php' ); |
|
| 221 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 222 | + $default = array( 'email/delivery/' . $status . '/html-header-default.php', 'email/common/html-header-default.php' ); |
|
| 223 | 223 | |
| 224 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 225 | - } |
|
| 224 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 225 | + } |
|
| 226 | 226 | |
| 227 | 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/email/delivery/html/decorators/excludes |
|
| 238 | - * Excludes decorators added by the "common" option from the "email delivery html" 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/email/delivery/html/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/email/delivery/html/decorators/global |
|
| 260 | - * @see client/html/email/delivery/html/decorators/local |
|
| 261 | - */ |
|
| 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/email/delivery/html/decorators/excludes |
|
| 238 | + * Excludes decorators added by the "common" option from the "email delivery html" 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/email/delivery/html/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/email/delivery/html/decorators/global |
|
| 260 | + * @see client/html/email/delivery/html/decorators/local |
|
| 261 | + */ |
|
| 262 | 262 | |
| 263 | - /** client/html/email/delivery/html/decorators/global |
|
| 264 | - * Adds a list of globally available decorators only to the "email delivery html" 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/email/delivery/html/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/email/delivery/html/decorators/excludes |
|
| 284 | - * @see client/html/email/delivery/html/decorators/local |
|
| 285 | - */ |
|
| 263 | + /** client/html/email/delivery/html/decorators/global |
|
| 264 | + * Adds a list of globally available decorators only to the "email delivery html" 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/email/delivery/html/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/email/delivery/html/decorators/excludes |
|
| 284 | + * @see client/html/email/delivery/html/decorators/local |
|
| 285 | + */ |
|
| 286 | 286 | |
| 287 | - /** client/html/email/delivery/html/decorators/local |
|
| 288 | - * Adds a list of local decorators only to the "email delivery html" 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/email/delivery/html/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/email/delivery/html/decorators/excludes |
|
| 308 | - * @see client/html/email/delivery/html/decorators/global |
|
| 309 | - */ |
|
| 287 | + /** client/html/email/delivery/html/decorators/local |
|
| 288 | + * Adds a list of local decorators only to the "email delivery html" 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/email/delivery/html/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/email/delivery/html/decorators/excludes |
|
| 308 | + * @see client/html/email/delivery/html/decorators/global |
|
| 309 | + */ |
|
| 310 | 310 | |
| 311 | - return $this->createSubClient( 'email/delivery/html/' . $type, $name ); |
|
| 312 | - } |
|
| 311 | + return $this->createSubClient( 'email/delivery/html/' . $type, $name ); |
|
| 312 | + } |
|
| 313 | 313 | |
| 314 | 314 | |
| 315 | - /** |
|
| 316 | - * Returns the list of sub-client names configured for the client. |
|
| 317 | - * |
|
| 318 | - * @return array List of HTML client names |
|
| 319 | - */ |
|
| 320 | - protected function getSubClientNames() |
|
| 321 | - { |
|
| 322 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 323 | - } |
|
| 315 | + /** |
|
| 316 | + * Returns the list of sub-client names configured for the client. |
|
| 317 | + * |
|
| 318 | + * @return array List of HTML client names |
|
| 319 | + */ |
|
| 320 | + protected function getSubClientNames() |
|
| 321 | + { |
|
| 322 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 323 | + } |
|
| 324 | 324 | } |
| 325 | 325 | \ No newline at end of file |
@@ -19,249 +19,249 @@ |
||
| 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/email/delivery/html/outro/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email delivery html outro 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/email/delivery/html/outro/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 25 | + /** client/html/email/delivery/html/outro/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email delivery html outro 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/email/delivery/html/outro/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 | - $content = ''; |
|
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | - } |
|
| 78 | - $view->outroBody = $content; |
|
| 74 | + $content = ''; |
|
| 75 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | + } |
|
| 78 | + $view->outroBody = $content; |
|
| 79 | 79 | |
| 80 | - /** client/html/email/delivery/html/outro/standard/template-body |
|
| 81 | - * Relative path to the HTML body template of the email delivery html footer client. |
|
| 82 | - * |
|
| 83 | - * The template file contains the HTML code and processing instructions |
|
| 84 | - * to generate the result shown in the body of the e-mail. 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 | - * The footer part of the email delivery html client allows to use |
|
| 96 | - * a different template for each delivery status value. You can create a |
|
| 97 | - * template for each delivery status and store it in the "email/delivery/<status number>/" |
|
| 98 | - * directory below the "templates" directory (usually in client/html/templates). |
|
| 99 | - * If no specific layout template is found, the common template in the |
|
| 100 | - * "email/delivery/" directory is used. |
|
| 101 | - * |
|
| 102 | - * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | - * @since 2014.03 |
|
| 104 | - * @category Developer |
|
| 105 | - * @see client/html/email/delivery/html/outro/standard/template-header |
|
| 106 | - */ |
|
| 107 | - $tplconf = 'client/html/email/delivery/html/outro/standard/template-body'; |
|
| 80 | + /** client/html/email/delivery/html/outro/standard/template-body |
|
| 81 | + * Relative path to the HTML body template of the email delivery html footer client. |
|
| 82 | + * |
|
| 83 | + * The template file contains the HTML code and processing instructions |
|
| 84 | + * to generate the result shown in the body of the e-mail. 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 | + * The footer part of the email delivery html client allows to use |
|
| 96 | + * a different template for each delivery status value. You can create a |
|
| 97 | + * template for each delivery status and store it in the "email/delivery/<status number>/" |
|
| 98 | + * directory below the "templates" directory (usually in client/html/templates). |
|
| 99 | + * If no specific layout template is found, the common template in the |
|
| 100 | + * "email/delivery/" directory is used. |
|
| 101 | + * |
|
| 102 | + * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | + * @since 2014.03 |
|
| 104 | + * @category Developer |
|
| 105 | + * @see client/html/email/delivery/html/outro/standard/template-header |
|
| 106 | + */ |
|
| 107 | + $tplconf = 'client/html/email/delivery/html/outro/standard/template-body'; |
|
| 108 | 108 | |
| 109 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 110 | - $default = array( 'email/delivery/' . $status . '/html-outro-body-default.php', 'email/common/html-outro-body-default.php' ); |
|
| 109 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 110 | + $default = array( 'email/delivery/' . $status . '/html-outro-body-default.php', 'email/common/html-outro-body-default.php' ); |
|
| 111 | 111 | |
| 112 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 113 | - } |
|
| 112 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 113 | + } |
|
| 114 | 114 | |
| 115 | 115 | |
| 116 | - /** |
|
| 117 | - * Returns the HTML string for insertion into the header. |
|
| 118 | - * |
|
| 119 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 120 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 121 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 122 | - * @return string|null String including HTML tags for the header on error |
|
| 123 | - */ |
|
| 124 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 125 | - { |
|
| 126 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 116 | + /** |
|
| 117 | + * Returns the HTML string for insertion into the header. |
|
| 118 | + * |
|
| 119 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 120 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 121 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 122 | + * @return string|null String including HTML tags for the header on error |
|
| 123 | + */ |
|
| 124 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 125 | + { |
|
| 126 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 127 | 127 | |
| 128 | - $content = ''; |
|
| 129 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 130 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 131 | - } |
|
| 132 | - $view->outroHeader = $content; |
|
| 128 | + $content = ''; |
|
| 129 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 130 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 131 | + } |
|
| 132 | + $view->outroHeader = $content; |
|
| 133 | 133 | |
| 134 | - /** client/html/email/delivery/html/outro/standard/template-header |
|
| 135 | - * Relative path to the HTML header template of the email delivery html footer client. |
|
| 136 | - * |
|
| 137 | - * The template file contains the HTML code and processing instructions |
|
| 138 | - * to generate the HTML code that is inserted into the header |
|
| 139 | - * of the e-mail. The configuration string is the |
|
| 140 | - * path to the template file relative to the templates directory (usually |
|
| 141 | - * in client/html/templates). |
|
| 142 | - * |
|
| 143 | - * You can overwrite the template file configuration in extensions and |
|
| 144 | - * provide alternative templates. These alternative templates should be |
|
| 145 | - * named like the default one but with the string "standard" replaced by |
|
| 146 | - * an unique name. You may use the name of your project for this. If |
|
| 147 | - * you've implemented an alternative client class as well, "standard" |
|
| 148 | - * should be replaced by the name of the new class. |
|
| 149 | - * |
|
| 150 | - * The email payment HTML client allows to use a different template for |
|
| 151 | - * each payment status value. You can create a template for each payment |
|
| 152 | - * status and store it in the "email/payment/<status number>/" directory |
|
| 153 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 154 | - * specific layout template is found, the common template in the |
|
| 155 | - * "email/payment/" directory is used. |
|
| 156 | - * |
|
| 157 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 158 | - * @since 2014.03 |
|
| 159 | - * @category Developer |
|
| 160 | - * @see client/html/email/delivery/html/outro/standard/template-body |
|
| 161 | - */ |
|
| 162 | - $tplconf = 'client/html/email/delivery/html/outro/standard/template-header'; |
|
| 134 | + /** client/html/email/delivery/html/outro/standard/template-header |
|
| 135 | + * Relative path to the HTML header template of the email delivery html footer client. |
|
| 136 | + * |
|
| 137 | + * The template file contains the HTML code and processing instructions |
|
| 138 | + * to generate the HTML code that is inserted into the header |
|
| 139 | + * of the e-mail. The configuration string is the |
|
| 140 | + * path to the template file relative to the templates directory (usually |
|
| 141 | + * in client/html/templates). |
|
| 142 | + * |
|
| 143 | + * You can overwrite the template file configuration in extensions and |
|
| 144 | + * provide alternative templates. These alternative templates should be |
|
| 145 | + * named like the default one but with the string "standard" replaced by |
|
| 146 | + * an unique name. You may use the name of your project for this. If |
|
| 147 | + * you've implemented an alternative client class as well, "standard" |
|
| 148 | + * should be replaced by the name of the new class. |
|
| 149 | + * |
|
| 150 | + * The email payment HTML client allows to use a different template for |
|
| 151 | + * each payment status value. You can create a template for each payment |
|
| 152 | + * status and store it in the "email/payment/<status number>/" directory |
|
| 153 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 154 | + * specific layout template is found, the common template in the |
|
| 155 | + * "email/payment/" directory is used. |
|
| 156 | + * |
|
| 157 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 158 | + * @since 2014.03 |
|
| 159 | + * @category Developer |
|
| 160 | + * @see client/html/email/delivery/html/outro/standard/template-body |
|
| 161 | + */ |
|
| 162 | + $tplconf = 'client/html/email/delivery/html/outro/standard/template-header'; |
|
| 163 | 163 | |
| 164 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 165 | - $default = array( 'email/delivery/' . $status . '/html-outro-header-default.php', 'email/common/html-outro-header-default.php' ); |
|
| 164 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 165 | + $default = array( 'email/delivery/' . $status . '/html-outro-header-default.php', 'email/common/html-outro-header-default.php' ); |
|
| 166 | 166 | |
| 167 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | - } |
|
| 167 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | + } |
|
| 169 | 169 | |
| 170 | 170 | |
| 171 | - /** |
|
| 172 | - * Returns the sub-client given by its name. |
|
| 173 | - * |
|
| 174 | - * @param string $type Name of the client type |
|
| 175 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 176 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 177 | - */ |
|
| 178 | - public function getSubClient( $type, $name = null ) |
|
| 179 | - { |
|
| 180 | - /** client/html/email/delivery/html/outro/decorators/excludes |
|
| 181 | - * Excludes decorators added by the "common" option from the email delivery html outro html client |
|
| 182 | - * |
|
| 183 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 184 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 185 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 186 | - * modify what is returned to the caller. |
|
| 187 | - * |
|
| 188 | - * This option allows you to remove a decorator added via |
|
| 189 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 190 | - * around the html client. |
|
| 191 | - * |
|
| 192 | - * client/html/email/delivery/html/outro/decorators/excludes = array( 'decorator1' ) |
|
| 193 | - * |
|
| 194 | - * This would remove the decorator named "decorator1" from the list of |
|
| 195 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 196 | - * "client/html/common/decorators/default" to the html client. |
|
| 197 | - * |
|
| 198 | - * @param array List of decorator names |
|
| 199 | - * @since 2015.08 |
|
| 200 | - * @category Developer |
|
| 201 | - * @see client/html/common/decorators/default |
|
| 202 | - * @see client/html/email/delivery/html/outro/decorators/global |
|
| 203 | - * @see client/html/email/delivery/html/outro/decorators/local |
|
| 204 | - */ |
|
| 171 | + /** |
|
| 172 | + * Returns the sub-client given by its name. |
|
| 173 | + * |
|
| 174 | + * @param string $type Name of the client type |
|
| 175 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 176 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 177 | + */ |
|
| 178 | + public function getSubClient( $type, $name = null ) |
|
| 179 | + { |
|
| 180 | + /** client/html/email/delivery/html/outro/decorators/excludes |
|
| 181 | + * Excludes decorators added by the "common" option from the email delivery html outro html client |
|
| 182 | + * |
|
| 183 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 184 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 185 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 186 | + * modify what is returned to the caller. |
|
| 187 | + * |
|
| 188 | + * This option allows you to remove a decorator added via |
|
| 189 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 190 | + * around the html client. |
|
| 191 | + * |
|
| 192 | + * client/html/email/delivery/html/outro/decorators/excludes = array( 'decorator1' ) |
|
| 193 | + * |
|
| 194 | + * This would remove the decorator named "decorator1" from the list of |
|
| 195 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 196 | + * "client/html/common/decorators/default" to the html client. |
|
| 197 | + * |
|
| 198 | + * @param array List of decorator names |
|
| 199 | + * @since 2015.08 |
|
| 200 | + * @category Developer |
|
| 201 | + * @see client/html/common/decorators/default |
|
| 202 | + * @see client/html/email/delivery/html/outro/decorators/global |
|
| 203 | + * @see client/html/email/delivery/html/outro/decorators/local |
|
| 204 | + */ |
|
| 205 | 205 | |
| 206 | - /** client/html/email/delivery/html/outro/decorators/global |
|
| 207 | - * Adds a list of globally available decorators only to the email delivery html outro html client |
|
| 208 | - * |
|
| 209 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 210 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 211 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 212 | - * modify what is returned to the caller. |
|
| 213 | - * |
|
| 214 | - * This option allows you to wrap global decorators |
|
| 215 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 216 | - * |
|
| 217 | - * client/html/email/delivery/html/outro/decorators/global = array( 'decorator1' ) |
|
| 218 | - * |
|
| 219 | - * This would add the decorator named "decorator1" defined by |
|
| 220 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 221 | - * |
|
| 222 | - * @param array List of decorator names |
|
| 223 | - * @since 2015.08 |
|
| 224 | - * @category Developer |
|
| 225 | - * @see client/html/common/decorators/default |
|
| 226 | - * @see client/html/email/delivery/html/outro/decorators/excludes |
|
| 227 | - * @see client/html/email/delivery/html/outro/decorators/local |
|
| 228 | - */ |
|
| 206 | + /** client/html/email/delivery/html/outro/decorators/global |
|
| 207 | + * Adds a list of globally available decorators only to the email delivery html outro html client |
|
| 208 | + * |
|
| 209 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 210 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 211 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 212 | + * modify what is returned to the caller. |
|
| 213 | + * |
|
| 214 | + * This option allows you to wrap global decorators |
|
| 215 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 216 | + * |
|
| 217 | + * client/html/email/delivery/html/outro/decorators/global = array( 'decorator1' ) |
|
| 218 | + * |
|
| 219 | + * This would add the decorator named "decorator1" defined by |
|
| 220 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 221 | + * |
|
| 222 | + * @param array List of decorator names |
|
| 223 | + * @since 2015.08 |
|
| 224 | + * @category Developer |
|
| 225 | + * @see client/html/common/decorators/default |
|
| 226 | + * @see client/html/email/delivery/html/outro/decorators/excludes |
|
| 227 | + * @see client/html/email/delivery/html/outro/decorators/local |
|
| 228 | + */ |
|
| 229 | 229 | |
| 230 | - /** client/html/email/delivery/html/outro/decorators/local |
|
| 231 | - * Adds a list of local decorators only to the email delivery html outro html client |
|
| 232 | - * |
|
| 233 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 234 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 235 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 236 | - * modify what is returned to the caller. |
|
| 237 | - * |
|
| 238 | - * This option allows you to wrap local decorators |
|
| 239 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 240 | - * |
|
| 241 | - * client/html/email/delivery/html/outro/decorators/local = array( 'decorator2' ) |
|
| 242 | - * |
|
| 243 | - * This would add the decorator named "decorator2" defined by |
|
| 244 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 245 | - * |
|
| 246 | - * @param array List of decorator names |
|
| 247 | - * @since 2015.08 |
|
| 248 | - * @category Developer |
|
| 249 | - * @see client/html/common/decorators/default |
|
| 250 | - * @see client/html/email/delivery/html/outro/decorators/excludes |
|
| 251 | - * @see client/html/email/delivery/html/outro/decorators/global |
|
| 252 | - */ |
|
| 230 | + /** client/html/email/delivery/html/outro/decorators/local |
|
| 231 | + * Adds a list of local decorators only to the email delivery html outro html client |
|
| 232 | + * |
|
| 233 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 234 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 235 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 236 | + * modify what is returned to the caller. |
|
| 237 | + * |
|
| 238 | + * This option allows you to wrap local decorators |
|
| 239 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 240 | + * |
|
| 241 | + * client/html/email/delivery/html/outro/decorators/local = array( 'decorator2' ) |
|
| 242 | + * |
|
| 243 | + * This would add the decorator named "decorator2" defined by |
|
| 244 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 245 | + * |
|
| 246 | + * @param array List of decorator names |
|
| 247 | + * @since 2015.08 |
|
| 248 | + * @category Developer |
|
| 249 | + * @see client/html/common/decorators/default |
|
| 250 | + * @see client/html/email/delivery/html/outro/decorators/excludes |
|
| 251 | + * @see client/html/email/delivery/html/outro/decorators/global |
|
| 252 | + */ |
|
| 253 | 253 | |
| 254 | - return $this->createSubClient( 'email/delivery/html/outro/' . $type, $name ); |
|
| 255 | - } |
|
| 254 | + return $this->createSubClient( 'email/delivery/html/outro/' . $type, $name ); |
|
| 255 | + } |
|
| 256 | 256 | |
| 257 | 257 | |
| 258 | - /** |
|
| 259 | - * Returns the list of sub-client names configured for the client. |
|
| 260 | - * |
|
| 261 | - * @return array List of HTML client names |
|
| 262 | - */ |
|
| 263 | - protected function getSubClientNames() |
|
| 264 | - { |
|
| 265 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 266 | - } |
|
| 258 | + /** |
|
| 259 | + * Returns the list of sub-client names configured for the client. |
|
| 260 | + * |
|
| 261 | + * @return array List of HTML client names |
|
| 262 | + */ |
|
| 263 | + protected function getSubClientNames() |
|
| 264 | + { |
|
| 265 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 266 | + } |
|
| 267 | 267 | } |
| 268 | 268 | \ No newline at end of file |
@@ -19,249 +19,249 @@ |
||
| 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/email/delivery/html/salutation/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email delivery html salutation 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/email/delivery/html/salutation/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 25 | + /** client/html/email/delivery/html/salutation/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email delivery html salutation 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/email/delivery/html/salutation/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 | - $content = ''; |
|
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | - } |
|
| 78 | - $view->salutationBody = $content; |
|
| 74 | + $content = ''; |
|
| 75 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | + } |
|
| 78 | + $view->salutationBody = $content; |
|
| 79 | 79 | |
| 80 | - /** client/html/email/delivery/html/salutation/standard/template-body |
|
| 81 | - * Relative path to the HTML body template of the email delivery html salutation client. |
|
| 82 | - * |
|
| 83 | - * The template file contains the HTML code and processing instructions |
|
| 84 | - * to generate the result shown in the body of the e-mail. 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 | - * The salutation part of the email delivery html client allows to use |
|
| 96 | - * a different template for each delivery status value. You can create a |
|
| 97 | - * template for each delivery status and store it in the "email/delivery/<status number>/" |
|
| 98 | - * directory below the "templates" directory (usually in client/html/templates). |
|
| 99 | - * If no specific layout template is found, the common template in the |
|
| 100 | - * "email/delivery/" directory is used. |
|
| 101 | - * |
|
| 102 | - * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | - * @since 2014.03 |
|
| 104 | - * @category Developer |
|
| 105 | - * @see client/html/email/delivery/html/salutation/standard/template-header |
|
| 106 | - */ |
|
| 107 | - $tplconf = 'client/html/email/delivery/html/salutation/standard/template-body'; |
|
| 80 | + /** client/html/email/delivery/html/salutation/standard/template-body |
|
| 81 | + * Relative path to the HTML body template of the email delivery html salutation client. |
|
| 82 | + * |
|
| 83 | + * The template file contains the HTML code and processing instructions |
|
| 84 | + * to generate the result shown in the body of the e-mail. 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 | + * The salutation part of the email delivery html client allows to use |
|
| 96 | + * a different template for each delivery status value. You can create a |
|
| 97 | + * template for each delivery status and store it in the "email/delivery/<status number>/" |
|
| 98 | + * directory below the "templates" directory (usually in client/html/templates). |
|
| 99 | + * If no specific layout template is found, the common template in the |
|
| 100 | + * "email/delivery/" directory is used. |
|
| 101 | + * |
|
| 102 | + * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | + * @since 2014.03 |
|
| 104 | + * @category Developer |
|
| 105 | + * @see client/html/email/delivery/html/salutation/standard/template-header |
|
| 106 | + */ |
|
| 107 | + $tplconf = 'client/html/email/delivery/html/salutation/standard/template-body'; |
|
| 108 | 108 | |
| 109 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 110 | - $default = array( 'email/delivery/' . $status . '/html-salutation-body-default.php', 'email/common/html-salutation-body-default.php' ); |
|
| 109 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 110 | + $default = array( 'email/delivery/' . $status . '/html-salutation-body-default.php', 'email/common/html-salutation-body-default.php' ); |
|
| 111 | 111 | |
| 112 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 113 | - } |
|
| 112 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 113 | + } |
|
| 114 | 114 | |
| 115 | 115 | |
| 116 | - /** |
|
| 117 | - * Returns the HTML string for insertion into the header. |
|
| 118 | - * |
|
| 119 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 120 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 121 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 122 | - * @return string|null String including HTML tags for the header on error |
|
| 123 | - */ |
|
| 124 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 125 | - { |
|
| 126 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 116 | + /** |
|
| 117 | + * Returns the HTML string for insertion into the header. |
|
| 118 | + * |
|
| 119 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 120 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 121 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 122 | + * @return string|null String including HTML tags for the header on error |
|
| 123 | + */ |
|
| 124 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 125 | + { |
|
| 126 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 127 | 127 | |
| 128 | - $content = ''; |
|
| 129 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 130 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 131 | - } |
|
| 132 | - $view->salutationHeader = $content; |
|
| 128 | + $content = ''; |
|
| 129 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 130 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 131 | + } |
|
| 132 | + $view->salutationHeader = $content; |
|
| 133 | 133 | |
| 134 | - /** client/html/email/delivery/html/salutation/standard/template-header |
|
| 135 | - * Relative path to the HTML header template of the email delivery html salutation client. |
|
| 136 | - * |
|
| 137 | - * The template file contains the HTML code and processing instructions |
|
| 138 | - * to generate the HTML code that is inserted into the header |
|
| 139 | - * of the e-mail. The configuration string is the |
|
| 140 | - * path to the template file relative to the templates directory (usually |
|
| 141 | - * in client/html/templates). |
|
| 142 | - * |
|
| 143 | - * You can overwrite the template file configuration in extensions and |
|
| 144 | - * provide alternative templates. These alternative templates should be |
|
| 145 | - * named like the default one but with the string "standard" replaced by |
|
| 146 | - * an unique name. You may use the name of your project for this. If |
|
| 147 | - * you've implemented an alternative client class as well, "standard" |
|
| 148 | - * should be replaced by the name of the new class. |
|
| 149 | - * |
|
| 150 | - * The email payment HTML client allows to use a different template for |
|
| 151 | - * each payment status value. You can create a template for each payment |
|
| 152 | - * status and store it in the "email/payment/<status number>/" directory |
|
| 153 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 154 | - * specific layout template is found, the common template in the |
|
| 155 | - * "email/payment/" directory is used. |
|
| 156 | - * |
|
| 157 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 158 | - * @since 2014.03 |
|
| 159 | - * @category Developer |
|
| 160 | - * @see client/html/email/delivery/html/salutation/standard/template-body |
|
| 161 | - */ |
|
| 162 | - $tplconf = 'client/html/email/delivery/html/salutation/standard/template-header'; |
|
| 134 | + /** client/html/email/delivery/html/salutation/standard/template-header |
|
| 135 | + * Relative path to the HTML header template of the email delivery html salutation client. |
|
| 136 | + * |
|
| 137 | + * The template file contains the HTML code and processing instructions |
|
| 138 | + * to generate the HTML code that is inserted into the header |
|
| 139 | + * of the e-mail. The configuration string is the |
|
| 140 | + * path to the template file relative to the templates directory (usually |
|
| 141 | + * in client/html/templates). |
|
| 142 | + * |
|
| 143 | + * You can overwrite the template file configuration in extensions and |
|
| 144 | + * provide alternative templates. These alternative templates should be |
|
| 145 | + * named like the default one but with the string "standard" replaced by |
|
| 146 | + * an unique name. You may use the name of your project for this. If |
|
| 147 | + * you've implemented an alternative client class as well, "standard" |
|
| 148 | + * should be replaced by the name of the new class. |
|
| 149 | + * |
|
| 150 | + * The email payment HTML client allows to use a different template for |
|
| 151 | + * each payment status value. You can create a template for each payment |
|
| 152 | + * status and store it in the "email/payment/<status number>/" directory |
|
| 153 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 154 | + * specific layout template is found, the common template in the |
|
| 155 | + * "email/payment/" directory is used. |
|
| 156 | + * |
|
| 157 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 158 | + * @since 2014.03 |
|
| 159 | + * @category Developer |
|
| 160 | + * @see client/html/email/delivery/html/salutation/standard/template-body |
|
| 161 | + */ |
|
| 162 | + $tplconf = 'client/html/email/delivery/html/salutation/standard/template-header'; |
|
| 163 | 163 | |
| 164 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 165 | - $default = array( 'email/delivery/' . $status . '/html-salutation-header-default.php', 'email/common/html-salutation-header-default.php' ); |
|
| 164 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 165 | + $default = array( 'email/delivery/' . $status . '/html-salutation-header-default.php', 'email/common/html-salutation-header-default.php' ); |
|
| 166 | 166 | |
| 167 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | - } |
|
| 167 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | + } |
|
| 169 | 169 | |
| 170 | 170 | |
| 171 | - /** |
|
| 172 | - * Returns the sub-client given by its name. |
|
| 173 | - * |
|
| 174 | - * @param string $type Name of the client type |
|
| 175 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 176 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 177 | - */ |
|
| 178 | - public function getSubClient( $type, $name = null ) |
|
| 179 | - { |
|
| 180 | - /** client/html/email/delivery/html/salutation/decorators/excludes |
|
| 181 | - * Excludes decorators added by the "common" option from the email delivery html salutation html client |
|
| 182 | - * |
|
| 183 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 184 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 185 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 186 | - * modify what is returned to the caller. |
|
| 187 | - * |
|
| 188 | - * This option allows you to remove a decorator added via |
|
| 189 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 190 | - * around the html client. |
|
| 191 | - * |
|
| 192 | - * client/html/email/delivery/html/salutation/decorators/excludes = array( 'decorator1' ) |
|
| 193 | - * |
|
| 194 | - * This would remove the decorator named "decorator1" from the list of |
|
| 195 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 196 | - * "client/html/common/decorators/default" to the html client. |
|
| 197 | - * |
|
| 198 | - * @param array List of decorator names |
|
| 199 | - * @since 2015.08 |
|
| 200 | - * @category Developer |
|
| 201 | - * @see client/html/common/decorators/default |
|
| 202 | - * @see client/html/email/delivery/html/salutation/decorators/global |
|
| 203 | - * @see client/html/email/delivery/html/salutation/decorators/local |
|
| 204 | - */ |
|
| 171 | + /** |
|
| 172 | + * Returns the sub-client given by its name. |
|
| 173 | + * |
|
| 174 | + * @param string $type Name of the client type |
|
| 175 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 176 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 177 | + */ |
|
| 178 | + public function getSubClient( $type, $name = null ) |
|
| 179 | + { |
|
| 180 | + /** client/html/email/delivery/html/salutation/decorators/excludes |
|
| 181 | + * Excludes decorators added by the "common" option from the email delivery html salutation html client |
|
| 182 | + * |
|
| 183 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 184 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 185 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 186 | + * modify what is returned to the caller. |
|
| 187 | + * |
|
| 188 | + * This option allows you to remove a decorator added via |
|
| 189 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 190 | + * around the html client. |
|
| 191 | + * |
|
| 192 | + * client/html/email/delivery/html/salutation/decorators/excludes = array( 'decorator1' ) |
|
| 193 | + * |
|
| 194 | + * This would remove the decorator named "decorator1" from the list of |
|
| 195 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 196 | + * "client/html/common/decorators/default" to the html client. |
|
| 197 | + * |
|
| 198 | + * @param array List of decorator names |
|
| 199 | + * @since 2015.08 |
|
| 200 | + * @category Developer |
|
| 201 | + * @see client/html/common/decorators/default |
|
| 202 | + * @see client/html/email/delivery/html/salutation/decorators/global |
|
| 203 | + * @see client/html/email/delivery/html/salutation/decorators/local |
|
| 204 | + */ |
|
| 205 | 205 | |
| 206 | - /** client/html/email/delivery/html/salutation/decorators/global |
|
| 207 | - * Adds a list of globally available decorators only to the email delivery html salutation html client |
|
| 208 | - * |
|
| 209 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 210 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 211 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 212 | - * modify what is returned to the caller. |
|
| 213 | - * |
|
| 214 | - * This option allows you to wrap global decorators |
|
| 215 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 216 | - * |
|
| 217 | - * client/html/email/delivery/html/salutation/decorators/global = array( 'decorator1' ) |
|
| 218 | - * |
|
| 219 | - * This would add the decorator named "decorator1" defined by |
|
| 220 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 221 | - * |
|
| 222 | - * @param array List of decorator names |
|
| 223 | - * @since 2015.08 |
|
| 224 | - * @category Developer |
|
| 225 | - * @see client/html/common/decorators/default |
|
| 226 | - * @see client/html/email/delivery/html/salutation/decorators/excludes |
|
| 227 | - * @see client/html/email/delivery/html/salutation/decorators/local |
|
| 228 | - */ |
|
| 206 | + /** client/html/email/delivery/html/salutation/decorators/global |
|
| 207 | + * Adds a list of globally available decorators only to the email delivery html salutation html client |
|
| 208 | + * |
|
| 209 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 210 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 211 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 212 | + * modify what is returned to the caller. |
|
| 213 | + * |
|
| 214 | + * This option allows you to wrap global decorators |
|
| 215 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 216 | + * |
|
| 217 | + * client/html/email/delivery/html/salutation/decorators/global = array( 'decorator1' ) |
|
| 218 | + * |
|
| 219 | + * This would add the decorator named "decorator1" defined by |
|
| 220 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 221 | + * |
|
| 222 | + * @param array List of decorator names |
|
| 223 | + * @since 2015.08 |
|
| 224 | + * @category Developer |
|
| 225 | + * @see client/html/common/decorators/default |
|
| 226 | + * @see client/html/email/delivery/html/salutation/decorators/excludes |
|
| 227 | + * @see client/html/email/delivery/html/salutation/decorators/local |
|
| 228 | + */ |
|
| 229 | 229 | |
| 230 | - /** client/html/email/delivery/html/salutation/decorators/local |
|
| 231 | - * Adds a list of local decorators only to the email delivery html salutation html client |
|
| 232 | - * |
|
| 233 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 234 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 235 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 236 | - * modify what is returned to the caller. |
|
| 237 | - * |
|
| 238 | - * This option allows you to wrap local decorators |
|
| 239 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 240 | - * |
|
| 241 | - * client/html/email/delivery/html/salutation/decorators/local = array( 'decorator2' ) |
|
| 242 | - * |
|
| 243 | - * This would add the decorator named "decorator2" defined by |
|
| 244 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 245 | - * |
|
| 246 | - * @param array List of decorator names |
|
| 247 | - * @since 2015.08 |
|
| 248 | - * @category Developer |
|
| 249 | - * @see client/html/common/decorators/default |
|
| 250 | - * @see client/html/email/delivery/html/salutation/decorators/excludes |
|
| 251 | - * @see client/html/email/delivery/html/salutation/decorators/global |
|
| 252 | - */ |
|
| 230 | + /** client/html/email/delivery/html/salutation/decorators/local |
|
| 231 | + * Adds a list of local decorators only to the email delivery html salutation html client |
|
| 232 | + * |
|
| 233 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 234 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 235 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 236 | + * modify what is returned to the caller. |
|
| 237 | + * |
|
| 238 | + * This option allows you to wrap local decorators |
|
| 239 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 240 | + * |
|
| 241 | + * client/html/email/delivery/html/salutation/decorators/local = array( 'decorator2' ) |
|
| 242 | + * |
|
| 243 | + * This would add the decorator named "decorator2" defined by |
|
| 244 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 245 | + * |
|
| 246 | + * @param array List of decorator names |
|
| 247 | + * @since 2015.08 |
|
| 248 | + * @category Developer |
|
| 249 | + * @see client/html/common/decorators/default |
|
| 250 | + * @see client/html/email/delivery/html/salutation/decorators/excludes |
|
| 251 | + * @see client/html/email/delivery/html/salutation/decorators/global |
|
| 252 | + */ |
|
| 253 | 253 | |
| 254 | - return $this->createSubClient( 'email/delivery/html/salutation/' . $type, $name ); |
|
| 255 | - } |
|
| 254 | + return $this->createSubClient( 'email/delivery/html/salutation/' . $type, $name ); |
|
| 255 | + } |
|
| 256 | 256 | |
| 257 | 257 | |
| 258 | - /** |
|
| 259 | - * Returns the list of sub-client names configured for the client. |
|
| 260 | - * |
|
| 261 | - * @return array List of HTML client names |
|
| 262 | - */ |
|
| 263 | - protected function getSubClientNames() |
|
| 264 | - { |
|
| 265 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 266 | - } |
|
| 258 | + /** |
|
| 259 | + * Returns the list of sub-client names configured for the client. |
|
| 260 | + * |
|
| 261 | + * @return array List of HTML client names |
|
| 262 | + */ |
|
| 263 | + protected function getSubClientNames() |
|
| 264 | + { |
|
| 265 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 266 | + } |
|
| 267 | 267 | } |
| 268 | 268 | \ No newline at end of file |
@@ -19,249 +19,249 @@ |
||
| 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/email/delivery/html/legal/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email delivery html legal 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/email/delivery/html/legal/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 25 | + /** client/html/email/delivery/html/legal/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email delivery html legal 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/email/delivery/html/legal/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 | - $content = ''; |
|
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | - } |
|
| 78 | - $view->legalBody = $content; |
|
| 74 | + $content = ''; |
|
| 75 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | + } |
|
| 78 | + $view->legalBody = $content; |
|
| 79 | 79 | |
| 80 | - /** client/html/email/delivery/html/legal/standard/template-body |
|
| 81 | - * Relative path to the HTML body template of the email delivery html legal client. |
|
| 82 | - * |
|
| 83 | - * The template file contains the HTML code and processing instructions |
|
| 84 | - * to generate the result shown in the body of the e-mail. 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 | - * The legal part of the email delivery html client allows to use |
|
| 96 | - * a different template for each delivery status value. You can create a |
|
| 97 | - * template for each delivery status and store it in the "email/delivery/<status number>/" |
|
| 98 | - * directory below the "templates" directory (usually in client/html/templates). |
|
| 99 | - * If no specific layout template is found, the common template in the |
|
| 100 | - * "email/delivery/" directory is used. |
|
| 101 | - * |
|
| 102 | - * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | - * @since 2014.03 |
|
| 104 | - * @category Developer |
|
| 105 | - * @see client/html/email/delivery/html/legal/standard/template-header |
|
| 106 | - */ |
|
| 107 | - $tplconf = 'client/html/email/delivery/html/legal/standard/template-body'; |
|
| 80 | + /** client/html/email/delivery/html/legal/standard/template-body |
|
| 81 | + * Relative path to the HTML body template of the email delivery html legal client. |
|
| 82 | + * |
|
| 83 | + * The template file contains the HTML code and processing instructions |
|
| 84 | + * to generate the result shown in the body of the e-mail. 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 | + * The legal part of the email delivery html client allows to use |
|
| 96 | + * a different template for each delivery status value. You can create a |
|
| 97 | + * template for each delivery status and store it in the "email/delivery/<status number>/" |
|
| 98 | + * directory below the "templates" directory (usually in client/html/templates). |
|
| 99 | + * If no specific layout template is found, the common template in the |
|
| 100 | + * "email/delivery/" directory is used. |
|
| 101 | + * |
|
| 102 | + * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | + * @since 2014.03 |
|
| 104 | + * @category Developer |
|
| 105 | + * @see client/html/email/delivery/html/legal/standard/template-header |
|
| 106 | + */ |
|
| 107 | + $tplconf = 'client/html/email/delivery/html/legal/standard/template-body'; |
|
| 108 | 108 | |
| 109 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 110 | - $default = array( 'email/delivery/' . $status . '/html-legal-body-default.php', 'email/common/html-legal-body-default.php' ); |
|
| 109 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 110 | + $default = array( 'email/delivery/' . $status . '/html-legal-body-default.php', 'email/common/html-legal-body-default.php' ); |
|
| 111 | 111 | |
| 112 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 113 | - } |
|
| 112 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 113 | + } |
|
| 114 | 114 | |
| 115 | 115 | |
| 116 | - /** |
|
| 117 | - * Returns the HTML string for insertion into the header. |
|
| 118 | - * |
|
| 119 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 120 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 121 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 122 | - * @return string|null String including HTML tags for the header on error |
|
| 123 | - */ |
|
| 124 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 125 | - { |
|
| 126 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 116 | + /** |
|
| 117 | + * Returns the HTML string for insertion into the header. |
|
| 118 | + * |
|
| 119 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 120 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 121 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 122 | + * @return string|null String including HTML tags for the header on error |
|
| 123 | + */ |
|
| 124 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 125 | + { |
|
| 126 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 127 | 127 | |
| 128 | - $content = ''; |
|
| 129 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 130 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 131 | - } |
|
| 132 | - $view->legalHeader = $content; |
|
| 128 | + $content = ''; |
|
| 129 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 130 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 131 | + } |
|
| 132 | + $view->legalHeader = $content; |
|
| 133 | 133 | |
| 134 | - /** client/html/email/delivery/html/legal/standard/template-header |
|
| 135 | - * Relative path to the HTML header template of the email delivery html legal client. |
|
| 136 | - * |
|
| 137 | - * The template file contains the HTML code and processing instructions |
|
| 138 | - * to generate the HTML code that is inserted into the header |
|
| 139 | - * of the e-mail. The configuration string is the |
|
| 140 | - * path to the template file relative to the templates directory (usually |
|
| 141 | - * in client/html/templates). |
|
| 142 | - * |
|
| 143 | - * You can overwrite the template file configuration in extensions and |
|
| 144 | - * provide alternative templates. These alternative templates should be |
|
| 145 | - * named like the default one but with the string "standard" replaced by |
|
| 146 | - * an unique name. You may use the name of your project for this. If |
|
| 147 | - * you've implemented an alternative client class as well, "standard" |
|
| 148 | - * should be replaced by the name of the new class. |
|
| 149 | - * |
|
| 150 | - * The email payment HTML client allows to use a different template for |
|
| 151 | - * each payment status value. You can create a template for each payment |
|
| 152 | - * status and store it in the "email/payment/<status number>/" directory |
|
| 153 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 154 | - * specific layout template is found, the common template in the |
|
| 155 | - * "email/payment/" directory is used. |
|
| 156 | - * |
|
| 157 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 158 | - * @since 2014.03 |
|
| 159 | - * @category Developer |
|
| 160 | - * @see client/html/email/delivery/html/legal/standard/template-body |
|
| 161 | - */ |
|
| 162 | - $tplconf = 'client/html/email/delivery/html/legal/standard/template-header'; |
|
| 134 | + /** client/html/email/delivery/html/legal/standard/template-header |
|
| 135 | + * Relative path to the HTML header template of the email delivery html legal client. |
|
| 136 | + * |
|
| 137 | + * The template file contains the HTML code and processing instructions |
|
| 138 | + * to generate the HTML code that is inserted into the header |
|
| 139 | + * of the e-mail. The configuration string is the |
|
| 140 | + * path to the template file relative to the templates directory (usually |
|
| 141 | + * in client/html/templates). |
|
| 142 | + * |
|
| 143 | + * You can overwrite the template file configuration in extensions and |
|
| 144 | + * provide alternative templates. These alternative templates should be |
|
| 145 | + * named like the default one but with the string "standard" replaced by |
|
| 146 | + * an unique name. You may use the name of your project for this. If |
|
| 147 | + * you've implemented an alternative client class as well, "standard" |
|
| 148 | + * should be replaced by the name of the new class. |
|
| 149 | + * |
|
| 150 | + * The email payment HTML client allows to use a different template for |
|
| 151 | + * each payment status value. You can create a template for each payment |
|
| 152 | + * status and store it in the "email/payment/<status number>/" directory |
|
| 153 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 154 | + * specific layout template is found, the common template in the |
|
| 155 | + * "email/payment/" directory is used. |
|
| 156 | + * |
|
| 157 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 158 | + * @since 2014.03 |
|
| 159 | + * @category Developer |
|
| 160 | + * @see client/html/email/delivery/html/legal/standard/template-body |
|
| 161 | + */ |
|
| 162 | + $tplconf = 'client/html/email/delivery/html/legal/standard/template-header'; |
|
| 163 | 163 | |
| 164 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 165 | - $default = array( 'email/delivery/' . $status . '/html-legal-header-default.php', 'email/common/html-legal-header-default.php' ); |
|
| 164 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 165 | + $default = array( 'email/delivery/' . $status . '/html-legal-header-default.php', 'email/common/html-legal-header-default.php' ); |
|
| 166 | 166 | |
| 167 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | - } |
|
| 167 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | + } |
|
| 169 | 169 | |
| 170 | 170 | |
| 171 | - /** |
|
| 172 | - * Returns the sub-client given by its name. |
|
| 173 | - * |
|
| 174 | - * @param string $type Name of the client type |
|
| 175 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 176 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 177 | - */ |
|
| 178 | - public function getSubClient( $type, $name = null ) |
|
| 179 | - { |
|
| 180 | - /** client/html/email/delivery/html/legal/decorators/excludes |
|
| 181 | - * Excludes decorators added by the "common" option from the email delivery html legal html client |
|
| 182 | - * |
|
| 183 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 184 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 185 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 186 | - * modify what is returned to the caller. |
|
| 187 | - * |
|
| 188 | - * This option allows you to remove a decorator added via |
|
| 189 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 190 | - * around the html client. |
|
| 191 | - * |
|
| 192 | - * client/html/email/delivery/html/legal/decorators/excludes = array( 'decorator1' ) |
|
| 193 | - * |
|
| 194 | - * This would remove the decorator named "decorator1" from the list of |
|
| 195 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 196 | - * "client/html/common/decorators/default" to the html client. |
|
| 197 | - * |
|
| 198 | - * @param array List of decorator names |
|
| 199 | - * @since 2015.08 |
|
| 200 | - * @category Developer |
|
| 201 | - * @see client/html/common/decorators/default |
|
| 202 | - * @see client/html/email/delivery/html/legal/decorators/global |
|
| 203 | - * @see client/html/email/delivery/html/legal/decorators/local |
|
| 204 | - */ |
|
| 171 | + /** |
|
| 172 | + * Returns the sub-client given by its name. |
|
| 173 | + * |
|
| 174 | + * @param string $type Name of the client type |
|
| 175 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 176 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 177 | + */ |
|
| 178 | + public function getSubClient( $type, $name = null ) |
|
| 179 | + { |
|
| 180 | + /** client/html/email/delivery/html/legal/decorators/excludes |
|
| 181 | + * Excludes decorators added by the "common" option from the email delivery html legal html client |
|
| 182 | + * |
|
| 183 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 184 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 185 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 186 | + * modify what is returned to the caller. |
|
| 187 | + * |
|
| 188 | + * This option allows you to remove a decorator added via |
|
| 189 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 190 | + * around the html client. |
|
| 191 | + * |
|
| 192 | + * client/html/email/delivery/html/legal/decorators/excludes = array( 'decorator1' ) |
|
| 193 | + * |
|
| 194 | + * This would remove the decorator named "decorator1" from the list of |
|
| 195 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 196 | + * "client/html/common/decorators/default" to the html client. |
|
| 197 | + * |
|
| 198 | + * @param array List of decorator names |
|
| 199 | + * @since 2015.08 |
|
| 200 | + * @category Developer |
|
| 201 | + * @see client/html/common/decorators/default |
|
| 202 | + * @see client/html/email/delivery/html/legal/decorators/global |
|
| 203 | + * @see client/html/email/delivery/html/legal/decorators/local |
|
| 204 | + */ |
|
| 205 | 205 | |
| 206 | - /** client/html/email/delivery/html/legal/decorators/global |
|
| 207 | - * Adds a list of globally available decorators only to the email delivery html legal html client |
|
| 208 | - * |
|
| 209 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 210 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 211 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 212 | - * modify what is returned to the caller. |
|
| 213 | - * |
|
| 214 | - * This option allows you to wrap global decorators |
|
| 215 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 216 | - * |
|
| 217 | - * client/html/email/delivery/html/legal/decorators/global = array( 'decorator1' ) |
|
| 218 | - * |
|
| 219 | - * This would add the decorator named "decorator1" defined by |
|
| 220 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 221 | - * |
|
| 222 | - * @param array List of decorator names |
|
| 223 | - * @since 2015.08 |
|
| 224 | - * @category Developer |
|
| 225 | - * @see client/html/common/decorators/default |
|
| 226 | - * @see client/html/email/delivery/html/legal/decorators/excludes |
|
| 227 | - * @see client/html/email/delivery/html/legal/decorators/local |
|
| 228 | - */ |
|
| 206 | + /** client/html/email/delivery/html/legal/decorators/global |
|
| 207 | + * Adds a list of globally available decorators only to the email delivery html legal html client |
|
| 208 | + * |
|
| 209 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 210 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 211 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 212 | + * modify what is returned to the caller. |
|
| 213 | + * |
|
| 214 | + * This option allows you to wrap global decorators |
|
| 215 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 216 | + * |
|
| 217 | + * client/html/email/delivery/html/legal/decorators/global = array( 'decorator1' ) |
|
| 218 | + * |
|
| 219 | + * This would add the decorator named "decorator1" defined by |
|
| 220 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 221 | + * |
|
| 222 | + * @param array List of decorator names |
|
| 223 | + * @since 2015.08 |
|
| 224 | + * @category Developer |
|
| 225 | + * @see client/html/common/decorators/default |
|
| 226 | + * @see client/html/email/delivery/html/legal/decorators/excludes |
|
| 227 | + * @see client/html/email/delivery/html/legal/decorators/local |
|
| 228 | + */ |
|
| 229 | 229 | |
| 230 | - /** client/html/email/delivery/html/legal/decorators/local |
|
| 231 | - * Adds a list of local decorators only to the email delivery html legal html client |
|
| 232 | - * |
|
| 233 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 234 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 235 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 236 | - * modify what is returned to the caller. |
|
| 237 | - * |
|
| 238 | - * This option allows you to wrap local decorators |
|
| 239 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 240 | - * |
|
| 241 | - * client/html/email/delivery/html/legal/decorators/local = array( 'decorator2' ) |
|
| 242 | - * |
|
| 243 | - * This would add the decorator named "decorator2" defined by |
|
| 244 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 245 | - * |
|
| 246 | - * @param array List of decorator names |
|
| 247 | - * @since 2015.08 |
|
| 248 | - * @category Developer |
|
| 249 | - * @see client/html/common/decorators/default |
|
| 250 | - * @see client/html/email/delivery/html/legal/decorators/excludes |
|
| 251 | - * @see client/html/email/delivery/html/legal/decorators/global |
|
| 252 | - */ |
|
| 230 | + /** client/html/email/delivery/html/legal/decorators/local |
|
| 231 | + * Adds a list of local decorators only to the email delivery html legal html client |
|
| 232 | + * |
|
| 233 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 234 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 235 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 236 | + * modify what is returned to the caller. |
|
| 237 | + * |
|
| 238 | + * This option allows you to wrap local decorators |
|
| 239 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 240 | + * |
|
| 241 | + * client/html/email/delivery/html/legal/decorators/local = array( 'decorator2' ) |
|
| 242 | + * |
|
| 243 | + * This would add the decorator named "decorator2" defined by |
|
| 244 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 245 | + * |
|
| 246 | + * @param array List of decorator names |
|
| 247 | + * @since 2015.08 |
|
| 248 | + * @category Developer |
|
| 249 | + * @see client/html/common/decorators/default |
|
| 250 | + * @see client/html/email/delivery/html/legal/decorators/excludes |
|
| 251 | + * @see client/html/email/delivery/html/legal/decorators/global |
|
| 252 | + */ |
|
| 253 | 253 | |
| 254 | - return $this->createSubClient( 'email/delivery/html/legal/' . $type, $name ); |
|
| 255 | - } |
|
| 254 | + return $this->createSubClient( 'email/delivery/html/legal/' . $type, $name ); |
|
| 255 | + } |
|
| 256 | 256 | |
| 257 | 257 | |
| 258 | - /** |
|
| 259 | - * Returns the list of sub-client names configured for the client. |
|
| 260 | - * |
|
| 261 | - * @return array List of HTML client names |
|
| 262 | - */ |
|
| 263 | - protected function getSubClientNames() |
|
| 264 | - { |
|
| 265 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 266 | - } |
|
| 258 | + /** |
|
| 259 | + * Returns the list of sub-client names configured for the client. |
|
| 260 | + * |
|
| 261 | + * @return array List of HTML client names |
|
| 262 | + */ |
|
| 263 | + protected function getSubClientNames() |
|
| 264 | + { |
|
| 265 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 266 | + } |
|
| 267 | 267 | } |
| 268 | 268 | \ No newline at end of file |
@@ -19,249 +19,249 @@ |
||
| 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/email/delivery/html/intro/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email delivery html intro 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/email/delivery/html/intro/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 25 | + /** client/html/email/delivery/html/intro/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email delivery html intro 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/email/delivery/html/intro/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 | - $content = ''; |
|
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | - } |
|
| 78 | - $view->introBody = $content; |
|
| 74 | + $content = ''; |
|
| 75 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | + } |
|
| 78 | + $view->introBody = $content; |
|
| 79 | 79 | |
| 80 | - /** client/html/email/delivery/html/intro/standard/template-body |
|
| 81 | - * Relative path to the HTML body template of the email delivery html introduction client. |
|
| 82 | - * |
|
| 83 | - * The template file contains the HTML code and processing instructions |
|
| 84 | - * to generate the result shown in the body of the e-mail. 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 | - * The introduction part of the email delivery html client allows to use |
|
| 96 | - * a different template for each delivery status value. You can create a |
|
| 97 | - * template for each delivery status and store it in the "email/delivery/<status number>/" |
|
| 98 | - * directory below the "templates" directory (usually in client/html/templates). |
|
| 99 | - * If no specific layout template is found, the common template in the |
|
| 100 | - * "email/delivery/" directory is used. |
|
| 101 | - * |
|
| 102 | - * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | - * @since 2014.03 |
|
| 104 | - * @category Developer |
|
| 105 | - * @see client/html/email/delivery/html/intro/standard/template-header |
|
| 106 | - */ |
|
| 107 | - $tplconf = 'client/html/email/delivery/html/intro/standard/template-body'; |
|
| 80 | + /** client/html/email/delivery/html/intro/standard/template-body |
|
| 81 | + * Relative path to the HTML body template of the email delivery html introduction client. |
|
| 82 | + * |
|
| 83 | + * The template file contains the HTML code and processing instructions |
|
| 84 | + * to generate the result shown in the body of the e-mail. 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 | + * The introduction part of the email delivery html client allows to use |
|
| 96 | + * a different template for each delivery status value. You can create a |
|
| 97 | + * template for each delivery status and store it in the "email/delivery/<status number>/" |
|
| 98 | + * directory below the "templates" directory (usually in client/html/templates). |
|
| 99 | + * If no specific layout template is found, the common template in the |
|
| 100 | + * "email/delivery/" directory is used. |
|
| 101 | + * |
|
| 102 | + * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | + * @since 2014.03 |
|
| 104 | + * @category Developer |
|
| 105 | + * @see client/html/email/delivery/html/intro/standard/template-header |
|
| 106 | + */ |
|
| 107 | + $tplconf = 'client/html/email/delivery/html/intro/standard/template-body'; |
|
| 108 | 108 | |
| 109 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 110 | - $default = array( 'email/delivery/' . $status . '/html-intro-body-default.php', 'email/delivery/html-intro-body-default.php' ); |
|
| 109 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 110 | + $default = array( 'email/delivery/' . $status . '/html-intro-body-default.php', 'email/delivery/html-intro-body-default.php' ); |
|
| 111 | 111 | |
| 112 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 113 | - } |
|
| 112 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 113 | + } |
|
| 114 | 114 | |
| 115 | 115 | |
| 116 | - /** |
|
| 117 | - * Returns the HTML string for insertion into the header. |
|
| 118 | - * |
|
| 119 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 120 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 121 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 122 | - * @return string|null String including HTML tags for the header on error |
|
| 123 | - */ |
|
| 124 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 125 | - { |
|
| 126 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 116 | + /** |
|
| 117 | + * Returns the HTML string for insertion into the header. |
|
| 118 | + * |
|
| 119 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 120 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 121 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 122 | + * @return string|null String including HTML tags for the header on error |
|
| 123 | + */ |
|
| 124 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 125 | + { |
|
| 126 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 127 | 127 | |
| 128 | - $content = ''; |
|
| 129 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 130 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 131 | - } |
|
| 132 | - $view->introHeader = $content; |
|
| 128 | + $content = ''; |
|
| 129 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 130 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 131 | + } |
|
| 132 | + $view->introHeader = $content; |
|
| 133 | 133 | |
| 134 | - /** client/html/email/delivery/html/intro/standard/template-header |
|
| 135 | - * Relative path to the HTML header template of the email delivery html introduction client. |
|
| 136 | - * |
|
| 137 | - * The template file contains the HTML code and processing instructions |
|
| 138 | - * to generate the HTML code that is inserted into the header |
|
| 139 | - * of the e-mail. The configuration string is the |
|
| 140 | - * path to the template file relative to the templates directory (usually |
|
| 141 | - * in client/html/templates). |
|
| 142 | - * |
|
| 143 | - * You can overwrite the template file configuration in extensions and |
|
| 144 | - * provide alternative templates. These alternative templates should be |
|
| 145 | - * named like the default one but with the string "standard" replaced by |
|
| 146 | - * an unique name. You may use the name of your project for this. If |
|
| 147 | - * you've implemented an alternative client class as well, "standard" |
|
| 148 | - * should be replaced by the name of the new class. |
|
| 149 | - * |
|
| 150 | - * The email delivery HTML client allows to use a different template for |
|
| 151 | - * each delivery status value. You can create a template for each delivery |
|
| 152 | - * status and store it in the "email/delivery/<status number>/" directory |
|
| 153 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 154 | - * specific layout template is found, the common template in the |
|
| 155 | - * "email/delivery/" directory is used. |
|
| 156 | - * |
|
| 157 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 158 | - * @since 2014.03 |
|
| 159 | - * @category Developer |
|
| 160 | - * @see client/html/email/delivery/html/intro/standard/template-body |
|
| 161 | - */ |
|
| 162 | - $tplconf = 'client/html/email/delivery/html/intro/standard/template-header'; |
|
| 134 | + /** client/html/email/delivery/html/intro/standard/template-header |
|
| 135 | + * Relative path to the HTML header template of the email delivery html introduction client. |
|
| 136 | + * |
|
| 137 | + * The template file contains the HTML code and processing instructions |
|
| 138 | + * to generate the HTML code that is inserted into the header |
|
| 139 | + * of the e-mail. The configuration string is the |
|
| 140 | + * path to the template file relative to the templates directory (usually |
|
| 141 | + * in client/html/templates). |
|
| 142 | + * |
|
| 143 | + * You can overwrite the template file configuration in extensions and |
|
| 144 | + * provide alternative templates. These alternative templates should be |
|
| 145 | + * named like the default one but with the string "standard" replaced by |
|
| 146 | + * an unique name. You may use the name of your project for this. If |
|
| 147 | + * you've implemented an alternative client class as well, "standard" |
|
| 148 | + * should be replaced by the name of the new class. |
|
| 149 | + * |
|
| 150 | + * The email delivery HTML client allows to use a different template for |
|
| 151 | + * each delivery status value. You can create a template for each delivery |
|
| 152 | + * status and store it in the "email/delivery/<status number>/" directory |
|
| 153 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 154 | + * specific layout template is found, the common template in the |
|
| 155 | + * "email/delivery/" directory is used. |
|
| 156 | + * |
|
| 157 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 158 | + * @since 2014.03 |
|
| 159 | + * @category Developer |
|
| 160 | + * @see client/html/email/delivery/html/intro/standard/template-body |
|
| 161 | + */ |
|
| 162 | + $tplconf = 'client/html/email/delivery/html/intro/standard/template-header'; |
|
| 163 | 163 | |
| 164 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 165 | - $default = array( 'email/delivery/' . $status . '/html-intro-header-default.php', 'email/delivery/html-intro-header-default.php' ); |
|
| 164 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 165 | + $default = array( 'email/delivery/' . $status . '/html-intro-header-default.php', 'email/delivery/html-intro-header-default.php' ); |
|
| 166 | 166 | |
| 167 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | - } |
|
| 167 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | + } |
|
| 169 | 169 | |
| 170 | 170 | |
| 171 | - /** |
|
| 172 | - * Returns the sub-client given by its name. |
|
| 173 | - * |
|
| 174 | - * @param string $type Name of the client type |
|
| 175 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 176 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 177 | - */ |
|
| 178 | - public function getSubClient( $type, $name = null ) |
|
| 179 | - { |
|
| 180 | - /** client/html/email/delivery/html/intro/decorators/excludes |
|
| 181 | - * Excludes decorators added by the "common" option from the email delivery html intro html client |
|
| 182 | - * |
|
| 183 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 184 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 185 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 186 | - * modify what is returned to the caller. |
|
| 187 | - * |
|
| 188 | - * This option allows you to remove a decorator added via |
|
| 189 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 190 | - * around the html client. |
|
| 191 | - * |
|
| 192 | - * client/html/email/delivery/html/intro/decorators/excludes = array( 'decorator1' ) |
|
| 193 | - * |
|
| 194 | - * This would remove the decorator named "decorator1" from the list of |
|
| 195 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 196 | - * "client/html/common/decorators/default" to the html client. |
|
| 197 | - * |
|
| 198 | - * @param array List of decorator names |
|
| 199 | - * @since 2015.08 |
|
| 200 | - * @category Developer |
|
| 201 | - * @see client/html/common/decorators/default |
|
| 202 | - * @see client/html/email/delivery/html/intro/decorators/global |
|
| 203 | - * @see client/html/email/delivery/html/intro/decorators/local |
|
| 204 | - */ |
|
| 171 | + /** |
|
| 172 | + * Returns the sub-client given by its name. |
|
| 173 | + * |
|
| 174 | + * @param string $type Name of the client type |
|
| 175 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 176 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 177 | + */ |
|
| 178 | + public function getSubClient( $type, $name = null ) |
|
| 179 | + { |
|
| 180 | + /** client/html/email/delivery/html/intro/decorators/excludes |
|
| 181 | + * Excludes decorators added by the "common" option from the email delivery html intro html client |
|
| 182 | + * |
|
| 183 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 184 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 185 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 186 | + * modify what is returned to the caller. |
|
| 187 | + * |
|
| 188 | + * This option allows you to remove a decorator added via |
|
| 189 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 190 | + * around the html client. |
|
| 191 | + * |
|
| 192 | + * client/html/email/delivery/html/intro/decorators/excludes = array( 'decorator1' ) |
|
| 193 | + * |
|
| 194 | + * This would remove the decorator named "decorator1" from the list of |
|
| 195 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 196 | + * "client/html/common/decorators/default" to the html client. |
|
| 197 | + * |
|
| 198 | + * @param array List of decorator names |
|
| 199 | + * @since 2015.08 |
|
| 200 | + * @category Developer |
|
| 201 | + * @see client/html/common/decorators/default |
|
| 202 | + * @see client/html/email/delivery/html/intro/decorators/global |
|
| 203 | + * @see client/html/email/delivery/html/intro/decorators/local |
|
| 204 | + */ |
|
| 205 | 205 | |
| 206 | - /** client/html/email/delivery/html/intro/decorators/global |
|
| 207 | - * Adds a list of globally available decorators only to the email delivery html intro html client |
|
| 208 | - * |
|
| 209 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 210 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 211 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 212 | - * modify what is returned to the caller. |
|
| 213 | - * |
|
| 214 | - * This option allows you to wrap global decorators |
|
| 215 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 216 | - * |
|
| 217 | - * client/html/email/delivery/html/intro/decorators/global = array( 'decorator1' ) |
|
| 218 | - * |
|
| 219 | - * This would add the decorator named "decorator1" defined by |
|
| 220 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 221 | - * |
|
| 222 | - * @param array List of decorator names |
|
| 223 | - * @since 2015.08 |
|
| 224 | - * @category Developer |
|
| 225 | - * @see client/html/common/decorators/default |
|
| 226 | - * @see client/html/email/delivery/html/intro/decorators/excludes |
|
| 227 | - * @see client/html/email/delivery/html/intro/decorators/local |
|
| 228 | - */ |
|
| 206 | + /** client/html/email/delivery/html/intro/decorators/global |
|
| 207 | + * Adds a list of globally available decorators only to the email delivery html intro html client |
|
| 208 | + * |
|
| 209 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 210 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 211 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 212 | + * modify what is returned to the caller. |
|
| 213 | + * |
|
| 214 | + * This option allows you to wrap global decorators |
|
| 215 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 216 | + * |
|
| 217 | + * client/html/email/delivery/html/intro/decorators/global = array( 'decorator1' ) |
|
| 218 | + * |
|
| 219 | + * This would add the decorator named "decorator1" defined by |
|
| 220 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 221 | + * |
|
| 222 | + * @param array List of decorator names |
|
| 223 | + * @since 2015.08 |
|
| 224 | + * @category Developer |
|
| 225 | + * @see client/html/common/decorators/default |
|
| 226 | + * @see client/html/email/delivery/html/intro/decorators/excludes |
|
| 227 | + * @see client/html/email/delivery/html/intro/decorators/local |
|
| 228 | + */ |
|
| 229 | 229 | |
| 230 | - /** client/html/email/delivery/html/intro/decorators/local |
|
| 231 | - * Adds a list of local decorators only to the email delivery html intro html client |
|
| 232 | - * |
|
| 233 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 234 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 235 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 236 | - * modify what is returned to the caller. |
|
| 237 | - * |
|
| 238 | - * This option allows you to wrap local decorators |
|
| 239 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 240 | - * |
|
| 241 | - * client/html/email/delivery/html/intro/decorators/local = array( 'decorator2' ) |
|
| 242 | - * |
|
| 243 | - * This would add the decorator named "decorator2" defined by |
|
| 244 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 245 | - * |
|
| 246 | - * @param array List of decorator names |
|
| 247 | - * @since 2015.08 |
|
| 248 | - * @category Developer |
|
| 249 | - * @see client/html/common/decorators/default |
|
| 250 | - * @see client/html/email/delivery/html/intro/decorators/excludes |
|
| 251 | - * @see client/html/email/delivery/html/intro/decorators/global |
|
| 252 | - */ |
|
| 230 | + /** client/html/email/delivery/html/intro/decorators/local |
|
| 231 | + * Adds a list of local decorators only to the email delivery html intro html client |
|
| 232 | + * |
|
| 233 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 234 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 235 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 236 | + * modify what is returned to the caller. |
|
| 237 | + * |
|
| 238 | + * This option allows you to wrap local decorators |
|
| 239 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 240 | + * |
|
| 241 | + * client/html/email/delivery/html/intro/decorators/local = array( 'decorator2' ) |
|
| 242 | + * |
|
| 243 | + * This would add the decorator named "decorator2" defined by |
|
| 244 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 245 | + * |
|
| 246 | + * @param array List of decorator names |
|
| 247 | + * @since 2015.08 |
|
| 248 | + * @category Developer |
|
| 249 | + * @see client/html/common/decorators/default |
|
| 250 | + * @see client/html/email/delivery/html/intro/decorators/excludes |
|
| 251 | + * @see client/html/email/delivery/html/intro/decorators/global |
|
| 252 | + */ |
|
| 253 | 253 | |
| 254 | - return $this->createSubClient( 'email/delivery/html/intro/' . $type, $name ); |
|
| 255 | - } |
|
| 254 | + return $this->createSubClient( 'email/delivery/html/intro/' . $type, $name ); |
|
| 255 | + } |
|
| 256 | 256 | |
| 257 | 257 | |
| 258 | - /** |
|
| 259 | - * Returns the list of sub-client names configured for the client. |
|
| 260 | - * |
|
| 261 | - * @return array List of HTML client names |
|
| 262 | - */ |
|
| 263 | - protected function getSubClientNames() |
|
| 264 | - { |
|
| 265 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 266 | - } |
|
| 258 | + /** |
|
| 259 | + * Returns the list of sub-client names configured for the client. |
|
| 260 | + * |
|
| 261 | + * @return array List of HTML client names |
|
| 262 | + */ |
|
| 263 | + protected function getSubClientNames() |
|
| 264 | + { |
|
| 265 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 266 | + } |
|
| 267 | 267 | } |
| 268 | 268 | \ No newline at end of file |
@@ -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 delivery email 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/email/delivery/name |
|
| 37 | - * Class name of the used email delivery 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\Email\Delivery\Standard |
|
| 47 | - * |
|
| 48 | - * and you want to replace it with your own version named |
|
| 49 | - * |
|
| 50 | - * \Aimeos\Client\Html\Email\Delivery\Mydelivery |
|
| 51 | - * |
|
| 52 | - * then you have to set the this configuration option: |
|
| 53 | - * |
|
| 54 | - * client/html/email/delivery/name = Mydelivery |
|
| 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 "MyDelivery"! |
|
| 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/email/delivery/name', 'Standard' ); |
|
| 71 | - } |
|
| 25 | + /** |
|
| 26 | + * Creates a delivery email 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/email/delivery/name |
|
| 37 | + * Class name of the used email delivery 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\Email\Delivery\Standard |
|
| 47 | + * |
|
| 48 | + * and you want to replace it with your own version named |
|
| 49 | + * |
|
| 50 | + * \Aimeos\Client\Html\Email\Delivery\Mydelivery |
|
| 51 | + * |
|
| 52 | + * then you have to set the this configuration option: |
|
| 53 | + * |
|
| 54 | + * client/html/email/delivery/name = Mydelivery |
|
| 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 "MyDelivery"! |
|
| 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/email/delivery/name', 'Standard' ); |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - if( ctype_alnum( $name ) === false ) |
|
| 74 | - { |
|
| 75 | - $classname = is_string( $name ) ? '\\Aimeos\\Client\\Html\\Email\\Delivery\\' . $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\\Email\\Delivery\\' . $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\\Email\\Delivery\\' . $name; |
|
| 79 | + $iface = '\\Aimeos\\Client\\Html\\Iface'; |
|
| 80 | + $classname = '\\Aimeos\\Client\\Html\\Email\\Delivery\\' . $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, 'email/delivery' ); |
|
| 85 | - } |
|
| 84 | + return self::addClientDecorators( $context, $client, $templatePaths, 'email/delivery' ); |
|
| 85 | + } |
|
| 86 | 86 | } |
| 87 | 87 | |