@@ -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/payment/text/legal/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email payment text 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/payment/text/legal/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 25 | + /** client/html/email/payment/text/legal/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email payment text 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/payment/text/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/payment/text/legal/standard/template-body |
|
| 81 | - * Relative path to the text body template of the email payment text legal client. |
|
| 82 | - * |
|
| 83 | - * The template file contains the text 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 email payment text client allows to use a different template for |
|
| 96 | - * each payment status value. You can create a template for each payment |
|
| 97 | - * status and store it in the "email/payment/<status number>/" directory |
|
| 98 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 99 | - * specific layout template is found, the common template in the |
|
| 100 | - * "email/payment/" directory is used. |
|
| 101 | - * |
|
| 102 | - * @param string Relative path to the template creating code for the e-mail body |
|
| 103 | - * @since 2014.03 |
|
| 104 | - * @category Developer |
|
| 105 | - * @see client/html/email/payment/text/legal/standard/template-header |
|
| 106 | - */ |
|
| 107 | - $tplconf = 'client/html/email/payment/text/legal/standard/template-body'; |
|
| 80 | + /** client/html/email/payment/text/legal/standard/template-body |
|
| 81 | + * Relative path to the text body template of the email payment text legal client. |
|
| 82 | + * |
|
| 83 | + * The template file contains the text 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 email payment text client allows to use a different template for |
|
| 96 | + * each payment status value. You can create a template for each payment |
|
| 97 | + * status and store it in the "email/payment/<status number>/" directory |
|
| 98 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 99 | + * specific layout template is found, the common template in the |
|
| 100 | + * "email/payment/" directory is used. |
|
| 101 | + * |
|
| 102 | + * @param string Relative path to the template creating code for the e-mail body |
|
| 103 | + * @since 2014.03 |
|
| 104 | + * @category Developer |
|
| 105 | + * @see client/html/email/payment/text/legal/standard/template-header |
|
| 106 | + */ |
|
| 107 | + $tplconf = 'client/html/email/payment/text/legal/standard/template-body'; |
|
| 108 | 108 | |
| 109 | - $status = $view->extOrderItem->getPaymentStatus(); |
|
| 110 | - $default = array( 'email/payment/' . $status . '/text-legal-body-default.php', 'email/common/text-legal-body-default.php' ); |
|
| 109 | + $status = $view->extOrderItem->getPaymentStatus(); |
|
| 110 | + $default = array( 'email/payment/' . $status . '/text-legal-body-default.php', 'email/common/text-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/payment/text/legal/standard/template-header |
|
| 135 | - * Relative path to the text header template of the email payment text legal client. |
|
| 136 | - * |
|
| 137 | - * The template file contains the text and processing instructions |
|
| 138 | - * to generate the text 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 text 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/payment/text/legal/standard/template-body |
|
| 161 | - */ |
|
| 162 | - $tplconf = 'client/html/email/payment/text/legal/standard/template-header'; |
|
| 134 | + /** client/html/email/payment/text/legal/standard/template-header |
|
| 135 | + * Relative path to the text header template of the email payment text legal client. |
|
| 136 | + * |
|
| 137 | + * The template file contains the text and processing instructions |
|
| 138 | + * to generate the text 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 text 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/payment/text/legal/standard/template-body |
|
| 161 | + */ |
|
| 162 | + $tplconf = 'client/html/email/payment/text/legal/standard/template-header'; |
|
| 163 | 163 | |
| 164 | - $status = $view->extOrderItem->getPaymentStatus(); |
|
| 165 | - $default = array( 'email/payment/' . $status . '/text-legal-header-default.php', 'email/common/text-legal-header-default.php' ); |
|
| 164 | + $status = $view->extOrderItem->getPaymentStatus(); |
|
| 165 | + $default = array( 'email/payment/' . $status . '/text-legal-header-default.php', 'email/common/text-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/payment/text/legal/decorators/excludes |
|
| 181 | - * Excludes decorators added by the "common" option from the "email payment text 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/payment/text/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/payment/text/legal/decorators/global |
|
| 203 | - * @see client/html/email/payment/text/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/payment/text/legal/decorators/excludes |
|
| 181 | + * Excludes decorators added by the "common" option from the "email payment text 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/payment/text/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/payment/text/legal/decorators/global |
|
| 203 | + * @see client/html/email/payment/text/legal/decorators/local |
|
| 204 | + */ |
|
| 205 | 205 | |
| 206 | - /** client/html/email/payment/text/legal/decorators/global |
|
| 207 | - * Adds a list of globally available decorators only to the "email payment text 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/payment/text/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/payment/text/legal/decorators/excludes |
|
| 227 | - * @see client/html/email/payment/text/legal/decorators/local |
|
| 228 | - */ |
|
| 206 | + /** client/html/email/payment/text/legal/decorators/global |
|
| 207 | + * Adds a list of globally available decorators only to the "email payment text 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/payment/text/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/payment/text/legal/decorators/excludes |
|
| 227 | + * @see client/html/email/payment/text/legal/decorators/local |
|
| 228 | + */ |
|
| 229 | 229 | |
| 230 | - /** client/html/email/payment/text/legal/decorators/local |
|
| 231 | - * Adds a list of local decorators only to the "email payment text 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/payment/text/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/payment/text/legal/decorators/excludes |
|
| 251 | - * @see client/html/email/payment/text/legal/decorators/global |
|
| 252 | - */ |
|
| 230 | + /** client/html/email/payment/text/legal/decorators/local |
|
| 231 | + * Adds a list of local decorators only to the "email payment text 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/payment/text/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/payment/text/legal/decorators/excludes |
|
| 251 | + * @see client/html/email/payment/text/legal/decorators/global |
|
| 252 | + */ |
|
| 253 | 253 | |
| 254 | - return $this->createSubClient( 'email/payment/text/legal/' . $type, $name ); |
|
| 255 | - } |
|
| 254 | + return $this->createSubClient( 'email/payment/text/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/payment/text/intro/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email payment text introduction 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/payment/text/intro/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 25 | + /** client/html/email/payment/text/intro/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email payment text introduction 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/payment/text/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/payment/text/intro/standard/template-body |
|
| 81 | - * Relative path to the text body template of the email payment text introduction client. |
|
| 82 | - * |
|
| 83 | - * The template file contains the text 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 email payment text client allows to use a different template for |
|
| 96 | - * each payment status value. You can create a template for each payment |
|
| 97 | - * status and store it in the "email/payment/<status number>/" directory |
|
| 98 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 99 | - * specific layout template is found, the common template in the |
|
| 100 | - * "email/payment/" directory is used. |
|
| 101 | - * |
|
| 102 | - * @param string Relative path to the template creating code for the e-mail body |
|
| 103 | - * @since 2014.03 |
|
| 104 | - * @category Developer |
|
| 105 | - * @see client/html/email/payment/text/intro/standard/template-header |
|
| 106 | - */ |
|
| 107 | - $tplconf = 'client/html/email/payment/text/intro/standard/template-body'; |
|
| 80 | + /** client/html/email/payment/text/intro/standard/template-body |
|
| 81 | + * Relative path to the text body template of the email payment text introduction client. |
|
| 82 | + * |
|
| 83 | + * The template file contains the text 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 email payment text client allows to use a different template for |
|
| 96 | + * each payment status value. You can create a template for each payment |
|
| 97 | + * status and store it in the "email/payment/<status number>/" directory |
|
| 98 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 99 | + * specific layout template is found, the common template in the |
|
| 100 | + * "email/payment/" directory is used. |
|
| 101 | + * |
|
| 102 | + * @param string Relative path to the template creating code for the e-mail body |
|
| 103 | + * @since 2014.03 |
|
| 104 | + * @category Developer |
|
| 105 | + * @see client/html/email/payment/text/intro/standard/template-header |
|
| 106 | + */ |
|
| 107 | + $tplconf = 'client/html/email/payment/text/intro/standard/template-body'; |
|
| 108 | 108 | |
| 109 | - $status = $view->extOrderItem->getPaymentStatus(); |
|
| 110 | - $default = array( 'email/payment/' . $status . '/text-intro-body-default.php', 'email/payment/text-intro-body-default.php' ); |
|
| 109 | + $status = $view->extOrderItem->getPaymentStatus(); |
|
| 110 | + $default = array( 'email/payment/' . $status . '/text-intro-body-default.php', 'email/payment/text-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/payment/text/intro/standard/template-header |
|
| 135 | - * Relative path to the text header template of the email payment text introduction client. |
|
| 136 | - * |
|
| 137 | - * The template file contains the text and processing instructions |
|
| 138 | - * to generate the text 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 text 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/payment/text/intro/standard/template-body |
|
| 161 | - */ |
|
| 162 | - $tplconf = 'client/html/email/payment/text/intro/standard/template-header'; |
|
| 134 | + /** client/html/email/payment/text/intro/standard/template-header |
|
| 135 | + * Relative path to the text header template of the email payment text introduction client. |
|
| 136 | + * |
|
| 137 | + * The template file contains the text and processing instructions |
|
| 138 | + * to generate the text 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 text 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/payment/text/intro/standard/template-body |
|
| 161 | + */ |
|
| 162 | + $tplconf = 'client/html/email/payment/text/intro/standard/template-header'; |
|
| 163 | 163 | |
| 164 | - $status = $view->extOrderItem->getPaymentStatus(); |
|
| 165 | - $default = array( 'email/payment/' . $status . '/text-intro-header-default.php', 'email/payment/text-intro-header-default.php' ); |
|
| 164 | + $status = $view->extOrderItem->getPaymentStatus(); |
|
| 165 | + $default = array( 'email/payment/' . $status . '/text-intro-header-default.php', 'email/payment/text-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/payment/text/intro/decorators/excludes |
|
| 181 | - * Excludes decorators added by the "common" option from the "email payment text 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/payment/text/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/payment/text/intro/decorators/global |
|
| 203 | - * @see client/html/email/payment/text/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/payment/text/intro/decorators/excludes |
|
| 181 | + * Excludes decorators added by the "common" option from the "email payment text 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/payment/text/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/payment/text/intro/decorators/global |
|
| 203 | + * @see client/html/email/payment/text/intro/decorators/local |
|
| 204 | + */ |
|
| 205 | 205 | |
| 206 | - /** client/html/email/payment/text/intro/decorators/global |
|
| 207 | - * Adds a list of globally available decorators only to the "email payment text 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/payment/text/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/payment/text/intro/decorators/excludes |
|
| 227 | - * @see client/html/email/payment/text/intro/decorators/local |
|
| 228 | - */ |
|
| 206 | + /** client/html/email/payment/text/intro/decorators/global |
|
| 207 | + * Adds a list of globally available decorators only to the "email payment text 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/payment/text/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/payment/text/intro/decorators/excludes |
|
| 227 | + * @see client/html/email/payment/text/intro/decorators/local |
|
| 228 | + */ |
|
| 229 | 229 | |
| 230 | - /** client/html/email/payment/text/intro/decorators/local |
|
| 231 | - * Adds a list of local decorators only to the "email payment text 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/payment/text/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/payment/text/intro/decorators/excludes |
|
| 251 | - * @see client/html/email/payment/text/intro/decorators/global |
|
| 252 | - */ |
|
| 230 | + /** client/html/email/payment/text/intro/decorators/local |
|
| 231 | + * Adds a list of local decorators only to the "email payment text 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/payment/text/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/payment/text/intro/decorators/excludes |
|
| 251 | + * @see client/html/email/payment/text/intro/decorators/global |
|
| 252 | + */ |
|
| 253 | 253 | |
| 254 | - return $this->createSubClient( 'email/payment/text/intro/' . $type, $name ); |
|
| 255 | - } |
|
| 254 | + return $this->createSubClient( 'email/payment/text/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,243 +19,243 @@ |
||
| 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/watch/html/detail/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the product notifiction e-mail html detailduction 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/watch/html/detail/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 25 | + /** client/html/email/watch/html/detail/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the product notifiction e-mail html detailduction 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/watch/html/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 | - $content = ''; |
|
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | - } |
|
| 78 | - $view->detailBody = $content; |
|
| 74 | + $content = ''; |
|
| 75 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | + } |
|
| 78 | + $view->detailBody = $content; |
|
| 79 | 79 | |
| 80 | - /** client/html/email/watch/html/detail/standard/template-body |
|
| 81 | - * Relative path to the HTML body template of the product notifiction e-mail html detailduction 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 product notifiction e-mail html client allows to use a different template for |
|
| 96 | - * each watch status value. You can create a template for each watch |
|
| 97 | - * status and store it in the "email/watch/<status number>/" directory |
|
| 98 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 99 | - * specific layout template is found, the common template in the |
|
| 100 | - * "email/watch/" directory is used. |
|
| 101 | - * |
|
| 102 | - * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | - * @since 2014.09 |
|
| 104 | - * @category Developer |
|
| 105 | - * @see client/html/email/watch/html/detail/standard/template-header |
|
| 106 | - */ |
|
| 107 | - $tplconf = 'client/html/email/watch/html/detail/standard/template-body'; |
|
| 80 | + /** client/html/email/watch/html/detail/standard/template-body |
|
| 81 | + * Relative path to the HTML body template of the product notifiction e-mail html detailduction 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 product notifiction e-mail html client allows to use a different template for |
|
| 96 | + * each watch status value. You can create a template for each watch |
|
| 97 | + * status and store it in the "email/watch/<status number>/" directory |
|
| 98 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 99 | + * specific layout template is found, the common template in the |
|
| 100 | + * "email/watch/" directory is used. |
|
| 101 | + * |
|
| 102 | + * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | + * @since 2014.09 |
|
| 104 | + * @category Developer |
|
| 105 | + * @see client/html/email/watch/html/detail/standard/template-header |
|
| 106 | + */ |
|
| 107 | + $tplconf = 'client/html/email/watch/html/detail/standard/template-body'; |
|
| 108 | 108 | |
| 109 | - return $view->render( $view->config( $tplconf, 'email/watch/html-detail-body-default.php' ) ); |
|
| 110 | - } |
|
| 109 | + return $view->render( $view->config( $tplconf, 'email/watch/html-detail-body-default.php' ) ); |
|
| 110 | + } |
|
| 111 | 111 | |
| 112 | 112 | |
| 113 | - /** |
|
| 114 | - * Returns the HTML string for insertion into the header. |
|
| 115 | - * |
|
| 116 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 117 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 118 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 119 | - * @return string|null String including HTML tags for the header on error |
|
| 120 | - */ |
|
| 121 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 122 | - { |
|
| 123 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 113 | + /** |
|
| 114 | + * Returns the HTML string for insertion into the header. |
|
| 115 | + * |
|
| 116 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 117 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 118 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 119 | + * @return string|null String including HTML tags for the header on error |
|
| 120 | + */ |
|
| 121 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 122 | + { |
|
| 123 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 124 | 124 | |
| 125 | - $content = ''; |
|
| 126 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 127 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 128 | - } |
|
| 129 | - $view->detailHeader = $content; |
|
| 125 | + $content = ''; |
|
| 126 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 127 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 128 | + } |
|
| 129 | + $view->detailHeader = $content; |
|
| 130 | 130 | |
| 131 | - /** client/html/email/watch/html/detail/standard/template-header |
|
| 132 | - * Relative path to the HTML header template of the product notifiction e-mail html detailduction client. |
|
| 133 | - * |
|
| 134 | - * The template file contains the HTML code and processing instructions |
|
| 135 | - * to generate the HTML code that is inserted into the header |
|
| 136 | - * of the e-mail. The configuration string is the |
|
| 137 | - * path to the template file relative to the templates directory (usually |
|
| 138 | - * in client/html/templates). |
|
| 139 | - * |
|
| 140 | - * You can overwrite the template file configuration in extensions and |
|
| 141 | - * provide alternative templates. These alternative templates should be |
|
| 142 | - * named like the default one but with the string "standard" replaced by |
|
| 143 | - * an unique name. You may use the name of your project for this. If |
|
| 144 | - * you've implemented an alternative client class as well, "standard" |
|
| 145 | - * should be replaced by the name of the new class. |
|
| 146 | - * |
|
| 147 | - * The product notifiction e-mail HTML client allows to use a different template for |
|
| 148 | - * each watch status value. You can create a template for each watch |
|
| 149 | - * status and store it in the "email/watch/<status number>/" directory |
|
| 150 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 151 | - * specific layout template is found, the common template in the |
|
| 152 | - * "email/watch/" directory is used. |
|
| 153 | - * |
|
| 154 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 155 | - * @since 2014.09 |
|
| 156 | - * @category Developer |
|
| 157 | - * @see client/html/email/watch/html/detail/standard/template-body |
|
| 158 | - */ |
|
| 159 | - $tplconf = 'client/html/email/watch/html/detail/standard/template-header'; |
|
| 131 | + /** client/html/email/watch/html/detail/standard/template-header |
|
| 132 | + * Relative path to the HTML header template of the product notifiction e-mail html detailduction client. |
|
| 133 | + * |
|
| 134 | + * The template file contains the HTML code and processing instructions |
|
| 135 | + * to generate the HTML code that is inserted into the header |
|
| 136 | + * of the e-mail. The configuration string is the |
|
| 137 | + * path to the template file relative to the templates directory (usually |
|
| 138 | + * in client/html/templates). |
|
| 139 | + * |
|
| 140 | + * You can overwrite the template file configuration in extensions and |
|
| 141 | + * provide alternative templates. These alternative templates should be |
|
| 142 | + * named like the default one but with the string "standard" replaced by |
|
| 143 | + * an unique name. You may use the name of your project for this. If |
|
| 144 | + * you've implemented an alternative client class as well, "standard" |
|
| 145 | + * should be replaced by the name of the new class. |
|
| 146 | + * |
|
| 147 | + * The product notifiction e-mail HTML client allows to use a different template for |
|
| 148 | + * each watch status value. You can create a template for each watch |
|
| 149 | + * status and store it in the "email/watch/<status number>/" directory |
|
| 150 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 151 | + * specific layout template is found, the common template in the |
|
| 152 | + * "email/watch/" directory is used. |
|
| 153 | + * |
|
| 154 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 155 | + * @since 2014.09 |
|
| 156 | + * @category Developer |
|
| 157 | + * @see client/html/email/watch/html/detail/standard/template-body |
|
| 158 | + */ |
|
| 159 | + $tplconf = 'client/html/email/watch/html/detail/standard/template-header'; |
|
| 160 | 160 | |
| 161 | - return $view->render( $view->config( $tplconf, 'email/watch/html-detail-header-default.php' ) ); |
|
| 162 | - } |
|
| 161 | + return $view->render( $view->config( $tplconf, 'email/watch/html-detail-header-default.php' ) ); |
|
| 162 | + } |
|
| 163 | 163 | |
| 164 | 164 | |
| 165 | - /** |
|
| 166 | - * Returns the sub-client given by its name. |
|
| 167 | - * |
|
| 168 | - * @param string $type Name of the client type |
|
| 169 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 170 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 171 | - */ |
|
| 172 | - public function getSubClient( $type, $name = null ) |
|
| 173 | - { |
|
| 174 | - /** client/html/email/watch/html/detail/decorators/excludes |
|
| 175 | - * Excludes decorators added by the "common" option from the email watch html detail html client |
|
| 176 | - * |
|
| 177 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 178 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 179 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 180 | - * modify what is returned to the caller. |
|
| 181 | - * |
|
| 182 | - * This option allows you to remove a decorator added via |
|
| 183 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 184 | - * around the html client. |
|
| 185 | - * |
|
| 186 | - * client/html/email/watch/html/detail/decorators/excludes = array( 'decorator1' ) |
|
| 187 | - * |
|
| 188 | - * This would remove the decorator named "decorator1" from the list of |
|
| 189 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 190 | - * "client/html/common/decorators/default" to the html client. |
|
| 191 | - * |
|
| 192 | - * @param array List of decorator names |
|
| 193 | - * @since 2015.08 |
|
| 194 | - * @category Developer |
|
| 195 | - * @see client/html/common/decorators/default |
|
| 196 | - * @see client/html/email/watch/html/detail/decorators/global |
|
| 197 | - * @see client/html/email/watch/html/detail/decorators/local |
|
| 198 | - */ |
|
| 165 | + /** |
|
| 166 | + * Returns the sub-client given by its name. |
|
| 167 | + * |
|
| 168 | + * @param string $type Name of the client type |
|
| 169 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 170 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 171 | + */ |
|
| 172 | + public function getSubClient( $type, $name = null ) |
|
| 173 | + { |
|
| 174 | + /** client/html/email/watch/html/detail/decorators/excludes |
|
| 175 | + * Excludes decorators added by the "common" option from the email watch html detail html client |
|
| 176 | + * |
|
| 177 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 178 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 179 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 180 | + * modify what is returned to the caller. |
|
| 181 | + * |
|
| 182 | + * This option allows you to remove a decorator added via |
|
| 183 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 184 | + * around the html client. |
|
| 185 | + * |
|
| 186 | + * client/html/email/watch/html/detail/decorators/excludes = array( 'decorator1' ) |
|
| 187 | + * |
|
| 188 | + * This would remove the decorator named "decorator1" from the list of |
|
| 189 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 190 | + * "client/html/common/decorators/default" to the html client. |
|
| 191 | + * |
|
| 192 | + * @param array List of decorator names |
|
| 193 | + * @since 2015.08 |
|
| 194 | + * @category Developer |
|
| 195 | + * @see client/html/common/decorators/default |
|
| 196 | + * @see client/html/email/watch/html/detail/decorators/global |
|
| 197 | + * @see client/html/email/watch/html/detail/decorators/local |
|
| 198 | + */ |
|
| 199 | 199 | |
| 200 | - /** client/html/email/watch/html/detail/decorators/global |
|
| 201 | - * Adds a list of globally available decorators only to the email watch html detail html client |
|
| 202 | - * |
|
| 203 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 204 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 205 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 206 | - * modify what is returned to the caller. |
|
| 207 | - * |
|
| 208 | - * This option allows you to wrap global decorators |
|
| 209 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 210 | - * |
|
| 211 | - * client/html/email/watch/html/detail/decorators/global = array( 'decorator1' ) |
|
| 212 | - * |
|
| 213 | - * This would add the decorator named "decorator1" defined by |
|
| 214 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 215 | - * |
|
| 216 | - * @param array List of decorator names |
|
| 217 | - * @since 2015.08 |
|
| 218 | - * @category Developer |
|
| 219 | - * @see client/html/common/decorators/default |
|
| 220 | - * @see client/html/email/watch/html/detail/decorators/excludes |
|
| 221 | - * @see client/html/email/watch/html/detail/decorators/local |
|
| 222 | - */ |
|
| 200 | + /** client/html/email/watch/html/detail/decorators/global |
|
| 201 | + * Adds a list of globally available decorators only to the email watch html detail html client |
|
| 202 | + * |
|
| 203 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 204 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 205 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 206 | + * modify what is returned to the caller. |
|
| 207 | + * |
|
| 208 | + * This option allows you to wrap global decorators |
|
| 209 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 210 | + * |
|
| 211 | + * client/html/email/watch/html/detail/decorators/global = array( 'decorator1' ) |
|
| 212 | + * |
|
| 213 | + * This would add the decorator named "decorator1" defined by |
|
| 214 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 215 | + * |
|
| 216 | + * @param array List of decorator names |
|
| 217 | + * @since 2015.08 |
|
| 218 | + * @category Developer |
|
| 219 | + * @see client/html/common/decorators/default |
|
| 220 | + * @see client/html/email/watch/html/detail/decorators/excludes |
|
| 221 | + * @see client/html/email/watch/html/detail/decorators/local |
|
| 222 | + */ |
|
| 223 | 223 | |
| 224 | - /** client/html/email/watch/html/detail/decorators/local |
|
| 225 | - * Adds a list of local decorators only to the email watch html detail html client |
|
| 226 | - * |
|
| 227 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 228 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 229 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 230 | - * modify what is returned to the caller. |
|
| 231 | - * |
|
| 232 | - * This option allows you to wrap local decorators |
|
| 233 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 234 | - * |
|
| 235 | - * client/html/email/watch/html/detail/decorators/local = array( 'decorator2' ) |
|
| 236 | - * |
|
| 237 | - * This would add the decorator named "decorator2" defined by |
|
| 238 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 239 | - * |
|
| 240 | - * @param array List of decorator names |
|
| 241 | - * @since 2015.08 |
|
| 242 | - * @category Developer |
|
| 243 | - * @see client/html/common/decorators/default |
|
| 244 | - * @see client/html/email/watch/html/detail/decorators/excludes |
|
| 245 | - * @see client/html/email/watch/html/detail/decorators/global |
|
| 246 | - */ |
|
| 224 | + /** client/html/email/watch/html/detail/decorators/local |
|
| 225 | + * Adds a list of local decorators only to the email watch html detail html client |
|
| 226 | + * |
|
| 227 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 228 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 229 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 230 | + * modify what is returned to the caller. |
|
| 231 | + * |
|
| 232 | + * This option allows you to wrap local decorators |
|
| 233 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 234 | + * |
|
| 235 | + * client/html/email/watch/html/detail/decorators/local = array( 'decorator2' ) |
|
| 236 | + * |
|
| 237 | + * This would add the decorator named "decorator2" defined by |
|
| 238 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 239 | + * |
|
| 240 | + * @param array List of decorator names |
|
| 241 | + * @since 2015.08 |
|
| 242 | + * @category Developer |
|
| 243 | + * @see client/html/common/decorators/default |
|
| 244 | + * @see client/html/email/watch/html/detail/decorators/excludes |
|
| 245 | + * @see client/html/email/watch/html/detail/decorators/global |
|
| 246 | + */ |
|
| 247 | 247 | |
| 248 | - return $this->createSubClient( 'email/watch/html/detail/' . $type, $name ); |
|
| 249 | - } |
|
| 248 | + return $this->createSubClient( 'email/watch/html/detail/' . $type, $name ); |
|
| 249 | + } |
|
| 250 | 250 | |
| 251 | 251 | |
| 252 | - /** |
|
| 253 | - * Returns the list of sub-client names configured for the client. |
|
| 254 | - * |
|
| 255 | - * @return array List of HTML client names |
|
| 256 | - */ |
|
| 257 | - protected function getSubClientNames() |
|
| 258 | - { |
|
| 259 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 260 | - } |
|
| 252 | + /** |
|
| 253 | + * Returns the list of sub-client names configured for the client. |
|
| 254 | + * |
|
| 255 | + * @return array List of HTML client names |
|
| 256 | + */ |
|
| 257 | + protected function getSubClientNames() |
|
| 258 | + { |
|
| 259 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 260 | + } |
|
| 261 | 261 | } |
| 262 | 262 | \ No newline at end of file |
@@ -19,300 +19,300 @@ |
||
| 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/watch/html/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the product notification e-mail 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.09 |
|
| 56 | - * @category Developer |
|
| 57 | - */ |
|
| 58 | - private $subPartPath = 'client/html/email/watch/html/standard/subparts'; |
|
| 25 | + /** client/html/email/watch/html/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the product notification e-mail 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.09 |
|
| 56 | + * @category Developer |
|
| 57 | + */ |
|
| 58 | + private $subPartPath = 'client/html/email/watch/html/standard/subparts'; |
|
| 59 | 59 | |
| 60 | - /** client/html/email/watch/html/salutation/name |
|
| 61 | - * Name of the salutation part used by the product notification e-mail html client implementation |
|
| 62 | - * |
|
| 63 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Watch\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.09 |
|
| 68 | - * @category Developer |
|
| 69 | - */ |
|
| 60 | + /** client/html/email/watch/html/salutation/name |
|
| 61 | + * Name of the salutation part used by the product notification e-mail html client implementation |
|
| 62 | + * |
|
| 63 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Watch\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.09 |
|
| 68 | + * @category Developer |
|
| 69 | + */ |
|
| 70 | 70 | |
| 71 | - /** client/html/email/watch/html/intro/name |
|
| 72 | - * Name of the introduction part used by the product notification e-mail html client implementation |
|
| 73 | - * |
|
| 74 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Watch\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.09 |
|
| 79 | - * @category Developer |
|
| 80 | - */ |
|
| 71 | + /** client/html/email/watch/html/intro/name |
|
| 72 | + * Name of the introduction part used by the product notification e-mail html client implementation |
|
| 73 | + * |
|
| 74 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Watch\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.09 |
|
| 79 | + * @category Developer |
|
| 80 | + */ |
|
| 81 | 81 | |
| 82 | - /** client/html/email/watch/html/detail/name |
|
| 83 | - * Name of the summary part used by the product notification e-mail html client implementation |
|
| 84 | - * |
|
| 85 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Watch\Html\Detail\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.09 |
|
| 90 | - * @category Developer |
|
| 91 | - */ |
|
| 82 | + /** client/html/email/watch/html/detail/name |
|
| 83 | + * Name of the summary part used by the product notification e-mail html client implementation |
|
| 84 | + * |
|
| 85 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Watch\Html\Detail\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.09 |
|
| 90 | + * @category Developer |
|
| 91 | + */ |
|
| 92 | 92 | |
| 93 | - /** client/html/email/watch/html/outro/name |
|
| 94 | - * Name of the footer part used by the product notification e-mail html client implementation |
|
| 95 | - * |
|
| 96 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Watch\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.09 |
|
| 101 | - * @category Developer |
|
| 102 | - */ |
|
| 93 | + /** client/html/email/watch/html/outro/name |
|
| 94 | + * Name of the footer part used by the product notification e-mail html client implementation |
|
| 95 | + * |
|
| 96 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Watch\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.09 |
|
| 101 | + * @category Developer |
|
| 102 | + */ |
|
| 103 | 103 | |
| 104 | - /** client/html/email/watch/html/legal/name |
|
| 105 | - * Name of the legal part used by the product notification e-mail html client implementation |
|
| 106 | - * |
|
| 107 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Watch\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.09 |
|
| 112 | - * @category Developer |
|
| 113 | - */ |
|
| 114 | - private $subPartNames = array( 'salutation', 'intro', 'detail', 'outro' ); |
|
| 104 | + /** client/html/email/watch/html/legal/name |
|
| 105 | + * Name of the legal part used by the product notification e-mail html client implementation |
|
| 106 | + * |
|
| 107 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Watch\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.09 |
|
| 112 | + * @category Developer |
|
| 113 | + */ |
|
| 114 | + private $subPartNames = array( 'salutation', 'intro', 'detail', 'outro' ); |
|
| 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/watch/html/standard/template-body |
|
| 136 | - * Relative path to the HTML body template of the product notification e-mail 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 product notification e-mail html client allows to use a different template for |
|
| 151 | - * each watch status value. You can create a template for each watch |
|
| 152 | - * status and store it in the "email/watch/<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/watch/" directory is used. |
|
| 156 | - * |
|
| 157 | - * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 158 | - * @since 2014.09 |
|
| 159 | - * @category Developer |
|
| 160 | - * @see client/html/email/watch/html/standard/template-header |
|
| 161 | - */ |
|
| 162 | - $tplconf = 'client/html/email/watch/html/standard/template-body'; |
|
| 135 | + /** client/html/email/watch/html/standard/template-body |
|
| 136 | + * Relative path to the HTML body template of the product notification e-mail 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 product notification e-mail html client allows to use a different template for |
|
| 151 | + * each watch status value. You can create a template for each watch |
|
| 152 | + * status and store it in the "email/watch/<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/watch/" directory is used. |
|
| 156 | + * |
|
| 157 | + * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 158 | + * @since 2014.09 |
|
| 159 | + * @category Developer |
|
| 160 | + * @see client/html/email/watch/html/standard/template-header |
|
| 161 | + */ |
|
| 162 | + $tplconf = 'client/html/email/watch/html/standard/template-body'; |
|
| 163 | 163 | |
| 164 | - $html = $view->render( $view->config( $tplconf, 'email/common/html-body-default.php' ) ); |
|
| 165 | - $view->mail()->setBodyHtml( $html ); |
|
| 166 | - return $html; |
|
| 167 | - } |
|
| 164 | + $html = $view->render( $view->config( $tplconf, 'email/common/html-body-default.php' ) ); |
|
| 165 | + $view->mail()->setBodyHtml( $html ); |
|
| 166 | + return $html; |
|
| 167 | + } |
|
| 168 | 168 | |
| 169 | 169 | |
| 170 | - /** |
|
| 171 | - * Returns the HTML string for insertion into the header. |
|
| 172 | - * |
|
| 173 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 174 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 175 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 176 | - * @return string|null String including HTML tags for the header on error |
|
| 177 | - */ |
|
| 178 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 179 | - { |
|
| 180 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 170 | + /** |
|
| 171 | + * Returns the HTML string for insertion into the header. |
|
| 172 | + * |
|
| 173 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 174 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 175 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 176 | + * @return string|null String including HTML tags for the header on error |
|
| 177 | + */ |
|
| 178 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 179 | + { |
|
| 180 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 181 | 181 | |
| 182 | - $content = ''; |
|
| 183 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 184 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 185 | - } |
|
| 186 | - $view->htmlHeader = $content; |
|
| 182 | + $content = ''; |
|
| 183 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 184 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 185 | + } |
|
| 186 | + $view->htmlHeader = $content; |
|
| 187 | 187 | |
| 188 | - /** client/html/email/watch/html/standard/template-header |
|
| 189 | - * Relative path to the HTML header template of the product notification e-mail html client. |
|
| 190 | - * |
|
| 191 | - * The template file contains the HTML code and processing instructions |
|
| 192 | - * to generate the HTML code that is inserted into the header |
|
| 193 | - * of the e-mail. The configuration string is the |
|
| 194 | - * path to the template file relative to the templates directory (usually |
|
| 195 | - * in client/html/templates). |
|
| 196 | - * |
|
| 197 | - * You can overwrite the template file configuration in extensions and |
|
| 198 | - * provide alternative templates. These alternative templates should be |
|
| 199 | - * named like the default one but with the string "standard" replaced by |
|
| 200 | - * an unique name. You may use the name of your project for this. If |
|
| 201 | - * you've implemented an alternative client class as well, "standard" |
|
| 202 | - * should be replaced by the name of the new class. |
|
| 203 | - * |
|
| 204 | - * The product notification e-mail HTML client allows to use a different template for |
|
| 205 | - * each watch status value. You can create a template for each watch |
|
| 206 | - * status and store it in the "email/watch/<status number>/" directory |
|
| 207 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 208 | - * specific layout template is found, the common template in the |
|
| 209 | - * "email/watch/" directory is used. |
|
| 210 | - * |
|
| 211 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 212 | - * @since 2014.09 |
|
| 213 | - * @category Developer |
|
| 214 | - * @see client/html/email/watch/html/standard/template-body |
|
| 215 | - */ |
|
| 216 | - $tplconf = 'client/html/email/watch/html/standard/template-header'; |
|
| 188 | + /** client/html/email/watch/html/standard/template-header |
|
| 189 | + * Relative path to the HTML header template of the product notification e-mail html client. |
|
| 190 | + * |
|
| 191 | + * The template file contains the HTML code and processing instructions |
|
| 192 | + * to generate the HTML code that is inserted into the header |
|
| 193 | + * of the e-mail. The configuration string is the |
|
| 194 | + * path to the template file relative to the templates directory (usually |
|
| 195 | + * in client/html/templates). |
|
| 196 | + * |
|
| 197 | + * You can overwrite the template file configuration in extensions and |
|
| 198 | + * provide alternative templates. These alternative templates should be |
|
| 199 | + * named like the default one but with the string "standard" replaced by |
|
| 200 | + * an unique name. You may use the name of your project for this. If |
|
| 201 | + * you've implemented an alternative client class as well, "standard" |
|
| 202 | + * should be replaced by the name of the new class. |
|
| 203 | + * |
|
| 204 | + * The product notification e-mail HTML client allows to use a different template for |
|
| 205 | + * each watch status value. You can create a template for each watch |
|
| 206 | + * status and store it in the "email/watch/<status number>/" directory |
|
| 207 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 208 | + * specific layout template is found, the common template in the |
|
| 209 | + * "email/watch/" directory is used. |
|
| 210 | + * |
|
| 211 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 212 | + * @since 2014.09 |
|
| 213 | + * @category Developer |
|
| 214 | + * @see client/html/email/watch/html/standard/template-body |
|
| 215 | + */ |
|
| 216 | + $tplconf = 'client/html/email/watch/html/standard/template-header'; |
|
| 217 | 217 | |
| 218 | - return $view->render( $view->config( $tplconf, 'email/common/html-header-default.php' ) ); |
|
| 219 | - } |
|
| 218 | + return $view->render( $view->config( $tplconf, 'email/common/html-header-default.php' ) ); |
|
| 219 | + } |
|
| 220 | 220 | |
| 221 | 221 | |
| 222 | - /** |
|
| 223 | - * Returns the sub-client given by its name. |
|
| 224 | - * |
|
| 225 | - * @param string $type Name of the client type |
|
| 226 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 227 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 228 | - */ |
|
| 229 | - public function getSubClient( $type, $name = null ) |
|
| 230 | - { |
|
| 231 | - /** client/html/email/watch/html/decorators/excludes |
|
| 232 | - * Excludes decorators added by the "common" option from the "email watch html" html client |
|
| 233 | - * |
|
| 234 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 235 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 236 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 237 | - * modify what is returned to the caller. |
|
| 238 | - * |
|
| 239 | - * This option allows you to remove a decorator added via |
|
| 240 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 241 | - * around the html client. |
|
| 242 | - * |
|
| 243 | - * client/html/email/watch/html/decorators/excludes = array( 'decorator1' ) |
|
| 244 | - * |
|
| 245 | - * This would remove the decorator named "decorator1" from the list of |
|
| 246 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 247 | - * "client/html/common/decorators/default" to the html client. |
|
| 248 | - * |
|
| 249 | - * @param array List of decorator names |
|
| 250 | - * @since 2015.08 |
|
| 251 | - * @category Developer |
|
| 252 | - * @see client/html/common/decorators/default |
|
| 253 | - * @see client/html/email/watch/html/decorators/global |
|
| 254 | - * @see client/html/email/watch/html/decorators/local |
|
| 255 | - */ |
|
| 222 | + /** |
|
| 223 | + * Returns the sub-client given by its name. |
|
| 224 | + * |
|
| 225 | + * @param string $type Name of the client type |
|
| 226 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 227 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 228 | + */ |
|
| 229 | + public function getSubClient( $type, $name = null ) |
|
| 230 | + { |
|
| 231 | + /** client/html/email/watch/html/decorators/excludes |
|
| 232 | + * Excludes decorators added by the "common" option from the "email watch html" html client |
|
| 233 | + * |
|
| 234 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 235 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 236 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 237 | + * modify what is returned to the caller. |
|
| 238 | + * |
|
| 239 | + * This option allows you to remove a decorator added via |
|
| 240 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 241 | + * around the html client. |
|
| 242 | + * |
|
| 243 | + * client/html/email/watch/html/decorators/excludes = array( 'decorator1' ) |
|
| 244 | + * |
|
| 245 | + * This would remove the decorator named "decorator1" from the list of |
|
| 246 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 247 | + * "client/html/common/decorators/default" to the html client. |
|
| 248 | + * |
|
| 249 | + * @param array List of decorator names |
|
| 250 | + * @since 2015.08 |
|
| 251 | + * @category Developer |
|
| 252 | + * @see client/html/common/decorators/default |
|
| 253 | + * @see client/html/email/watch/html/decorators/global |
|
| 254 | + * @see client/html/email/watch/html/decorators/local |
|
| 255 | + */ |
|
| 256 | 256 | |
| 257 | - /** client/html/email/watch/html/decorators/global |
|
| 258 | - * Adds a list of globally available decorators only to the "email watch html" html client |
|
| 259 | - * |
|
| 260 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 261 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 262 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 263 | - * modify what is returned to the caller. |
|
| 264 | - * |
|
| 265 | - * This option allows you to wrap global decorators |
|
| 266 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 267 | - * |
|
| 268 | - * client/html/email/watch/html/decorators/global = array( 'decorator1' ) |
|
| 269 | - * |
|
| 270 | - * This would add the decorator named "decorator1" defined by |
|
| 271 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 272 | - * |
|
| 273 | - * @param array List of decorator names |
|
| 274 | - * @since 2015.08 |
|
| 275 | - * @category Developer |
|
| 276 | - * @see client/html/common/decorators/default |
|
| 277 | - * @see client/html/email/watch/html/decorators/excludes |
|
| 278 | - * @see client/html/email/watch/html/decorators/local |
|
| 279 | - */ |
|
| 257 | + /** client/html/email/watch/html/decorators/global |
|
| 258 | + * Adds a list of globally available decorators only to the "email watch html" html client |
|
| 259 | + * |
|
| 260 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 261 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 262 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 263 | + * modify what is returned to the caller. |
|
| 264 | + * |
|
| 265 | + * This option allows you to wrap global decorators |
|
| 266 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 267 | + * |
|
| 268 | + * client/html/email/watch/html/decorators/global = array( 'decorator1' ) |
|
| 269 | + * |
|
| 270 | + * This would add the decorator named "decorator1" defined by |
|
| 271 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 272 | + * |
|
| 273 | + * @param array List of decorator names |
|
| 274 | + * @since 2015.08 |
|
| 275 | + * @category Developer |
|
| 276 | + * @see client/html/common/decorators/default |
|
| 277 | + * @see client/html/email/watch/html/decorators/excludes |
|
| 278 | + * @see client/html/email/watch/html/decorators/local |
|
| 279 | + */ |
|
| 280 | 280 | |
| 281 | - /** client/html/email/watch/html/decorators/local |
|
| 282 | - * Adds a list of local decorators only to the "email watch html" html client |
|
| 283 | - * |
|
| 284 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 285 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 286 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 287 | - * modify what is returned to the caller. |
|
| 288 | - * |
|
| 289 | - * This option allows you to wrap local decorators |
|
| 290 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 291 | - * |
|
| 292 | - * client/html/email/watch/html/decorators/local = array( 'decorator2' ) |
|
| 293 | - * |
|
| 294 | - * This would add the decorator named "decorator2" defined by |
|
| 295 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 296 | - * |
|
| 297 | - * @param array List of decorator names |
|
| 298 | - * @since 2015.08 |
|
| 299 | - * @category Developer |
|
| 300 | - * @see client/html/common/decorators/default |
|
| 301 | - * @see client/html/email/watch/html/decorators/excludes |
|
| 302 | - * @see client/html/email/watch/html/decorators/global |
|
| 303 | - */ |
|
| 281 | + /** client/html/email/watch/html/decorators/local |
|
| 282 | + * Adds a list of local decorators only to the "email watch html" html client |
|
| 283 | + * |
|
| 284 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 285 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 286 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 287 | + * modify what is returned to the caller. |
|
| 288 | + * |
|
| 289 | + * This option allows you to wrap local decorators |
|
| 290 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 291 | + * |
|
| 292 | + * client/html/email/watch/html/decorators/local = array( 'decorator2' ) |
|
| 293 | + * |
|
| 294 | + * This would add the decorator named "decorator2" defined by |
|
| 295 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 296 | + * |
|
| 297 | + * @param array List of decorator names |
|
| 298 | + * @since 2015.08 |
|
| 299 | + * @category Developer |
|
| 300 | + * @see client/html/common/decorators/default |
|
| 301 | + * @see client/html/email/watch/html/decorators/excludes |
|
| 302 | + * @see client/html/email/watch/html/decorators/global |
|
| 303 | + */ |
|
| 304 | 304 | |
| 305 | - return $this->createSubClient( 'email/watch/html/' . $type, $name ); |
|
| 306 | - } |
|
| 305 | + return $this->createSubClient( 'email/watch/html/' . $type, $name ); |
|
| 306 | + } |
|
| 307 | 307 | |
| 308 | 308 | |
| 309 | - /** |
|
| 310 | - * Returns the list of sub-client names configured for the client. |
|
| 311 | - * |
|
| 312 | - * @return array List of HTML client names |
|
| 313 | - */ |
|
| 314 | - protected function getSubClientNames() |
|
| 315 | - { |
|
| 316 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 317 | - } |
|
| 309 | + /** |
|
| 310 | + * Returns the list of sub-client names configured for the client. |
|
| 311 | + * |
|
| 312 | + * @return array List of HTML client names |
|
| 313 | + */ |
|
| 314 | + protected function getSubClientNames() |
|
| 315 | + { |
|
| 316 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 317 | + } |
|
| 318 | 318 | } |
| 319 | 319 | \ No newline at end of file |
@@ -19,243 +19,243 @@ |
||
| 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/watch/html/outro/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the product notification e-mail html footer 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.09 |
|
| 56 | - * @category Developer |
|
| 57 | - */ |
|
| 58 | - private $subPartPath = 'client/html/email/watch/html/outro/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 25 | + /** client/html/email/watch/html/outro/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the product notification e-mail html footer 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.09 |
|
| 56 | + * @category Developer |
|
| 57 | + */ |
|
| 58 | + private $subPartPath = 'client/html/email/watch/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/watch/html/outro/standard/template-body |
|
| 81 | - * Relative path to the HTML body template of the product notification e-mail 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 product notification e-mail html client allows to use a different template for |
|
| 96 | - * each watch status value. You can create a template for each watch |
|
| 97 | - * status and store it in the "email/watch/<status number>/" directory |
|
| 98 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 99 | - * specific layout template is found, the common template in the |
|
| 100 | - * "email/watch/" directory is used. |
|
| 101 | - * |
|
| 102 | - * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | - * @since 2014.09 |
|
| 104 | - * @category Developer |
|
| 105 | - * @see client/html/email/watch/html/outro/standard/template-header |
|
| 106 | - */ |
|
| 107 | - $tplconf = 'client/html/email/watch/html/outro/standard/template-body'; |
|
| 80 | + /** client/html/email/watch/html/outro/standard/template-body |
|
| 81 | + * Relative path to the HTML body template of the product notification e-mail 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 product notification e-mail html client allows to use a different template for |
|
| 96 | + * each watch status value. You can create a template for each watch |
|
| 97 | + * status and store it in the "email/watch/<status number>/" directory |
|
| 98 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 99 | + * specific layout template is found, the common template in the |
|
| 100 | + * "email/watch/" directory is used. |
|
| 101 | + * |
|
| 102 | + * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | + * @since 2014.09 |
|
| 104 | + * @category Developer |
|
| 105 | + * @see client/html/email/watch/html/outro/standard/template-header |
|
| 106 | + */ |
|
| 107 | + $tplconf = 'client/html/email/watch/html/outro/standard/template-body'; |
|
| 108 | 108 | |
| 109 | - return $view->render( $view->config( $tplconf, 'email/common/html-outro-body-default.php' ) ); |
|
| 110 | - } |
|
| 109 | + return $view->render( $view->config( $tplconf, 'email/common/html-outro-body-default.php' ) ); |
|
| 110 | + } |
|
| 111 | 111 | |
| 112 | 112 | |
| 113 | - /** |
|
| 114 | - * Returns the HTML string for insertion into the header. |
|
| 115 | - * |
|
| 116 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 117 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 118 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 119 | - * @return string|null String including HTML tags for the header on error |
|
| 120 | - */ |
|
| 121 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 122 | - { |
|
| 123 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 113 | + /** |
|
| 114 | + * Returns the HTML string for insertion into the header. |
|
| 115 | + * |
|
| 116 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 117 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 118 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 119 | + * @return string|null String including HTML tags for the header on error |
|
| 120 | + */ |
|
| 121 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 122 | + { |
|
| 123 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 124 | 124 | |
| 125 | - $content = ''; |
|
| 126 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 127 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 128 | - } |
|
| 129 | - $view->outroHeader = $content; |
|
| 125 | + $content = ''; |
|
| 126 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 127 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 128 | + } |
|
| 129 | + $view->outroHeader = $content; |
|
| 130 | 130 | |
| 131 | - /** client/html/email/watch/html/outro/standard/template-header |
|
| 132 | - * Relative path to the HTML header template of the product notification e-mail html footer client. |
|
| 133 | - * |
|
| 134 | - * The template file contains the HTML code and processing instructions |
|
| 135 | - * to generate the HTML code that is inserted into the header |
|
| 136 | - * of the e-mail. The configuration string is the |
|
| 137 | - * path to the template file relative to the templates directory (usually |
|
| 138 | - * in client/html/templates). |
|
| 139 | - * |
|
| 140 | - * You can overwrite the template file configuration in extensions and |
|
| 141 | - * provide alternative templates. These alternative templates should be |
|
| 142 | - * named like the default one but with the string "standard" replaced by |
|
| 143 | - * an unique name. You may use the name of your project for this. If |
|
| 144 | - * you've implemented an alternative client class as well, "standard" |
|
| 145 | - * should be replaced by the name of the new class. |
|
| 146 | - * |
|
| 147 | - * The product notification e-mail HTML client allows to use a different template for |
|
| 148 | - * each watch status value. You can create a template for each watch |
|
| 149 | - * status and store it in the "email/watch/<status number>/" directory |
|
| 150 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 151 | - * specific layout template is found, the common template in the |
|
| 152 | - * "email/watch/" directory is used. |
|
| 153 | - * |
|
| 154 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 155 | - * @since 2014.09 |
|
| 156 | - * @category Developer |
|
| 157 | - * @see client/html/email/watch/html/outro/standard/template-body |
|
| 158 | - */ |
|
| 159 | - $tplconf = 'client/html/email/watch/html/outro/standard/template-header'; |
|
| 131 | + /** client/html/email/watch/html/outro/standard/template-header |
|
| 132 | + * Relative path to the HTML header template of the product notification e-mail html footer client. |
|
| 133 | + * |
|
| 134 | + * The template file contains the HTML code and processing instructions |
|
| 135 | + * to generate the HTML code that is inserted into the header |
|
| 136 | + * of the e-mail. The configuration string is the |
|
| 137 | + * path to the template file relative to the templates directory (usually |
|
| 138 | + * in client/html/templates). |
|
| 139 | + * |
|
| 140 | + * You can overwrite the template file configuration in extensions and |
|
| 141 | + * provide alternative templates. These alternative templates should be |
|
| 142 | + * named like the default one but with the string "standard" replaced by |
|
| 143 | + * an unique name. You may use the name of your project for this. If |
|
| 144 | + * you've implemented an alternative client class as well, "standard" |
|
| 145 | + * should be replaced by the name of the new class. |
|
| 146 | + * |
|
| 147 | + * The product notification e-mail HTML client allows to use a different template for |
|
| 148 | + * each watch status value. You can create a template for each watch |
|
| 149 | + * status and store it in the "email/watch/<status number>/" directory |
|
| 150 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 151 | + * specific layout template is found, the common template in the |
|
| 152 | + * "email/watch/" directory is used. |
|
| 153 | + * |
|
| 154 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 155 | + * @since 2014.09 |
|
| 156 | + * @category Developer |
|
| 157 | + * @see client/html/email/watch/html/outro/standard/template-body |
|
| 158 | + */ |
|
| 159 | + $tplconf = 'client/html/email/watch/html/outro/standard/template-header'; |
|
| 160 | 160 | |
| 161 | - return $view->render( $view->config( $tplconf, 'email/common/html-outro-header-default.php' ) ); |
|
| 162 | - } |
|
| 161 | + return $view->render( $view->config( $tplconf, 'email/common/html-outro-header-default.php' ) ); |
|
| 162 | + } |
|
| 163 | 163 | |
| 164 | 164 | |
| 165 | - /** |
|
| 166 | - * Returns the sub-client given by its name. |
|
| 167 | - * |
|
| 168 | - * @param string $type Name of the client type |
|
| 169 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 170 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 171 | - */ |
|
| 172 | - public function getSubClient( $type, $name = null ) |
|
| 173 | - { |
|
| 174 | - /** client/html/email/watch/html/outro/decorators/excludes |
|
| 175 | - * Excludes decorators added by the "common" option from the email watch html outro html client |
|
| 176 | - * |
|
| 177 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 178 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 179 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 180 | - * modify what is returned to the caller. |
|
| 181 | - * |
|
| 182 | - * This option allows you to remove a decorator added via |
|
| 183 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 184 | - * around the html client. |
|
| 185 | - * |
|
| 186 | - * client/html/email/watch/html/outro/decorators/excludes = array( 'decorator1' ) |
|
| 187 | - * |
|
| 188 | - * This would remove the decorator named "decorator1" from the list of |
|
| 189 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 190 | - * "client/html/common/decorators/default" to the html client. |
|
| 191 | - * |
|
| 192 | - * @param array List of decorator names |
|
| 193 | - * @since 2015.08 |
|
| 194 | - * @category Developer |
|
| 195 | - * @see client/html/common/decorators/default |
|
| 196 | - * @see client/html/email/watch/html/outro/decorators/global |
|
| 197 | - * @see client/html/email/watch/html/outro/decorators/local |
|
| 198 | - */ |
|
| 165 | + /** |
|
| 166 | + * Returns the sub-client given by its name. |
|
| 167 | + * |
|
| 168 | + * @param string $type Name of the client type |
|
| 169 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 170 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 171 | + */ |
|
| 172 | + public function getSubClient( $type, $name = null ) |
|
| 173 | + { |
|
| 174 | + /** client/html/email/watch/html/outro/decorators/excludes |
|
| 175 | + * Excludes decorators added by the "common" option from the email watch html outro html client |
|
| 176 | + * |
|
| 177 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 178 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 179 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 180 | + * modify what is returned to the caller. |
|
| 181 | + * |
|
| 182 | + * This option allows you to remove a decorator added via |
|
| 183 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 184 | + * around the html client. |
|
| 185 | + * |
|
| 186 | + * client/html/email/watch/html/outro/decorators/excludes = array( 'decorator1' ) |
|
| 187 | + * |
|
| 188 | + * This would remove the decorator named "decorator1" from the list of |
|
| 189 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 190 | + * "client/html/common/decorators/default" to the html client. |
|
| 191 | + * |
|
| 192 | + * @param array List of decorator names |
|
| 193 | + * @since 2015.08 |
|
| 194 | + * @category Developer |
|
| 195 | + * @see client/html/common/decorators/default |
|
| 196 | + * @see client/html/email/watch/html/outro/decorators/global |
|
| 197 | + * @see client/html/email/watch/html/outro/decorators/local |
|
| 198 | + */ |
|
| 199 | 199 | |
| 200 | - /** client/html/email/watch/html/outro/decorators/global |
|
| 201 | - * Adds a list of globally available decorators only to the email watch html outro html client |
|
| 202 | - * |
|
| 203 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 204 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 205 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 206 | - * modify what is returned to the caller. |
|
| 207 | - * |
|
| 208 | - * This option allows you to wrap global decorators |
|
| 209 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 210 | - * |
|
| 211 | - * client/html/email/watch/html/outro/decorators/global = array( 'decorator1' ) |
|
| 212 | - * |
|
| 213 | - * This would add the decorator named "decorator1" defined by |
|
| 214 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 215 | - * |
|
| 216 | - * @param array List of decorator names |
|
| 217 | - * @since 2015.08 |
|
| 218 | - * @category Developer |
|
| 219 | - * @see client/html/common/decorators/default |
|
| 220 | - * @see client/html/email/watch/html/outro/decorators/excludes |
|
| 221 | - * @see client/html/email/watch/html/outro/decorators/local |
|
| 222 | - */ |
|
| 200 | + /** client/html/email/watch/html/outro/decorators/global |
|
| 201 | + * Adds a list of globally available decorators only to the email watch html outro html client |
|
| 202 | + * |
|
| 203 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 204 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 205 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 206 | + * modify what is returned to the caller. |
|
| 207 | + * |
|
| 208 | + * This option allows you to wrap global decorators |
|
| 209 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 210 | + * |
|
| 211 | + * client/html/email/watch/html/outro/decorators/global = array( 'decorator1' ) |
|
| 212 | + * |
|
| 213 | + * This would add the decorator named "decorator1" defined by |
|
| 214 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 215 | + * |
|
| 216 | + * @param array List of decorator names |
|
| 217 | + * @since 2015.08 |
|
| 218 | + * @category Developer |
|
| 219 | + * @see client/html/common/decorators/default |
|
| 220 | + * @see client/html/email/watch/html/outro/decorators/excludes |
|
| 221 | + * @see client/html/email/watch/html/outro/decorators/local |
|
| 222 | + */ |
|
| 223 | 223 | |
| 224 | - /** client/html/email/watch/html/outro/decorators/local |
|
| 225 | - * Adds a list of local decorators only to the email watch html outro html client |
|
| 226 | - * |
|
| 227 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 228 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 229 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 230 | - * modify what is returned to the caller. |
|
| 231 | - * |
|
| 232 | - * This option allows you to wrap local decorators |
|
| 233 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 234 | - * |
|
| 235 | - * client/html/email/watch/html/outro/decorators/local = array( 'decorator2' ) |
|
| 236 | - * |
|
| 237 | - * This would add the decorator named "decorator2" defined by |
|
| 238 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 239 | - * |
|
| 240 | - * @param array List of decorator names |
|
| 241 | - * @since 2015.08 |
|
| 242 | - * @category Developer |
|
| 243 | - * @see client/html/common/decorators/default |
|
| 244 | - * @see client/html/email/watch/html/outro/decorators/excludes |
|
| 245 | - * @see client/html/email/watch/html/outro/decorators/global |
|
| 246 | - */ |
|
| 224 | + /** client/html/email/watch/html/outro/decorators/local |
|
| 225 | + * Adds a list of local decorators only to the email watch html outro html client |
|
| 226 | + * |
|
| 227 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 228 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 229 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 230 | + * modify what is returned to the caller. |
|
| 231 | + * |
|
| 232 | + * This option allows you to wrap local decorators |
|
| 233 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 234 | + * |
|
| 235 | + * client/html/email/watch/html/outro/decorators/local = array( 'decorator2' ) |
|
| 236 | + * |
|
| 237 | + * This would add the decorator named "decorator2" defined by |
|
| 238 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 239 | + * |
|
| 240 | + * @param array List of decorator names |
|
| 241 | + * @since 2015.08 |
|
| 242 | + * @category Developer |
|
| 243 | + * @see client/html/common/decorators/default |
|
| 244 | + * @see client/html/email/watch/html/outro/decorators/excludes |
|
| 245 | + * @see client/html/email/watch/html/outro/decorators/global |
|
| 246 | + */ |
|
| 247 | 247 | |
| 248 | - return $this->createSubClient( 'email/watch/html/outro/' . $type, $name ); |
|
| 249 | - } |
|
| 248 | + return $this->createSubClient( 'email/watch/html/outro/' . $type, $name ); |
|
| 249 | + } |
|
| 250 | 250 | |
| 251 | 251 | |
| 252 | - /** |
|
| 253 | - * Returns the list of sub-client names configured for the client. |
|
| 254 | - * |
|
| 255 | - * @return array List of HTML client names |
|
| 256 | - */ |
|
| 257 | - protected function getSubClientNames() |
|
| 258 | - { |
|
| 259 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 260 | - } |
|
| 252 | + /** |
|
| 253 | + * Returns the list of sub-client names configured for the client. |
|
| 254 | + * |
|
| 255 | + * @return array List of HTML client names |
|
| 256 | + */ |
|
| 257 | + protected function getSubClientNames() |
|
| 258 | + { |
|
| 259 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 260 | + } |
|
| 261 | 261 | } |
| 262 | 262 | \ No newline at end of file |
@@ -19,243 +19,243 @@ |
||
| 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/watch/html/salutation/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the product notification e-mail 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.09 |
|
| 56 | - * @category Developer |
|
| 57 | - */ |
|
| 58 | - private $subPartPath = 'client/html/email/watch/html/salutation/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 25 | + /** client/html/email/watch/html/salutation/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the product notification e-mail 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.09 |
|
| 56 | + * @category Developer |
|
| 57 | + */ |
|
| 58 | + private $subPartPath = 'client/html/email/watch/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/watch/html/salutation/standard/template-body |
|
| 81 | - * Relative path to the HTML body template of the product notification e-mail 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 product notification e-mail html summary client allows to use a different template for |
|
| 96 | - * each watch status value. You can create a template for each watch |
|
| 97 | - * status and store it in the "email/watch/<status number>/" directory |
|
| 98 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 99 | - * specific layout template is found, the common template in the |
|
| 100 | - * "email/watch/" directory is used. |
|
| 101 | - * |
|
| 102 | - * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | - * @since 2014.09 |
|
| 104 | - * @category Developer |
|
| 105 | - * @see client/html/email/watch/html/salutation/standard/template-header |
|
| 106 | - */ |
|
| 107 | - $tplconf = 'client/html/email/watch/html/salutation/standard/template-body'; |
|
| 80 | + /** client/html/email/watch/html/salutation/standard/template-body |
|
| 81 | + * Relative path to the HTML body template of the product notification e-mail 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 product notification e-mail html summary client allows to use a different template for |
|
| 96 | + * each watch status value. You can create a template for each watch |
|
| 97 | + * status and store it in the "email/watch/<status number>/" directory |
|
| 98 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 99 | + * specific layout template is found, the common template in the |
|
| 100 | + * "email/watch/" directory is used. |
|
| 101 | + * |
|
| 102 | + * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | + * @since 2014.09 |
|
| 104 | + * @category Developer |
|
| 105 | + * @see client/html/email/watch/html/salutation/standard/template-header |
|
| 106 | + */ |
|
| 107 | + $tplconf = 'client/html/email/watch/html/salutation/standard/template-body'; |
|
| 108 | 108 | |
| 109 | - return $view->render( $view->config( $tplconf, 'email/common/html-salutation-body-default.php' ) ); |
|
| 110 | - } |
|
| 109 | + return $view->render( $view->config( $tplconf, 'email/common/html-salutation-body-default.php' ) ); |
|
| 110 | + } |
|
| 111 | 111 | |
| 112 | 112 | |
| 113 | - /** |
|
| 114 | - * Returns the HTML string for insertion into the header. |
|
| 115 | - * |
|
| 116 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 117 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 118 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 119 | - * @return string|null String including HTML tags for the header on error |
|
| 120 | - */ |
|
| 121 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 122 | - { |
|
| 123 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 113 | + /** |
|
| 114 | + * Returns the HTML string for insertion into the header. |
|
| 115 | + * |
|
| 116 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 117 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 118 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 119 | + * @return string|null String including HTML tags for the header on error |
|
| 120 | + */ |
|
| 121 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 122 | + { |
|
| 123 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 124 | 124 | |
| 125 | - $content = ''; |
|
| 126 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 127 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 128 | - } |
|
| 129 | - $view->salutationHeader = $content; |
|
| 125 | + $content = ''; |
|
| 126 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 127 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 128 | + } |
|
| 129 | + $view->salutationHeader = $content; |
|
| 130 | 130 | |
| 131 | - /** client/html/email/watch/html/salutation/standard/template-header |
|
| 132 | - * Relative path to the HTML header template of the product notification e-mail html salutation client. |
|
| 133 | - * |
|
| 134 | - * The template file contains the HTML code and processing instructions |
|
| 135 | - * to generate the HTML code that is inserted into the header |
|
| 136 | - * of the e-mail. The configuration string is the |
|
| 137 | - * path to the template file relative to the templates directory (usually |
|
| 138 | - * in client/html/templates). |
|
| 139 | - * |
|
| 140 | - * You can overwrite the template file configuration in extensions and |
|
| 141 | - * provide alternative templates. These alternative templates should be |
|
| 142 | - * named like the default one but with the string "standard" replaced by |
|
| 143 | - * an unique name. You may use the name of your project for this. If |
|
| 144 | - * you've implemented an alternative client class as well, "standard" |
|
| 145 | - * should be replaced by the name of the new class. |
|
| 146 | - * |
|
| 147 | - * The product notification e-mail HTML client allows to use a different template for |
|
| 148 | - * each watch status value. You can create a template for each watch |
|
| 149 | - * status and store it in the "email/watch/<status number>/" directory |
|
| 150 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 151 | - * specific layout template is found, the common template in the |
|
| 152 | - * "email/watch/" directory is used. |
|
| 153 | - * |
|
| 154 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 155 | - * @since 2014.09 |
|
| 156 | - * @category Developer |
|
| 157 | - * @see client/html/email/watch/html/salutation/standard/template-body |
|
| 158 | - */ |
|
| 159 | - $tplconf = 'client/html/email/watch/html/salutation/standard/template-header'; |
|
| 131 | + /** client/html/email/watch/html/salutation/standard/template-header |
|
| 132 | + * Relative path to the HTML header template of the product notification e-mail html salutation client. |
|
| 133 | + * |
|
| 134 | + * The template file contains the HTML code and processing instructions |
|
| 135 | + * to generate the HTML code that is inserted into the header |
|
| 136 | + * of the e-mail. The configuration string is the |
|
| 137 | + * path to the template file relative to the templates directory (usually |
|
| 138 | + * in client/html/templates). |
|
| 139 | + * |
|
| 140 | + * You can overwrite the template file configuration in extensions and |
|
| 141 | + * provide alternative templates. These alternative templates should be |
|
| 142 | + * named like the default one but with the string "standard" replaced by |
|
| 143 | + * an unique name. You may use the name of your project for this. If |
|
| 144 | + * you've implemented an alternative client class as well, "standard" |
|
| 145 | + * should be replaced by the name of the new class. |
|
| 146 | + * |
|
| 147 | + * The product notification e-mail HTML client allows to use a different template for |
|
| 148 | + * each watch status value. You can create a template for each watch |
|
| 149 | + * status and store it in the "email/watch/<status number>/" directory |
|
| 150 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 151 | + * specific layout template is found, the common template in the |
|
| 152 | + * "email/watch/" directory is used. |
|
| 153 | + * |
|
| 154 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 155 | + * @since 2014.09 |
|
| 156 | + * @category Developer |
|
| 157 | + * @see client/html/email/watch/html/salutation/standard/template-body |
|
| 158 | + */ |
|
| 159 | + $tplconf = 'client/html/email/watch/html/salutation/standard/template-header'; |
|
| 160 | 160 | |
| 161 | - return $view->render( $view->config( $tplconf, 'email/common/html-salutation-header-default.php' ) ); |
|
| 162 | - } |
|
| 161 | + return $view->render( $view->config( $tplconf, 'email/common/html-salutation-header-default.php' ) ); |
|
| 162 | + } |
|
| 163 | 163 | |
| 164 | 164 | |
| 165 | - /** |
|
| 166 | - * Returns the sub-client given by its name. |
|
| 167 | - * |
|
| 168 | - * @param string $type Name of the client type |
|
| 169 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 170 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 171 | - */ |
|
| 172 | - public function getSubClient( $type, $name = null ) |
|
| 173 | - { |
|
| 174 | - /** client/html/email/watch/html/salutation/decorators/excludes |
|
| 175 | - * Excludes decorators added by the "common" option from the email watch html salutation html client |
|
| 176 | - * |
|
| 177 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 178 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 179 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 180 | - * modify what is returned to the caller. |
|
| 181 | - * |
|
| 182 | - * This option allows you to remove a decorator added via |
|
| 183 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 184 | - * around the html client. |
|
| 185 | - * |
|
| 186 | - * client/html/email/watch/html/salutation/decorators/excludes = array( 'decorator1' ) |
|
| 187 | - * |
|
| 188 | - * This would remove the decorator named "decorator1" from the list of |
|
| 189 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 190 | - * "client/html/common/decorators/default" to the html client. |
|
| 191 | - * |
|
| 192 | - * @param array List of decorator names |
|
| 193 | - * @since 2015.08 |
|
| 194 | - * @category Developer |
|
| 195 | - * @see client/html/common/decorators/default |
|
| 196 | - * @see client/html/email/watch/html/salutation/decorators/global |
|
| 197 | - * @see client/html/email/watch/html/salutation/decorators/local |
|
| 198 | - */ |
|
| 165 | + /** |
|
| 166 | + * Returns the sub-client given by its name. |
|
| 167 | + * |
|
| 168 | + * @param string $type Name of the client type |
|
| 169 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 170 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 171 | + */ |
|
| 172 | + public function getSubClient( $type, $name = null ) |
|
| 173 | + { |
|
| 174 | + /** client/html/email/watch/html/salutation/decorators/excludes |
|
| 175 | + * Excludes decorators added by the "common" option from the email watch html salutation html client |
|
| 176 | + * |
|
| 177 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 178 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 179 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 180 | + * modify what is returned to the caller. |
|
| 181 | + * |
|
| 182 | + * This option allows you to remove a decorator added via |
|
| 183 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 184 | + * around the html client. |
|
| 185 | + * |
|
| 186 | + * client/html/email/watch/html/salutation/decorators/excludes = array( 'decorator1' ) |
|
| 187 | + * |
|
| 188 | + * This would remove the decorator named "decorator1" from the list of |
|
| 189 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 190 | + * "client/html/common/decorators/default" to the html client. |
|
| 191 | + * |
|
| 192 | + * @param array List of decorator names |
|
| 193 | + * @since 2015.08 |
|
| 194 | + * @category Developer |
|
| 195 | + * @see client/html/common/decorators/default |
|
| 196 | + * @see client/html/email/watch/html/salutation/decorators/global |
|
| 197 | + * @see client/html/email/watch/html/salutation/decorators/local |
|
| 198 | + */ |
|
| 199 | 199 | |
| 200 | - /** client/html/email/watch/html/salutation/decorators/global |
|
| 201 | - * Adds a list of globally available decorators only to the email watch html salutation html client |
|
| 202 | - * |
|
| 203 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 204 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 205 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 206 | - * modify what is returned to the caller. |
|
| 207 | - * |
|
| 208 | - * This option allows you to wrap global decorators |
|
| 209 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 210 | - * |
|
| 211 | - * client/html/email/watch/html/salutation/decorators/global = array( 'decorator1' ) |
|
| 212 | - * |
|
| 213 | - * This would add the decorator named "decorator1" defined by |
|
| 214 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 215 | - * |
|
| 216 | - * @param array List of decorator names |
|
| 217 | - * @since 2015.08 |
|
| 218 | - * @category Developer |
|
| 219 | - * @see client/html/common/decorators/default |
|
| 220 | - * @see client/html/email/watch/html/salutation/decorators/excludes |
|
| 221 | - * @see client/html/email/watch/html/salutation/decorators/local |
|
| 222 | - */ |
|
| 200 | + /** client/html/email/watch/html/salutation/decorators/global |
|
| 201 | + * Adds a list of globally available decorators only to the email watch html salutation html client |
|
| 202 | + * |
|
| 203 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 204 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 205 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 206 | + * modify what is returned to the caller. |
|
| 207 | + * |
|
| 208 | + * This option allows you to wrap global decorators |
|
| 209 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 210 | + * |
|
| 211 | + * client/html/email/watch/html/salutation/decorators/global = array( 'decorator1' ) |
|
| 212 | + * |
|
| 213 | + * This would add the decorator named "decorator1" defined by |
|
| 214 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 215 | + * |
|
| 216 | + * @param array List of decorator names |
|
| 217 | + * @since 2015.08 |
|
| 218 | + * @category Developer |
|
| 219 | + * @see client/html/common/decorators/default |
|
| 220 | + * @see client/html/email/watch/html/salutation/decorators/excludes |
|
| 221 | + * @see client/html/email/watch/html/salutation/decorators/local |
|
| 222 | + */ |
|
| 223 | 223 | |
| 224 | - /** client/html/email/watch/html/salutation/decorators/local |
|
| 225 | - * Adds a list of local decorators only to the email watch html salutation html client |
|
| 226 | - * |
|
| 227 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 228 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 229 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 230 | - * modify what is returned to the caller. |
|
| 231 | - * |
|
| 232 | - * This option allows you to wrap local decorators |
|
| 233 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 234 | - * |
|
| 235 | - * client/html/email/watch/html/salutation/decorators/local = array( 'decorator2' ) |
|
| 236 | - * |
|
| 237 | - * This would add the decorator named "decorator2" defined by |
|
| 238 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 239 | - * |
|
| 240 | - * @param array List of decorator names |
|
| 241 | - * @since 2015.08 |
|
| 242 | - * @category Developer |
|
| 243 | - * @see client/html/common/decorators/default |
|
| 244 | - * @see client/html/email/watch/html/salutation/decorators/excludes |
|
| 245 | - * @see client/html/email/watch/html/salutation/decorators/global |
|
| 246 | - */ |
|
| 224 | + /** client/html/email/watch/html/salutation/decorators/local |
|
| 225 | + * Adds a list of local decorators only to the email watch html salutation html client |
|
| 226 | + * |
|
| 227 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 228 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 229 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 230 | + * modify what is returned to the caller. |
|
| 231 | + * |
|
| 232 | + * This option allows you to wrap local decorators |
|
| 233 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 234 | + * |
|
| 235 | + * client/html/email/watch/html/salutation/decorators/local = array( 'decorator2' ) |
|
| 236 | + * |
|
| 237 | + * This would add the decorator named "decorator2" defined by |
|
| 238 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 239 | + * |
|
| 240 | + * @param array List of decorator names |
|
| 241 | + * @since 2015.08 |
|
| 242 | + * @category Developer |
|
| 243 | + * @see client/html/common/decorators/default |
|
| 244 | + * @see client/html/email/watch/html/salutation/decorators/excludes |
|
| 245 | + * @see client/html/email/watch/html/salutation/decorators/global |
|
| 246 | + */ |
|
| 247 | 247 | |
| 248 | - return $this->createSubClient( 'email/watch/html/salutation/' . $type, $name ); |
|
| 249 | - } |
|
| 248 | + return $this->createSubClient( 'email/watch/html/salutation/' . $type, $name ); |
|
| 249 | + } |
|
| 250 | 250 | |
| 251 | 251 | |
| 252 | - /** |
|
| 253 | - * Returns the list of sub-client names configured for the client. |
|
| 254 | - * |
|
| 255 | - * @return array List of HTML client names |
|
| 256 | - */ |
|
| 257 | - protected function getSubClientNames() |
|
| 258 | - { |
|
| 259 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 260 | - } |
|
| 252 | + /** |
|
| 253 | + * Returns the list of sub-client names configured for the client. |
|
| 254 | + * |
|
| 255 | + * @return array List of HTML client names |
|
| 256 | + */ |
|
| 257 | + protected function getSubClientNames() |
|
| 258 | + { |
|
| 259 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 260 | + } |
|
| 261 | 261 | } |
| 262 | 262 | \ No newline at end of file |
@@ -19,243 +19,243 @@ |
||
| 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/watch/html/intro/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the product notifiction e-mail html introduction 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/watch/html/intro/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 25 | + /** client/html/email/watch/html/intro/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the product notifiction e-mail html introduction 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/watch/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/watch/html/intro/standard/template-body |
|
| 81 | - * Relative path to the HTML body template of the product notifiction e-mail 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 product notifiction e-mail html client allows to use a different template for |
|
| 96 | - * each watch status value. You can create a template for each watch |
|
| 97 | - * status and store it in the "email/watch/<status number>/" directory |
|
| 98 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 99 | - * specific layout template is found, the common template in the |
|
| 100 | - * "email/watch/" directory is used. |
|
| 101 | - * |
|
| 102 | - * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | - * @since 2014.09 |
|
| 104 | - * @category Developer |
|
| 105 | - * @see client/html/email/watch/html/intro/standard/template-header |
|
| 106 | - */ |
|
| 107 | - $tplconf = 'client/html/email/watch/html/intro/standard/template-body'; |
|
| 80 | + /** client/html/email/watch/html/intro/standard/template-body |
|
| 81 | + * Relative path to the HTML body template of the product notifiction e-mail 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 product notifiction e-mail html client allows to use a different template for |
|
| 96 | + * each watch status value. You can create a template for each watch |
|
| 97 | + * status and store it in the "email/watch/<status number>/" directory |
|
| 98 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 99 | + * specific layout template is found, the common template in the |
|
| 100 | + * "email/watch/" directory is used. |
|
| 101 | + * |
|
| 102 | + * @param string Relative path to the template creating code for the HTML e-mail body |
|
| 103 | + * @since 2014.09 |
|
| 104 | + * @category Developer |
|
| 105 | + * @see client/html/email/watch/html/intro/standard/template-header |
|
| 106 | + */ |
|
| 107 | + $tplconf = 'client/html/email/watch/html/intro/standard/template-body'; |
|
| 108 | 108 | |
| 109 | - return $view->render( $view->config( $tplconf, 'email/watch/html-intro-body-default.php' ) ); |
|
| 110 | - } |
|
| 109 | + return $view->render( $view->config( $tplconf, 'email/watch/html-intro-body-default.php' ) ); |
|
| 110 | + } |
|
| 111 | 111 | |
| 112 | 112 | |
| 113 | - /** |
|
| 114 | - * Returns the HTML string for insertion into the header. |
|
| 115 | - * |
|
| 116 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 117 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 118 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 119 | - * @return string|null String including HTML tags for the header on error |
|
| 120 | - */ |
|
| 121 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 122 | - { |
|
| 123 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 113 | + /** |
|
| 114 | + * Returns the HTML string for insertion into the header. |
|
| 115 | + * |
|
| 116 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 117 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 118 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 119 | + * @return string|null String including HTML tags for the header on error |
|
| 120 | + */ |
|
| 121 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 122 | + { |
|
| 123 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 124 | 124 | |
| 125 | - $content = ''; |
|
| 126 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 127 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 128 | - } |
|
| 129 | - $view->introHeader = $content; |
|
| 125 | + $content = ''; |
|
| 126 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 127 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 128 | + } |
|
| 129 | + $view->introHeader = $content; |
|
| 130 | 130 | |
| 131 | - /** client/html/email/watch/html/intro/standard/template-header |
|
| 132 | - * Relative path to the HTML header template of the product notifiction e-mail html introduction client. |
|
| 133 | - * |
|
| 134 | - * The template file contains the HTML code and processing instructions |
|
| 135 | - * to generate the HTML code that is inserted into the header |
|
| 136 | - * of the e-mail. The configuration string is the |
|
| 137 | - * path to the template file relative to the templates directory (usually |
|
| 138 | - * in client/html/templates). |
|
| 139 | - * |
|
| 140 | - * You can overwrite the template file configuration in extensions and |
|
| 141 | - * provide alternative templates. These alternative templates should be |
|
| 142 | - * named like the default one but with the string "standard" replaced by |
|
| 143 | - * an unique name. You may use the name of your project for this. If |
|
| 144 | - * you've implemented an alternative client class as well, "standard" |
|
| 145 | - * should be replaced by the name of the new class. |
|
| 146 | - * |
|
| 147 | - * The product notifiction e-mail HTML client allows to use a different template for |
|
| 148 | - * each watch status value. You can create a template for each watch |
|
| 149 | - * status and store it in the "email/watch/<status number>/" directory |
|
| 150 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 151 | - * specific layout template is found, the common template in the |
|
| 152 | - * "email/watch/" directory is used. |
|
| 153 | - * |
|
| 154 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 155 | - * @since 2014.09 |
|
| 156 | - * @category Developer |
|
| 157 | - * @see client/html/email/watch/html/intro/standard/template-body |
|
| 158 | - */ |
|
| 159 | - $tplconf = 'client/html/email/watch/html/intro/standard/template-header'; |
|
| 131 | + /** client/html/email/watch/html/intro/standard/template-header |
|
| 132 | + * Relative path to the HTML header template of the product notifiction e-mail html introduction client. |
|
| 133 | + * |
|
| 134 | + * The template file contains the HTML code and processing instructions |
|
| 135 | + * to generate the HTML code that is inserted into the header |
|
| 136 | + * of the e-mail. The configuration string is the |
|
| 137 | + * path to the template file relative to the templates directory (usually |
|
| 138 | + * in client/html/templates). |
|
| 139 | + * |
|
| 140 | + * You can overwrite the template file configuration in extensions and |
|
| 141 | + * provide alternative templates. These alternative templates should be |
|
| 142 | + * named like the default one but with the string "standard" replaced by |
|
| 143 | + * an unique name. You may use the name of your project for this. If |
|
| 144 | + * you've implemented an alternative client class as well, "standard" |
|
| 145 | + * should be replaced by the name of the new class. |
|
| 146 | + * |
|
| 147 | + * The product notifiction e-mail HTML client allows to use a different template for |
|
| 148 | + * each watch status value. You can create a template for each watch |
|
| 149 | + * status and store it in the "email/watch/<status number>/" directory |
|
| 150 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 151 | + * specific layout template is found, the common template in the |
|
| 152 | + * "email/watch/" directory is used. |
|
| 153 | + * |
|
| 154 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 155 | + * @since 2014.09 |
|
| 156 | + * @category Developer |
|
| 157 | + * @see client/html/email/watch/html/intro/standard/template-body |
|
| 158 | + */ |
|
| 159 | + $tplconf = 'client/html/email/watch/html/intro/standard/template-header'; |
|
| 160 | 160 | |
| 161 | - return $view->render( $view->config( $tplconf, 'email/watch/html-intro-header-default.php' ) ); |
|
| 162 | - } |
|
| 161 | + return $view->render( $view->config( $tplconf, 'email/watch/html-intro-header-default.php' ) ); |
|
| 162 | + } |
|
| 163 | 163 | |
| 164 | 164 | |
| 165 | - /** |
|
| 166 | - * Returns the sub-client given by its name. |
|
| 167 | - * |
|
| 168 | - * @param string $type Name of the client type |
|
| 169 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 170 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 171 | - */ |
|
| 172 | - public function getSubClient( $type, $name = null ) |
|
| 173 | - { |
|
| 174 | - /** client/html/email/watch/html/intro/decorators/excludes |
|
| 175 | - * Excludes decorators added by the "common" option from the email watch html intro html client |
|
| 176 | - * |
|
| 177 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 178 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 179 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 180 | - * modify what is returned to the caller. |
|
| 181 | - * |
|
| 182 | - * This option allows you to remove a decorator added via |
|
| 183 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 184 | - * around the html client. |
|
| 185 | - * |
|
| 186 | - * client/html/email/watch/html/intro/decorators/excludes = array( 'decorator1' ) |
|
| 187 | - * |
|
| 188 | - * This would remove the decorator named "decorator1" from the list of |
|
| 189 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 190 | - * "client/html/common/decorators/default" to the html client. |
|
| 191 | - * |
|
| 192 | - * @param array List of decorator names |
|
| 193 | - * @since 2015.08 |
|
| 194 | - * @category Developer |
|
| 195 | - * @see client/html/common/decorators/default |
|
| 196 | - * @see client/html/email/watch/html/intro/decorators/global |
|
| 197 | - * @see client/html/email/watch/html/intro/decorators/local |
|
| 198 | - */ |
|
| 165 | + /** |
|
| 166 | + * Returns the sub-client given by its name. |
|
| 167 | + * |
|
| 168 | + * @param string $type Name of the client type |
|
| 169 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 170 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 171 | + */ |
|
| 172 | + public function getSubClient( $type, $name = null ) |
|
| 173 | + { |
|
| 174 | + /** client/html/email/watch/html/intro/decorators/excludes |
|
| 175 | + * Excludes decorators added by the "common" option from the email watch html intro html client |
|
| 176 | + * |
|
| 177 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 178 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 179 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 180 | + * modify what is returned to the caller. |
|
| 181 | + * |
|
| 182 | + * This option allows you to remove a decorator added via |
|
| 183 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 184 | + * around the html client. |
|
| 185 | + * |
|
| 186 | + * client/html/email/watch/html/intro/decorators/excludes = array( 'decorator1' ) |
|
| 187 | + * |
|
| 188 | + * This would remove the decorator named "decorator1" from the list of |
|
| 189 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 190 | + * "client/html/common/decorators/default" to the html client. |
|
| 191 | + * |
|
| 192 | + * @param array List of decorator names |
|
| 193 | + * @since 2015.08 |
|
| 194 | + * @category Developer |
|
| 195 | + * @see client/html/common/decorators/default |
|
| 196 | + * @see client/html/email/watch/html/intro/decorators/global |
|
| 197 | + * @see client/html/email/watch/html/intro/decorators/local |
|
| 198 | + */ |
|
| 199 | 199 | |
| 200 | - /** client/html/email/watch/html/intro/decorators/global |
|
| 201 | - * Adds a list of globally available decorators only to the email watch html intro html client |
|
| 202 | - * |
|
| 203 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 204 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 205 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 206 | - * modify what is returned to the caller. |
|
| 207 | - * |
|
| 208 | - * This option allows you to wrap global decorators |
|
| 209 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 210 | - * |
|
| 211 | - * client/html/email/watch/html/intro/decorators/global = array( 'decorator1' ) |
|
| 212 | - * |
|
| 213 | - * This would add the decorator named "decorator1" defined by |
|
| 214 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 215 | - * |
|
| 216 | - * @param array List of decorator names |
|
| 217 | - * @since 2015.08 |
|
| 218 | - * @category Developer |
|
| 219 | - * @see client/html/common/decorators/default |
|
| 220 | - * @see client/html/email/watch/html/intro/decorators/excludes |
|
| 221 | - * @see client/html/email/watch/html/intro/decorators/local |
|
| 222 | - */ |
|
| 200 | + /** client/html/email/watch/html/intro/decorators/global |
|
| 201 | + * Adds a list of globally available decorators only to the email watch html intro html client |
|
| 202 | + * |
|
| 203 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 204 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 205 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 206 | + * modify what is returned to the caller. |
|
| 207 | + * |
|
| 208 | + * This option allows you to wrap global decorators |
|
| 209 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 210 | + * |
|
| 211 | + * client/html/email/watch/html/intro/decorators/global = array( 'decorator1' ) |
|
| 212 | + * |
|
| 213 | + * This would add the decorator named "decorator1" defined by |
|
| 214 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 215 | + * |
|
| 216 | + * @param array List of decorator names |
|
| 217 | + * @since 2015.08 |
|
| 218 | + * @category Developer |
|
| 219 | + * @see client/html/common/decorators/default |
|
| 220 | + * @see client/html/email/watch/html/intro/decorators/excludes |
|
| 221 | + * @see client/html/email/watch/html/intro/decorators/local |
|
| 222 | + */ |
|
| 223 | 223 | |
| 224 | - /** client/html/email/watch/html/intro/decorators/local |
|
| 225 | - * Adds a list of local decorators only to the email watch html intro html client |
|
| 226 | - * |
|
| 227 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 228 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 229 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 230 | - * modify what is returned to the caller. |
|
| 231 | - * |
|
| 232 | - * This option allows you to wrap local decorators |
|
| 233 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 234 | - * |
|
| 235 | - * client/html/email/watch/html/intro/decorators/local = array( 'decorator2' ) |
|
| 236 | - * |
|
| 237 | - * This would add the decorator named "decorator2" defined by |
|
| 238 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 239 | - * |
|
| 240 | - * @param array List of decorator names |
|
| 241 | - * @since 2015.08 |
|
| 242 | - * @category Developer |
|
| 243 | - * @see client/html/common/decorators/default |
|
| 244 | - * @see client/html/email/watch/html/intro/decorators/excludes |
|
| 245 | - * @see client/html/email/watch/html/intro/decorators/global |
|
| 246 | - */ |
|
| 224 | + /** client/html/email/watch/html/intro/decorators/local |
|
| 225 | + * Adds a list of local decorators only to the email watch html intro html client |
|
| 226 | + * |
|
| 227 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 228 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 229 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 230 | + * modify what is returned to the caller. |
|
| 231 | + * |
|
| 232 | + * This option allows you to wrap local decorators |
|
| 233 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 234 | + * |
|
| 235 | + * client/html/email/watch/html/intro/decorators/local = array( 'decorator2' ) |
|
| 236 | + * |
|
| 237 | + * This would add the decorator named "decorator2" defined by |
|
| 238 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 239 | + * |
|
| 240 | + * @param array List of decorator names |
|
| 241 | + * @since 2015.08 |
|
| 242 | + * @category Developer |
|
| 243 | + * @see client/html/common/decorators/default |
|
| 244 | + * @see client/html/email/watch/html/intro/decorators/excludes |
|
| 245 | + * @see client/html/email/watch/html/intro/decorators/global |
|
| 246 | + */ |
|
| 247 | 247 | |
| 248 | - return $this->createSubClient( 'email/watch/html/intro/' . $type, $name ); |
|
| 249 | - } |
|
| 248 | + return $this->createSubClient( 'email/watch/html/intro/' . $type, $name ); |
|
| 249 | + } |
|
| 250 | 250 | |
| 251 | 251 | |
| 252 | - /** |
|
| 253 | - * Returns the list of sub-client names configured for the client. |
|
| 254 | - * |
|
| 255 | - * @return array List of HTML client names |
|
| 256 | - */ |
|
| 257 | - protected function getSubClientNames() |
|
| 258 | - { |
|
| 259 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 260 | - } |
|
| 252 | + /** |
|
| 253 | + * Returns the list of sub-client names configured for the client. |
|
| 254 | + * |
|
| 255 | + * @return array List of HTML client names |
|
| 256 | + */ |
|
| 257 | + protected function getSubClientNames() |
|
| 258 | + { |
|
| 259 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 260 | + } |
|
| 261 | 261 | } |
| 262 | 262 | \ 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 product notification 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/watch/name |
|
| 37 | - * Class name of the used email watch 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\Watch\Standard |
|
| 47 | - * |
|
| 48 | - * and you want to replace it with your own version named |
|
| 49 | - * |
|
| 50 | - * \Aimeos\Client\Html\Email\Watch\Mywatch |
|
| 51 | - * |
|
| 52 | - * then you have to set the this configuration option: |
|
| 53 | - * |
|
| 54 | - * client/html/email/watch/name = Mywatch |
|
| 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 "MyWatch"! |
|
| 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/watch/name', 'Standard' ); |
|
| 71 | - } |
|
| 25 | + /** |
|
| 26 | + * Creates a product notification 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/watch/name |
|
| 37 | + * Class name of the used email watch 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\Watch\Standard |
|
| 47 | + * |
|
| 48 | + * and you want to replace it with your own version named |
|
| 49 | + * |
|
| 50 | + * \Aimeos\Client\Html\Email\Watch\Mywatch |
|
| 51 | + * |
|
| 52 | + * then you have to set the this configuration option: |
|
| 53 | + * |
|
| 54 | + * client/html/email/watch/name = Mywatch |
|
| 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 "MyWatch"! |
|
| 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/watch/name', 'Standard' ); |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - if( ctype_alnum( $name ) === false ) |
|
| 74 | - { |
|
| 75 | - $classname = is_string( $name ) ? '\\Aimeos\\Client\\Html\\Email\\Watch\\' . $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\\Watch\\' . $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\\Watch\\' . $name; |
|
| 79 | + $iface = '\\Aimeos\\Client\\Html\\Iface'; |
|
| 80 | + $classname = '\\Aimeos\\Client\\Html\\Email\\Watch\\' . $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/watch' ); |
|
| 85 | - } |
|
| 84 | + return self::addClientDecorators( $context, $client, $templatePaths, 'email/watch' ); |
|
| 85 | + } |
|
| 86 | 86 | } |
| 87 | 87 | |
@@ -19,402 +19,402 @@ |
||
| 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/watch/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the product notification 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 2014.03 |
|
| 56 | - * @category Developer |
|
| 57 | - */ |
|
| 58 | - private $subPartPath = 'client/html/email/watch/standard/subparts'; |
|
| 59 | - |
|
| 60 | - /** client/html/email/watch/text/name |
|
| 61 | - * Name of the text part used by the product notification e-mail client implementation |
|
| 62 | - * |
|
| 63 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Watch\Text\Myname". |
|
| 64 | - * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 65 | - * |
|
| 66 | - * @param string Last part of the client class name |
|
| 67 | - * @since 2014.03 |
|
| 68 | - * @category Developer |
|
| 69 | - */ |
|
| 70 | - |
|
| 71 | - /** client/html/email/watch/html/name |
|
| 72 | - * Name of the html part used by the product notification e-mail client implementation |
|
| 73 | - * |
|
| 74 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Watch\Html\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 | - private $subPartNames = array( 'text', 'html' ); |
|
| 82 | - |
|
| 83 | - |
|
| 84 | - /** |
|
| 85 | - * Returns the HTML code for insertion into the body. |
|
| 86 | - * |
|
| 87 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 88 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 89 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 90 | - * @return string HTML code |
|
| 91 | - */ |
|
| 92 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 93 | - { |
|
| 94 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 95 | - |
|
| 96 | - $content = ''; |
|
| 97 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 98 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 99 | - } |
|
| 100 | - $view->watchBody = $content; |
|
| 101 | - |
|
| 102 | - /** client/html/email/watch/standard/template-body |
|
| 103 | - * Relative path to the HTML body template of the product notification e-mail client. |
|
| 104 | - * |
|
| 105 | - * The template file contains the HTML code and processing instructions |
|
| 106 | - * to generate the result shown in the body of the frontend. The |
|
| 107 | - * configuration string is the path to the template file relative |
|
| 108 | - * to the templates directory (usually in client/html/templates). |
|
| 109 | - * |
|
| 110 | - * You can overwrite the template file configuration in extensions and |
|
| 111 | - * provide alternative templates. These alternative templates should be |
|
| 112 | - * named like the default one but with the string "standard" replaced by |
|
| 113 | - * an unique name. You may use the name of your project for this. If |
|
| 114 | - * you've implemented an alternative client class as well, "standard" |
|
| 115 | - * should be replaced by the name of the new class. |
|
| 116 | - * |
|
| 117 | - * The product notification e-mail HTML client allows to use a different template for |
|
| 118 | - * each watch status value. You can create a template for each watch |
|
| 119 | - * status and store it in the "email/watch/<status number>/" directory |
|
| 120 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 121 | - * specific layout template is found, the common template in the |
|
| 122 | - * "email/watch/" directory is used. |
|
| 123 | - * |
|
| 124 | - * @param string Relative path to the template creating code for the HTML page body |
|
| 125 | - * @since 2014.03 |
|
| 126 | - * @category Developer |
|
| 127 | - * @see client/html/email/watch/standard/template-header |
|
| 128 | - */ |
|
| 129 | - $tplconf = 'client/html/email/watch/standard/template-body'; |
|
| 130 | - |
|
| 131 | - return $view->render( $view->config( $tplconf, 'email/watch/body-default.php' ) ); |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - |
|
| 135 | - /** |
|
| 136 | - * Returns the HTML string for insertion into the header. |
|
| 137 | - * |
|
| 138 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 139 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 140 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 141 | - * @return string|null String including HTML tags for the header on error |
|
| 142 | - */ |
|
| 143 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 144 | - { |
|
| 145 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 146 | - |
|
| 147 | - $content = ''; |
|
| 148 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 149 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 150 | - } |
|
| 151 | - $view->watchHeader = $content; |
|
| 152 | - |
|
| 153 | - |
|
| 154 | - $addr = $view->extAddressItem; |
|
| 155 | - |
|
| 156 | - $msg = $view->mail(); |
|
| 157 | - $msg->addHeader( 'X-MailGenerator', 'Aimeos' ); |
|
| 158 | - $msg->addTo( $addr->getEMail(), $addr->getFirstName() . ' ' . $addr->getLastName() ); |
|
| 159 | - |
|
| 160 | - |
|
| 161 | - /** client/html/email/from-name |
|
| 162 | - * @see client/html/email/watch/from-email |
|
| 163 | - */ |
|
| 164 | - $fromName = $view->config( 'client/html/email/from-name' ); |
|
| 165 | - |
|
| 166 | - /** client/html/email/watch/from-name |
|
| 167 | - * Name used when sending product notification e-mails |
|
| 168 | - * |
|
| 169 | - * The name of the person or e-mail account that is used for sending all |
|
| 170 | - * shop related watch e-mails to customers. This configuration option |
|
| 171 | - * overwrite the name set in "client/html/email/from-name". |
|
| 172 | - * |
|
| 173 | - * @param string Name shown in the e-mail |
|
| 174 | - * @since 2014.03 |
|
| 175 | - * @category User |
|
| 176 | - * @see client/html/email/from-name |
|
| 177 | - * @see client/html/email/from-email |
|
| 178 | - * @see client/html/email/reply-email |
|
| 179 | - * @see client/html/email/bcc-email |
|
| 180 | - */ |
|
| 181 | - $fromNameWatch = $view->config( 'client/html/email/watch/from-name', $fromName ); |
|
| 182 | - |
|
| 183 | - /** client/html/email/from-email |
|
| 184 | - * @see client/html/email/watch/from-email |
|
| 185 | - */ |
|
| 186 | - $fromEmail = $view->config( 'client/html/email/from-email' ); |
|
| 187 | - |
|
| 188 | - /** client/html/email/watch/from-email |
|
| 189 | - * E-Mail address used when sending product notification e-mails |
|
| 190 | - * |
|
| 191 | - * The e-mail address of the person or account that is used for sending |
|
| 192 | - * all shop related product notification e-mails to customers. This configuration option |
|
| 193 | - * overwrites the e-mail address set via "client/html/email/from-email". |
|
| 194 | - * |
|
| 195 | - * @param string E-mail address |
|
| 196 | - * @since 2014.03 |
|
| 197 | - * @category User |
|
| 198 | - * @see client/html/email/watch/from-name |
|
| 199 | - * @see client/html/email/from-email |
|
| 200 | - * @see client/html/email/reply-email |
|
| 201 | - * @see client/html/email/bcc-email |
|
| 202 | - */ |
|
| 203 | - if( ( $fromEmailWatch = $view->config( 'client/html/email/watch/from-email', $fromEmail ) ) != null ) { |
|
| 204 | - $msg->addFrom( $fromEmailWatch, $fromNameWatch ); |
|
| 205 | - } |
|
| 206 | - |
|
| 207 | - |
|
| 208 | - /** client/html/email/reply-name |
|
| 209 | - * @see client/html/email/watch/reply-email |
|
| 210 | - */ |
|
| 211 | - $replyName = $view->config( 'client/html/email/reply-name', $fromName ); |
|
| 212 | - |
|
| 213 | - /** client/html/email/watch/reply-name |
|
| 214 | - * Recipient name displayed when the customer replies to product notification e-mails |
|
| 215 | - * |
|
| 216 | - * The name of the person or e-mail account the customer should |
|
| 217 | - * reply to in case of watch related questions or problems. This |
|
| 218 | - * configuration option overwrites the name set via |
|
| 219 | - * "client/html/email/reply-name". |
|
| 220 | - * |
|
| 221 | - * @param string Name shown in the e-mail |
|
| 222 | - * @since 2014.03 |
|
| 223 | - * @category User |
|
| 224 | - * @see client/html/email/watch/reply-email |
|
| 225 | - * @see client/html/email/reply-name |
|
| 226 | - * @see client/html/email/reply-email |
|
| 227 | - * @see client/html/email/from-email |
|
| 228 | - * @see client/html/email/bcc-email |
|
| 229 | - */ |
|
| 230 | - $replyNameWatch = $view->config( 'client/html/email/watch/reply-name', $replyName ); |
|
| 231 | - |
|
| 232 | - /** client/html/email/reply-email |
|
| 233 | - * @see client/html/email/watch/reply-email |
|
| 234 | - */ |
|
| 235 | - $replyEmail = $view->config( 'client/html/email/reply-email', $fromEmail ); |
|
| 236 | - |
|
| 237 | - /** client/html/email/watch/reply-email |
|
| 238 | - * E-Mail address used by the customer when replying to product notification e-mails |
|
| 239 | - * |
|
| 240 | - * The e-mail address of the person or e-mail account the customer |
|
| 241 | - * should reply to in case of watch related questions or problems. |
|
| 242 | - * This configuration option overwrites the e-mail address set via |
|
| 243 | - * "client/html/email/reply-email". |
|
| 244 | - * |
|
| 245 | - * @param string E-mail address |
|
| 246 | - * @since 2014.03 |
|
| 247 | - * @category User |
|
| 248 | - * @see client/html/email/watch/reply-name |
|
| 249 | - * @see client/html/email/reply-email |
|
| 250 | - * @see client/html/email/from-email |
|
| 251 | - * @see client/html/email/bcc-email |
|
| 252 | - */ |
|
| 253 | - if( ( $replyEmailWatch = $view->config( 'client/html/email/watch/reply-email', $replyEmail ) ) != null ) { |
|
| 254 | - $msg->addReplyTo( $replyEmailWatch, $replyNameWatch ); |
|
| 255 | - } |
|
| 256 | - |
|
| 257 | - |
|
| 258 | - /** client/html/email/bcc-email |
|
| 259 | - * @see client/html/email/watch/bcc-email |
|
| 260 | - */ |
|
| 261 | - $bccEmail = $view->config( 'client/html/email/bcc-email' ); |
|
| 262 | - |
|
| 263 | - /** client/html/email/watch/bcc-email |
|
| 264 | - * E-Mail address all product notification e-mails should be also sent to |
|
| 265 | - * |
|
| 266 | - * Using this option you can send a copy of all watch related e-mails |
|
| 267 | - * to a second e-mail account. This can be handy for testing and checking |
|
| 268 | - * the e-mails sent to customers. |
|
| 269 | - * |
|
| 270 | - * It also allows shop owners with a very small volume of orders to be |
|
| 271 | - * notified about watch changes. Be aware that this isn't useful if the |
|
| 272 | - * order volumne is high or has peeks! |
|
| 273 | - * |
|
| 274 | - * This configuration option overwrites the e-mail address set via |
|
| 275 | - * "client/html/email/bcc-email". |
|
| 276 | - * |
|
| 277 | - * @param string E-mail address |
|
| 278 | - * @since 2014.03 |
|
| 279 | - * @category User |
|
| 280 | - * @category Developer |
|
| 281 | - * @see client/html/email/bcc-email |
|
| 282 | - * @see client/html/email/reply-email |
|
| 283 | - * @see client/html/email/from-email |
|
| 284 | - */ |
|
| 285 | - if( ( $bccEmailWatch = $view->config( 'client/html/email/watch/bcc-email', $bccEmail ) ) != null ) { |
|
| 286 | - $msg->addBcc( $bccEmailWatch ); |
|
| 287 | - } |
|
| 288 | - |
|
| 289 | - |
|
| 290 | - /** client/html/email/watch/standard/template-header |
|
| 291 | - * Relative path to the HTML header template of the product notification e-mail client. |
|
| 292 | - * |
|
| 293 | - * The template file contains the HTML code and processing instructions |
|
| 294 | - * to generate the HTML code that is inserted into the HTML page header |
|
| 295 | - * of the rendered page in the frontend. The configuration string is the |
|
| 296 | - * path to the template file relative to the templates directory (usually |
|
| 297 | - * in client/html/templates). |
|
| 298 | - * |
|
| 299 | - * You can overwrite the template file configuration in extensions and |
|
| 300 | - * provide alternative templates. These alternative templates should be |
|
| 301 | - * named like the default one but with the string "standard" replaced by |
|
| 302 | - * an unique name. You may use the name of your project for this. If |
|
| 303 | - * you've implemented an alternative client class as well, "standard" |
|
| 304 | - * should be replaced by the name of the new class. |
|
| 305 | - * |
|
| 306 | - * The product notification e-mail HTML client allows to use a different template for |
|
| 307 | - * each watch status value. You can create a template for each watch |
|
| 308 | - * status and store it in the "email/watch/<status number>/" directory |
|
| 309 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 310 | - * specific layout template is found, the common template in the |
|
| 311 | - * "email/watch/" directory is used. |
|
| 312 | - * |
|
| 313 | - * @param string Relative path to the template creating code for the HTML page head |
|
| 314 | - * @since 2014.03 |
|
| 315 | - * @category Developer |
|
| 316 | - * @see client/html/email/watch/standard/template-body |
|
| 317 | - */ |
|
| 318 | - $tplconf = 'client/html/email/watch/standard/template-header'; |
|
| 319 | - |
|
| 320 | - return $view->render( $view->config( $tplconf, 'email/watch/header-default.php' ) ); ; |
|
| 321 | - } |
|
| 322 | - |
|
| 323 | - |
|
| 324 | - /** |
|
| 325 | - * Returns the sub-client given by its name. |
|
| 326 | - * |
|
| 327 | - * @param string $type Name of the client type |
|
| 328 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 329 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 330 | - */ |
|
| 331 | - public function getSubClient( $type, $name = null ) |
|
| 332 | - { |
|
| 333 | - /** client/html/email/watch/decorators/excludes |
|
| 334 | - * Excludes decorators added by the "common" option from the email watch html client |
|
| 335 | - * |
|
| 336 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 337 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 338 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 339 | - * modify what is returned to the caller. |
|
| 340 | - * |
|
| 341 | - * This option allows you to remove a decorator added via |
|
| 342 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 343 | - * around the html client. |
|
| 344 | - * |
|
| 345 | - * client/html/email/watch/decorators/excludes = array( 'decorator1' ) |
|
| 346 | - * |
|
| 347 | - * This would remove the decorator named "decorator1" from the list of |
|
| 348 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 349 | - * "client/html/common/decorators/default" to the html client. |
|
| 350 | - * |
|
| 351 | - * @param array List of decorator names |
|
| 352 | - * @since 2014.05 |
|
| 353 | - * @category Developer |
|
| 354 | - * @see client/html/common/decorators/default |
|
| 355 | - * @see client/html/email/watch/decorators/global |
|
| 356 | - * @see client/html/email/watch/decorators/local |
|
| 357 | - */ |
|
| 358 | - |
|
| 359 | - /** client/html/email/watch/decorators/global |
|
| 360 | - * Adds a list of globally available decorators only to the email watch html client |
|
| 361 | - * |
|
| 362 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 363 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 364 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 365 | - * modify what is returned to the caller. |
|
| 366 | - * |
|
| 367 | - * This option allows you to wrap global decorators |
|
| 368 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 369 | - * |
|
| 370 | - * client/html/email/watch/decorators/global = array( 'decorator1' ) |
|
| 371 | - * |
|
| 372 | - * This would add the decorator named "decorator1" defined by |
|
| 373 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 374 | - * |
|
| 375 | - * @param array List of decorator names |
|
| 376 | - * @since 2014.05 |
|
| 377 | - * @category Developer |
|
| 378 | - * @see client/html/common/decorators/default |
|
| 379 | - * @see client/html/email/watch/decorators/excludes |
|
| 380 | - * @see client/html/email/watch/decorators/local |
|
| 381 | - */ |
|
| 382 | - |
|
| 383 | - /** client/html/email/watch/decorators/local |
|
| 384 | - * Adds a list of local decorators only to the email watch html client |
|
| 385 | - * |
|
| 386 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 387 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 388 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 389 | - * modify what is returned to the caller. |
|
| 390 | - * |
|
| 391 | - * This option allows you to wrap local decorators |
|
| 392 | - * ("\Aimeos\Client\Html\Email\Decorator\*") around the html client. |
|
| 393 | - * |
|
| 394 | - * client/html/email/watch/decorators/local = array( 'decorator2' ) |
|
| 395 | - * |
|
| 396 | - * This would add the decorator named "decorator2" defined by |
|
| 397 | - * "\Aimeos\Client\Html\Email\Decorator\Decorator2" only to the html client. |
|
| 398 | - * |
|
| 399 | - * @param array List of decorator names |
|
| 400 | - * @since 2014.05 |
|
| 401 | - * @category Developer |
|
| 402 | - * @see client/html/common/decorators/default |
|
| 403 | - * @see client/html/email/watch/decorators/excludes |
|
| 404 | - * @see client/html/email/watch/decorators/global |
|
| 405 | - */ |
|
| 406 | - |
|
| 407 | - return $this->createSubClient( 'email/watch/' . $type, $name ); |
|
| 408 | - } |
|
| 409 | - |
|
| 410 | - |
|
| 411 | - /** |
|
| 412 | - * Returns the list of sub-client names configured for the client. |
|
| 413 | - * |
|
| 414 | - * @return array List of HTML client names |
|
| 415 | - */ |
|
| 416 | - protected function getSubClientNames() |
|
| 417 | - { |
|
| 418 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 419 | - } |
|
| 25 | + /** client/html/email/watch/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the product notification 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 2014.03 |
|
| 56 | + * @category Developer |
|
| 57 | + */ |
|
| 58 | + private $subPartPath = 'client/html/email/watch/standard/subparts'; |
|
| 59 | + |
|
| 60 | + /** client/html/email/watch/text/name |
|
| 61 | + * Name of the text part used by the product notification e-mail client implementation |
|
| 62 | + * |
|
| 63 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Watch\Text\Myname". |
|
| 64 | + * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 65 | + * |
|
| 66 | + * @param string Last part of the client class name |
|
| 67 | + * @since 2014.03 |
|
| 68 | + * @category Developer |
|
| 69 | + */ |
|
| 70 | + |
|
| 71 | + /** client/html/email/watch/html/name |
|
| 72 | + * Name of the html part used by the product notification e-mail client implementation |
|
| 73 | + * |
|
| 74 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Watch\Html\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 | + private $subPartNames = array( 'text', 'html' ); |
|
| 82 | + |
|
| 83 | + |
|
| 84 | + /** |
|
| 85 | + * Returns the HTML code for insertion into the body. |
|
| 86 | + * |
|
| 87 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 88 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 89 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 90 | + * @return string HTML code |
|
| 91 | + */ |
|
| 92 | + public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 93 | + { |
|
| 94 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 95 | + |
|
| 96 | + $content = ''; |
|
| 97 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 98 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 99 | + } |
|
| 100 | + $view->watchBody = $content; |
|
| 101 | + |
|
| 102 | + /** client/html/email/watch/standard/template-body |
|
| 103 | + * Relative path to the HTML body template of the product notification e-mail client. |
|
| 104 | + * |
|
| 105 | + * The template file contains the HTML code and processing instructions |
|
| 106 | + * to generate the result shown in the body of the frontend. The |
|
| 107 | + * configuration string is the path to the template file relative |
|
| 108 | + * to the templates directory (usually in client/html/templates). |
|
| 109 | + * |
|
| 110 | + * You can overwrite the template file configuration in extensions and |
|
| 111 | + * provide alternative templates. These alternative templates should be |
|
| 112 | + * named like the default one but with the string "standard" replaced by |
|
| 113 | + * an unique name. You may use the name of your project for this. If |
|
| 114 | + * you've implemented an alternative client class as well, "standard" |
|
| 115 | + * should be replaced by the name of the new class. |
|
| 116 | + * |
|
| 117 | + * The product notification e-mail HTML client allows to use a different template for |
|
| 118 | + * each watch status value. You can create a template for each watch |
|
| 119 | + * status and store it in the "email/watch/<status number>/" directory |
|
| 120 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 121 | + * specific layout template is found, the common template in the |
|
| 122 | + * "email/watch/" directory is used. |
|
| 123 | + * |
|
| 124 | + * @param string Relative path to the template creating code for the HTML page body |
|
| 125 | + * @since 2014.03 |
|
| 126 | + * @category Developer |
|
| 127 | + * @see client/html/email/watch/standard/template-header |
|
| 128 | + */ |
|
| 129 | + $tplconf = 'client/html/email/watch/standard/template-body'; |
|
| 130 | + |
|
| 131 | + return $view->render( $view->config( $tplconf, 'email/watch/body-default.php' ) ); |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + |
|
| 135 | + /** |
|
| 136 | + * Returns the HTML string for insertion into the header. |
|
| 137 | + * |
|
| 138 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 139 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 140 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 141 | + * @return string|null String including HTML tags for the header on error |
|
| 142 | + */ |
|
| 143 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 144 | + { |
|
| 145 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 146 | + |
|
| 147 | + $content = ''; |
|
| 148 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 149 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 150 | + } |
|
| 151 | + $view->watchHeader = $content; |
|
| 152 | + |
|
| 153 | + |
|
| 154 | + $addr = $view->extAddressItem; |
|
| 155 | + |
|
| 156 | + $msg = $view->mail(); |
|
| 157 | + $msg->addHeader( 'X-MailGenerator', 'Aimeos' ); |
|
| 158 | + $msg->addTo( $addr->getEMail(), $addr->getFirstName() . ' ' . $addr->getLastName() ); |
|
| 159 | + |
|
| 160 | + |
|
| 161 | + /** client/html/email/from-name |
|
| 162 | + * @see client/html/email/watch/from-email |
|
| 163 | + */ |
|
| 164 | + $fromName = $view->config( 'client/html/email/from-name' ); |
|
| 165 | + |
|
| 166 | + /** client/html/email/watch/from-name |
|
| 167 | + * Name used when sending product notification e-mails |
|
| 168 | + * |
|
| 169 | + * The name of the person or e-mail account that is used for sending all |
|
| 170 | + * shop related watch e-mails to customers. This configuration option |
|
| 171 | + * overwrite the name set in "client/html/email/from-name". |
|
| 172 | + * |
|
| 173 | + * @param string Name shown in the e-mail |
|
| 174 | + * @since 2014.03 |
|
| 175 | + * @category User |
|
| 176 | + * @see client/html/email/from-name |
|
| 177 | + * @see client/html/email/from-email |
|
| 178 | + * @see client/html/email/reply-email |
|
| 179 | + * @see client/html/email/bcc-email |
|
| 180 | + */ |
|
| 181 | + $fromNameWatch = $view->config( 'client/html/email/watch/from-name', $fromName ); |
|
| 182 | + |
|
| 183 | + /** client/html/email/from-email |
|
| 184 | + * @see client/html/email/watch/from-email |
|
| 185 | + */ |
|
| 186 | + $fromEmail = $view->config( 'client/html/email/from-email' ); |
|
| 187 | + |
|
| 188 | + /** client/html/email/watch/from-email |
|
| 189 | + * E-Mail address used when sending product notification e-mails |
|
| 190 | + * |
|
| 191 | + * The e-mail address of the person or account that is used for sending |
|
| 192 | + * all shop related product notification e-mails to customers. This configuration option |
|
| 193 | + * overwrites the e-mail address set via "client/html/email/from-email". |
|
| 194 | + * |
|
| 195 | + * @param string E-mail address |
|
| 196 | + * @since 2014.03 |
|
| 197 | + * @category User |
|
| 198 | + * @see client/html/email/watch/from-name |
|
| 199 | + * @see client/html/email/from-email |
|
| 200 | + * @see client/html/email/reply-email |
|
| 201 | + * @see client/html/email/bcc-email |
|
| 202 | + */ |
|
| 203 | + if( ( $fromEmailWatch = $view->config( 'client/html/email/watch/from-email', $fromEmail ) ) != null ) { |
|
| 204 | + $msg->addFrom( $fromEmailWatch, $fromNameWatch ); |
|
| 205 | + } |
|
| 206 | + |
|
| 207 | + |
|
| 208 | + /** client/html/email/reply-name |
|
| 209 | + * @see client/html/email/watch/reply-email |
|
| 210 | + */ |
|
| 211 | + $replyName = $view->config( 'client/html/email/reply-name', $fromName ); |
|
| 212 | + |
|
| 213 | + /** client/html/email/watch/reply-name |
|
| 214 | + * Recipient name displayed when the customer replies to product notification e-mails |
|
| 215 | + * |
|
| 216 | + * The name of the person or e-mail account the customer should |
|
| 217 | + * reply to in case of watch related questions or problems. This |
|
| 218 | + * configuration option overwrites the name set via |
|
| 219 | + * "client/html/email/reply-name". |
|
| 220 | + * |
|
| 221 | + * @param string Name shown in the e-mail |
|
| 222 | + * @since 2014.03 |
|
| 223 | + * @category User |
|
| 224 | + * @see client/html/email/watch/reply-email |
|
| 225 | + * @see client/html/email/reply-name |
|
| 226 | + * @see client/html/email/reply-email |
|
| 227 | + * @see client/html/email/from-email |
|
| 228 | + * @see client/html/email/bcc-email |
|
| 229 | + */ |
|
| 230 | + $replyNameWatch = $view->config( 'client/html/email/watch/reply-name', $replyName ); |
|
| 231 | + |
|
| 232 | + /** client/html/email/reply-email |
|
| 233 | + * @see client/html/email/watch/reply-email |
|
| 234 | + */ |
|
| 235 | + $replyEmail = $view->config( 'client/html/email/reply-email', $fromEmail ); |
|
| 236 | + |
|
| 237 | + /** client/html/email/watch/reply-email |
|
| 238 | + * E-Mail address used by the customer when replying to product notification e-mails |
|
| 239 | + * |
|
| 240 | + * The e-mail address of the person or e-mail account the customer |
|
| 241 | + * should reply to in case of watch related questions or problems. |
|
| 242 | + * This configuration option overwrites the e-mail address set via |
|
| 243 | + * "client/html/email/reply-email". |
|
| 244 | + * |
|
| 245 | + * @param string E-mail address |
|
| 246 | + * @since 2014.03 |
|
| 247 | + * @category User |
|
| 248 | + * @see client/html/email/watch/reply-name |
|
| 249 | + * @see client/html/email/reply-email |
|
| 250 | + * @see client/html/email/from-email |
|
| 251 | + * @see client/html/email/bcc-email |
|
| 252 | + */ |
|
| 253 | + if( ( $replyEmailWatch = $view->config( 'client/html/email/watch/reply-email', $replyEmail ) ) != null ) { |
|
| 254 | + $msg->addReplyTo( $replyEmailWatch, $replyNameWatch ); |
|
| 255 | + } |
|
| 256 | + |
|
| 257 | + |
|
| 258 | + /** client/html/email/bcc-email |
|
| 259 | + * @see client/html/email/watch/bcc-email |
|
| 260 | + */ |
|
| 261 | + $bccEmail = $view->config( 'client/html/email/bcc-email' ); |
|
| 262 | + |
|
| 263 | + /** client/html/email/watch/bcc-email |
|
| 264 | + * E-Mail address all product notification e-mails should be also sent to |
|
| 265 | + * |
|
| 266 | + * Using this option you can send a copy of all watch related e-mails |
|
| 267 | + * to a second e-mail account. This can be handy for testing and checking |
|
| 268 | + * the e-mails sent to customers. |
|
| 269 | + * |
|
| 270 | + * It also allows shop owners with a very small volume of orders to be |
|
| 271 | + * notified about watch changes. Be aware that this isn't useful if the |
|
| 272 | + * order volumne is high or has peeks! |
|
| 273 | + * |
|
| 274 | + * This configuration option overwrites the e-mail address set via |
|
| 275 | + * "client/html/email/bcc-email". |
|
| 276 | + * |
|
| 277 | + * @param string E-mail address |
|
| 278 | + * @since 2014.03 |
|
| 279 | + * @category User |
|
| 280 | + * @category Developer |
|
| 281 | + * @see client/html/email/bcc-email |
|
| 282 | + * @see client/html/email/reply-email |
|
| 283 | + * @see client/html/email/from-email |
|
| 284 | + */ |
|
| 285 | + if( ( $bccEmailWatch = $view->config( 'client/html/email/watch/bcc-email', $bccEmail ) ) != null ) { |
|
| 286 | + $msg->addBcc( $bccEmailWatch ); |
|
| 287 | + } |
|
| 288 | + |
|
| 289 | + |
|
| 290 | + /** client/html/email/watch/standard/template-header |
|
| 291 | + * Relative path to the HTML header template of the product notification e-mail client. |
|
| 292 | + * |
|
| 293 | + * The template file contains the HTML code and processing instructions |
|
| 294 | + * to generate the HTML code that is inserted into the HTML page header |
|
| 295 | + * of the rendered page in the frontend. The configuration string is the |
|
| 296 | + * path to the template file relative to the templates directory (usually |
|
| 297 | + * in client/html/templates). |
|
| 298 | + * |
|
| 299 | + * You can overwrite the template file configuration in extensions and |
|
| 300 | + * provide alternative templates. These alternative templates should be |
|
| 301 | + * named like the default one but with the string "standard" replaced by |
|
| 302 | + * an unique name. You may use the name of your project for this. If |
|
| 303 | + * you've implemented an alternative client class as well, "standard" |
|
| 304 | + * should be replaced by the name of the new class. |
|
| 305 | + * |
|
| 306 | + * The product notification e-mail HTML client allows to use a different template for |
|
| 307 | + * each watch status value. You can create a template for each watch |
|
| 308 | + * status and store it in the "email/watch/<status number>/" directory |
|
| 309 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 310 | + * specific layout template is found, the common template in the |
|
| 311 | + * "email/watch/" directory is used. |
|
| 312 | + * |
|
| 313 | + * @param string Relative path to the template creating code for the HTML page head |
|
| 314 | + * @since 2014.03 |
|
| 315 | + * @category Developer |
|
| 316 | + * @see client/html/email/watch/standard/template-body |
|
| 317 | + */ |
|
| 318 | + $tplconf = 'client/html/email/watch/standard/template-header'; |
|
| 319 | + |
|
| 320 | + return $view->render( $view->config( $tplconf, 'email/watch/header-default.php' ) ); ; |
|
| 321 | + } |
|
| 322 | + |
|
| 323 | + |
|
| 324 | + /** |
|
| 325 | + * Returns the sub-client given by its name. |
|
| 326 | + * |
|
| 327 | + * @param string $type Name of the client type |
|
| 328 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 329 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 330 | + */ |
|
| 331 | + public function getSubClient( $type, $name = null ) |
|
| 332 | + { |
|
| 333 | + /** client/html/email/watch/decorators/excludes |
|
| 334 | + * Excludes decorators added by the "common" option from the email watch html client |
|
| 335 | + * |
|
| 336 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 337 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 338 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 339 | + * modify what is returned to the caller. |
|
| 340 | + * |
|
| 341 | + * This option allows you to remove a decorator added via |
|
| 342 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 343 | + * around the html client. |
|
| 344 | + * |
|
| 345 | + * client/html/email/watch/decorators/excludes = array( 'decorator1' ) |
|
| 346 | + * |
|
| 347 | + * This would remove the decorator named "decorator1" from the list of |
|
| 348 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 349 | + * "client/html/common/decorators/default" to the html client. |
|
| 350 | + * |
|
| 351 | + * @param array List of decorator names |
|
| 352 | + * @since 2014.05 |
|
| 353 | + * @category Developer |
|
| 354 | + * @see client/html/common/decorators/default |
|
| 355 | + * @see client/html/email/watch/decorators/global |
|
| 356 | + * @see client/html/email/watch/decorators/local |
|
| 357 | + */ |
|
| 358 | + |
|
| 359 | + /** client/html/email/watch/decorators/global |
|
| 360 | + * Adds a list of globally available decorators only to the email watch html client |
|
| 361 | + * |
|
| 362 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 363 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 364 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 365 | + * modify what is returned to the caller. |
|
| 366 | + * |
|
| 367 | + * This option allows you to wrap global decorators |
|
| 368 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 369 | + * |
|
| 370 | + * client/html/email/watch/decorators/global = array( 'decorator1' ) |
|
| 371 | + * |
|
| 372 | + * This would add the decorator named "decorator1" defined by |
|
| 373 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 374 | + * |
|
| 375 | + * @param array List of decorator names |
|
| 376 | + * @since 2014.05 |
|
| 377 | + * @category Developer |
|
| 378 | + * @see client/html/common/decorators/default |
|
| 379 | + * @see client/html/email/watch/decorators/excludes |
|
| 380 | + * @see client/html/email/watch/decorators/local |
|
| 381 | + */ |
|
| 382 | + |
|
| 383 | + /** client/html/email/watch/decorators/local |
|
| 384 | + * Adds a list of local decorators only to the email watch html client |
|
| 385 | + * |
|
| 386 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 387 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 388 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 389 | + * modify what is returned to the caller. |
|
| 390 | + * |
|
| 391 | + * This option allows you to wrap local decorators |
|
| 392 | + * ("\Aimeos\Client\Html\Email\Decorator\*") around the html client. |
|
| 393 | + * |
|
| 394 | + * client/html/email/watch/decorators/local = array( 'decorator2' ) |
|
| 395 | + * |
|
| 396 | + * This would add the decorator named "decorator2" defined by |
|
| 397 | + * "\Aimeos\Client\Html\Email\Decorator\Decorator2" only to the html client. |
|
| 398 | + * |
|
| 399 | + * @param array List of decorator names |
|
| 400 | + * @since 2014.05 |
|
| 401 | + * @category Developer |
|
| 402 | + * @see client/html/common/decorators/default |
|
| 403 | + * @see client/html/email/watch/decorators/excludes |
|
| 404 | + * @see client/html/email/watch/decorators/global |
|
| 405 | + */ |
|
| 406 | + |
|
| 407 | + return $this->createSubClient( 'email/watch/' . $type, $name ); |
|
| 408 | + } |
|
| 409 | + |
|
| 410 | + |
|
| 411 | + /** |
|
| 412 | + * Returns the list of sub-client names configured for the client. |
|
| 413 | + * |
|
| 414 | + * @return array List of HTML client names |
|
| 415 | + */ |
|
| 416 | + protected function getSubClientNames() |
|
| 417 | + { |
|
| 418 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 419 | + } |
|
| 420 | 420 | } |
| 421 | 421 | \ No newline at end of file |