@@ -19,69 +19,69 @@ |
||
| 19 | 19 | * @subpackage Html |
| 20 | 20 | */ |
| 21 | 21 | class Factory |
| 22 | - extends \Aimeos\Client\Html\Common\Factory\Base |
|
| 23 | - implements \Aimeos\Client\Html\Common\Factory\Iface |
|
| 22 | + extends \Aimeos\Client\Html\Common\Factory\Base |
|
| 23 | + implements \Aimeos\Client\Html\Common\Factory\Iface |
|
| 24 | 24 | { |
| 25 | - /** |
|
| 26 | - * Creates a delivery email client object. |
|
| 27 | - * |
|
| 28 | - * @param \Aimeos\MShop\Context\Item\Iface $context Shop context instance with necessary objects |
|
| 29 | - * @param array $templatePaths List of file system paths where the templates are stored |
|
| 30 | - * @param string|null $name Client name (default: "Standard") |
|
| 31 | - * @return \Aimeos\Client\Html\Iface Filter part implementing \Aimeos\Client\Html\Iface |
|
| 32 | - * @throws \Aimeos\Client\Html\Exception If requested client implementation couldn't be found or initialisation fails |
|
| 33 | - */ |
|
| 34 | - public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null ) |
|
| 35 | - { |
|
| 36 | - /** client/html/email/delivery/name |
|
| 37 | - * Class name of the used email delivery client implementation |
|
| 38 | - * |
|
| 39 | - * Each default HTML client can be replace by an alternative imlementation. |
|
| 40 | - * To use this implementation, you have to set the last part of the class |
|
| 41 | - * name as configuration value so the client factory knows which class it |
|
| 42 | - * has to instantiate. |
|
| 43 | - * |
|
| 44 | - * For example, if the name of the default class is |
|
| 45 | - * |
|
| 46 | - * \Aimeos\Client\Html\Email\Delivery\Standard |
|
| 47 | - * |
|
| 48 | - * and you want to replace it with your own version named |
|
| 49 | - * |
|
| 50 | - * \Aimeos\Client\Html\Email\Delivery\Mydelivery |
|
| 51 | - * |
|
| 52 | - * then you have to set the this configuration option: |
|
| 53 | - * |
|
| 54 | - * client/html/email/delivery/name = Mydelivery |
|
| 55 | - * |
|
| 56 | - * The value is the last part of your own class name and it's case sensitive, |
|
| 57 | - * so take care that the configuration value is exactly named like the last |
|
| 58 | - * part of the class name. |
|
| 59 | - * |
|
| 60 | - * The allowed characters of the class name are A-Z, a-z and 0-9. No other |
|
| 61 | - * characters are possible! You should always start the last part of the class |
|
| 62 | - * name with an upper case character and continue only with lower case characters |
|
| 63 | - * or numbers. Avoid chamel case names like "MyDelivery"! |
|
| 64 | - * |
|
| 65 | - * @param string Last part of the class name |
|
| 66 | - * @since 2014.03 |
|
| 67 | - * @category Developer |
|
| 68 | - */ |
|
| 69 | - if( $name === null ) { |
|
| 70 | - $name = $context->getConfig()->get( 'client/html/email/delivery/name', 'Standard' ); |
|
| 71 | - } |
|
| 25 | + /** |
|
| 26 | + * Creates a delivery email client object. |
|
| 27 | + * |
|
| 28 | + * @param \Aimeos\MShop\Context\Item\Iface $context Shop context instance with necessary objects |
|
| 29 | + * @param array $templatePaths List of file system paths where the templates are stored |
|
| 30 | + * @param string|null $name Client name (default: "Standard") |
|
| 31 | + * @return \Aimeos\Client\Html\Iface Filter part implementing \Aimeos\Client\Html\Iface |
|
| 32 | + * @throws \Aimeos\Client\Html\Exception If requested client implementation couldn't be found or initialisation fails |
|
| 33 | + */ |
|
| 34 | + public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null ) |
|
| 35 | + { |
|
| 36 | + /** client/html/email/delivery/name |
|
| 37 | + * Class name of the used email delivery client implementation |
|
| 38 | + * |
|
| 39 | + * Each default HTML client can be replace by an alternative imlementation. |
|
| 40 | + * To use this implementation, you have to set the last part of the class |
|
| 41 | + * name as configuration value so the client factory knows which class it |
|
| 42 | + * has to instantiate. |
|
| 43 | + * |
|
| 44 | + * For example, if the name of the default class is |
|
| 45 | + * |
|
| 46 | + * \Aimeos\Client\Html\Email\Delivery\Standard |
|
| 47 | + * |
|
| 48 | + * and you want to replace it with your own version named |
|
| 49 | + * |
|
| 50 | + * \Aimeos\Client\Html\Email\Delivery\Mydelivery |
|
| 51 | + * |
|
| 52 | + * then you have to set the this configuration option: |
|
| 53 | + * |
|
| 54 | + * client/html/email/delivery/name = Mydelivery |
|
| 55 | + * |
|
| 56 | + * The value is the last part of your own class name and it's case sensitive, |
|
| 57 | + * so take care that the configuration value is exactly named like the last |
|
| 58 | + * part of the class name. |
|
| 59 | + * |
|
| 60 | + * The allowed characters of the class name are A-Z, a-z and 0-9. No other |
|
| 61 | + * characters are possible! You should always start the last part of the class |
|
| 62 | + * name with an upper case character and continue only with lower case characters |
|
| 63 | + * or numbers. Avoid chamel case names like "MyDelivery"! |
|
| 64 | + * |
|
| 65 | + * @param string Last part of the class name |
|
| 66 | + * @since 2014.03 |
|
| 67 | + * @category Developer |
|
| 68 | + */ |
|
| 69 | + if( $name === null ) { |
|
| 70 | + $name = $context->getConfig()->get( 'client/html/email/delivery/name', 'Standard' ); |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - if( ctype_alnum( $name ) === false ) |
|
| 74 | - { |
|
| 75 | - $classname = is_string( $name ) ? '\\Aimeos\\Client\\Html\\Email\\Delivery\\' . $name : '<not a string>'; |
|
| 76 | - throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
| 77 | - } |
|
| 73 | + if( ctype_alnum( $name ) === false ) |
|
| 74 | + { |
|
| 75 | + $classname = is_string( $name ) ? '\\Aimeos\\Client\\Html\\Email\\Delivery\\' . $name : '<not a string>'; |
|
| 76 | + throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - $iface = '\\Aimeos\\Client\\Html\\Iface'; |
|
| 80 | - $classname = '\\Aimeos\\Client\\Html\\Email\\Delivery\\' . $name; |
|
| 79 | + $iface = '\\Aimeos\\Client\\Html\\Iface'; |
|
| 80 | + $classname = '\\Aimeos\\Client\\Html\\Email\\Delivery\\' . $name; |
|
| 81 | 81 | |
| 82 | - $client = self::createClientBase( $context, $classname, $iface, $templatePaths ); |
|
| 82 | + $client = self::createClientBase( $context, $classname, $iface, $templatePaths ); |
|
| 83 | 83 | |
| 84 | - return self::addClientDecorators( $context, $client, $templatePaths, 'email/delivery' ); |
|
| 85 | - } |
|
| 84 | + return self::addClientDecorators( $context, $client, $templatePaths, 'email/delivery' ); |
|
| 85 | + } |
|
| 86 | 86 | } |
| 87 | 87 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * @return \Aimeos\Client\Html\Iface Filter part implementing \Aimeos\Client\Html\Iface |
| 32 | 32 | * @throws \Aimeos\Client\Html\Exception If requested client implementation couldn't be found or initialisation fails |
| 33 | 33 | */ |
| 34 | - public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null ) |
|
| 34 | + public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $name = null) |
|
| 35 | 35 | { |
| 36 | 36 | /** client/html/email/delivery/name |
| 37 | 37 | * Class name of the used email delivery client implementation |
@@ -66,22 +66,22 @@ discard block |
||
| 66 | 66 | * @since 2014.03 |
| 67 | 67 | * @category Developer |
| 68 | 68 | */ |
| 69 | - if( $name === null ) { |
|
| 70 | - $name = $context->getConfig()->get( 'client/html/email/delivery/name', 'Standard' ); |
|
| 69 | + if ($name === null) { |
|
| 70 | + $name = $context->getConfig()->get('client/html/email/delivery/name', 'Standard'); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if( ctype_alnum( $name ) === false ) |
|
| 73 | + if (ctype_alnum($name) === false) |
|
| 74 | 74 | { |
| 75 | - $classname = is_string( $name ) ? '\\Aimeos\\Client\\Html\\Email\\Delivery\\' . $name : '<not a string>'; |
|
| 76 | - throw new \Aimeos\Client\Html\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) ); |
|
| 75 | + $classname = is_string($name) ? '\\Aimeos\\Client\\Html\\Email\\Delivery\\'.$name : '<not a string>'; |
|
| 76 | + throw new \Aimeos\Client\Html\Exception(sprintf('Invalid characters in class name "%1$s"', $classname)); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | $iface = '\\Aimeos\\Client\\Html\\Iface'; |
| 80 | - $classname = '\\Aimeos\\Client\\Html\\Email\\Delivery\\' . $name; |
|
| 80 | + $classname = '\\Aimeos\\Client\\Html\\Email\\Delivery\\'.$name; |
|
| 81 | 81 | |
| 82 | - $client = self::createClientBase( $context, $classname, $iface, $templatePaths ); |
|
| 82 | + $client = self::createClientBase($context, $classname, $iface, $templatePaths); |
|
| 83 | 83 | |
| 84 | - return self::addClientDecorators( $context, $client, $templatePaths, 'email/delivery' ); |
|
| 84 | + return self::addClientDecorators($context, $client, $templatePaths, 'email/delivery'); |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
@@ -19,473 +19,473 @@ |
||
| 19 | 19 | * @subpackage Html |
| 20 | 20 | */ |
| 21 | 21 | class Standard |
| 22 | - extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
| 23 | - implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 22 | + extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
| 23 | + implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 24 | 24 | { |
| 25 | - /** client/html/email/delivery/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email delivery section |
|
| 27 | - * |
|
| 28 | - * The output of the frontend is composed of the code generated by the HTML |
|
| 29 | - * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 30 | - * that are responsible for rendering certain sub-parts of the output. The |
|
| 31 | - * sub-clients can contain HTML clients themselves and therefore a |
|
| 32 | - * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 33 | - * the output that is placed inside the container of its parent. |
|
| 34 | - * |
|
| 35 | - * At first, always the HTML code generated by the parent is printed, then |
|
| 36 | - * the HTML code of its sub-clients. The order of the HTML sub-clients |
|
| 37 | - * determines the order of the output of these sub-clients inside the parent |
|
| 38 | - * container. If the configured list of clients is |
|
| 39 | - * |
|
| 40 | - * array( "subclient1", "subclient2" ) |
|
| 41 | - * |
|
| 42 | - * you can easily change the order of the output by reordering the subparts: |
|
| 43 | - * |
|
| 44 | - * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 45 | - * |
|
| 46 | - * You can also remove one or more parts if they shouldn't be rendered: |
|
| 47 | - * |
|
| 48 | - * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 49 | - * |
|
| 50 | - * As the clients only generates structural HTML, the layout defined via CSS |
|
| 51 | - * should support adding, removing or reordering content by a fluid like |
|
| 52 | - * design. |
|
| 53 | - * |
|
| 54 | - * @param array List of sub-client names |
|
| 55 | - * @since 2014.03 |
|
| 56 | - * @category Developer |
|
| 57 | - */ |
|
| 58 | - private $subPartPath = 'client/html/email/delivery/standard/subparts'; |
|
| 59 | - |
|
| 60 | - /** client/html/email/delivery/text/name |
|
| 61 | - * Name of the text part used by the email delivery client implementation |
|
| 62 | - * |
|
| 63 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\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/delivery/html/name |
|
| 72 | - * Name of the html part used by the email delivery client implementation |
|
| 73 | - * |
|
| 74 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\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->deliveryBody = $content; |
|
| 101 | - |
|
| 102 | - /** client/html/email/delivery/standard/template-body |
|
| 103 | - * Relative path to the text body template of the email delivery client. |
|
| 104 | - * |
|
| 105 | - * The template file contains the text and processing instructions |
|
| 106 | - * to generate the result shown in the e-mail. 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 email delivery text client allows to use a different template for |
|
| 118 | - * each delivery status value. You can create a template for each delivery |
|
| 119 | - * status and store it in the "email/delivery/<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/delivery/" directory is used. |
|
| 123 | - * |
|
| 124 | - * @param string Relative path to the template creating code for the e-mail body |
|
| 125 | - * @since 2014.03 |
|
| 126 | - * @category Developer |
|
| 127 | - * @see client/html/email/delivery/standard/template-header |
|
| 128 | - */ |
|
| 129 | - $tplconf = 'client/html/email/delivery/standard/template-body'; |
|
| 130 | - |
|
| 131 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 132 | - $default = array( 'email/delivery/' . $status . '/body-default.php', 'email/delivery/body-default.php' ); |
|
| 133 | - |
|
| 134 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 135 | - } |
|
| 136 | - |
|
| 137 | - |
|
| 138 | - /** |
|
| 139 | - * Returns the HTML string for insertion into the header. |
|
| 140 | - * |
|
| 141 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 142 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 143 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 144 | - * @return string|null String including HTML tags for the header on error |
|
| 145 | - */ |
|
| 146 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 147 | - { |
|
| 148 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 149 | - |
|
| 150 | - $content = ''; |
|
| 151 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 152 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 153 | - } |
|
| 154 | - $view->deliveryHeader = $content; |
|
| 155 | - |
|
| 156 | - |
|
| 157 | - $addr = $view->extAddressItem; |
|
| 158 | - $billAddr = $view->extOrderBaseItem->getAddress( \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT ); |
|
| 159 | - |
|
| 160 | - $msg = $view->mail(); |
|
| 161 | - $msg->addHeader( 'X-MailGenerator', 'Aimeos' ); |
|
| 162 | - $msg->addTo( $addr->getEMail(), $addr->getFirstName() . ' ' . $addr->getLastName() ); |
|
| 163 | - |
|
| 164 | - if( $billAddr->getEMail() != $addr->getEmail() ) { |
|
| 165 | - $msg->addCc( $billAddr->getEMail(), $billAddr->getFirstName() . ' ' . $billAddr->getLastName() ); |
|
| 166 | - } |
|
| 167 | - |
|
| 168 | - /** client/html/email/from-name |
|
| 169 | - * Name used when sending e-mails |
|
| 170 | - * |
|
| 171 | - * The name of the person or e-mail account that is used for sending all |
|
| 172 | - * shop related emails to customers. |
|
| 173 | - * |
|
| 174 | - * @param string Name shown in the e-mail |
|
| 175 | - * @since 2014.03 |
|
| 176 | - * @category User |
|
| 177 | - * @see client/html/email/delivery/from-name |
|
| 178 | - * @see client/html/email/from-email |
|
| 179 | - * @see client/html/email/reply-email |
|
| 180 | - * @see client/html/email/bcc-email |
|
| 181 | - */ |
|
| 182 | - $fromName = $view->config( 'client/html/email/from-name' ); |
|
| 183 | - |
|
| 184 | - /** client/html/email/delivery/from-name |
|
| 185 | - * Name used when sending delivery e-mails |
|
| 186 | - * |
|
| 187 | - * The name of the person or e-mail account that is used for sending all |
|
| 188 | - * shop related delivery e-mails to customers. This configuration option |
|
| 189 | - * overwrites the name set in "client/html/email/from-name". |
|
| 190 | - * |
|
| 191 | - * @param string Name shown in the e-mail |
|
| 192 | - * @since 2014.03 |
|
| 193 | - * @category User |
|
| 194 | - * @see client/html/email/from-name |
|
| 195 | - * @see client/html/email/from-email |
|
| 196 | - * @see client/html/email/reply-email |
|
| 197 | - * @see client/html/email/bcc-email |
|
| 198 | - */ |
|
| 199 | - $fromNameDelivery = $view->config( 'client/html/email/delivery/from-name', $fromName ); |
|
| 200 | - |
|
| 201 | - /** client/html/email/from-email |
|
| 202 | - * E-Mail address used when sending e-mails |
|
| 203 | - * |
|
| 204 | - * The e-mail address of the person or account that is used for sending |
|
| 205 | - * all shop related emails to customers. |
|
| 206 | - * |
|
| 207 | - * @param string E-mail address |
|
| 208 | - * @since 2014.03 |
|
| 209 | - * @category User |
|
| 210 | - * @see client/html/email/from-name |
|
| 211 | - * @see client/html/email/delivery/from-email |
|
| 212 | - * @see client/html/email/reply-email |
|
| 213 | - * @see client/html/email/bcc-email |
|
| 214 | - */ |
|
| 215 | - $fromEmail = $view->config( 'client/html/email/from-email' ); |
|
| 216 | - |
|
| 217 | - /** client/html/email/delivery/from-email |
|
| 218 | - * E-Mail address used when sending delivery e-mails |
|
| 219 | - * |
|
| 220 | - * The e-mail address of the person or account that is used for sending |
|
| 221 | - * all shop related delivery emails to customers. This configuration option |
|
| 222 | - * overwrites the e-mail address set via "client/html/email/from-email". |
|
| 223 | - * |
|
| 224 | - * @param string E-mail address |
|
| 225 | - * @since 2014.03 |
|
| 226 | - * @category User |
|
| 227 | - * @see client/html/email/delivery/from-name |
|
| 228 | - * @see client/html/email/from-email |
|
| 229 | - * @see client/html/email/reply-email |
|
| 230 | - * @see client/html/email/bcc-email |
|
| 231 | - */ |
|
| 232 | - if( ( $fromEmailDelivery = $view->config( 'client/html/email/delivery/from-email', $fromEmail ) ) != null ) { |
|
| 233 | - $msg->addFrom( $fromEmailDelivery, $fromNameDelivery ); |
|
| 234 | - } |
|
| 235 | - |
|
| 236 | - |
|
| 237 | - /** client/html/email/reply-name |
|
| 238 | - * Recipient name displayed when the customer replies to e-mails |
|
| 239 | - * |
|
| 240 | - * The name of the person or e-mail account the customer should |
|
| 241 | - * reply to in case of questions or problems. If no reply name is |
|
| 242 | - * configured, the name person or e-mail account set via |
|
| 243 | - * "client/html/email/from-name" is used. |
|
| 244 | - * |
|
| 245 | - * @param string Name shown in the e-mail |
|
| 246 | - * @since 2014.03 |
|
| 247 | - * @category User |
|
| 248 | - * @see client/html/email/reply-email |
|
| 249 | - * @see client/html/email/delivery/reply-email |
|
| 250 | - * @see client/html/email/from-email |
|
| 251 | - * @see client/html/email/from-name |
|
| 252 | - * @see client/html/email/bcc-email |
|
| 253 | - */ |
|
| 254 | - $replyName = $view->config( 'client/html/email/reply-name', $fromName ); |
|
| 255 | - |
|
| 256 | - /** client/html/email/delivery/reply-name |
|
| 257 | - * Recipient name displayed when the customer replies to delivery e-mails |
|
| 258 | - * |
|
| 259 | - * The name of the person or e-mail account the customer should |
|
| 260 | - * reply to in case of questions or problems. This configuration option |
|
| 261 | - * overwrites the name set via "client/html/email/reply-name". |
|
| 262 | - * |
|
| 263 | - * @param string Name shown in the e-mail |
|
| 264 | - * @since 2014.03 |
|
| 265 | - * @category User |
|
| 266 | - * @see client/html/email/delivery/reply-email |
|
| 267 | - * @see client/html/email/reply-name |
|
| 268 | - * @see client/html/email/reply-email |
|
| 269 | - * @see client/html/email/from-email |
|
| 270 | - * @see client/html/email/bcc-email |
|
| 271 | - */ |
|
| 272 | - $replyNameDelivery = $view->config( 'client/html/email/delivery/reply-name', $replyName ); |
|
| 273 | - |
|
| 274 | - /** client/html/email/reply-email |
|
| 275 | - * E-Mail address used by the customer when replying to e-mails |
|
| 276 | - * |
|
| 277 | - * The e-mail address of the person or e-mail account the customer |
|
| 278 | - * should reply to in case of questions or problems. |
|
| 279 | - * |
|
| 280 | - * @param string E-mail address |
|
| 281 | - * @since 2014.03 |
|
| 282 | - * @category User |
|
| 283 | - * @see client/html/email/reply-name |
|
| 284 | - * @see client/html/email/delivery/reply-email |
|
| 285 | - * @see client/html/email/from-email |
|
| 286 | - * @see client/html/email/bcc-email |
|
| 287 | - */ |
|
| 288 | - $replyEmail = $view->config( 'client/html/email/reply-email', $fromEmail ); |
|
| 289 | - |
|
| 290 | - /** client/html/email/delivery/reply-email |
|
| 291 | - * E-Mail address used by the customer when replying to delivery e-mails |
|
| 292 | - * |
|
| 293 | - * The e-mail address of the person or e-mail account the customer |
|
| 294 | - * should reply to in case of questions or problems. This configuration |
|
| 295 | - * option overwrites the e-mail address set via "client/html/email/reply-email". |
|
| 296 | - * |
|
| 297 | - * @param string E-mail address |
|
| 298 | - * @since 2014.03 |
|
| 299 | - * @category User |
|
| 300 | - * @see client/html/email/delivery/reply-name |
|
| 301 | - * @see client/html/email/reply-email |
|
| 302 | - * @see client/html/email/from-email |
|
| 303 | - * @see client/html/email/bcc-email |
|
| 304 | - */ |
|
| 305 | - if( ( $replyEmailDelivery = $view->config( 'client/html/email/delivery/reply-email', $replyEmail ) ) != null ) { |
|
| 306 | - $msg->addReplyTo( $replyEmailDelivery, $replyNameDelivery ); |
|
| 307 | - } |
|
| 308 | - |
|
| 309 | - |
|
| 310 | - /** client/html/email/bcc-email |
|
| 311 | - * E-Mail address all e-mails should be also sent to |
|
| 312 | - * |
|
| 313 | - * Using this option you can send a copy of all shop related e-mails to |
|
| 314 | - * a second e-mail account. This can be handy for testing and checking |
|
| 315 | - * the e-mails sent to customers. |
|
| 316 | - * |
|
| 317 | - * It also allows shop owners with a very small volume of orders to be |
|
| 318 | - * notified about new orders. Be aware that this isn't useful if the |
|
| 319 | - * order volumne is high or has peeks! |
|
| 320 | - * |
|
| 321 | - * @param string E-mail address |
|
| 322 | - * @since 2014.03 |
|
| 323 | - * @category User |
|
| 324 | - * @category Developer |
|
| 325 | - * @see client/html/email/delivery/bcc-email |
|
| 326 | - * @see client/html/email/reply-email |
|
| 327 | - * @see client/html/email/from-email |
|
| 328 | - */ |
|
| 329 | - $bccEmail = $view->config( 'client/html/email/bcc-email' ); |
|
| 330 | - |
|
| 331 | - /** client/html/email/delivery/bcc-email |
|
| 332 | - * E-Mail address all delivery e-mails should be also sent to |
|
| 333 | - * |
|
| 334 | - * Using this option you can send a copy of all delivery related e-mails |
|
| 335 | - * to a second e-mail account. This can be handy for testing and checking |
|
| 336 | - * the e-mails sent to customers. |
|
| 337 | - * |
|
| 338 | - * It also allows shop owners with a very small volume of orders to be |
|
| 339 | - * notified about new orders. Be aware that this isn't useful if the |
|
| 340 | - * order volumne is high or has peeks! |
|
| 341 | - * |
|
| 342 | - * This configuration option overwrites the e-mail address set via |
|
| 343 | - * "client/html/email/bcc-email". |
|
| 344 | - * |
|
| 345 | - * @param string E-mail address |
|
| 346 | - * @since 2014.03 |
|
| 347 | - * @category User |
|
| 348 | - * @category Developer |
|
| 349 | - * @see client/html/email/bcc-email |
|
| 350 | - * @see client/html/email/reply-email |
|
| 351 | - * @see client/html/email/from-email |
|
| 352 | - */ |
|
| 353 | - if( ( $bccEmailDelivery = $view->config( 'client/html/email/delivery/bcc-email', $bccEmail ) ) != null ) { |
|
| 354 | - $msg->addBcc( $bccEmailDelivery ); |
|
| 355 | - } |
|
| 356 | - |
|
| 357 | - |
|
| 358 | - /** client/html/email/delivery/standard/template-header |
|
| 359 | - * Relative path to the text header template of the email delivery client. |
|
| 360 | - * |
|
| 361 | - * The template file contains the text and processing instructions |
|
| 362 | - * to generate the text that is inserted into the header |
|
| 363 | - * of the e-mail. The configuration string is the |
|
| 364 | - * path to the template file relative to the templates directory (usually |
|
| 365 | - * in client/html/templates). |
|
| 366 | - * |
|
| 367 | - * You can overwrite the template file configuration in extensions and |
|
| 368 | - * provide alternative templates. These alternative templates should be |
|
| 369 | - * named like the default one but with the string "standard" replaced by |
|
| 370 | - * an unique name. You may use the name of your project for this. If |
|
| 371 | - * you've implemented an alternative client class as well, "standard" |
|
| 372 | - * should be replaced by the name of the new class. |
|
| 373 | - * |
|
| 374 | - * The email payment text client allows to use a different template for |
|
| 375 | - * each payment status value. You can create a template for each payment |
|
| 376 | - * status and store it in the "email/payment/<status number>/" directory |
|
| 377 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 378 | - * specific layout template is found, the common template in the |
|
| 379 | - * "email/payment/" directory is used. |
|
| 380 | - * |
|
| 381 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 382 | - * @since 2014.03 |
|
| 383 | - * @category Developer |
|
| 384 | - * @see client/html/email/delivery/standard/template-body |
|
| 385 | - */ |
|
| 386 | - $tplconf = 'client/html/email/delivery/standard/template-header'; |
|
| 387 | - |
|
| 388 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 389 | - $default = array( 'email/delivery/' . $status . '/header-default.php', 'email/delivery/header-default.php' ); |
|
| 390 | - |
|
| 391 | - return $view->render( $view->config( $tplconf, $default ) ); ; |
|
| 392 | - } |
|
| 393 | - |
|
| 394 | - |
|
| 395 | - /** |
|
| 396 | - * Returns the sub-client given by its name. |
|
| 397 | - * |
|
| 398 | - * @param string $type Name of the client type |
|
| 399 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 400 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 401 | - */ |
|
| 402 | - public function getSubClient( $type, $name = null ) |
|
| 403 | - { |
|
| 404 | - /** client/html/email/delivery/decorators/excludes |
|
| 405 | - * Excludes decorators added by the "common" option from the email delivery html client |
|
| 406 | - * |
|
| 407 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 408 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 409 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 410 | - * modify what is returned to the caller. |
|
| 411 | - * |
|
| 412 | - * This option allows you to remove a decorator added via |
|
| 413 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 414 | - * around the html client. |
|
| 415 | - * |
|
| 416 | - * client/html/email/delivery/decorators/excludes = array( 'decorator1' ) |
|
| 417 | - * |
|
| 418 | - * This would remove the decorator named "decorator1" from the list of |
|
| 419 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 420 | - * "client/html/common/decorators/default" to the html client. |
|
| 421 | - * |
|
| 422 | - * @param array List of decorator names |
|
| 423 | - * @since 2014.05 |
|
| 424 | - * @category Developer |
|
| 425 | - * @see client/html/common/decorators/default |
|
| 426 | - * @see client/html/email/delivery/decorators/global |
|
| 427 | - * @see client/html/email/delivery/decorators/local |
|
| 428 | - */ |
|
| 429 | - |
|
| 430 | - /** client/html/email/delivery/decorators/global |
|
| 431 | - * Adds a list of globally available decorators only to the email delivery html client |
|
| 432 | - * |
|
| 433 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 434 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 435 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 436 | - * modify what is returned to the caller. |
|
| 437 | - * |
|
| 438 | - * This option allows you to wrap global decorators |
|
| 439 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 440 | - * |
|
| 441 | - * client/html/email/delivery/decorators/global = array( 'decorator1' ) |
|
| 442 | - * |
|
| 443 | - * This would add the decorator named "decorator1" defined by |
|
| 444 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 445 | - * |
|
| 446 | - * @param array List of decorator names |
|
| 447 | - * @since 2014.05 |
|
| 448 | - * @category Developer |
|
| 449 | - * @see client/html/common/decorators/default |
|
| 450 | - * @see client/html/email/delivery/decorators/excludes |
|
| 451 | - * @see client/html/email/delivery/decorators/local |
|
| 452 | - */ |
|
| 453 | - |
|
| 454 | - /** client/html/email/delivery/decorators/local |
|
| 455 | - * Adds a list of local decorators only to the email delivery html client |
|
| 456 | - * |
|
| 457 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 458 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 459 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 460 | - * modify what is returned to the caller. |
|
| 461 | - * |
|
| 462 | - * This option allows you to wrap local decorators |
|
| 463 | - * ("\Aimeos\Client\Html\Email\Decorator\*") around the html client. |
|
| 464 | - * |
|
| 465 | - * client/html/email/delivery/decorators/local = array( 'decorator2' ) |
|
| 466 | - * |
|
| 467 | - * This would add the decorator named "decorator2" defined by |
|
| 468 | - * "\Aimeos\Client\Html\Email\Decorator\Decorator2" only to the html client. |
|
| 469 | - * |
|
| 470 | - * @param array List of decorator names |
|
| 471 | - * @since 2014.05 |
|
| 472 | - * @category Developer |
|
| 473 | - * @see client/html/common/decorators/default |
|
| 474 | - * @see client/html/email/delivery/decorators/excludes |
|
| 475 | - * @see client/html/email/delivery/decorators/global |
|
| 476 | - */ |
|
| 477 | - |
|
| 478 | - return $this->createSubClient( 'email/delivery/' . $type, $name ); |
|
| 479 | - } |
|
| 480 | - |
|
| 481 | - |
|
| 482 | - /** |
|
| 483 | - * Returns the list of sub-client names configured for the client. |
|
| 484 | - * |
|
| 485 | - * @return array List of HTML client names |
|
| 486 | - */ |
|
| 487 | - protected function getSubClientNames() |
|
| 488 | - { |
|
| 489 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 490 | - } |
|
| 25 | + /** client/html/email/delivery/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email delivery section |
|
| 27 | + * |
|
| 28 | + * The output of the frontend is composed of the code generated by the HTML |
|
| 29 | + * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 30 | + * that are responsible for rendering certain sub-parts of the output. The |
|
| 31 | + * sub-clients can contain HTML clients themselves and therefore a |
|
| 32 | + * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 33 | + * the output that is placed inside the container of its parent. |
|
| 34 | + * |
|
| 35 | + * At first, always the HTML code generated by the parent is printed, then |
|
| 36 | + * the HTML code of its sub-clients. The order of the HTML sub-clients |
|
| 37 | + * determines the order of the output of these sub-clients inside the parent |
|
| 38 | + * container. If the configured list of clients is |
|
| 39 | + * |
|
| 40 | + * array( "subclient1", "subclient2" ) |
|
| 41 | + * |
|
| 42 | + * you can easily change the order of the output by reordering the subparts: |
|
| 43 | + * |
|
| 44 | + * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 45 | + * |
|
| 46 | + * You can also remove one or more parts if they shouldn't be rendered: |
|
| 47 | + * |
|
| 48 | + * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 49 | + * |
|
| 50 | + * As the clients only generates structural HTML, the layout defined via CSS |
|
| 51 | + * should support adding, removing or reordering content by a fluid like |
|
| 52 | + * design. |
|
| 53 | + * |
|
| 54 | + * @param array List of sub-client names |
|
| 55 | + * @since 2014.03 |
|
| 56 | + * @category Developer |
|
| 57 | + */ |
|
| 58 | + private $subPartPath = 'client/html/email/delivery/standard/subparts'; |
|
| 59 | + |
|
| 60 | + /** client/html/email/delivery/text/name |
|
| 61 | + * Name of the text part used by the email delivery client implementation |
|
| 62 | + * |
|
| 63 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\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/delivery/html/name |
|
| 72 | + * Name of the html part used by the email delivery client implementation |
|
| 73 | + * |
|
| 74 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\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->deliveryBody = $content; |
|
| 101 | + |
|
| 102 | + /** client/html/email/delivery/standard/template-body |
|
| 103 | + * Relative path to the text body template of the email delivery client. |
|
| 104 | + * |
|
| 105 | + * The template file contains the text and processing instructions |
|
| 106 | + * to generate the result shown in the e-mail. 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 email delivery text client allows to use a different template for |
|
| 118 | + * each delivery status value. You can create a template for each delivery |
|
| 119 | + * status and store it in the "email/delivery/<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/delivery/" directory is used. |
|
| 123 | + * |
|
| 124 | + * @param string Relative path to the template creating code for the e-mail body |
|
| 125 | + * @since 2014.03 |
|
| 126 | + * @category Developer |
|
| 127 | + * @see client/html/email/delivery/standard/template-header |
|
| 128 | + */ |
|
| 129 | + $tplconf = 'client/html/email/delivery/standard/template-body'; |
|
| 130 | + |
|
| 131 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 132 | + $default = array( 'email/delivery/' . $status . '/body-default.php', 'email/delivery/body-default.php' ); |
|
| 133 | + |
|
| 134 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 135 | + } |
|
| 136 | + |
|
| 137 | + |
|
| 138 | + /** |
|
| 139 | + * Returns the HTML string for insertion into the header. |
|
| 140 | + * |
|
| 141 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 142 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 143 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 144 | + * @return string|null String including HTML tags for the header on error |
|
| 145 | + */ |
|
| 146 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 147 | + { |
|
| 148 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 149 | + |
|
| 150 | + $content = ''; |
|
| 151 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 152 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 153 | + } |
|
| 154 | + $view->deliveryHeader = $content; |
|
| 155 | + |
|
| 156 | + |
|
| 157 | + $addr = $view->extAddressItem; |
|
| 158 | + $billAddr = $view->extOrderBaseItem->getAddress( \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT ); |
|
| 159 | + |
|
| 160 | + $msg = $view->mail(); |
|
| 161 | + $msg->addHeader( 'X-MailGenerator', 'Aimeos' ); |
|
| 162 | + $msg->addTo( $addr->getEMail(), $addr->getFirstName() . ' ' . $addr->getLastName() ); |
|
| 163 | + |
|
| 164 | + if( $billAddr->getEMail() != $addr->getEmail() ) { |
|
| 165 | + $msg->addCc( $billAddr->getEMail(), $billAddr->getFirstName() . ' ' . $billAddr->getLastName() ); |
|
| 166 | + } |
|
| 167 | + |
|
| 168 | + /** client/html/email/from-name |
|
| 169 | + * Name used when sending e-mails |
|
| 170 | + * |
|
| 171 | + * The name of the person or e-mail account that is used for sending all |
|
| 172 | + * shop related emails to customers. |
|
| 173 | + * |
|
| 174 | + * @param string Name shown in the e-mail |
|
| 175 | + * @since 2014.03 |
|
| 176 | + * @category User |
|
| 177 | + * @see client/html/email/delivery/from-name |
|
| 178 | + * @see client/html/email/from-email |
|
| 179 | + * @see client/html/email/reply-email |
|
| 180 | + * @see client/html/email/bcc-email |
|
| 181 | + */ |
|
| 182 | + $fromName = $view->config( 'client/html/email/from-name' ); |
|
| 183 | + |
|
| 184 | + /** client/html/email/delivery/from-name |
|
| 185 | + * Name used when sending delivery e-mails |
|
| 186 | + * |
|
| 187 | + * The name of the person or e-mail account that is used for sending all |
|
| 188 | + * shop related delivery e-mails to customers. This configuration option |
|
| 189 | + * overwrites the name set in "client/html/email/from-name". |
|
| 190 | + * |
|
| 191 | + * @param string Name shown in the e-mail |
|
| 192 | + * @since 2014.03 |
|
| 193 | + * @category User |
|
| 194 | + * @see client/html/email/from-name |
|
| 195 | + * @see client/html/email/from-email |
|
| 196 | + * @see client/html/email/reply-email |
|
| 197 | + * @see client/html/email/bcc-email |
|
| 198 | + */ |
|
| 199 | + $fromNameDelivery = $view->config( 'client/html/email/delivery/from-name', $fromName ); |
|
| 200 | + |
|
| 201 | + /** client/html/email/from-email |
|
| 202 | + * E-Mail address used when sending e-mails |
|
| 203 | + * |
|
| 204 | + * The e-mail address of the person or account that is used for sending |
|
| 205 | + * all shop related emails to customers. |
|
| 206 | + * |
|
| 207 | + * @param string E-mail address |
|
| 208 | + * @since 2014.03 |
|
| 209 | + * @category User |
|
| 210 | + * @see client/html/email/from-name |
|
| 211 | + * @see client/html/email/delivery/from-email |
|
| 212 | + * @see client/html/email/reply-email |
|
| 213 | + * @see client/html/email/bcc-email |
|
| 214 | + */ |
|
| 215 | + $fromEmail = $view->config( 'client/html/email/from-email' ); |
|
| 216 | + |
|
| 217 | + /** client/html/email/delivery/from-email |
|
| 218 | + * E-Mail address used when sending delivery e-mails |
|
| 219 | + * |
|
| 220 | + * The e-mail address of the person or account that is used for sending |
|
| 221 | + * all shop related delivery emails to customers. This configuration option |
|
| 222 | + * overwrites the e-mail address set via "client/html/email/from-email". |
|
| 223 | + * |
|
| 224 | + * @param string E-mail address |
|
| 225 | + * @since 2014.03 |
|
| 226 | + * @category User |
|
| 227 | + * @see client/html/email/delivery/from-name |
|
| 228 | + * @see client/html/email/from-email |
|
| 229 | + * @see client/html/email/reply-email |
|
| 230 | + * @see client/html/email/bcc-email |
|
| 231 | + */ |
|
| 232 | + if( ( $fromEmailDelivery = $view->config( 'client/html/email/delivery/from-email', $fromEmail ) ) != null ) { |
|
| 233 | + $msg->addFrom( $fromEmailDelivery, $fromNameDelivery ); |
|
| 234 | + } |
|
| 235 | + |
|
| 236 | + |
|
| 237 | + /** client/html/email/reply-name |
|
| 238 | + * Recipient name displayed when the customer replies to e-mails |
|
| 239 | + * |
|
| 240 | + * The name of the person or e-mail account the customer should |
|
| 241 | + * reply to in case of questions or problems. If no reply name is |
|
| 242 | + * configured, the name person or e-mail account set via |
|
| 243 | + * "client/html/email/from-name" is used. |
|
| 244 | + * |
|
| 245 | + * @param string Name shown in the e-mail |
|
| 246 | + * @since 2014.03 |
|
| 247 | + * @category User |
|
| 248 | + * @see client/html/email/reply-email |
|
| 249 | + * @see client/html/email/delivery/reply-email |
|
| 250 | + * @see client/html/email/from-email |
|
| 251 | + * @see client/html/email/from-name |
|
| 252 | + * @see client/html/email/bcc-email |
|
| 253 | + */ |
|
| 254 | + $replyName = $view->config( 'client/html/email/reply-name', $fromName ); |
|
| 255 | + |
|
| 256 | + /** client/html/email/delivery/reply-name |
|
| 257 | + * Recipient name displayed when the customer replies to delivery e-mails |
|
| 258 | + * |
|
| 259 | + * The name of the person or e-mail account the customer should |
|
| 260 | + * reply to in case of questions or problems. This configuration option |
|
| 261 | + * overwrites the name set via "client/html/email/reply-name". |
|
| 262 | + * |
|
| 263 | + * @param string Name shown in the e-mail |
|
| 264 | + * @since 2014.03 |
|
| 265 | + * @category User |
|
| 266 | + * @see client/html/email/delivery/reply-email |
|
| 267 | + * @see client/html/email/reply-name |
|
| 268 | + * @see client/html/email/reply-email |
|
| 269 | + * @see client/html/email/from-email |
|
| 270 | + * @see client/html/email/bcc-email |
|
| 271 | + */ |
|
| 272 | + $replyNameDelivery = $view->config( 'client/html/email/delivery/reply-name', $replyName ); |
|
| 273 | + |
|
| 274 | + /** client/html/email/reply-email |
|
| 275 | + * E-Mail address used by the customer when replying to e-mails |
|
| 276 | + * |
|
| 277 | + * The e-mail address of the person or e-mail account the customer |
|
| 278 | + * should reply to in case of questions or problems. |
|
| 279 | + * |
|
| 280 | + * @param string E-mail address |
|
| 281 | + * @since 2014.03 |
|
| 282 | + * @category User |
|
| 283 | + * @see client/html/email/reply-name |
|
| 284 | + * @see client/html/email/delivery/reply-email |
|
| 285 | + * @see client/html/email/from-email |
|
| 286 | + * @see client/html/email/bcc-email |
|
| 287 | + */ |
|
| 288 | + $replyEmail = $view->config( 'client/html/email/reply-email', $fromEmail ); |
|
| 289 | + |
|
| 290 | + /** client/html/email/delivery/reply-email |
|
| 291 | + * E-Mail address used by the customer when replying to delivery e-mails |
|
| 292 | + * |
|
| 293 | + * The e-mail address of the person or e-mail account the customer |
|
| 294 | + * should reply to in case of questions or problems. This configuration |
|
| 295 | + * option overwrites the e-mail address set via "client/html/email/reply-email". |
|
| 296 | + * |
|
| 297 | + * @param string E-mail address |
|
| 298 | + * @since 2014.03 |
|
| 299 | + * @category User |
|
| 300 | + * @see client/html/email/delivery/reply-name |
|
| 301 | + * @see client/html/email/reply-email |
|
| 302 | + * @see client/html/email/from-email |
|
| 303 | + * @see client/html/email/bcc-email |
|
| 304 | + */ |
|
| 305 | + if( ( $replyEmailDelivery = $view->config( 'client/html/email/delivery/reply-email', $replyEmail ) ) != null ) { |
|
| 306 | + $msg->addReplyTo( $replyEmailDelivery, $replyNameDelivery ); |
|
| 307 | + } |
|
| 308 | + |
|
| 309 | + |
|
| 310 | + /** client/html/email/bcc-email |
|
| 311 | + * E-Mail address all e-mails should be also sent to |
|
| 312 | + * |
|
| 313 | + * Using this option you can send a copy of all shop related e-mails to |
|
| 314 | + * a second e-mail account. This can be handy for testing and checking |
|
| 315 | + * the e-mails sent to customers. |
|
| 316 | + * |
|
| 317 | + * It also allows shop owners with a very small volume of orders to be |
|
| 318 | + * notified about new orders. Be aware that this isn't useful if the |
|
| 319 | + * order volumne is high or has peeks! |
|
| 320 | + * |
|
| 321 | + * @param string E-mail address |
|
| 322 | + * @since 2014.03 |
|
| 323 | + * @category User |
|
| 324 | + * @category Developer |
|
| 325 | + * @see client/html/email/delivery/bcc-email |
|
| 326 | + * @see client/html/email/reply-email |
|
| 327 | + * @see client/html/email/from-email |
|
| 328 | + */ |
|
| 329 | + $bccEmail = $view->config( 'client/html/email/bcc-email' ); |
|
| 330 | + |
|
| 331 | + /** client/html/email/delivery/bcc-email |
|
| 332 | + * E-Mail address all delivery e-mails should be also sent to |
|
| 333 | + * |
|
| 334 | + * Using this option you can send a copy of all delivery related e-mails |
|
| 335 | + * to a second e-mail account. This can be handy for testing and checking |
|
| 336 | + * the e-mails sent to customers. |
|
| 337 | + * |
|
| 338 | + * It also allows shop owners with a very small volume of orders to be |
|
| 339 | + * notified about new orders. Be aware that this isn't useful if the |
|
| 340 | + * order volumne is high or has peeks! |
|
| 341 | + * |
|
| 342 | + * This configuration option overwrites the e-mail address set via |
|
| 343 | + * "client/html/email/bcc-email". |
|
| 344 | + * |
|
| 345 | + * @param string E-mail address |
|
| 346 | + * @since 2014.03 |
|
| 347 | + * @category User |
|
| 348 | + * @category Developer |
|
| 349 | + * @see client/html/email/bcc-email |
|
| 350 | + * @see client/html/email/reply-email |
|
| 351 | + * @see client/html/email/from-email |
|
| 352 | + */ |
|
| 353 | + if( ( $bccEmailDelivery = $view->config( 'client/html/email/delivery/bcc-email', $bccEmail ) ) != null ) { |
|
| 354 | + $msg->addBcc( $bccEmailDelivery ); |
|
| 355 | + } |
|
| 356 | + |
|
| 357 | + |
|
| 358 | + /** client/html/email/delivery/standard/template-header |
|
| 359 | + * Relative path to the text header template of the email delivery client. |
|
| 360 | + * |
|
| 361 | + * The template file contains the text and processing instructions |
|
| 362 | + * to generate the text that is inserted into the header |
|
| 363 | + * of the e-mail. The configuration string is the |
|
| 364 | + * path to the template file relative to the templates directory (usually |
|
| 365 | + * in client/html/templates). |
|
| 366 | + * |
|
| 367 | + * You can overwrite the template file configuration in extensions and |
|
| 368 | + * provide alternative templates. These alternative templates should be |
|
| 369 | + * named like the default one but with the string "standard" replaced by |
|
| 370 | + * an unique name. You may use the name of your project for this. If |
|
| 371 | + * you've implemented an alternative client class as well, "standard" |
|
| 372 | + * should be replaced by the name of the new class. |
|
| 373 | + * |
|
| 374 | + * The email payment text client allows to use a different template for |
|
| 375 | + * each payment status value. You can create a template for each payment |
|
| 376 | + * status and store it in the "email/payment/<status number>/" directory |
|
| 377 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 378 | + * specific layout template is found, the common template in the |
|
| 379 | + * "email/payment/" directory is used. |
|
| 380 | + * |
|
| 381 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 382 | + * @since 2014.03 |
|
| 383 | + * @category Developer |
|
| 384 | + * @see client/html/email/delivery/standard/template-body |
|
| 385 | + */ |
|
| 386 | + $tplconf = 'client/html/email/delivery/standard/template-header'; |
|
| 387 | + |
|
| 388 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 389 | + $default = array( 'email/delivery/' . $status . '/header-default.php', 'email/delivery/header-default.php' ); |
|
| 390 | + |
|
| 391 | + return $view->render( $view->config( $tplconf, $default ) ); ; |
|
| 392 | + } |
|
| 393 | + |
|
| 394 | + |
|
| 395 | + /** |
|
| 396 | + * Returns the sub-client given by its name. |
|
| 397 | + * |
|
| 398 | + * @param string $type Name of the client type |
|
| 399 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 400 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 401 | + */ |
|
| 402 | + public function getSubClient( $type, $name = null ) |
|
| 403 | + { |
|
| 404 | + /** client/html/email/delivery/decorators/excludes |
|
| 405 | + * Excludes decorators added by the "common" option from the email delivery html client |
|
| 406 | + * |
|
| 407 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 408 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 409 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 410 | + * modify what is returned to the caller. |
|
| 411 | + * |
|
| 412 | + * This option allows you to remove a decorator added via |
|
| 413 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 414 | + * around the html client. |
|
| 415 | + * |
|
| 416 | + * client/html/email/delivery/decorators/excludes = array( 'decorator1' ) |
|
| 417 | + * |
|
| 418 | + * This would remove the decorator named "decorator1" from the list of |
|
| 419 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 420 | + * "client/html/common/decorators/default" to the html client. |
|
| 421 | + * |
|
| 422 | + * @param array List of decorator names |
|
| 423 | + * @since 2014.05 |
|
| 424 | + * @category Developer |
|
| 425 | + * @see client/html/common/decorators/default |
|
| 426 | + * @see client/html/email/delivery/decorators/global |
|
| 427 | + * @see client/html/email/delivery/decorators/local |
|
| 428 | + */ |
|
| 429 | + |
|
| 430 | + /** client/html/email/delivery/decorators/global |
|
| 431 | + * Adds a list of globally available decorators only to the email delivery html client |
|
| 432 | + * |
|
| 433 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 434 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 435 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 436 | + * modify what is returned to the caller. |
|
| 437 | + * |
|
| 438 | + * This option allows you to wrap global decorators |
|
| 439 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 440 | + * |
|
| 441 | + * client/html/email/delivery/decorators/global = array( 'decorator1' ) |
|
| 442 | + * |
|
| 443 | + * This would add the decorator named "decorator1" defined by |
|
| 444 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 445 | + * |
|
| 446 | + * @param array List of decorator names |
|
| 447 | + * @since 2014.05 |
|
| 448 | + * @category Developer |
|
| 449 | + * @see client/html/common/decorators/default |
|
| 450 | + * @see client/html/email/delivery/decorators/excludes |
|
| 451 | + * @see client/html/email/delivery/decorators/local |
|
| 452 | + */ |
|
| 453 | + |
|
| 454 | + /** client/html/email/delivery/decorators/local |
|
| 455 | + * Adds a list of local decorators only to the email delivery html client |
|
| 456 | + * |
|
| 457 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 458 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 459 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 460 | + * modify what is returned to the caller. |
|
| 461 | + * |
|
| 462 | + * This option allows you to wrap local decorators |
|
| 463 | + * ("\Aimeos\Client\Html\Email\Decorator\*") around the html client. |
|
| 464 | + * |
|
| 465 | + * client/html/email/delivery/decorators/local = array( 'decorator2' ) |
|
| 466 | + * |
|
| 467 | + * This would add the decorator named "decorator2" defined by |
|
| 468 | + * "\Aimeos\Client\Html\Email\Decorator\Decorator2" only to the html client. |
|
| 469 | + * |
|
| 470 | + * @param array List of decorator names |
|
| 471 | + * @since 2014.05 |
|
| 472 | + * @category Developer |
|
| 473 | + * @see client/html/common/decorators/default |
|
| 474 | + * @see client/html/email/delivery/decorators/excludes |
|
| 475 | + * @see client/html/email/delivery/decorators/global |
|
| 476 | + */ |
|
| 477 | + |
|
| 478 | + return $this->createSubClient( 'email/delivery/' . $type, $name ); |
|
| 479 | + } |
|
| 480 | + |
|
| 481 | + |
|
| 482 | + /** |
|
| 483 | + * Returns the list of sub-client names configured for the client. |
|
| 484 | + * |
|
| 485 | + * @return array List of HTML client names |
|
| 486 | + */ |
|
| 487 | + protected function getSubClientNames() |
|
| 488 | + { |
|
| 489 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 490 | + } |
|
| 491 | 491 | } |
| 492 | 492 | \ No newline at end of file |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * @since 2014.03 |
| 79 | 79 | * @category Developer |
| 80 | 80 | */ |
| 81 | - private $subPartNames = array( 'text', 'html' ); |
|
| 81 | + private $subPartNames = array('text', 'html'); |
|
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -89,13 +89,13 @@ discard block |
||
| 89 | 89 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 90 | 90 | * @return string HTML code |
| 91 | 91 | */ |
| 92 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 92 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 93 | 93 | { |
| 94 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 94 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 95 | 95 | |
| 96 | 96 | $content = ''; |
| 97 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 98 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 97 | + foreach ($this->getSubClients() as $subclient) { |
|
| 98 | + $content .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 99 | 99 | } |
| 100 | 100 | $view->deliveryBody = $content; |
| 101 | 101 | |
@@ -129,9 +129,9 @@ discard block |
||
| 129 | 129 | $tplconf = 'client/html/email/delivery/standard/template-body'; |
| 130 | 130 | |
| 131 | 131 | $status = $view->extOrderItem->getDeliveryStatus(); |
| 132 | - $default = array( 'email/delivery/' . $status . '/body-default.php', 'email/delivery/body-default.php' ); |
|
| 132 | + $default = array('email/delivery/'.$status.'/body-default.php', 'email/delivery/body-default.php'); |
|
| 133 | 133 | |
| 134 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 134 | + return $view->render($view->config($tplconf, $default)); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | |
@@ -143,26 +143,26 @@ discard block |
||
| 143 | 143 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 144 | 144 | * @return string|null String including HTML tags for the header on error |
| 145 | 145 | */ |
| 146 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 146 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 147 | 147 | { |
| 148 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 148 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 149 | 149 | |
| 150 | 150 | $content = ''; |
| 151 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 152 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 151 | + foreach ($this->getSubClients() as $subclient) { |
|
| 152 | + $content .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 153 | 153 | } |
| 154 | 154 | $view->deliveryHeader = $content; |
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | $addr = $view->extAddressItem; |
| 158 | - $billAddr = $view->extOrderBaseItem->getAddress( \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT ); |
|
| 158 | + $billAddr = $view->extOrderBaseItem->getAddress(\Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT); |
|
| 159 | 159 | |
| 160 | 160 | $msg = $view->mail(); |
| 161 | - $msg->addHeader( 'X-MailGenerator', 'Aimeos' ); |
|
| 162 | - $msg->addTo( $addr->getEMail(), $addr->getFirstName() . ' ' . $addr->getLastName() ); |
|
| 161 | + $msg->addHeader('X-MailGenerator', 'Aimeos'); |
|
| 162 | + $msg->addTo($addr->getEMail(), $addr->getFirstName().' '.$addr->getLastName()); |
|
| 163 | 163 | |
| 164 | - if( $billAddr->getEMail() != $addr->getEmail() ) { |
|
| 165 | - $msg->addCc( $billAddr->getEMail(), $billAddr->getFirstName() . ' ' . $billAddr->getLastName() ); |
|
| 164 | + if ($billAddr->getEMail() != $addr->getEmail()) { |
|
| 165 | + $msg->addCc($billAddr->getEMail(), $billAddr->getFirstName().' '.$billAddr->getLastName()); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /** client/html/email/from-name |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | * @see client/html/email/reply-email |
| 180 | 180 | * @see client/html/email/bcc-email |
| 181 | 181 | */ |
| 182 | - $fromName = $view->config( 'client/html/email/from-name' ); |
|
| 182 | + $fromName = $view->config('client/html/email/from-name'); |
|
| 183 | 183 | |
| 184 | 184 | /** client/html/email/delivery/from-name |
| 185 | 185 | * Name used when sending delivery e-mails |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | * @see client/html/email/reply-email |
| 197 | 197 | * @see client/html/email/bcc-email |
| 198 | 198 | */ |
| 199 | - $fromNameDelivery = $view->config( 'client/html/email/delivery/from-name', $fromName ); |
|
| 199 | + $fromNameDelivery = $view->config('client/html/email/delivery/from-name', $fromName); |
|
| 200 | 200 | |
| 201 | 201 | /** client/html/email/from-email |
| 202 | 202 | * E-Mail address used when sending e-mails |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | * @see client/html/email/reply-email |
| 213 | 213 | * @see client/html/email/bcc-email |
| 214 | 214 | */ |
| 215 | - $fromEmail = $view->config( 'client/html/email/from-email' ); |
|
| 215 | + $fromEmail = $view->config('client/html/email/from-email'); |
|
| 216 | 216 | |
| 217 | 217 | /** client/html/email/delivery/from-email |
| 218 | 218 | * E-Mail address used when sending delivery e-mails |
@@ -229,8 +229,8 @@ discard block |
||
| 229 | 229 | * @see client/html/email/reply-email |
| 230 | 230 | * @see client/html/email/bcc-email |
| 231 | 231 | */ |
| 232 | - if( ( $fromEmailDelivery = $view->config( 'client/html/email/delivery/from-email', $fromEmail ) ) != null ) { |
|
| 233 | - $msg->addFrom( $fromEmailDelivery, $fromNameDelivery ); |
|
| 232 | + if (($fromEmailDelivery = $view->config('client/html/email/delivery/from-email', $fromEmail)) != null) { |
|
| 233 | + $msg->addFrom($fromEmailDelivery, $fromNameDelivery); |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | * @see client/html/email/from-name |
| 252 | 252 | * @see client/html/email/bcc-email |
| 253 | 253 | */ |
| 254 | - $replyName = $view->config( 'client/html/email/reply-name', $fromName ); |
|
| 254 | + $replyName = $view->config('client/html/email/reply-name', $fromName); |
|
| 255 | 255 | |
| 256 | 256 | /** client/html/email/delivery/reply-name |
| 257 | 257 | * Recipient name displayed when the customer replies to delivery e-mails |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | * @see client/html/email/from-email |
| 270 | 270 | * @see client/html/email/bcc-email |
| 271 | 271 | */ |
| 272 | - $replyNameDelivery = $view->config( 'client/html/email/delivery/reply-name', $replyName ); |
|
| 272 | + $replyNameDelivery = $view->config('client/html/email/delivery/reply-name', $replyName); |
|
| 273 | 273 | |
| 274 | 274 | /** client/html/email/reply-email |
| 275 | 275 | * E-Mail address used by the customer when replying to e-mails |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | * @see client/html/email/from-email |
| 286 | 286 | * @see client/html/email/bcc-email |
| 287 | 287 | */ |
| 288 | - $replyEmail = $view->config( 'client/html/email/reply-email', $fromEmail ); |
|
| 288 | + $replyEmail = $view->config('client/html/email/reply-email', $fromEmail); |
|
| 289 | 289 | |
| 290 | 290 | /** client/html/email/delivery/reply-email |
| 291 | 291 | * E-Mail address used by the customer when replying to delivery e-mails |
@@ -302,8 +302,8 @@ discard block |
||
| 302 | 302 | * @see client/html/email/from-email |
| 303 | 303 | * @see client/html/email/bcc-email |
| 304 | 304 | */ |
| 305 | - if( ( $replyEmailDelivery = $view->config( 'client/html/email/delivery/reply-email', $replyEmail ) ) != null ) { |
|
| 306 | - $msg->addReplyTo( $replyEmailDelivery, $replyNameDelivery ); |
|
| 305 | + if (($replyEmailDelivery = $view->config('client/html/email/delivery/reply-email', $replyEmail)) != null) { |
|
| 306 | + $msg->addReplyTo($replyEmailDelivery, $replyNameDelivery); |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | * @see client/html/email/reply-email |
| 327 | 327 | * @see client/html/email/from-email |
| 328 | 328 | */ |
| 329 | - $bccEmail = $view->config( 'client/html/email/bcc-email' ); |
|
| 329 | + $bccEmail = $view->config('client/html/email/bcc-email'); |
|
| 330 | 330 | |
| 331 | 331 | /** client/html/email/delivery/bcc-email |
| 332 | 332 | * E-Mail address all delivery e-mails should be also sent to |
@@ -350,8 +350,8 @@ discard block |
||
| 350 | 350 | * @see client/html/email/reply-email |
| 351 | 351 | * @see client/html/email/from-email |
| 352 | 352 | */ |
| 353 | - if( ( $bccEmailDelivery = $view->config( 'client/html/email/delivery/bcc-email', $bccEmail ) ) != null ) { |
|
| 354 | - $msg->addBcc( $bccEmailDelivery ); |
|
| 353 | + if (($bccEmailDelivery = $view->config('client/html/email/delivery/bcc-email', $bccEmail)) != null) { |
|
| 354 | + $msg->addBcc($bccEmailDelivery); |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | |
@@ -386,9 +386,9 @@ discard block |
||
| 386 | 386 | $tplconf = 'client/html/email/delivery/standard/template-header'; |
| 387 | 387 | |
| 388 | 388 | $status = $view->extOrderItem->getDeliveryStatus(); |
| 389 | - $default = array( 'email/delivery/' . $status . '/header-default.php', 'email/delivery/header-default.php' ); |
|
| 389 | + $default = array('email/delivery/'.$status.'/header-default.php', 'email/delivery/header-default.php'); |
|
| 390 | 390 | |
| 391 | - return $view->render( $view->config( $tplconf, $default ) ); ; |
|
| 391 | + return $view->render($view->config($tplconf, $default)); ; |
|
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | * @param string|null $name Name of the sub-client (Default if null) |
| 400 | 400 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 401 | 401 | */ |
| 402 | - public function getSubClient( $type, $name = null ) |
|
| 402 | + public function getSubClient($type, $name = null) |
|
| 403 | 403 | { |
| 404 | 404 | /** client/html/email/delivery/decorators/excludes |
| 405 | 405 | * Excludes decorators added by the "common" option from the email delivery html client |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | * @see client/html/email/delivery/decorators/global |
| 476 | 476 | */ |
| 477 | 477 | |
| 478 | - return $this->createSubClient( 'email/delivery/' . $type, $name ); |
|
| 478 | + return $this->createSubClient('email/delivery/'.$type, $name); |
|
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | |
@@ -486,6 +486,6 @@ discard block |
||
| 486 | 486 | */ |
| 487 | 487 | protected function getSubClientNames() |
| 488 | 488 | { |
| 489 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 489 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 490 | 490 | } |
| 491 | 491 | } |
| 492 | 492 | \ No newline at end of file |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
| 111 | 111 | * @param array &$tags Result array for the list of tags that are associated to the output |
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | - * @return string|null String including HTML tags for the header on error |
|
| 113 | + * @return string String including HTML tags for the header on error |
|
| 114 | 114 | */ |
| 115 | 115 | public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
| 116 | 116 | { |
@@ -19,231 +19,231 @@ |
||
| 19 | 19 | * @subpackage Html |
| 20 | 20 | */ |
| 21 | 21 | class Standard |
| 22 | - extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
| 23 | - implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 22 | + extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
| 23 | + implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 24 | 24 | { |
| 25 | - /** client/html/email/delivery/text/summary/service/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email delivery text summary service section |
|
| 27 | - * |
|
| 28 | - * The output of the frontend is composed of the code generated by the HTML |
|
| 29 | - * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 30 | - * that are responsible for rendering certain sub-parts of the output. The |
|
| 31 | - * sub-clients can contain HTML clients themselves and therefore a |
|
| 32 | - * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 33 | - * the output that is placed inside the container of its parent. |
|
| 34 | - * |
|
| 35 | - * At first, always the HTML code generated by the parent is printed, then |
|
| 36 | - * the HTML code of its sub-clients. The order of the HTML sub-clients |
|
| 37 | - * determines the order of the output of these sub-clients inside the parent |
|
| 38 | - * container. If the configured list of clients is |
|
| 39 | - * |
|
| 40 | - * array( "subclient1", "subclient2" ) |
|
| 41 | - * |
|
| 42 | - * you can easily change the order of the output by reordering the subparts: |
|
| 43 | - * |
|
| 44 | - * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 45 | - * |
|
| 46 | - * You can also remove one or more parts if they shouldn't be rendered: |
|
| 47 | - * |
|
| 48 | - * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 49 | - * |
|
| 50 | - * As the clients only generates structural HTML, the layout defined via CSS |
|
| 51 | - * should support adding, removing or reordering content by a fluid like |
|
| 52 | - * design. |
|
| 53 | - * |
|
| 54 | - * @param array List of sub-client names |
|
| 55 | - * @since 2014.03 |
|
| 56 | - * @category Developer |
|
| 57 | - */ |
|
| 58 | - private $subPartPath = 'client/html/email/delivery/text/summary/service/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 60 | - |
|
| 61 | - |
|
| 62 | - /** |
|
| 63 | - * Returns the HTML code for insertion into the body. |
|
| 64 | - * |
|
| 65 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 66 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 67 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 68 | - * @return string HTML code |
|
| 69 | - */ |
|
| 70 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 71 | - { |
|
| 72 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 73 | - |
|
| 74 | - $content = ''; |
|
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | - } |
|
| 78 | - $view->summaryBody = $content; |
|
| 79 | - |
|
| 80 | - /** client/html/email/delivery/text/summary/service/standard/template-body |
|
| 81 | - * Relative path to the text body template of the email delivery text summary service 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 | - * @param string Relative path to the template creating code for the e-mail body |
|
| 96 | - * @since 2014.03 |
|
| 97 | - * @category Developer |
|
| 98 | - * @see client/html/email/delivery/text/summary/service/standard/template-header |
|
| 99 | - */ |
|
| 100 | - $tplconf = 'client/html/email/delivery/text/summary/service/standard/template-body'; |
|
| 101 | - $default = 'email/common/text-summary-service-body-default.php'; |
|
| 102 | - |
|
| 103 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * Returns the HTML string for insertion into the header. |
|
| 109 | - * |
|
| 110 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 111 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 112 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 113 | - * @return string|null String including HTML tags for the header on error |
|
| 114 | - */ |
|
| 115 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 116 | - { |
|
| 117 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 118 | - |
|
| 119 | - $content = ''; |
|
| 120 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 122 | - } |
|
| 123 | - $view->summaryHeader = $content; |
|
| 124 | - |
|
| 125 | - /** client/html/email/delivery/text/summary/service/standard/template-header |
|
| 126 | - * Relative path to the text header template of the email delivery text summary service client. |
|
| 127 | - * |
|
| 128 | - * The template file contains the text and processing instructions |
|
| 129 | - * to generate the text that is inserted into the e-mail header |
|
| 130 | - * of the rendered e-mail. The configuration string is the |
|
| 131 | - * path to the template file relative to the templates directory (usually |
|
| 132 | - * in client/html/templates). |
|
| 133 | - * |
|
| 134 | - * You can overwrite the template file configuration in extensions and |
|
| 135 | - * provide alternative templates. These alternative templates should be |
|
| 136 | - * named like the default one but with the string "standard" replaced by |
|
| 137 | - * an unique name. You may use the name of your project for this. If |
|
| 138 | - * you've implemented an alternative client class as well, "standard" |
|
| 139 | - * should be replaced by the name of the new class. |
|
| 140 | - * |
|
| 141 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 142 | - * @since 2014.03 |
|
| 143 | - * @category Developer |
|
| 144 | - * @see client/html/email/delivery/text/summary/service/standard/template-body |
|
| 145 | - */ |
|
| 146 | - $tplconf = 'client/html/email/delivery/text/summary/service/standard/template-header'; |
|
| 147 | - $default = 'email/common/text-summary-service-header-default.php'; |
|
| 148 | - |
|
| 149 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 150 | - } |
|
| 151 | - |
|
| 152 | - |
|
| 153 | - /** |
|
| 154 | - * Returns the sub-client given by its name. |
|
| 155 | - * |
|
| 156 | - * @param string $type Name of the client type |
|
| 157 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 158 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 159 | - */ |
|
| 160 | - public function getSubClient( $type, $name = null ) |
|
| 161 | - { |
|
| 162 | - /** client/html/email/delivery/text/summary/service/decorators/excludes |
|
| 163 | - * Excludes decorators added by the "common" option from the "email delivery text summary service" html client |
|
| 164 | - * |
|
| 165 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 166 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 167 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 168 | - * modify what is returned to the caller. |
|
| 169 | - * |
|
| 170 | - * This option allows you to remove a decorator added via |
|
| 171 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 172 | - * around the html client. |
|
| 173 | - * |
|
| 174 | - * client/html/email/delivery/text/summary/service/decorators/excludes = array( 'decorator1' ) |
|
| 175 | - * |
|
| 176 | - * This would remove the decorator named "decorator1" from the list of |
|
| 177 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 178 | - * "client/html/common/decorators/default" to the html client. |
|
| 179 | - * |
|
| 180 | - * @param array List of decorator names |
|
| 181 | - * @since 2015.08 |
|
| 182 | - * @category Developer |
|
| 183 | - * @see client/html/common/decorators/default |
|
| 184 | - * @see client/html/email/delivery/text/summary/service/decorators/global |
|
| 185 | - * @see client/html/email/delivery/text/summary/service/decorators/local |
|
| 186 | - */ |
|
| 187 | - |
|
| 188 | - /** client/html/email/delivery/text/summary/service/decorators/global |
|
| 189 | - * Adds a list of globally available decorators only to the "email delivery text summary service" html client |
|
| 190 | - * |
|
| 191 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 192 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 193 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 194 | - * modify what is returned to the caller. |
|
| 195 | - * |
|
| 196 | - * This option allows you to wrap global decorators |
|
| 197 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 198 | - * |
|
| 199 | - * client/html/email/delivery/text/summary/service/decorators/global = array( 'decorator1' ) |
|
| 200 | - * |
|
| 201 | - * This would add the decorator named "decorator1" defined by |
|
| 202 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 203 | - * |
|
| 204 | - * @param array List of decorator names |
|
| 205 | - * @since 2015.08 |
|
| 206 | - * @category Developer |
|
| 207 | - * @see client/html/common/decorators/default |
|
| 208 | - * @see client/html/email/delivery/text/summary/service/decorators/excludes |
|
| 209 | - * @see client/html/email/delivery/text/summary/service/decorators/local |
|
| 210 | - */ |
|
| 211 | - |
|
| 212 | - /** client/html/email/delivery/text/summary/service/decorators/local |
|
| 213 | - * Adds a list of local decorators only to the "email delivery text summary service" html client |
|
| 214 | - * |
|
| 215 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 216 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 217 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 218 | - * modify what is returned to the caller. |
|
| 219 | - * |
|
| 220 | - * This option allows you to wrap local decorators |
|
| 221 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 222 | - * |
|
| 223 | - * client/html/email/delivery/text/summary/service/decorators/local = array( 'decorator2' ) |
|
| 224 | - * |
|
| 225 | - * This would add the decorator named "decorator2" defined by |
|
| 226 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 227 | - * |
|
| 228 | - * @param array List of decorator names |
|
| 229 | - * @since 2015.08 |
|
| 230 | - * @category Developer |
|
| 231 | - * @see client/html/common/decorators/default |
|
| 232 | - * @see client/html/email/delivery/text/summary/service/decorators/excludes |
|
| 233 | - * @see client/html/email/delivery/text/summary/service/decorators/global |
|
| 234 | - */ |
|
| 235 | - |
|
| 236 | - return $this->createSubClient( 'email/delivery/text/summary/service/' . $type, $name ); |
|
| 237 | - } |
|
| 238 | - |
|
| 239 | - |
|
| 240 | - /** |
|
| 241 | - * Returns the list of sub-client names configured for the client. |
|
| 242 | - * |
|
| 243 | - * @return array List of HTML client names |
|
| 244 | - */ |
|
| 245 | - protected function getSubClientNames() |
|
| 246 | - { |
|
| 247 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 248 | - } |
|
| 25 | + /** client/html/email/delivery/text/summary/service/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email delivery text summary service section |
|
| 27 | + * |
|
| 28 | + * The output of the frontend is composed of the code generated by the HTML |
|
| 29 | + * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 30 | + * that are responsible for rendering certain sub-parts of the output. The |
|
| 31 | + * sub-clients can contain HTML clients themselves and therefore a |
|
| 32 | + * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 33 | + * the output that is placed inside the container of its parent. |
|
| 34 | + * |
|
| 35 | + * At first, always the HTML code generated by the parent is printed, then |
|
| 36 | + * the HTML code of its sub-clients. The order of the HTML sub-clients |
|
| 37 | + * determines the order of the output of these sub-clients inside the parent |
|
| 38 | + * container. If the configured list of clients is |
|
| 39 | + * |
|
| 40 | + * array( "subclient1", "subclient2" ) |
|
| 41 | + * |
|
| 42 | + * you can easily change the order of the output by reordering the subparts: |
|
| 43 | + * |
|
| 44 | + * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 45 | + * |
|
| 46 | + * You can also remove one or more parts if they shouldn't be rendered: |
|
| 47 | + * |
|
| 48 | + * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 49 | + * |
|
| 50 | + * As the clients only generates structural HTML, the layout defined via CSS |
|
| 51 | + * should support adding, removing or reordering content by a fluid like |
|
| 52 | + * design. |
|
| 53 | + * |
|
| 54 | + * @param array List of sub-client names |
|
| 55 | + * @since 2014.03 |
|
| 56 | + * @category Developer |
|
| 57 | + */ |
|
| 58 | + private $subPartPath = 'client/html/email/delivery/text/summary/service/standard/subparts'; |
|
| 59 | + private $subPartNames = array(); |
|
| 60 | + |
|
| 61 | + |
|
| 62 | + /** |
|
| 63 | + * Returns the HTML code for insertion into the body. |
|
| 64 | + * |
|
| 65 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 66 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 67 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 68 | + * @return string HTML code |
|
| 69 | + */ |
|
| 70 | + public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 71 | + { |
|
| 72 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 73 | + |
|
| 74 | + $content = ''; |
|
| 75 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | + } |
|
| 78 | + $view->summaryBody = $content; |
|
| 79 | + |
|
| 80 | + /** client/html/email/delivery/text/summary/service/standard/template-body |
|
| 81 | + * Relative path to the text body template of the email delivery text summary service 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 | + * @param string Relative path to the template creating code for the e-mail body |
|
| 96 | + * @since 2014.03 |
|
| 97 | + * @category Developer |
|
| 98 | + * @see client/html/email/delivery/text/summary/service/standard/template-header |
|
| 99 | + */ |
|
| 100 | + $tplconf = 'client/html/email/delivery/text/summary/service/standard/template-body'; |
|
| 101 | + $default = 'email/common/text-summary-service-body-default.php'; |
|
| 102 | + |
|
| 103 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * Returns the HTML string for insertion into the header. |
|
| 109 | + * |
|
| 110 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 111 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 112 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 113 | + * @return string|null String including HTML tags for the header on error |
|
| 114 | + */ |
|
| 115 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 116 | + { |
|
| 117 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 118 | + |
|
| 119 | + $content = ''; |
|
| 120 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 122 | + } |
|
| 123 | + $view->summaryHeader = $content; |
|
| 124 | + |
|
| 125 | + /** client/html/email/delivery/text/summary/service/standard/template-header |
|
| 126 | + * Relative path to the text header template of the email delivery text summary service client. |
|
| 127 | + * |
|
| 128 | + * The template file contains the text and processing instructions |
|
| 129 | + * to generate the text that is inserted into the e-mail header |
|
| 130 | + * of the rendered e-mail. The configuration string is the |
|
| 131 | + * path to the template file relative to the templates directory (usually |
|
| 132 | + * in client/html/templates). |
|
| 133 | + * |
|
| 134 | + * You can overwrite the template file configuration in extensions and |
|
| 135 | + * provide alternative templates. These alternative templates should be |
|
| 136 | + * named like the default one but with the string "standard" replaced by |
|
| 137 | + * an unique name. You may use the name of your project for this. If |
|
| 138 | + * you've implemented an alternative client class as well, "standard" |
|
| 139 | + * should be replaced by the name of the new class. |
|
| 140 | + * |
|
| 141 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 142 | + * @since 2014.03 |
|
| 143 | + * @category Developer |
|
| 144 | + * @see client/html/email/delivery/text/summary/service/standard/template-body |
|
| 145 | + */ |
|
| 146 | + $tplconf = 'client/html/email/delivery/text/summary/service/standard/template-header'; |
|
| 147 | + $default = 'email/common/text-summary-service-header-default.php'; |
|
| 148 | + |
|
| 149 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 150 | + } |
|
| 151 | + |
|
| 152 | + |
|
| 153 | + /** |
|
| 154 | + * Returns the sub-client given by its name. |
|
| 155 | + * |
|
| 156 | + * @param string $type Name of the client type |
|
| 157 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 158 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 159 | + */ |
|
| 160 | + public function getSubClient( $type, $name = null ) |
|
| 161 | + { |
|
| 162 | + /** client/html/email/delivery/text/summary/service/decorators/excludes |
|
| 163 | + * Excludes decorators added by the "common" option from the "email delivery text summary service" html client |
|
| 164 | + * |
|
| 165 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 166 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 167 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 168 | + * modify what is returned to the caller. |
|
| 169 | + * |
|
| 170 | + * This option allows you to remove a decorator added via |
|
| 171 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 172 | + * around the html client. |
|
| 173 | + * |
|
| 174 | + * client/html/email/delivery/text/summary/service/decorators/excludes = array( 'decorator1' ) |
|
| 175 | + * |
|
| 176 | + * This would remove the decorator named "decorator1" from the list of |
|
| 177 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 178 | + * "client/html/common/decorators/default" to the html client. |
|
| 179 | + * |
|
| 180 | + * @param array List of decorator names |
|
| 181 | + * @since 2015.08 |
|
| 182 | + * @category Developer |
|
| 183 | + * @see client/html/common/decorators/default |
|
| 184 | + * @see client/html/email/delivery/text/summary/service/decorators/global |
|
| 185 | + * @see client/html/email/delivery/text/summary/service/decorators/local |
|
| 186 | + */ |
|
| 187 | + |
|
| 188 | + /** client/html/email/delivery/text/summary/service/decorators/global |
|
| 189 | + * Adds a list of globally available decorators only to the "email delivery text summary service" html client |
|
| 190 | + * |
|
| 191 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 192 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 193 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 194 | + * modify what is returned to the caller. |
|
| 195 | + * |
|
| 196 | + * This option allows you to wrap global decorators |
|
| 197 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 198 | + * |
|
| 199 | + * client/html/email/delivery/text/summary/service/decorators/global = array( 'decorator1' ) |
|
| 200 | + * |
|
| 201 | + * This would add the decorator named "decorator1" defined by |
|
| 202 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 203 | + * |
|
| 204 | + * @param array List of decorator names |
|
| 205 | + * @since 2015.08 |
|
| 206 | + * @category Developer |
|
| 207 | + * @see client/html/common/decorators/default |
|
| 208 | + * @see client/html/email/delivery/text/summary/service/decorators/excludes |
|
| 209 | + * @see client/html/email/delivery/text/summary/service/decorators/local |
|
| 210 | + */ |
|
| 211 | + |
|
| 212 | + /** client/html/email/delivery/text/summary/service/decorators/local |
|
| 213 | + * Adds a list of local decorators only to the "email delivery text summary service" html client |
|
| 214 | + * |
|
| 215 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 216 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 217 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 218 | + * modify what is returned to the caller. |
|
| 219 | + * |
|
| 220 | + * This option allows you to wrap local decorators |
|
| 221 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 222 | + * |
|
| 223 | + * client/html/email/delivery/text/summary/service/decorators/local = array( 'decorator2' ) |
|
| 224 | + * |
|
| 225 | + * This would add the decorator named "decorator2" defined by |
|
| 226 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 227 | + * |
|
| 228 | + * @param array List of decorator names |
|
| 229 | + * @since 2015.08 |
|
| 230 | + * @category Developer |
|
| 231 | + * @see client/html/common/decorators/default |
|
| 232 | + * @see client/html/email/delivery/text/summary/service/decorators/excludes |
|
| 233 | + * @see client/html/email/delivery/text/summary/service/decorators/global |
|
| 234 | + */ |
|
| 235 | + |
|
| 236 | + return $this->createSubClient( 'email/delivery/text/summary/service/' . $type, $name ); |
|
| 237 | + } |
|
| 238 | + |
|
| 239 | + |
|
| 240 | + /** |
|
| 241 | + * Returns the list of sub-client names configured for the client. |
|
| 242 | + * |
|
| 243 | + * @return array List of HTML client names |
|
| 244 | + */ |
|
| 245 | + protected function getSubClientNames() |
|
| 246 | + { |
|
| 247 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 248 | + } |
|
| 249 | 249 | } |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 68 | 68 | * @return string HTML code |
| 69 | 69 | */ |
| 70 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 70 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 71 | 71 | { |
| 72 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 72 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 73 | 73 | |
| 74 | 74 | $content = ''; |
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 75 | + foreach ($this->getSubClients() as $subclient) { |
|
| 76 | + $content .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 77 | 77 | } |
| 78 | 78 | $view->summaryBody = $content; |
| 79 | 79 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $tplconf = 'client/html/email/delivery/text/summary/service/standard/template-body'; |
| 101 | 101 | $default = 'email/common/text-summary-service-body-default.php'; |
| 102 | 102 | |
| 103 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 103 | + return $view->render($view->config($tplconf, $default)); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
@@ -112,13 +112,13 @@ discard block |
||
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | 113 | * @return string|null String including HTML tags for the header on error |
| 114 | 114 | */ |
| 115 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 115 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 116 | 116 | { |
| 117 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 117 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 118 | 118 | |
| 119 | 119 | $content = ''; |
| 120 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 120 | + foreach ($this->getSubClients() as $subclient) { |
|
| 121 | + $content .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 122 | 122 | } |
| 123 | 123 | $view->summaryHeader = $content; |
| 124 | 124 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $tplconf = 'client/html/email/delivery/text/summary/service/standard/template-header'; |
| 147 | 147 | $default = 'email/common/text-summary-service-header-default.php'; |
| 148 | 148 | |
| 149 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 149 | + return $view->render($view->config($tplconf, $default)); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @param string|null $name Name of the sub-client (Default if null) |
| 158 | 158 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 159 | 159 | */ |
| 160 | - public function getSubClient( $type, $name = null ) |
|
| 160 | + public function getSubClient($type, $name = null) |
|
| 161 | 161 | { |
| 162 | 162 | /** client/html/email/delivery/text/summary/service/decorators/excludes |
| 163 | 163 | * Excludes decorators added by the "common" option from the "email delivery text summary service" html client |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @see client/html/email/delivery/text/summary/service/decorators/global |
| 234 | 234 | */ |
| 235 | 235 | |
| 236 | - return $this->createSubClient( 'email/delivery/text/summary/service/' . $type, $name ); |
|
| 236 | + return $this->createSubClient('email/delivery/text/summary/service/'.$type, $name); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
@@ -244,6 +244,6 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | protected function getSubClientNames() |
| 246 | 246 | { |
| 247 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 247 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 248 | 248 | } |
| 249 | 249 | } |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
| 111 | 111 | * @param array &$tags Result array for the list of tags that are associated to the output |
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | - * @return string|null String including HTML tags for the header on error |
|
| 113 | + * @return string String including HTML tags for the header on error |
|
| 114 | 114 | */ |
| 115 | 115 | public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
| 116 | 116 | { |
@@ -19,231 +19,231 @@ |
||
| 19 | 19 | * @subpackage Html |
| 20 | 20 | */ |
| 21 | 21 | class Standard |
| 22 | - extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
| 23 | - implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 22 | + extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
| 23 | + implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 24 | 24 | { |
| 25 | - /** client/html/email/delivery/text/summary/coupon/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email delivery text summary coupon section |
|
| 27 | - * |
|
| 28 | - * The output of the frontend is composed of the code generated by the HTML |
|
| 29 | - * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 30 | - * that are responsible for rendering certain sub-parts of the output. The |
|
| 31 | - * sub-clients can contain HTML clients themselves and therefore a |
|
| 32 | - * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 33 | - * the output that is placed inside the container of its parent. |
|
| 34 | - * |
|
| 35 | - * At first, always the HTML code generated by the parent is printed, then |
|
| 36 | - * the HTML code of its sub-clients. The order of the HTML sub-clients |
|
| 37 | - * determines the order of the output of these sub-clients inside the parent |
|
| 38 | - * container. If the configured list of clients is |
|
| 39 | - * |
|
| 40 | - * array( "subclient1", "subclient2" ) |
|
| 41 | - * |
|
| 42 | - * you can easily change the order of the output by reordering the subparts: |
|
| 43 | - * |
|
| 44 | - * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 45 | - * |
|
| 46 | - * You can also remove one or more parts if they shouldn't be rendered: |
|
| 47 | - * |
|
| 48 | - * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 49 | - * |
|
| 50 | - * As the clients only generates structural HTML, the layout defined via CSS |
|
| 51 | - * should support adding, removing or reordering content by a fluid like |
|
| 52 | - * design. |
|
| 53 | - * |
|
| 54 | - * @param array List of sub-client names |
|
| 55 | - * @since 2014.03 |
|
| 56 | - * @category Developer |
|
| 57 | - */ |
|
| 58 | - private $subPartPath = 'client/html/email/delivery/text/summary/coupon/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 60 | - |
|
| 61 | - |
|
| 62 | - /** |
|
| 63 | - * Returns the HTML code for insertion into the body. |
|
| 64 | - * |
|
| 65 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 66 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 67 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 68 | - * @return string HTML code |
|
| 69 | - */ |
|
| 70 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 71 | - { |
|
| 72 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 73 | - |
|
| 74 | - $content = ''; |
|
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | - } |
|
| 78 | - $view->summaryBody = $content; |
|
| 79 | - |
|
| 80 | - /** client/html/email/delivery/text/summary/coupon/standard/template-body |
|
| 81 | - * Relative path to the text body template of the email delivery text summary coupon 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 | - * @param string Relative path to the template creating code for the e-mail body |
|
| 96 | - * @since 2014.03 |
|
| 97 | - * @category Developer |
|
| 98 | - * @see client/html/email/delivery/text/summary/coupon/standard/template-header |
|
| 99 | - */ |
|
| 100 | - $tplconf = 'client/html/email/delivery/text/summary/coupon/standard/template-body'; |
|
| 101 | - $default = 'email/common/text-summary-coupon-body-default.php'; |
|
| 102 | - |
|
| 103 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * Returns the HTML string for insertion into the header. |
|
| 109 | - * |
|
| 110 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 111 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 112 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 113 | - * @return string|null String including HTML tags for the header on error |
|
| 114 | - */ |
|
| 115 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 116 | - { |
|
| 117 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 118 | - |
|
| 119 | - $content = ''; |
|
| 120 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 122 | - } |
|
| 123 | - $view->summaryHeader = $content; |
|
| 124 | - |
|
| 125 | - /** client/html/email/delivery/text/summary/coupon/standard/template-header |
|
| 126 | - * Relative path to the text header template of the email delivery text summary coupon client. |
|
| 127 | - * |
|
| 128 | - * The template file contains the text and processing instructions |
|
| 129 | - * to generate the text that is inserted into the e-mail header |
|
| 130 | - * of the rendered e-mail. The configuration string is the |
|
| 131 | - * path to the template file relative to the templates directory (usually |
|
| 132 | - * in client/html/templates). |
|
| 133 | - * |
|
| 134 | - * You can overwrite the template file configuration in extensions and |
|
| 135 | - * provide alternative templates. These alternative templates should be |
|
| 136 | - * named like the default one but with the string "standard" replaced by |
|
| 137 | - * an unique name. You may use the name of your project for this. If |
|
| 138 | - * you've implemented an alternative client class as well, "standard" |
|
| 139 | - * should be replaced by the name of the new class. |
|
| 140 | - * |
|
| 141 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 142 | - * @since 2014.03 |
|
| 143 | - * @category Developer |
|
| 144 | - * @see client/html/email/delivery/text/summary/coupon/standard/template-body |
|
| 145 | - */ |
|
| 146 | - $tplconf = 'client/html/email/delivery/text/summary/coupon/standard/template-header'; |
|
| 147 | - $default = 'email/common/text-summary-coupon-header-default.php'; |
|
| 148 | - |
|
| 149 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 150 | - } |
|
| 151 | - |
|
| 152 | - |
|
| 153 | - /** |
|
| 154 | - * Returns the sub-client given by its name. |
|
| 155 | - * |
|
| 156 | - * @param string $type Name of the client type |
|
| 157 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 158 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 159 | - */ |
|
| 160 | - public function getSubClient( $type, $name = null ) |
|
| 161 | - { |
|
| 162 | - /** client/html/email/delivery/text/summary/coupon/decorators/excludes |
|
| 163 | - * Excludes decorators added by the "common" option from the "email delivery text summary coupon" html client |
|
| 164 | - * |
|
| 165 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 166 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 167 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 168 | - * modify what is returned to the caller. |
|
| 169 | - * |
|
| 170 | - * This option allows you to remove a decorator added via |
|
| 171 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 172 | - * around the html client. |
|
| 173 | - * |
|
| 174 | - * client/html/email/delivery/text/summary/coupon/decorators/excludes = array( 'decorator1' ) |
|
| 175 | - * |
|
| 176 | - * This would remove the decorator named "decorator1" from the list of |
|
| 177 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 178 | - * "client/html/common/decorators/default" to the html client. |
|
| 179 | - * |
|
| 180 | - * @param array List of decorator names |
|
| 181 | - * @since 2015.08 |
|
| 182 | - * @category Developer |
|
| 183 | - * @see client/html/common/decorators/default |
|
| 184 | - * @see client/html/email/delivery/text/summary/coupon/decorators/global |
|
| 185 | - * @see client/html/email/delivery/text/summary/coupon/decorators/local |
|
| 186 | - */ |
|
| 187 | - |
|
| 188 | - /** client/html/email/delivery/text/summary/coupon/decorators/global |
|
| 189 | - * Adds a list of globally available decorators only to the "email delivery text summary coupon" html client |
|
| 190 | - * |
|
| 191 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 192 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 193 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 194 | - * modify what is returned to the caller. |
|
| 195 | - * |
|
| 196 | - * This option allows you to wrap global decorators |
|
| 197 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 198 | - * |
|
| 199 | - * client/html/email/delivery/text/summary/coupon/decorators/global = array( 'decorator1' ) |
|
| 200 | - * |
|
| 201 | - * This would add the decorator named "decorator1" defined by |
|
| 202 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 203 | - * |
|
| 204 | - * @param array List of decorator names |
|
| 205 | - * @since 2015.08 |
|
| 206 | - * @category Developer |
|
| 207 | - * @see client/html/common/decorators/default |
|
| 208 | - * @see client/html/email/delivery/text/summary/coupon/decorators/excludes |
|
| 209 | - * @see client/html/email/delivery/text/summary/coupon/decorators/local |
|
| 210 | - */ |
|
| 211 | - |
|
| 212 | - /** client/html/email/delivery/text/summary/coupon/decorators/local |
|
| 213 | - * Adds a list of local decorators only to the "email delivery text summary coupon" html client |
|
| 214 | - * |
|
| 215 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 216 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 217 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 218 | - * modify what is returned to the caller. |
|
| 219 | - * |
|
| 220 | - * This option allows you to wrap local decorators |
|
| 221 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 222 | - * |
|
| 223 | - * client/html/email/delivery/text/summary/coupon/decorators/local = array( 'decorator2' ) |
|
| 224 | - * |
|
| 225 | - * This would add the decorator named "decorator2" defined by |
|
| 226 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 227 | - * |
|
| 228 | - * @param array List of decorator names |
|
| 229 | - * @since 2015.08 |
|
| 230 | - * @category Developer |
|
| 231 | - * @see client/html/common/decorators/default |
|
| 232 | - * @see client/html/email/delivery/text/summary/coupon/decorators/excludes |
|
| 233 | - * @see client/html/email/delivery/text/summary/coupon/decorators/global |
|
| 234 | - */ |
|
| 235 | - |
|
| 236 | - return $this->createSubClient( 'email/delivery/text/summary/coupon/' . $type, $name ); |
|
| 237 | - } |
|
| 238 | - |
|
| 239 | - |
|
| 240 | - /** |
|
| 241 | - * Returns the list of sub-client names configured for the client. |
|
| 242 | - * |
|
| 243 | - * @return array List of HTML client names |
|
| 244 | - */ |
|
| 245 | - protected function getSubClientNames() |
|
| 246 | - { |
|
| 247 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 248 | - } |
|
| 25 | + /** client/html/email/delivery/text/summary/coupon/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email delivery text summary coupon section |
|
| 27 | + * |
|
| 28 | + * The output of the frontend is composed of the code generated by the HTML |
|
| 29 | + * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 30 | + * that are responsible for rendering certain sub-parts of the output. The |
|
| 31 | + * sub-clients can contain HTML clients themselves and therefore a |
|
| 32 | + * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 33 | + * the output that is placed inside the container of its parent. |
|
| 34 | + * |
|
| 35 | + * At first, always the HTML code generated by the parent is printed, then |
|
| 36 | + * the HTML code of its sub-clients. The order of the HTML sub-clients |
|
| 37 | + * determines the order of the output of these sub-clients inside the parent |
|
| 38 | + * container. If the configured list of clients is |
|
| 39 | + * |
|
| 40 | + * array( "subclient1", "subclient2" ) |
|
| 41 | + * |
|
| 42 | + * you can easily change the order of the output by reordering the subparts: |
|
| 43 | + * |
|
| 44 | + * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 45 | + * |
|
| 46 | + * You can also remove one or more parts if they shouldn't be rendered: |
|
| 47 | + * |
|
| 48 | + * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 49 | + * |
|
| 50 | + * As the clients only generates structural HTML, the layout defined via CSS |
|
| 51 | + * should support adding, removing or reordering content by a fluid like |
|
| 52 | + * design. |
|
| 53 | + * |
|
| 54 | + * @param array List of sub-client names |
|
| 55 | + * @since 2014.03 |
|
| 56 | + * @category Developer |
|
| 57 | + */ |
|
| 58 | + private $subPartPath = 'client/html/email/delivery/text/summary/coupon/standard/subparts'; |
|
| 59 | + private $subPartNames = array(); |
|
| 60 | + |
|
| 61 | + |
|
| 62 | + /** |
|
| 63 | + * Returns the HTML code for insertion into the body. |
|
| 64 | + * |
|
| 65 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 66 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 67 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 68 | + * @return string HTML code |
|
| 69 | + */ |
|
| 70 | + public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 71 | + { |
|
| 72 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 73 | + |
|
| 74 | + $content = ''; |
|
| 75 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | + } |
|
| 78 | + $view->summaryBody = $content; |
|
| 79 | + |
|
| 80 | + /** client/html/email/delivery/text/summary/coupon/standard/template-body |
|
| 81 | + * Relative path to the text body template of the email delivery text summary coupon 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 | + * @param string Relative path to the template creating code for the e-mail body |
|
| 96 | + * @since 2014.03 |
|
| 97 | + * @category Developer |
|
| 98 | + * @see client/html/email/delivery/text/summary/coupon/standard/template-header |
|
| 99 | + */ |
|
| 100 | + $tplconf = 'client/html/email/delivery/text/summary/coupon/standard/template-body'; |
|
| 101 | + $default = 'email/common/text-summary-coupon-body-default.php'; |
|
| 102 | + |
|
| 103 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * Returns the HTML string for insertion into the header. |
|
| 109 | + * |
|
| 110 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 111 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 112 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 113 | + * @return string|null String including HTML tags for the header on error |
|
| 114 | + */ |
|
| 115 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 116 | + { |
|
| 117 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 118 | + |
|
| 119 | + $content = ''; |
|
| 120 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 122 | + } |
|
| 123 | + $view->summaryHeader = $content; |
|
| 124 | + |
|
| 125 | + /** client/html/email/delivery/text/summary/coupon/standard/template-header |
|
| 126 | + * Relative path to the text header template of the email delivery text summary coupon client. |
|
| 127 | + * |
|
| 128 | + * The template file contains the text and processing instructions |
|
| 129 | + * to generate the text that is inserted into the e-mail header |
|
| 130 | + * of the rendered e-mail. The configuration string is the |
|
| 131 | + * path to the template file relative to the templates directory (usually |
|
| 132 | + * in client/html/templates). |
|
| 133 | + * |
|
| 134 | + * You can overwrite the template file configuration in extensions and |
|
| 135 | + * provide alternative templates. These alternative templates should be |
|
| 136 | + * named like the default one but with the string "standard" replaced by |
|
| 137 | + * an unique name. You may use the name of your project for this. If |
|
| 138 | + * you've implemented an alternative client class as well, "standard" |
|
| 139 | + * should be replaced by the name of the new class. |
|
| 140 | + * |
|
| 141 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 142 | + * @since 2014.03 |
|
| 143 | + * @category Developer |
|
| 144 | + * @see client/html/email/delivery/text/summary/coupon/standard/template-body |
|
| 145 | + */ |
|
| 146 | + $tplconf = 'client/html/email/delivery/text/summary/coupon/standard/template-header'; |
|
| 147 | + $default = 'email/common/text-summary-coupon-header-default.php'; |
|
| 148 | + |
|
| 149 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 150 | + } |
|
| 151 | + |
|
| 152 | + |
|
| 153 | + /** |
|
| 154 | + * Returns the sub-client given by its name. |
|
| 155 | + * |
|
| 156 | + * @param string $type Name of the client type |
|
| 157 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 158 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 159 | + */ |
|
| 160 | + public function getSubClient( $type, $name = null ) |
|
| 161 | + { |
|
| 162 | + /** client/html/email/delivery/text/summary/coupon/decorators/excludes |
|
| 163 | + * Excludes decorators added by the "common" option from the "email delivery text summary coupon" html client |
|
| 164 | + * |
|
| 165 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 166 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 167 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 168 | + * modify what is returned to the caller. |
|
| 169 | + * |
|
| 170 | + * This option allows you to remove a decorator added via |
|
| 171 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 172 | + * around the html client. |
|
| 173 | + * |
|
| 174 | + * client/html/email/delivery/text/summary/coupon/decorators/excludes = array( 'decorator1' ) |
|
| 175 | + * |
|
| 176 | + * This would remove the decorator named "decorator1" from the list of |
|
| 177 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 178 | + * "client/html/common/decorators/default" to the html client. |
|
| 179 | + * |
|
| 180 | + * @param array List of decorator names |
|
| 181 | + * @since 2015.08 |
|
| 182 | + * @category Developer |
|
| 183 | + * @see client/html/common/decorators/default |
|
| 184 | + * @see client/html/email/delivery/text/summary/coupon/decorators/global |
|
| 185 | + * @see client/html/email/delivery/text/summary/coupon/decorators/local |
|
| 186 | + */ |
|
| 187 | + |
|
| 188 | + /** client/html/email/delivery/text/summary/coupon/decorators/global |
|
| 189 | + * Adds a list of globally available decorators only to the "email delivery text summary coupon" html client |
|
| 190 | + * |
|
| 191 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 192 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 193 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 194 | + * modify what is returned to the caller. |
|
| 195 | + * |
|
| 196 | + * This option allows you to wrap global decorators |
|
| 197 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 198 | + * |
|
| 199 | + * client/html/email/delivery/text/summary/coupon/decorators/global = array( 'decorator1' ) |
|
| 200 | + * |
|
| 201 | + * This would add the decorator named "decorator1" defined by |
|
| 202 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 203 | + * |
|
| 204 | + * @param array List of decorator names |
|
| 205 | + * @since 2015.08 |
|
| 206 | + * @category Developer |
|
| 207 | + * @see client/html/common/decorators/default |
|
| 208 | + * @see client/html/email/delivery/text/summary/coupon/decorators/excludes |
|
| 209 | + * @see client/html/email/delivery/text/summary/coupon/decorators/local |
|
| 210 | + */ |
|
| 211 | + |
|
| 212 | + /** client/html/email/delivery/text/summary/coupon/decorators/local |
|
| 213 | + * Adds a list of local decorators only to the "email delivery text summary coupon" html client |
|
| 214 | + * |
|
| 215 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 216 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 217 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 218 | + * modify what is returned to the caller. |
|
| 219 | + * |
|
| 220 | + * This option allows you to wrap local decorators |
|
| 221 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 222 | + * |
|
| 223 | + * client/html/email/delivery/text/summary/coupon/decorators/local = array( 'decorator2' ) |
|
| 224 | + * |
|
| 225 | + * This would add the decorator named "decorator2" defined by |
|
| 226 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 227 | + * |
|
| 228 | + * @param array List of decorator names |
|
| 229 | + * @since 2015.08 |
|
| 230 | + * @category Developer |
|
| 231 | + * @see client/html/common/decorators/default |
|
| 232 | + * @see client/html/email/delivery/text/summary/coupon/decorators/excludes |
|
| 233 | + * @see client/html/email/delivery/text/summary/coupon/decorators/global |
|
| 234 | + */ |
|
| 235 | + |
|
| 236 | + return $this->createSubClient( 'email/delivery/text/summary/coupon/' . $type, $name ); |
|
| 237 | + } |
|
| 238 | + |
|
| 239 | + |
|
| 240 | + /** |
|
| 241 | + * Returns the list of sub-client names configured for the client. |
|
| 242 | + * |
|
| 243 | + * @return array List of HTML client names |
|
| 244 | + */ |
|
| 245 | + protected function getSubClientNames() |
|
| 246 | + { |
|
| 247 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 248 | + } |
|
| 249 | 249 | } |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 68 | 68 | * @return string HTML code |
| 69 | 69 | */ |
| 70 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 70 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 71 | 71 | { |
| 72 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 72 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 73 | 73 | |
| 74 | 74 | $content = ''; |
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 75 | + foreach ($this->getSubClients() as $subclient) { |
|
| 76 | + $content .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 77 | 77 | } |
| 78 | 78 | $view->summaryBody = $content; |
| 79 | 79 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $tplconf = 'client/html/email/delivery/text/summary/coupon/standard/template-body'; |
| 101 | 101 | $default = 'email/common/text-summary-coupon-body-default.php'; |
| 102 | 102 | |
| 103 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 103 | + return $view->render($view->config($tplconf, $default)); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
@@ -112,13 +112,13 @@ discard block |
||
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | 113 | * @return string|null String including HTML tags for the header on error |
| 114 | 114 | */ |
| 115 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 115 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 116 | 116 | { |
| 117 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 117 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 118 | 118 | |
| 119 | 119 | $content = ''; |
| 120 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 120 | + foreach ($this->getSubClients() as $subclient) { |
|
| 121 | + $content .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 122 | 122 | } |
| 123 | 123 | $view->summaryHeader = $content; |
| 124 | 124 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $tplconf = 'client/html/email/delivery/text/summary/coupon/standard/template-header'; |
| 147 | 147 | $default = 'email/common/text-summary-coupon-header-default.php'; |
| 148 | 148 | |
| 149 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 149 | + return $view->render($view->config($tplconf, $default)); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @param string|null $name Name of the sub-client (Default if null) |
| 158 | 158 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 159 | 159 | */ |
| 160 | - public function getSubClient( $type, $name = null ) |
|
| 160 | + public function getSubClient($type, $name = null) |
|
| 161 | 161 | { |
| 162 | 162 | /** client/html/email/delivery/text/summary/coupon/decorators/excludes |
| 163 | 163 | * Excludes decorators added by the "common" option from the "email delivery text summary coupon" html client |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @see client/html/email/delivery/text/summary/coupon/decorators/global |
| 234 | 234 | */ |
| 235 | 235 | |
| 236 | - return $this->createSubClient( 'email/delivery/text/summary/coupon/' . $type, $name ); |
|
| 236 | + return $this->createSubClient('email/delivery/text/summary/coupon/'.$type, $name); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
@@ -244,6 +244,6 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | protected function getSubClientNames() |
| 246 | 246 | { |
| 247 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 247 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 248 | 248 | } |
| 249 | 249 | } |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
| 111 | 111 | * @param array &$tags Result array for the list of tags that are associated to the output |
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | - * @return string|null String including HTML tags for the header on error |
|
| 113 | + * @return string String including HTML tags for the header on error |
|
| 114 | 114 | */ |
| 115 | 115 | public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
| 116 | 116 | { |
@@ -19,252 +19,252 @@ |
||
| 19 | 19 | * @subpackage Html |
| 20 | 20 | */ |
| 21 | 21 | class Standard |
| 22 | - extends \Aimeos\Client\Html\Common\Summary\Detail\Base |
|
| 23 | - implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 22 | + extends \Aimeos\Client\Html\Common\Summary\Detail\Base |
|
| 23 | + implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 24 | 24 | { |
| 25 | - /** client/html/email/delivery/text/summary/detail/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email delivery text summary detail section |
|
| 27 | - * |
|
| 28 | - * The output of the frontend is composed of the code generated by the HTML |
|
| 29 | - * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 30 | - * that are responsible for rendering certain sub-parts of the output. The |
|
| 31 | - * sub-clients can contain HTML clients themselves and therefore a |
|
| 32 | - * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 33 | - * the output that is placed inside the container of its parent. |
|
| 34 | - * |
|
| 35 | - * At first, always the HTML code generated by the parent is printed, then |
|
| 36 | - * the HTML code of its sub-clients. The order of the HTML sub-clients |
|
| 37 | - * determines the order of the output of these sub-clients inside the parent |
|
| 38 | - * container. If the configured list of clients is |
|
| 39 | - * |
|
| 40 | - * array( "subclient1", "subclient2" ) |
|
| 41 | - * |
|
| 42 | - * you can easily change the order of the output by reordering the subparts: |
|
| 43 | - * |
|
| 44 | - * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 45 | - * |
|
| 46 | - * You can also remove one or more parts if they shouldn't be rendered: |
|
| 47 | - * |
|
| 48 | - * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 49 | - * |
|
| 50 | - * As the clients only generates structural HTML, the layout defined via CSS |
|
| 51 | - * should support adding, removing or reordering content by a fluid like |
|
| 52 | - * design. |
|
| 53 | - * |
|
| 54 | - * @param array List of sub-client names |
|
| 55 | - * @since 2014.03 |
|
| 56 | - * @category Developer |
|
| 57 | - */ |
|
| 58 | - private $subPartPath = 'client/html/email/delivery/text/summary/detail/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 25 | + /** client/html/email/delivery/text/summary/detail/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email delivery text summary detail section |
|
| 27 | + * |
|
| 28 | + * The output of the frontend is composed of the code generated by the HTML |
|
| 29 | + * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 30 | + * that are responsible for rendering certain sub-parts of the output. The |
|
| 31 | + * sub-clients can contain HTML clients themselves and therefore a |
|
| 32 | + * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 33 | + * the output that is placed inside the container of its parent. |
|
| 34 | + * |
|
| 35 | + * At first, always the HTML code generated by the parent is printed, then |
|
| 36 | + * the HTML code of its sub-clients. The order of the HTML sub-clients |
|
| 37 | + * determines the order of the output of these sub-clients inside the parent |
|
| 38 | + * container. If the configured list of clients is |
|
| 39 | + * |
|
| 40 | + * array( "subclient1", "subclient2" ) |
|
| 41 | + * |
|
| 42 | + * you can easily change the order of the output by reordering the subparts: |
|
| 43 | + * |
|
| 44 | + * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 45 | + * |
|
| 46 | + * You can also remove one or more parts if they shouldn't be rendered: |
|
| 47 | + * |
|
| 48 | + * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 49 | + * |
|
| 50 | + * As the clients only generates structural HTML, the layout defined via CSS |
|
| 51 | + * should support adding, removing or reordering content by a fluid like |
|
| 52 | + * design. |
|
| 53 | + * |
|
| 54 | + * @param array List of sub-client names |
|
| 55 | + * @since 2014.03 |
|
| 56 | + * @category Developer |
|
| 57 | + */ |
|
| 58 | + private $subPartPath = 'client/html/email/delivery/text/summary/detail/standard/subparts'; |
|
| 59 | + private $subPartNames = array(); |
|
| 60 | 60 | |
| 61 | 61 | |
| 62 | - /** |
|
| 63 | - * Returns the HTML code for insertion into the body. |
|
| 64 | - * |
|
| 65 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 66 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 67 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 68 | - * @return string HTML code |
|
| 69 | - */ |
|
| 70 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 71 | - { |
|
| 72 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 62 | + /** |
|
| 63 | + * Returns the HTML code for insertion into the body. |
|
| 64 | + * |
|
| 65 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 66 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 67 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 68 | + * @return string HTML code |
|
| 69 | + */ |
|
| 70 | + public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 71 | + { |
|
| 72 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 73 | 73 | |
| 74 | - $content = ''; |
|
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | - } |
|
| 78 | - $view->summaryBody = $content; |
|
| 74 | + $content = ''; |
|
| 75 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | + } |
|
| 78 | + $view->summaryBody = $content; |
|
| 79 | 79 | |
| 80 | - /** client/html/email/delivery/text/summary/detail/standard/template-body |
|
| 81 | - * Relative path to the text body template of the email delivery text summary detail 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 | - * @param string Relative path to the template creating code for the e-mail body |
|
| 96 | - * @since 2014.03 |
|
| 97 | - * @category Developer |
|
| 98 | - * @see client/html/email/delivery/text/summary/detail/standard/template-header |
|
| 99 | - */ |
|
| 100 | - $tplconf = 'client/html/email/delivery/text/summary/detail/standard/template-body'; |
|
| 101 | - $default = 'email/common/text-summary-detail-body-default.php'; |
|
| 80 | + /** client/html/email/delivery/text/summary/detail/standard/template-body |
|
| 81 | + * Relative path to the text body template of the email delivery text summary detail 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 | + * @param string Relative path to the template creating code for the e-mail body |
|
| 96 | + * @since 2014.03 |
|
| 97 | + * @category Developer |
|
| 98 | + * @see client/html/email/delivery/text/summary/detail/standard/template-header |
|
| 99 | + */ |
|
| 100 | + $tplconf = 'client/html/email/delivery/text/summary/detail/standard/template-body'; |
|
| 101 | + $default = 'email/common/text-summary-detail-body-default.php'; |
|
| 102 | 102 | |
| 103 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 104 | - } |
|
| 103 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 104 | + } |
|
| 105 | 105 | |
| 106 | 106 | |
| 107 | - /** |
|
| 108 | - * Returns the HTML string for insertion into the header. |
|
| 109 | - * |
|
| 110 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 111 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 112 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 113 | - * @return string|null String including HTML tags for the header on error |
|
| 114 | - */ |
|
| 115 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 116 | - { |
|
| 117 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 107 | + /** |
|
| 108 | + * Returns the HTML string for insertion into the header. |
|
| 109 | + * |
|
| 110 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 111 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 112 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 113 | + * @return string|null String including HTML tags for the header on error |
|
| 114 | + */ |
|
| 115 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 116 | + { |
|
| 117 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 118 | 118 | |
| 119 | - $content = ''; |
|
| 120 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 122 | - } |
|
| 123 | - $view->summaryHeader = $content; |
|
| 119 | + $content = ''; |
|
| 120 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 122 | + } |
|
| 123 | + $view->summaryHeader = $content; |
|
| 124 | 124 | |
| 125 | - /** client/html/email/delivery/text/summary/detail/standard/template-header |
|
| 126 | - * Relative path to the text header template of the email delivery text summary detail client. |
|
| 127 | - * |
|
| 128 | - * The template file contains the text and processing instructions |
|
| 129 | - * to generate the text that is inserted into the e-mail header |
|
| 130 | - * of the rendered e-mail. The configuration string is the |
|
| 131 | - * path to the template file relative to the templates directory (usually |
|
| 132 | - * in client/html/templates). |
|
| 133 | - * |
|
| 134 | - * You can overwrite the template file configuration in extensions and |
|
| 135 | - * provide alternative templates. These alternative templates should be |
|
| 136 | - * named like the default one but with the string "standard" replaced by |
|
| 137 | - * an unique name. You may use the name of your project for this. If |
|
| 138 | - * you've implemented an alternative client class as well, "standard" |
|
| 139 | - * should be replaced by the name of the new class. |
|
| 140 | - * |
|
| 141 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 142 | - * @since 2014.03 |
|
| 143 | - * @category Developer |
|
| 144 | - * @see client/html/email/delivery/text/summary/detail/standard/template-body |
|
| 145 | - */ |
|
| 146 | - $tplconf = 'client/html/email/delivery/text/summary/detail/standard/template-header'; |
|
| 147 | - $default = 'email/common/text-summary-detail-header-default.php'; |
|
| 125 | + /** client/html/email/delivery/text/summary/detail/standard/template-header |
|
| 126 | + * Relative path to the text header template of the email delivery text summary detail client. |
|
| 127 | + * |
|
| 128 | + * The template file contains the text and processing instructions |
|
| 129 | + * to generate the text that is inserted into the e-mail header |
|
| 130 | + * of the rendered e-mail. The configuration string is the |
|
| 131 | + * path to the template file relative to the templates directory (usually |
|
| 132 | + * in client/html/templates). |
|
| 133 | + * |
|
| 134 | + * You can overwrite the template file configuration in extensions and |
|
| 135 | + * provide alternative templates. These alternative templates should be |
|
| 136 | + * named like the default one but with the string "standard" replaced by |
|
| 137 | + * an unique name. You may use the name of your project for this. If |
|
| 138 | + * you've implemented an alternative client class as well, "standard" |
|
| 139 | + * should be replaced by the name of the new class. |
|
| 140 | + * |
|
| 141 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 142 | + * @since 2014.03 |
|
| 143 | + * @category Developer |
|
| 144 | + * @see client/html/email/delivery/text/summary/detail/standard/template-body |
|
| 145 | + */ |
|
| 146 | + $tplconf = 'client/html/email/delivery/text/summary/detail/standard/template-header'; |
|
| 147 | + $default = 'email/common/text-summary-detail-header-default.php'; |
|
| 148 | 148 | |
| 149 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 150 | - } |
|
| 149 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 150 | + } |
|
| 151 | 151 | |
| 152 | 152 | |
| 153 | - /** |
|
| 154 | - * Returns the sub-client given by its name. |
|
| 155 | - * |
|
| 156 | - * @param string $type Name of the client type |
|
| 157 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 158 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 159 | - */ |
|
| 160 | - public function getSubClient( $type, $name = null ) |
|
| 161 | - { |
|
| 162 | - /** client/html/email/delivery/text/summary/detail/decorators/excludes |
|
| 163 | - * Excludes decorators added by the "common" option from the "email delivery text summary detail" html client |
|
| 164 | - * |
|
| 165 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 166 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 167 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 168 | - * modify what is returned to the caller. |
|
| 169 | - * |
|
| 170 | - * This option allows you to remove a decorator added via |
|
| 171 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 172 | - * around the html client. |
|
| 173 | - * |
|
| 174 | - * client/html/email/delivery/text/summary/detail/decorators/excludes = array( 'decorator1' ) |
|
| 175 | - * |
|
| 176 | - * This would remove the decorator named "decorator1" from the list of |
|
| 177 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 178 | - * "client/html/common/decorators/default" to the html client. |
|
| 179 | - * |
|
| 180 | - * @param array List of decorator names |
|
| 181 | - * @since 2015.08 |
|
| 182 | - * @category Developer |
|
| 183 | - * @see client/html/common/decorators/default |
|
| 184 | - * @see client/html/email/delivery/text/summary/detail/decorators/global |
|
| 185 | - * @see client/html/email/delivery/text/summary/detail/decorators/local |
|
| 186 | - */ |
|
| 153 | + /** |
|
| 154 | + * Returns the sub-client given by its name. |
|
| 155 | + * |
|
| 156 | + * @param string $type Name of the client type |
|
| 157 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 158 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 159 | + */ |
|
| 160 | + public function getSubClient( $type, $name = null ) |
|
| 161 | + { |
|
| 162 | + /** client/html/email/delivery/text/summary/detail/decorators/excludes |
|
| 163 | + * Excludes decorators added by the "common" option from the "email delivery text summary detail" html client |
|
| 164 | + * |
|
| 165 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 166 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 167 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 168 | + * modify what is returned to the caller. |
|
| 169 | + * |
|
| 170 | + * This option allows you to remove a decorator added via |
|
| 171 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 172 | + * around the html client. |
|
| 173 | + * |
|
| 174 | + * client/html/email/delivery/text/summary/detail/decorators/excludes = array( 'decorator1' ) |
|
| 175 | + * |
|
| 176 | + * This would remove the decorator named "decorator1" from the list of |
|
| 177 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 178 | + * "client/html/common/decorators/default" to the html client. |
|
| 179 | + * |
|
| 180 | + * @param array List of decorator names |
|
| 181 | + * @since 2015.08 |
|
| 182 | + * @category Developer |
|
| 183 | + * @see client/html/common/decorators/default |
|
| 184 | + * @see client/html/email/delivery/text/summary/detail/decorators/global |
|
| 185 | + * @see client/html/email/delivery/text/summary/detail/decorators/local |
|
| 186 | + */ |
|
| 187 | 187 | |
| 188 | - /** client/html/email/delivery/text/summary/detail/decorators/global |
|
| 189 | - * Adds a list of globally available decorators only to the "email delivery text summary detail" html client |
|
| 190 | - * |
|
| 191 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 192 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 193 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 194 | - * modify what is returned to the caller. |
|
| 195 | - * |
|
| 196 | - * This option allows you to wrap global decorators |
|
| 197 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 198 | - * |
|
| 199 | - * client/html/email/delivery/text/summary/detail/decorators/global = array( 'decorator1' ) |
|
| 200 | - * |
|
| 201 | - * This would add the decorator named "decorator1" defined by |
|
| 202 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 203 | - * |
|
| 204 | - * @param array List of decorator names |
|
| 205 | - * @since 2015.08 |
|
| 206 | - * @category Developer |
|
| 207 | - * @see client/html/common/decorators/default |
|
| 208 | - * @see client/html/email/delivery/text/summary/detail/decorators/excludes |
|
| 209 | - * @see client/html/email/delivery/text/summary/detail/decorators/local |
|
| 210 | - */ |
|
| 188 | + /** client/html/email/delivery/text/summary/detail/decorators/global |
|
| 189 | + * Adds a list of globally available decorators only to the "email delivery text summary detail" html client |
|
| 190 | + * |
|
| 191 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 192 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 193 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 194 | + * modify what is returned to the caller. |
|
| 195 | + * |
|
| 196 | + * This option allows you to wrap global decorators |
|
| 197 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 198 | + * |
|
| 199 | + * client/html/email/delivery/text/summary/detail/decorators/global = array( 'decorator1' ) |
|
| 200 | + * |
|
| 201 | + * This would add the decorator named "decorator1" defined by |
|
| 202 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 203 | + * |
|
| 204 | + * @param array List of decorator names |
|
| 205 | + * @since 2015.08 |
|
| 206 | + * @category Developer |
|
| 207 | + * @see client/html/common/decorators/default |
|
| 208 | + * @see client/html/email/delivery/text/summary/detail/decorators/excludes |
|
| 209 | + * @see client/html/email/delivery/text/summary/detail/decorators/local |
|
| 210 | + */ |
|
| 211 | 211 | |
| 212 | - /** client/html/email/delivery/text/summary/detail/decorators/local |
|
| 213 | - * Adds a list of local decorators only to the "email delivery text summary detail" html client |
|
| 214 | - * |
|
| 215 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 216 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 217 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 218 | - * modify what is returned to the caller. |
|
| 219 | - * |
|
| 220 | - * This option allows you to wrap local decorators |
|
| 221 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 222 | - * |
|
| 223 | - * client/html/email/delivery/text/summary/detail/decorators/local = array( 'decorator2' ) |
|
| 224 | - * |
|
| 225 | - * This would add the decorator named "decorator2" defined by |
|
| 226 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 227 | - * |
|
| 228 | - * @param array List of decorator names |
|
| 229 | - * @since 2015.08 |
|
| 230 | - * @category Developer |
|
| 231 | - * @see client/html/common/decorators/default |
|
| 232 | - * @see client/html/email/delivery/text/summary/detail/decorators/excludes |
|
| 233 | - * @see client/html/email/delivery/text/summary/detail/decorators/global |
|
| 234 | - */ |
|
| 212 | + /** client/html/email/delivery/text/summary/detail/decorators/local |
|
| 213 | + * Adds a list of local decorators only to the "email delivery text summary detail" html client |
|
| 214 | + * |
|
| 215 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 216 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 217 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 218 | + * modify what is returned to the caller. |
|
| 219 | + * |
|
| 220 | + * This option allows you to wrap local decorators |
|
| 221 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 222 | + * |
|
| 223 | + * client/html/email/delivery/text/summary/detail/decorators/local = array( 'decorator2' ) |
|
| 224 | + * |
|
| 225 | + * This would add the decorator named "decorator2" defined by |
|
| 226 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 227 | + * |
|
| 228 | + * @param array List of decorator names |
|
| 229 | + * @since 2015.08 |
|
| 230 | + * @category Developer |
|
| 231 | + * @see client/html/common/decorators/default |
|
| 232 | + * @see client/html/email/delivery/text/summary/detail/decorators/excludes |
|
| 233 | + * @see client/html/email/delivery/text/summary/detail/decorators/global |
|
| 234 | + */ |
|
| 235 | 235 | |
| 236 | - return $this->createSubClient( 'email/delivery/text/summary/detail/' . $type, $name ); |
|
| 237 | - } |
|
| 236 | + return $this->createSubClient( 'email/delivery/text/summary/detail/' . $type, $name ); |
|
| 237 | + } |
|
| 238 | 238 | |
| 239 | 239 | |
| 240 | - /** |
|
| 241 | - * Returns the list of sub-client names configured for the client. |
|
| 242 | - * |
|
| 243 | - * @return array List of HTML client names |
|
| 244 | - */ |
|
| 245 | - protected function getSubClientNames() |
|
| 246 | - { |
|
| 247 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 248 | - } |
|
| 240 | + /** |
|
| 241 | + * Returns the list of sub-client names configured for the client. |
|
| 242 | + * |
|
| 243 | + * @return array List of HTML client names |
|
| 244 | + */ |
|
| 245 | + protected function getSubClientNames() |
|
| 246 | + { |
|
| 247 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 248 | + } |
|
| 249 | 249 | |
| 250 | 250 | |
| 251 | - /** |
|
| 252 | - * Sets the necessary parameter values in the view. |
|
| 253 | - * |
|
| 254 | - * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output |
|
| 255 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 256 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 257 | - * @return \Aimeos\MW\View\Iface Modified view object |
|
| 258 | - */ |
|
| 259 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 260 | - { |
|
| 261 | - // we can't cache the calculation because the same client object is used for all e-mails |
|
| 262 | - $view->summaryTaxRates = $this->getTaxRates( $view->extOrderBaseItem ); |
|
| 251 | + /** |
|
| 252 | + * Sets the necessary parameter values in the view. |
|
| 253 | + * |
|
| 254 | + * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output |
|
| 255 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 256 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 257 | + * @return \Aimeos\MW\View\Iface Modified view object |
|
| 258 | + */ |
|
| 259 | + protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 260 | + { |
|
| 261 | + // we can't cache the calculation because the same client object is used for all e-mails |
|
| 262 | + $view->summaryTaxRates = $this->getTaxRates( $view->extOrderBaseItem ); |
|
| 263 | 263 | |
| 264 | - if( $view->extOrderItem->getPaymentStatus() >= $this->getDownloadPaymentStatus() ) { |
|
| 265 | - $view->summaryShowDownloadAttributes = true; |
|
| 266 | - } |
|
| 264 | + if( $view->extOrderItem->getPaymentStatus() >= $this->getDownloadPaymentStatus() ) { |
|
| 265 | + $view->summaryShowDownloadAttributes = true; |
|
| 266 | + } |
|
| 267 | 267 | |
| 268 | - return $view; |
|
| 269 | - } |
|
| 268 | + return $view; |
|
| 269 | + } |
|
| 270 | 270 | } |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 68 | 68 | * @return string HTML code |
| 69 | 69 | */ |
| 70 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 70 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 71 | 71 | { |
| 72 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 72 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 73 | 73 | |
| 74 | 74 | $content = ''; |
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 75 | + foreach ($this->getSubClients() as $subclient) { |
|
| 76 | + $content .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 77 | 77 | } |
| 78 | 78 | $view->summaryBody = $content; |
| 79 | 79 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $tplconf = 'client/html/email/delivery/text/summary/detail/standard/template-body'; |
| 101 | 101 | $default = 'email/common/text-summary-detail-body-default.php'; |
| 102 | 102 | |
| 103 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 103 | + return $view->render($view->config($tplconf, $default)); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
@@ -112,13 +112,13 @@ discard block |
||
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | 113 | * @return string|null String including HTML tags for the header on error |
| 114 | 114 | */ |
| 115 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 115 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 116 | 116 | { |
| 117 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 117 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 118 | 118 | |
| 119 | 119 | $content = ''; |
| 120 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 120 | + foreach ($this->getSubClients() as $subclient) { |
|
| 121 | + $content .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 122 | 122 | } |
| 123 | 123 | $view->summaryHeader = $content; |
| 124 | 124 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $tplconf = 'client/html/email/delivery/text/summary/detail/standard/template-header'; |
| 147 | 147 | $default = 'email/common/text-summary-detail-header-default.php'; |
| 148 | 148 | |
| 149 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 149 | + return $view->render($view->config($tplconf, $default)); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @param string|null $name Name of the sub-client (Default if null) |
| 158 | 158 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 159 | 159 | */ |
| 160 | - public function getSubClient( $type, $name = null ) |
|
| 160 | + public function getSubClient($type, $name = null) |
|
| 161 | 161 | { |
| 162 | 162 | /** client/html/email/delivery/text/summary/detail/decorators/excludes |
| 163 | 163 | * Excludes decorators added by the "common" option from the "email delivery text summary detail" html client |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @see client/html/email/delivery/text/summary/detail/decorators/global |
| 234 | 234 | */ |
| 235 | 235 | |
| 236 | - return $this->createSubClient( 'email/delivery/text/summary/detail/' . $type, $name ); |
|
| 236 | + return $this->createSubClient('email/delivery/text/summary/detail/'.$type, $name); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | protected function getSubClientNames() |
| 246 | 246 | { |
| 247 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 247 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | |
@@ -256,12 +256,12 @@ discard block |
||
| 256 | 256 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 257 | 257 | * @return \Aimeos\MW\View\Iface Modified view object |
| 258 | 258 | */ |
| 259 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 259 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 260 | 260 | { |
| 261 | 261 | // we can't cache the calculation because the same client object is used for all e-mails |
| 262 | - $view->summaryTaxRates = $this->getTaxRates( $view->extOrderBaseItem ); |
|
| 262 | + $view->summaryTaxRates = $this->getTaxRates($view->extOrderBaseItem); |
|
| 263 | 263 | |
| 264 | - if( $view->extOrderItem->getPaymentStatus() >= $this->getDownloadPaymentStatus() ) { |
|
| 264 | + if ($view->extOrderItem->getPaymentStatus() >= $this->getDownloadPaymentStatus()) { |
|
| 265 | 265 | $view->summaryShowDownloadAttributes = true; |
| 266 | 266 | } |
| 267 | 267 | |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
| 111 | 111 | * @param array &$tags Result array for the list of tags that are associated to the output |
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | - * @return string|null String including HTML tags for the header on error |
|
| 113 | + * @return string String including HTML tags for the header on error |
|
| 114 | 114 | */ |
| 115 | 115 | public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
| 116 | 116 | { |
@@ -19,291 +19,291 @@ |
||
| 19 | 19 | * @subpackage Html |
| 20 | 20 | */ |
| 21 | 21 | class Standard |
| 22 | - extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
| 23 | - implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 22 | + extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
| 23 | + implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 24 | 24 | { |
| 25 | - /** client/html/email/delivery/text/summary/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email delivery text summary section |
|
| 27 | - * |
|
| 28 | - * The output of the frontend is composed of the code generated by the HTML |
|
| 29 | - * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 30 | - * that are responsible for rendering certain sub-parts of the output. The |
|
| 31 | - * sub-clients can contain HTML clients themselves and therefore a |
|
| 32 | - * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 33 | - * the output that is placed inside the container of its parent. |
|
| 34 | - * |
|
| 35 | - * At first, always the HTML code generated by the parent is printed, then |
|
| 36 | - * the HTML code of its sub-clients. The order of the HTML sub-clients |
|
| 37 | - * determines the order of the output of these sub-clients inside the parent |
|
| 38 | - * container. If the configured list of clients is |
|
| 39 | - * |
|
| 40 | - * array( "subclient1", "subclient2" ) |
|
| 41 | - * |
|
| 42 | - * you can easily change the order of the output by reordering the subparts: |
|
| 43 | - * |
|
| 44 | - * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 45 | - * |
|
| 46 | - * You can also remove one or more parts if they shouldn't be rendered: |
|
| 47 | - * |
|
| 48 | - * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 49 | - * |
|
| 50 | - * As the clients only generates structural HTML, the layout defined via CSS |
|
| 51 | - * should support adding, removing or reordering content by a fluid like |
|
| 52 | - * design. |
|
| 53 | - * |
|
| 54 | - * @param array List of sub-client names |
|
| 55 | - * @since 2014.03 |
|
| 56 | - * @category Developer |
|
| 57 | - */ |
|
| 58 | - private $subPartPath = 'client/html/email/delivery/text/summary/standard/subparts'; |
|
| 25 | + /** client/html/email/delivery/text/summary/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email delivery text summary section |
|
| 27 | + * |
|
| 28 | + * The output of the frontend is composed of the code generated by the HTML |
|
| 29 | + * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 30 | + * that are responsible for rendering certain sub-parts of the output. The |
|
| 31 | + * sub-clients can contain HTML clients themselves and therefore a |
|
| 32 | + * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 33 | + * the output that is placed inside the container of its parent. |
|
| 34 | + * |
|
| 35 | + * At first, always the HTML code generated by the parent is printed, then |
|
| 36 | + * the HTML code of its sub-clients. The order of the HTML sub-clients |
|
| 37 | + * determines the order of the output of these sub-clients inside the parent |
|
| 38 | + * container. If the configured list of clients is |
|
| 39 | + * |
|
| 40 | + * array( "subclient1", "subclient2" ) |
|
| 41 | + * |
|
| 42 | + * you can easily change the order of the output by reordering the subparts: |
|
| 43 | + * |
|
| 44 | + * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 45 | + * |
|
| 46 | + * You can also remove one or more parts if they shouldn't be rendered: |
|
| 47 | + * |
|
| 48 | + * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 49 | + * |
|
| 50 | + * As the clients only generates structural HTML, the layout defined via CSS |
|
| 51 | + * should support adding, removing or reordering content by a fluid like |
|
| 52 | + * design. |
|
| 53 | + * |
|
| 54 | + * @param array List of sub-client names |
|
| 55 | + * @since 2014.03 |
|
| 56 | + * @category Developer |
|
| 57 | + */ |
|
| 58 | + private $subPartPath = 'client/html/email/delivery/text/summary/standard/subparts'; |
|
| 59 | 59 | |
| 60 | - /** client/html/email/delivery/text/summary/address/name |
|
| 61 | - * Name of the address part used by the email delivery text client implementation |
|
| 62 | - * |
|
| 63 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Summary\Address\Myname". |
|
| 64 | - * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 65 | - * |
|
| 66 | - * @param string Last part of the client class name |
|
| 67 | - * @since 2014.03 |
|
| 68 | - * @category Developer |
|
| 69 | - */ |
|
| 60 | + /** client/html/email/delivery/text/summary/address/name |
|
| 61 | + * Name of the address part used by the email delivery text client implementation |
|
| 62 | + * |
|
| 63 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Summary\Address\Myname". |
|
| 64 | + * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 65 | + * |
|
| 66 | + * @param string Last part of the client class name |
|
| 67 | + * @since 2014.03 |
|
| 68 | + * @category Developer |
|
| 69 | + */ |
|
| 70 | 70 | |
| 71 | - /** client/html/email/delivery/text/summary/service/name |
|
| 72 | - * Name of the service part used by the email delivery text client implementation |
|
| 73 | - * |
|
| 74 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Summary\Service\Myname". |
|
| 75 | - * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 76 | - * |
|
| 77 | - * @param string Last part of the client class name |
|
| 78 | - * @since 2014.03 |
|
| 79 | - * @category Developer |
|
| 80 | - */ |
|
| 71 | + /** client/html/email/delivery/text/summary/service/name |
|
| 72 | + * Name of the service part used by the email delivery text client implementation |
|
| 73 | + * |
|
| 74 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Summary\Service\Myname". |
|
| 75 | + * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 76 | + * |
|
| 77 | + * @param string Last part of the client class name |
|
| 78 | + * @since 2014.03 |
|
| 79 | + * @category Developer |
|
| 80 | + */ |
|
| 81 | 81 | |
| 82 | - /** client/html/email/delivery/text/summary/coupon/name |
|
| 83 | - * Name of the coupon part used by the email delivery text client implementation |
|
| 84 | - * |
|
| 85 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Summary\Coupon\Myname". |
|
| 86 | - * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 87 | - * |
|
| 88 | - * @param string Last part of the client class name |
|
| 89 | - * @since 2014.05 |
|
| 90 | - * @category Developer |
|
| 91 | - */ |
|
| 82 | + /** client/html/email/delivery/text/summary/coupon/name |
|
| 83 | + * Name of the coupon part used by the email delivery text client implementation |
|
| 84 | + * |
|
| 85 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Summary\Coupon\Myname". |
|
| 86 | + * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 87 | + * |
|
| 88 | + * @param string Last part of the client class name |
|
| 89 | + * @since 2014.05 |
|
| 90 | + * @category Developer |
|
| 91 | + */ |
|
| 92 | 92 | |
| 93 | - /** client/html/email/delivery/text/summary/detail/name |
|
| 94 | - * Name of the detail part used by the email delivery text client implementation |
|
| 95 | - * |
|
| 96 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Detail\Address\Myname". |
|
| 97 | - * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 98 | - * |
|
| 99 | - * @param string Last part of the client class name |
|
| 100 | - * @since 2014.03 |
|
| 101 | - * @category Developer |
|
| 102 | - */ |
|
| 103 | - private $subPartNames = array( 'address', 'service', 'coupon', 'detail' ); |
|
| 93 | + /** client/html/email/delivery/text/summary/detail/name |
|
| 94 | + * Name of the detail part used by the email delivery text client implementation |
|
| 95 | + * |
|
| 96 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Detail\Address\Myname". |
|
| 97 | + * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 98 | + * |
|
| 99 | + * @param string Last part of the client class name |
|
| 100 | + * @since 2014.03 |
|
| 101 | + * @category Developer |
|
| 102 | + */ |
|
| 103 | + private $subPartNames = array( 'address', 'service', 'coupon', 'detail' ); |
|
| 104 | 104 | |
| 105 | 105 | |
| 106 | - /** |
|
| 107 | - * Returns the HTML code for insertion into the body. |
|
| 108 | - * |
|
| 109 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 110 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 111 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 112 | - * @return string HTML code |
|
| 113 | - */ |
|
| 114 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 115 | - { |
|
| 116 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 106 | + /** |
|
| 107 | + * Returns the HTML code for insertion into the body. |
|
| 108 | + * |
|
| 109 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 110 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 111 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 112 | + * @return string HTML code |
|
| 113 | + */ |
|
| 114 | + public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 115 | + { |
|
| 116 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 117 | 117 | |
| 118 | - $content = ''; |
|
| 119 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 120 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 121 | - } |
|
| 122 | - $view->summaryBody = $content; |
|
| 118 | + $content = ''; |
|
| 119 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 120 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 121 | + } |
|
| 122 | + $view->summaryBody = $content; |
|
| 123 | 123 | |
| 124 | - /** client/html/email/delivery/text/summary/standard/template-body |
|
| 125 | - * Relative path to the text body template of the email delivery text summary client. |
|
| 126 | - * |
|
| 127 | - * The template file contains the text and processing instructions |
|
| 128 | - * to generate the result shown in the body of the e-mail. The |
|
| 129 | - * configuration string is the path to the template file relative |
|
| 130 | - * to the templates directory (usually in client/html/templates). |
|
| 131 | - * |
|
| 132 | - * You can overwrite the template file configuration in extensions and |
|
| 133 | - * provide alternative templates. These alternative templates should be |
|
| 134 | - * named like the default one but with the string "standard" replaced by |
|
| 135 | - * an unique name. You may use the name of your project for this. If |
|
| 136 | - * you've implemented an alternative client class as well, "standard" |
|
| 137 | - * should be replaced by the name of the new class. |
|
| 138 | - * |
|
| 139 | - * @param string Relative path to the template creating code for the e-mail body |
|
| 140 | - * @since 2014.03 |
|
| 141 | - * @category Developer |
|
| 142 | - * @see client/html/email/delivery/text/summary/standard/template-header |
|
| 143 | - */ |
|
| 144 | - $tplconf = 'client/html/email/delivery/text/summary/standard/template-body'; |
|
| 145 | - $default = 'email/common/text-summary-body-default.php'; |
|
| 124 | + /** client/html/email/delivery/text/summary/standard/template-body |
|
| 125 | + * Relative path to the text body template of the email delivery text summary client. |
|
| 126 | + * |
|
| 127 | + * The template file contains the text and processing instructions |
|
| 128 | + * to generate the result shown in the body of the e-mail. The |
|
| 129 | + * configuration string is the path to the template file relative |
|
| 130 | + * to the templates directory (usually in client/html/templates). |
|
| 131 | + * |
|
| 132 | + * You can overwrite the template file configuration in extensions and |
|
| 133 | + * provide alternative templates. These alternative templates should be |
|
| 134 | + * named like the default one but with the string "standard" replaced by |
|
| 135 | + * an unique name. You may use the name of your project for this. If |
|
| 136 | + * you've implemented an alternative client class as well, "standard" |
|
| 137 | + * should be replaced by the name of the new class. |
|
| 138 | + * |
|
| 139 | + * @param string Relative path to the template creating code for the e-mail body |
|
| 140 | + * @since 2014.03 |
|
| 141 | + * @category Developer |
|
| 142 | + * @see client/html/email/delivery/text/summary/standard/template-header |
|
| 143 | + */ |
|
| 144 | + $tplconf = 'client/html/email/delivery/text/summary/standard/template-body'; |
|
| 145 | + $default = 'email/common/text-summary-body-default.php'; |
|
| 146 | 146 | |
| 147 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 148 | - } |
|
| 147 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 148 | + } |
|
| 149 | 149 | |
| 150 | 150 | |
| 151 | - /** |
|
| 152 | - * Returns the HTML string for insertion into the header. |
|
| 153 | - * |
|
| 154 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 155 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 156 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 157 | - * @return string|null String including HTML tags for the header on error |
|
| 158 | - */ |
|
| 159 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 160 | - { |
|
| 161 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 151 | + /** |
|
| 152 | + * Returns the HTML string for insertion into the header. |
|
| 153 | + * |
|
| 154 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 155 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 156 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 157 | + * @return string|null String including HTML tags for the header on error |
|
| 158 | + */ |
|
| 159 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 160 | + { |
|
| 161 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 162 | 162 | |
| 163 | - $content = ''; |
|
| 164 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 165 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 166 | - } |
|
| 167 | - $view->summaryHeader = $content; |
|
| 163 | + $content = ''; |
|
| 164 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 165 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 166 | + } |
|
| 167 | + $view->summaryHeader = $content; |
|
| 168 | 168 | |
| 169 | - /** client/html/email/delivery/text/summary/standard/template-header |
|
| 170 | - * Relative path to the text header template of the email delivery text summary client. |
|
| 171 | - * |
|
| 172 | - * The template file contains the text and processing instructions |
|
| 173 | - * to generate the text that is inserted into the header |
|
| 174 | - * of the e-mail. The configuration string is the |
|
| 175 | - * path to the template file relative to the templates directory (usually |
|
| 176 | - * in client/html/templates). |
|
| 177 | - * |
|
| 178 | - * You can overwrite the template file configuration in extensions and |
|
| 179 | - * provide alternative templates. These alternative templates should be |
|
| 180 | - * named like the default one but with the string "standard" replaced by |
|
| 181 | - * an unique name. You may use the name of your project for this. If |
|
| 182 | - * you've implemented an alternative client class as well, "standard" |
|
| 183 | - * should be replaced by the name of the new class. |
|
| 184 | - * |
|
| 185 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 186 | - * @since 2014.03 |
|
| 187 | - * @category Developer |
|
| 188 | - * @see client/html/email/delivery/text/summary/standard/template-body |
|
| 189 | - */ |
|
| 190 | - $tplconf = 'client/html/email/delivery/text/summary/standard/template-header'; |
|
| 191 | - $default = 'email/common/text-summary-header-default.php'; |
|
| 169 | + /** client/html/email/delivery/text/summary/standard/template-header |
|
| 170 | + * Relative path to the text header template of the email delivery text summary client. |
|
| 171 | + * |
|
| 172 | + * The template file contains the text and processing instructions |
|
| 173 | + * to generate the text that is inserted into the header |
|
| 174 | + * of the e-mail. The configuration string is the |
|
| 175 | + * path to the template file relative to the templates directory (usually |
|
| 176 | + * in client/html/templates). |
|
| 177 | + * |
|
| 178 | + * You can overwrite the template file configuration in extensions and |
|
| 179 | + * provide alternative templates. These alternative templates should be |
|
| 180 | + * named like the default one but with the string "standard" replaced by |
|
| 181 | + * an unique name. You may use the name of your project for this. If |
|
| 182 | + * you've implemented an alternative client class as well, "standard" |
|
| 183 | + * should be replaced by the name of the new class. |
|
| 184 | + * |
|
| 185 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 186 | + * @since 2014.03 |
|
| 187 | + * @category Developer |
|
| 188 | + * @see client/html/email/delivery/text/summary/standard/template-body |
|
| 189 | + */ |
|
| 190 | + $tplconf = 'client/html/email/delivery/text/summary/standard/template-header'; |
|
| 191 | + $default = 'email/common/text-summary-header-default.php'; |
|
| 192 | 192 | |
| 193 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 194 | - } |
|
| 193 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 194 | + } |
|
| 195 | 195 | |
| 196 | 196 | |
| 197 | - /** |
|
| 198 | - * Returns the sub-client given by its name. |
|
| 199 | - * |
|
| 200 | - * @param string $type Name of the client type |
|
| 201 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 202 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 203 | - */ |
|
| 204 | - public function getSubClient( $type, $name = null ) |
|
| 205 | - { |
|
| 206 | - /** client/html/email/delivery/text/summary/decorators/excludes |
|
| 207 | - * Excludes decorators added by the "common" option from the "email delivery text summary" html client |
|
| 208 | - * |
|
| 209 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 210 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 211 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 212 | - * modify what is returned to the caller. |
|
| 213 | - * |
|
| 214 | - * This option allows you to remove a decorator added via |
|
| 215 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 216 | - * around the html client. |
|
| 217 | - * |
|
| 218 | - * client/html/email/delivery/text/summary/decorators/excludes = array( 'decorator1' ) |
|
| 219 | - * |
|
| 220 | - * This would remove the decorator named "decorator1" from the list of |
|
| 221 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 222 | - * "client/html/common/decorators/default" to the html client. |
|
| 223 | - * |
|
| 224 | - * @param array List of decorator names |
|
| 225 | - * @since 2015.08 |
|
| 226 | - * @category Developer |
|
| 227 | - * @see client/html/common/decorators/default |
|
| 228 | - * @see client/html/email/delivery/text/summary/decorators/global |
|
| 229 | - * @see client/html/email/delivery/text/summary/decorators/local |
|
| 230 | - */ |
|
| 197 | + /** |
|
| 198 | + * Returns the sub-client given by its name. |
|
| 199 | + * |
|
| 200 | + * @param string $type Name of the client type |
|
| 201 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 202 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 203 | + */ |
|
| 204 | + public function getSubClient( $type, $name = null ) |
|
| 205 | + { |
|
| 206 | + /** client/html/email/delivery/text/summary/decorators/excludes |
|
| 207 | + * Excludes decorators added by the "common" option from the "email delivery text summary" html client |
|
| 208 | + * |
|
| 209 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 210 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 211 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 212 | + * modify what is returned to the caller. |
|
| 213 | + * |
|
| 214 | + * This option allows you to remove a decorator added via |
|
| 215 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 216 | + * around the html client. |
|
| 217 | + * |
|
| 218 | + * client/html/email/delivery/text/summary/decorators/excludes = array( 'decorator1' ) |
|
| 219 | + * |
|
| 220 | + * This would remove the decorator named "decorator1" from the list of |
|
| 221 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 222 | + * "client/html/common/decorators/default" to the html client. |
|
| 223 | + * |
|
| 224 | + * @param array List of decorator names |
|
| 225 | + * @since 2015.08 |
|
| 226 | + * @category Developer |
|
| 227 | + * @see client/html/common/decorators/default |
|
| 228 | + * @see client/html/email/delivery/text/summary/decorators/global |
|
| 229 | + * @see client/html/email/delivery/text/summary/decorators/local |
|
| 230 | + */ |
|
| 231 | 231 | |
| 232 | - /** client/html/email/delivery/text/summary/decorators/global |
|
| 233 | - * Adds a list of globally available decorators only to the "email delivery text summary" html client |
|
| 234 | - * |
|
| 235 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 236 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 237 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 238 | - * modify what is returned to the caller. |
|
| 239 | - * |
|
| 240 | - * This option allows you to wrap global decorators |
|
| 241 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 242 | - * |
|
| 243 | - * client/html/email/delivery/text/summary/decorators/global = array( 'decorator1' ) |
|
| 244 | - * |
|
| 245 | - * This would add the decorator named "decorator1" defined by |
|
| 246 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 247 | - * |
|
| 248 | - * @param array List of decorator names |
|
| 249 | - * @since 2015.08 |
|
| 250 | - * @category Developer |
|
| 251 | - * @see client/html/common/decorators/default |
|
| 252 | - * @see client/html/email/delivery/text/summary/decorators/excludes |
|
| 253 | - * @see client/html/email/delivery/text/summary/decorators/local |
|
| 254 | - */ |
|
| 232 | + /** client/html/email/delivery/text/summary/decorators/global |
|
| 233 | + * Adds a list of globally available decorators only to the "email delivery text summary" html client |
|
| 234 | + * |
|
| 235 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 236 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 237 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 238 | + * modify what is returned to the caller. |
|
| 239 | + * |
|
| 240 | + * This option allows you to wrap global decorators |
|
| 241 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 242 | + * |
|
| 243 | + * client/html/email/delivery/text/summary/decorators/global = array( 'decorator1' ) |
|
| 244 | + * |
|
| 245 | + * This would add the decorator named "decorator1" defined by |
|
| 246 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 247 | + * |
|
| 248 | + * @param array List of decorator names |
|
| 249 | + * @since 2015.08 |
|
| 250 | + * @category Developer |
|
| 251 | + * @see client/html/common/decorators/default |
|
| 252 | + * @see client/html/email/delivery/text/summary/decorators/excludes |
|
| 253 | + * @see client/html/email/delivery/text/summary/decorators/local |
|
| 254 | + */ |
|
| 255 | 255 | |
| 256 | - /** client/html/email/delivery/text/summary/decorators/local |
|
| 257 | - * Adds a list of local decorators only to the "email delivery text summary" html client |
|
| 258 | - * |
|
| 259 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 260 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 261 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 262 | - * modify what is returned to the caller. |
|
| 263 | - * |
|
| 264 | - * This option allows you to wrap local decorators |
|
| 265 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 266 | - * |
|
| 267 | - * client/html/email/delivery/text/summary/decorators/local = array( 'decorator2' ) |
|
| 268 | - * |
|
| 269 | - * This would add the decorator named "decorator2" defined by |
|
| 270 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 271 | - * |
|
| 272 | - * @param array List of decorator names |
|
| 273 | - * @since 2015.08 |
|
| 274 | - * @category Developer |
|
| 275 | - * @see client/html/common/decorators/default |
|
| 276 | - * @see client/html/email/delivery/text/summary/decorators/excludes |
|
| 277 | - * @see client/html/email/delivery/text/summary/decorators/global |
|
| 278 | - */ |
|
| 256 | + /** client/html/email/delivery/text/summary/decorators/local |
|
| 257 | + * Adds a list of local decorators only to the "email delivery text summary" html client |
|
| 258 | + * |
|
| 259 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 260 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 261 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 262 | + * modify what is returned to the caller. |
|
| 263 | + * |
|
| 264 | + * This option allows you to wrap local decorators |
|
| 265 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 266 | + * |
|
| 267 | + * client/html/email/delivery/text/summary/decorators/local = array( 'decorator2' ) |
|
| 268 | + * |
|
| 269 | + * This would add the decorator named "decorator2" defined by |
|
| 270 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 271 | + * |
|
| 272 | + * @param array List of decorator names |
|
| 273 | + * @since 2015.08 |
|
| 274 | + * @category Developer |
|
| 275 | + * @see client/html/common/decorators/default |
|
| 276 | + * @see client/html/email/delivery/text/summary/decorators/excludes |
|
| 277 | + * @see client/html/email/delivery/text/summary/decorators/global |
|
| 278 | + */ |
|
| 279 | 279 | |
| 280 | - return $this->createSubClient( 'email/delivery/text/summary/' . $type, $name ); |
|
| 281 | - } |
|
| 280 | + return $this->createSubClient( 'email/delivery/text/summary/' . $type, $name ); |
|
| 281 | + } |
|
| 282 | 282 | |
| 283 | 283 | |
| 284 | - /** |
|
| 285 | - * Returns the list of sub-client names configured for the client. |
|
| 286 | - * |
|
| 287 | - * @return array List of HTML client names |
|
| 288 | - */ |
|
| 289 | - protected function getSubClientNames() |
|
| 290 | - { |
|
| 291 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 292 | - } |
|
| 284 | + /** |
|
| 285 | + * Returns the list of sub-client names configured for the client. |
|
| 286 | + * |
|
| 287 | + * @return array List of HTML client names |
|
| 288 | + */ |
|
| 289 | + protected function getSubClientNames() |
|
| 290 | + { |
|
| 291 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 292 | + } |
|
| 293 | 293 | |
| 294 | 294 | |
| 295 | - /** |
|
| 296 | - * Sets the necessary parameter values in the view. |
|
| 297 | - * |
|
| 298 | - * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output |
|
| 299 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 300 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 301 | - * @return \Aimeos\MW\View\Iface Modified view object |
|
| 302 | - */ |
|
| 303 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 304 | - { |
|
| 305 | - $view->summaryBasket = $view->extOrderBaseItem; |
|
| 295 | + /** |
|
| 296 | + * Sets the necessary parameter values in the view. |
|
| 297 | + * |
|
| 298 | + * @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output |
|
| 299 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 300 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 301 | + * @return \Aimeos\MW\View\Iface Modified view object |
|
| 302 | + */ |
|
| 303 | + protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 304 | + { |
|
| 305 | + $view->summaryBasket = $view->extOrderBaseItem; |
|
| 306 | 306 | |
| 307 | - return $view; |
|
| 308 | - } |
|
| 307 | + return $view; |
|
| 308 | + } |
|
| 309 | 309 | } |
| 310 | 310 | \ No newline at end of file |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * @since 2014.03 |
| 101 | 101 | * @category Developer |
| 102 | 102 | */ |
| 103 | - private $subPartNames = array( 'address', 'service', 'coupon', 'detail' ); |
|
| 103 | + private $subPartNames = array('address', 'service', 'coupon', 'detail'); |
|
| 104 | 104 | |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -111,13 +111,13 @@ discard block |
||
| 111 | 111 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 112 | 112 | * @return string HTML code |
| 113 | 113 | */ |
| 114 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 114 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 115 | 115 | { |
| 116 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 116 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 117 | 117 | |
| 118 | 118 | $content = ''; |
| 119 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 120 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 119 | + foreach ($this->getSubClients() as $subclient) { |
|
| 120 | + $content .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 121 | 121 | } |
| 122 | 122 | $view->summaryBody = $content; |
| 123 | 123 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $tplconf = 'client/html/email/delivery/text/summary/standard/template-body'; |
| 145 | 145 | $default = 'email/common/text-summary-body-default.php'; |
| 146 | 146 | |
| 147 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 147 | + return $view->render($view->config($tplconf, $default)); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | |
@@ -156,13 +156,13 @@ discard block |
||
| 156 | 156 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 157 | 157 | * @return string|null String including HTML tags for the header on error |
| 158 | 158 | */ |
| 159 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 159 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 160 | 160 | { |
| 161 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 161 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 162 | 162 | |
| 163 | 163 | $content = ''; |
| 164 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 165 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 164 | + foreach ($this->getSubClients() as $subclient) { |
|
| 165 | + $content .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 166 | 166 | } |
| 167 | 167 | $view->summaryHeader = $content; |
| 168 | 168 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $tplconf = 'client/html/email/delivery/text/summary/standard/template-header'; |
| 191 | 191 | $default = 'email/common/text-summary-header-default.php'; |
| 192 | 192 | |
| 193 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 193 | + return $view->render($view->config($tplconf, $default)); |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | * @param string|null $name Name of the sub-client (Default if null) |
| 202 | 202 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 203 | 203 | */ |
| 204 | - public function getSubClient( $type, $name = null ) |
|
| 204 | + public function getSubClient($type, $name = null) |
|
| 205 | 205 | { |
| 206 | 206 | /** client/html/email/delivery/text/summary/decorators/excludes |
| 207 | 207 | * Excludes decorators added by the "common" option from the "email delivery text summary" html client |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | * @see client/html/email/delivery/text/summary/decorators/global |
| 278 | 278 | */ |
| 279 | 279 | |
| 280 | - return $this->createSubClient( 'email/delivery/text/summary/' . $type, $name ); |
|
| 280 | + return $this->createSubClient('email/delivery/text/summary/'.$type, $name); |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | */ |
| 289 | 289 | protected function getSubClientNames() |
| 290 | 290 | { |
| 291 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 291 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 301 | 301 | * @return \Aimeos\MW\View\Iface Modified view object |
| 302 | 302 | */ |
| 303 | - protected function setViewParams( \Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null ) |
|
| 303 | + protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null) |
|
| 304 | 304 | { |
| 305 | 305 | $view->summaryBasket = $view->extOrderBaseItem; |
| 306 | 306 | |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
| 111 | 111 | * @param array &$tags Result array for the list of tags that are associated to the output |
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | - * @return string|null String including HTML tags for the header on error |
|
| 113 | + * @return string String including HTML tags for the header on error |
|
| 114 | 114 | */ |
| 115 | 115 | public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
| 116 | 116 | { |
@@ -19,231 +19,231 @@ |
||
| 19 | 19 | * @subpackage Html |
| 20 | 20 | */ |
| 21 | 21 | class Standard |
| 22 | - extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
| 23 | - implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 22 | + extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
| 23 | + implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 24 | 24 | { |
| 25 | - /** client/html/email/delivery/text/summary/address/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email delivery text summary address section |
|
| 27 | - * |
|
| 28 | - * The output of the frontend is composed of the code generated by the HTML |
|
| 29 | - * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 30 | - * that are responsible for rendering certain sub-parts of the output. The |
|
| 31 | - * sub-clients can contain HTML clients themselves and therefore a |
|
| 32 | - * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 33 | - * the output that is placed inside the container of its parent. |
|
| 34 | - * |
|
| 35 | - * At first, always the HTML code generated by the parent is printed, then |
|
| 36 | - * the HTML code of its sub-clients. The order of the HTML sub-clients |
|
| 37 | - * determines the order of the output of these sub-clients inside the parent |
|
| 38 | - * container. If the configured list of clients is |
|
| 39 | - * |
|
| 40 | - * array( "subclient1", "subclient2" ) |
|
| 41 | - * |
|
| 42 | - * you can easily change the order of the output by reordering the subparts: |
|
| 43 | - * |
|
| 44 | - * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 45 | - * |
|
| 46 | - * You can also remove one or more parts if they shouldn't be rendered: |
|
| 47 | - * |
|
| 48 | - * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 49 | - * |
|
| 50 | - * As the clients only generates structural HTML, the layout defined via CSS |
|
| 51 | - * should support adding, removing or reordering content by a fluid like |
|
| 52 | - * design. |
|
| 53 | - * |
|
| 54 | - * @param array List of sub-client names |
|
| 55 | - * @since 2014.03 |
|
| 56 | - * @category Developer |
|
| 57 | - */ |
|
| 58 | - private $subPartPath = 'client/html/email/delivery/text/summary/address/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 60 | - |
|
| 61 | - |
|
| 62 | - /** |
|
| 63 | - * Returns the HTML code for insertion into the body. |
|
| 64 | - * |
|
| 65 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 66 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 67 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 68 | - * @return string HTML code |
|
| 69 | - */ |
|
| 70 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 71 | - { |
|
| 72 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 73 | - |
|
| 74 | - $content = ''; |
|
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | - } |
|
| 78 | - $view->summaryBody = $content; |
|
| 79 | - |
|
| 80 | - /** client/html/email/delivery/text/summary/address/standard/template-body |
|
| 81 | - * Relative path to the text body template of the email delivery text summary address 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 | - * @param string Relative path to the template creating code for the e-mail body |
|
| 96 | - * @since 2014.03 |
|
| 97 | - * @category Developer |
|
| 98 | - * @see client/html/email/delivery/text/summary/address/standard/template-header |
|
| 99 | - */ |
|
| 100 | - $tplconf = 'client/html/email/delivery/text/summary/address/standard/template-body'; |
|
| 101 | - $default = 'email/common/text-summary-address-body-default.php'; |
|
| 102 | - |
|
| 103 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * Returns the HTML string for insertion into the header. |
|
| 109 | - * |
|
| 110 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 111 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 112 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 113 | - * @return string|null String including HTML tags for the header on error |
|
| 114 | - */ |
|
| 115 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 116 | - { |
|
| 117 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 118 | - |
|
| 119 | - $content = ''; |
|
| 120 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 122 | - } |
|
| 123 | - $view->summaryHeader = $content; |
|
| 124 | - |
|
| 125 | - /** client/html/email/delivery/text/summary/address/standard/template-header |
|
| 126 | - * Relative path to the text header template of the email delivery text summary address client. |
|
| 127 | - * |
|
| 128 | - * The template file contains the text and processing instructions |
|
| 129 | - * to generate the text that is inserted into the e-mail header |
|
| 130 | - * of the rendered e-mail. The configuration string is the |
|
| 131 | - * path to the template file relative to the templates directory (usually |
|
| 132 | - * in client/html/templates). |
|
| 133 | - * |
|
| 134 | - * You can overwrite the template file configuration in extensions and |
|
| 135 | - * provide alternative templates. These alternative templates should be |
|
| 136 | - * named like the default one but with the string "standard" replaced by |
|
| 137 | - * an unique name. You may use the name of your project for this. If |
|
| 138 | - * you've implemented an alternative client class as well, "standard" |
|
| 139 | - * should be replaced by the name of the new class. |
|
| 140 | - * |
|
| 141 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 142 | - * @since 2014.03 |
|
| 143 | - * @category Developer |
|
| 144 | - * @see client/html/email/delivery/text/summary/address/standard/template-body |
|
| 145 | - */ |
|
| 146 | - $tplconf = 'client/html/email/delivery/text/summary/address/standard/template-header'; |
|
| 147 | - $default = 'email/common/text-summary-address-header-default.php'; |
|
| 148 | - |
|
| 149 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 150 | - } |
|
| 151 | - |
|
| 152 | - |
|
| 153 | - /** |
|
| 154 | - * Returns the sub-client given by its name. |
|
| 155 | - * |
|
| 156 | - * @param string $type Name of the client type |
|
| 157 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 158 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 159 | - */ |
|
| 160 | - public function getSubClient( $type, $name = null ) |
|
| 161 | - { |
|
| 162 | - /** client/html/email/delivery/text/summary/address/decorators/excludes |
|
| 163 | - * Excludes decorators added by the "common" option from the "email delivery text summary address" html client |
|
| 164 | - * |
|
| 165 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 166 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 167 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 168 | - * modify what is returned to the caller. |
|
| 169 | - * |
|
| 170 | - * This option allows you to remove a decorator added via |
|
| 171 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 172 | - * around the html client. |
|
| 173 | - * |
|
| 174 | - * client/html/email/delivery/text/summary/address/decorators/excludes = array( 'decorator1' ) |
|
| 175 | - * |
|
| 176 | - * This would remove the decorator named "decorator1" from the list of |
|
| 177 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 178 | - * "client/html/common/decorators/default" to the html client. |
|
| 179 | - * |
|
| 180 | - * @param array List of decorator names |
|
| 181 | - * @since 2015.08 |
|
| 182 | - * @category Developer |
|
| 183 | - * @see client/html/common/decorators/default |
|
| 184 | - * @see client/html/email/delivery/text/summary/address/decorators/global |
|
| 185 | - * @see client/html/email/delivery/text/summary/address/decorators/local |
|
| 186 | - */ |
|
| 187 | - |
|
| 188 | - /** client/html/email/delivery/text/summary/address/decorators/global |
|
| 189 | - * Adds a list of globally available decorators only to the "email delivery text summary address" html client |
|
| 190 | - * |
|
| 191 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 192 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 193 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 194 | - * modify what is returned to the caller. |
|
| 195 | - * |
|
| 196 | - * This option allows you to wrap global decorators |
|
| 197 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 198 | - * |
|
| 199 | - * client/html/email/delivery/text/summary/address/decorators/global = array( 'decorator1' ) |
|
| 200 | - * |
|
| 201 | - * This would add the decorator named "decorator1" defined by |
|
| 202 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 203 | - * |
|
| 204 | - * @param array List of decorator names |
|
| 205 | - * @since 2015.08 |
|
| 206 | - * @category Developer |
|
| 207 | - * @see client/html/common/decorators/default |
|
| 208 | - * @see client/html/email/delivery/text/summary/address/decorators/excludes |
|
| 209 | - * @see client/html/email/delivery/text/summary/address/decorators/local |
|
| 210 | - */ |
|
| 211 | - |
|
| 212 | - /** client/html/email/delivery/text/summary/address/decorators/local |
|
| 213 | - * Adds a list of local decorators only to the "email delivery text summary address" html client |
|
| 214 | - * |
|
| 215 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 216 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 217 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 218 | - * modify what is returned to the caller. |
|
| 219 | - * |
|
| 220 | - * This option allows you to wrap local decorators |
|
| 221 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 222 | - * |
|
| 223 | - * client/html/email/delivery/text/summary/address/decorators/local = array( 'decorator2' ) |
|
| 224 | - * |
|
| 225 | - * This would add the decorator named "decorator2" defined by |
|
| 226 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 227 | - * |
|
| 228 | - * @param array List of decorator names |
|
| 229 | - * @since 2015.08 |
|
| 230 | - * @category Developer |
|
| 231 | - * @see client/html/common/decorators/default |
|
| 232 | - * @see client/html/email/delivery/text/summary/address/decorators/excludes |
|
| 233 | - * @see client/html/email/delivery/text/summary/address/decorators/global |
|
| 234 | - */ |
|
| 235 | - |
|
| 236 | - return $this->createSubClient( 'email/delivery/text/summary/address/' . $type, $name ); |
|
| 237 | - } |
|
| 238 | - |
|
| 239 | - |
|
| 240 | - /** |
|
| 241 | - * Returns the list of sub-client names configured for the client. |
|
| 242 | - * |
|
| 243 | - * @return array List of HTML client names |
|
| 244 | - */ |
|
| 245 | - protected function getSubClientNames() |
|
| 246 | - { |
|
| 247 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 248 | - } |
|
| 25 | + /** client/html/email/delivery/text/summary/address/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email delivery text summary address section |
|
| 27 | + * |
|
| 28 | + * The output of the frontend is composed of the code generated by the HTML |
|
| 29 | + * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 30 | + * that are responsible for rendering certain sub-parts of the output. The |
|
| 31 | + * sub-clients can contain HTML clients themselves and therefore a |
|
| 32 | + * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 33 | + * the output that is placed inside the container of its parent. |
|
| 34 | + * |
|
| 35 | + * At first, always the HTML code generated by the parent is printed, then |
|
| 36 | + * the HTML code of its sub-clients. The order of the HTML sub-clients |
|
| 37 | + * determines the order of the output of these sub-clients inside the parent |
|
| 38 | + * container. If the configured list of clients is |
|
| 39 | + * |
|
| 40 | + * array( "subclient1", "subclient2" ) |
|
| 41 | + * |
|
| 42 | + * you can easily change the order of the output by reordering the subparts: |
|
| 43 | + * |
|
| 44 | + * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 45 | + * |
|
| 46 | + * You can also remove one or more parts if they shouldn't be rendered: |
|
| 47 | + * |
|
| 48 | + * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 49 | + * |
|
| 50 | + * As the clients only generates structural HTML, the layout defined via CSS |
|
| 51 | + * should support adding, removing or reordering content by a fluid like |
|
| 52 | + * design. |
|
| 53 | + * |
|
| 54 | + * @param array List of sub-client names |
|
| 55 | + * @since 2014.03 |
|
| 56 | + * @category Developer |
|
| 57 | + */ |
|
| 58 | + private $subPartPath = 'client/html/email/delivery/text/summary/address/standard/subparts'; |
|
| 59 | + private $subPartNames = array(); |
|
| 60 | + |
|
| 61 | + |
|
| 62 | + /** |
|
| 63 | + * Returns the HTML code for insertion into the body. |
|
| 64 | + * |
|
| 65 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 66 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 67 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 68 | + * @return string HTML code |
|
| 69 | + */ |
|
| 70 | + public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 71 | + { |
|
| 72 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 73 | + |
|
| 74 | + $content = ''; |
|
| 75 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | + } |
|
| 78 | + $view->summaryBody = $content; |
|
| 79 | + |
|
| 80 | + /** client/html/email/delivery/text/summary/address/standard/template-body |
|
| 81 | + * Relative path to the text body template of the email delivery text summary address 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 | + * @param string Relative path to the template creating code for the e-mail body |
|
| 96 | + * @since 2014.03 |
|
| 97 | + * @category Developer |
|
| 98 | + * @see client/html/email/delivery/text/summary/address/standard/template-header |
|
| 99 | + */ |
|
| 100 | + $tplconf = 'client/html/email/delivery/text/summary/address/standard/template-body'; |
|
| 101 | + $default = 'email/common/text-summary-address-body-default.php'; |
|
| 102 | + |
|
| 103 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * Returns the HTML string for insertion into the header. |
|
| 109 | + * |
|
| 110 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 111 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 112 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 113 | + * @return string|null String including HTML tags for the header on error |
|
| 114 | + */ |
|
| 115 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 116 | + { |
|
| 117 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 118 | + |
|
| 119 | + $content = ''; |
|
| 120 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 122 | + } |
|
| 123 | + $view->summaryHeader = $content; |
|
| 124 | + |
|
| 125 | + /** client/html/email/delivery/text/summary/address/standard/template-header |
|
| 126 | + * Relative path to the text header template of the email delivery text summary address client. |
|
| 127 | + * |
|
| 128 | + * The template file contains the text and processing instructions |
|
| 129 | + * to generate the text that is inserted into the e-mail header |
|
| 130 | + * of the rendered e-mail. The configuration string is the |
|
| 131 | + * path to the template file relative to the templates directory (usually |
|
| 132 | + * in client/html/templates). |
|
| 133 | + * |
|
| 134 | + * You can overwrite the template file configuration in extensions and |
|
| 135 | + * provide alternative templates. These alternative templates should be |
|
| 136 | + * named like the default one but with the string "standard" replaced by |
|
| 137 | + * an unique name. You may use the name of your project for this. If |
|
| 138 | + * you've implemented an alternative client class as well, "standard" |
|
| 139 | + * should be replaced by the name of the new class. |
|
| 140 | + * |
|
| 141 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 142 | + * @since 2014.03 |
|
| 143 | + * @category Developer |
|
| 144 | + * @see client/html/email/delivery/text/summary/address/standard/template-body |
|
| 145 | + */ |
|
| 146 | + $tplconf = 'client/html/email/delivery/text/summary/address/standard/template-header'; |
|
| 147 | + $default = 'email/common/text-summary-address-header-default.php'; |
|
| 148 | + |
|
| 149 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 150 | + } |
|
| 151 | + |
|
| 152 | + |
|
| 153 | + /** |
|
| 154 | + * Returns the sub-client given by its name. |
|
| 155 | + * |
|
| 156 | + * @param string $type Name of the client type |
|
| 157 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 158 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 159 | + */ |
|
| 160 | + public function getSubClient( $type, $name = null ) |
|
| 161 | + { |
|
| 162 | + /** client/html/email/delivery/text/summary/address/decorators/excludes |
|
| 163 | + * Excludes decorators added by the "common" option from the "email delivery text summary address" html client |
|
| 164 | + * |
|
| 165 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 166 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 167 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 168 | + * modify what is returned to the caller. |
|
| 169 | + * |
|
| 170 | + * This option allows you to remove a decorator added via |
|
| 171 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 172 | + * around the html client. |
|
| 173 | + * |
|
| 174 | + * client/html/email/delivery/text/summary/address/decorators/excludes = array( 'decorator1' ) |
|
| 175 | + * |
|
| 176 | + * This would remove the decorator named "decorator1" from the list of |
|
| 177 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 178 | + * "client/html/common/decorators/default" to the html client. |
|
| 179 | + * |
|
| 180 | + * @param array List of decorator names |
|
| 181 | + * @since 2015.08 |
|
| 182 | + * @category Developer |
|
| 183 | + * @see client/html/common/decorators/default |
|
| 184 | + * @see client/html/email/delivery/text/summary/address/decorators/global |
|
| 185 | + * @see client/html/email/delivery/text/summary/address/decorators/local |
|
| 186 | + */ |
|
| 187 | + |
|
| 188 | + /** client/html/email/delivery/text/summary/address/decorators/global |
|
| 189 | + * Adds a list of globally available decorators only to the "email delivery text summary address" html client |
|
| 190 | + * |
|
| 191 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 192 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 193 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 194 | + * modify what is returned to the caller. |
|
| 195 | + * |
|
| 196 | + * This option allows you to wrap global decorators |
|
| 197 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 198 | + * |
|
| 199 | + * client/html/email/delivery/text/summary/address/decorators/global = array( 'decorator1' ) |
|
| 200 | + * |
|
| 201 | + * This would add the decorator named "decorator1" defined by |
|
| 202 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 203 | + * |
|
| 204 | + * @param array List of decorator names |
|
| 205 | + * @since 2015.08 |
|
| 206 | + * @category Developer |
|
| 207 | + * @see client/html/common/decorators/default |
|
| 208 | + * @see client/html/email/delivery/text/summary/address/decorators/excludes |
|
| 209 | + * @see client/html/email/delivery/text/summary/address/decorators/local |
|
| 210 | + */ |
|
| 211 | + |
|
| 212 | + /** client/html/email/delivery/text/summary/address/decorators/local |
|
| 213 | + * Adds a list of local decorators only to the "email delivery text summary address" html client |
|
| 214 | + * |
|
| 215 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 216 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 217 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 218 | + * modify what is returned to the caller. |
|
| 219 | + * |
|
| 220 | + * This option allows you to wrap local decorators |
|
| 221 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 222 | + * |
|
| 223 | + * client/html/email/delivery/text/summary/address/decorators/local = array( 'decorator2' ) |
|
| 224 | + * |
|
| 225 | + * This would add the decorator named "decorator2" defined by |
|
| 226 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 227 | + * |
|
| 228 | + * @param array List of decorator names |
|
| 229 | + * @since 2015.08 |
|
| 230 | + * @category Developer |
|
| 231 | + * @see client/html/common/decorators/default |
|
| 232 | + * @see client/html/email/delivery/text/summary/address/decorators/excludes |
|
| 233 | + * @see client/html/email/delivery/text/summary/address/decorators/global |
|
| 234 | + */ |
|
| 235 | + |
|
| 236 | + return $this->createSubClient( 'email/delivery/text/summary/address/' . $type, $name ); |
|
| 237 | + } |
|
| 238 | + |
|
| 239 | + |
|
| 240 | + /** |
|
| 241 | + * Returns the list of sub-client names configured for the client. |
|
| 242 | + * |
|
| 243 | + * @return array List of HTML client names |
|
| 244 | + */ |
|
| 245 | + protected function getSubClientNames() |
|
| 246 | + { |
|
| 247 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 248 | + } |
|
| 249 | 249 | } |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 68 | 68 | * @return string HTML code |
| 69 | 69 | */ |
| 70 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 70 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 71 | 71 | { |
| 72 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 72 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 73 | 73 | |
| 74 | 74 | $content = ''; |
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 75 | + foreach ($this->getSubClients() as $subclient) { |
|
| 76 | + $content .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 77 | 77 | } |
| 78 | 78 | $view->summaryBody = $content; |
| 79 | 79 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $tplconf = 'client/html/email/delivery/text/summary/address/standard/template-body'; |
| 101 | 101 | $default = 'email/common/text-summary-address-body-default.php'; |
| 102 | 102 | |
| 103 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 103 | + return $view->render($view->config($tplconf, $default)); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
@@ -112,13 +112,13 @@ discard block |
||
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | 113 | * @return string|null String including HTML tags for the header on error |
| 114 | 114 | */ |
| 115 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 115 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 116 | 116 | { |
| 117 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 117 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 118 | 118 | |
| 119 | 119 | $content = ''; |
| 120 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 121 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 120 | + foreach ($this->getSubClients() as $subclient) { |
|
| 121 | + $content .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 122 | 122 | } |
| 123 | 123 | $view->summaryHeader = $content; |
| 124 | 124 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | $tplconf = 'client/html/email/delivery/text/summary/address/standard/template-header'; |
| 147 | 147 | $default = 'email/common/text-summary-address-header-default.php'; |
| 148 | 148 | |
| 149 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 149 | + return $view->render($view->config($tplconf, $default)); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @param string|null $name Name of the sub-client (Default if null) |
| 158 | 158 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 159 | 159 | */ |
| 160 | - public function getSubClient( $type, $name = null ) |
|
| 160 | + public function getSubClient($type, $name = null) |
|
| 161 | 161 | { |
| 162 | 162 | /** client/html/email/delivery/text/summary/address/decorators/excludes |
| 163 | 163 | * Excludes decorators added by the "common" option from the "email delivery text summary address" html client |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * @see client/html/email/delivery/text/summary/address/decorators/global |
| 234 | 234 | */ |
| 235 | 235 | |
| 236 | - return $this->createSubClient( 'email/delivery/text/summary/address/' . $type, $name ); |
|
| 236 | + return $this->createSubClient('email/delivery/text/summary/address/'.$type, $name); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
@@ -244,6 +244,6 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | protected function getSubClientNames() |
| 246 | 246 | { |
| 247 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 247 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 248 | 248 | } |
| 249 | 249 | } |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
| 111 | 111 | * @param array &$tags Result array for the list of tags that are associated to the output |
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | - * @return string|null String including HTML tags for the header on error |
|
| 113 | + * @return string String including HTML tags for the header on error |
|
| 114 | 114 | */ |
| 115 | 115 | public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
| 116 | 116 | { |
@@ -19,306 +19,306 @@ |
||
| 19 | 19 | * @subpackage Html |
| 20 | 20 | */ |
| 21 | 21 | class Standard |
| 22 | - extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
| 23 | - implements \Aimeos\Client\Html\Iface |
|
| 22 | + extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
| 23 | + implements \Aimeos\Client\Html\Iface |
|
| 24 | 24 | { |
| 25 | - /** client/html/email/delivery/text/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email delivery text section |
|
| 27 | - * |
|
| 28 | - * The output of the frontend is composed of the code generated by the HTML |
|
| 29 | - * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 30 | - * that are responsible for rendering certain sub-parts of the output. The |
|
| 31 | - * sub-clients can contain HTML clients themselves and therefore a |
|
| 32 | - * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 33 | - * the output that is placed inside the container of its parent. |
|
| 34 | - * |
|
| 35 | - * At first, always the HTML code generated by the parent is printed, then |
|
| 36 | - * the HTML code of its sub-clients. The order of the HTML sub-clients |
|
| 37 | - * determines the order of the output of these sub-clients inside the parent |
|
| 38 | - * container. If the configured list of clients is |
|
| 39 | - * |
|
| 40 | - * array( "subclient1", "subclient2" ) |
|
| 41 | - * |
|
| 42 | - * you can easily change the order of the output by reordering the subparts: |
|
| 43 | - * |
|
| 44 | - * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 45 | - * |
|
| 46 | - * You can also remove one or more parts if they shouldn't be rendered: |
|
| 47 | - * |
|
| 48 | - * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 49 | - * |
|
| 50 | - * As the clients only generates structural HTML, the layout defined via CSS |
|
| 51 | - * should support adding, removing or reordering content by a fluid like |
|
| 52 | - * design. |
|
| 53 | - * |
|
| 54 | - * @param array List of sub-client names |
|
| 55 | - * @since 2014.03 |
|
| 56 | - * @category Developer |
|
| 57 | - */ |
|
| 58 | - private $subPartPath = 'client/html/email/delivery/text/standard/subparts'; |
|
| 25 | + /** client/html/email/delivery/text/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email delivery text section |
|
| 27 | + * |
|
| 28 | + * The output of the frontend is composed of the code generated by the HTML |
|
| 29 | + * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 30 | + * that are responsible for rendering certain sub-parts of the output. The |
|
| 31 | + * sub-clients can contain HTML clients themselves and therefore a |
|
| 32 | + * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 33 | + * the output that is placed inside the container of its parent. |
|
| 34 | + * |
|
| 35 | + * At first, always the HTML code generated by the parent is printed, then |
|
| 36 | + * the HTML code of its sub-clients. The order of the HTML sub-clients |
|
| 37 | + * determines the order of the output of these sub-clients inside the parent |
|
| 38 | + * container. If the configured list of clients is |
|
| 39 | + * |
|
| 40 | + * array( "subclient1", "subclient2" ) |
|
| 41 | + * |
|
| 42 | + * you can easily change the order of the output by reordering the subparts: |
|
| 43 | + * |
|
| 44 | + * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 45 | + * |
|
| 46 | + * You can also remove one or more parts if they shouldn't be rendered: |
|
| 47 | + * |
|
| 48 | + * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 49 | + * |
|
| 50 | + * As the clients only generates structural HTML, the layout defined via CSS |
|
| 51 | + * should support adding, removing or reordering content by a fluid like |
|
| 52 | + * design. |
|
| 53 | + * |
|
| 54 | + * @param array List of sub-client names |
|
| 55 | + * @since 2014.03 |
|
| 56 | + * @category Developer |
|
| 57 | + */ |
|
| 58 | + private $subPartPath = 'client/html/email/delivery/text/standard/subparts'; |
|
| 59 | 59 | |
| 60 | - /** client/html/email/delivery/text/salutation/name |
|
| 61 | - * Name of the salutation part used by the email delivery text client implementation |
|
| 62 | - * |
|
| 63 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Salutation\Myname". |
|
| 64 | - * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 65 | - * |
|
| 66 | - * @param string Last part of the client class name |
|
| 67 | - * @since 2014.03 |
|
| 68 | - * @category Developer |
|
| 69 | - */ |
|
| 60 | + /** client/html/email/delivery/text/salutation/name |
|
| 61 | + * Name of the salutation part used by the email delivery text client implementation |
|
| 62 | + * |
|
| 63 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Salutation\Myname". |
|
| 64 | + * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 65 | + * |
|
| 66 | + * @param string Last part of the client class name |
|
| 67 | + * @since 2014.03 |
|
| 68 | + * @category Developer |
|
| 69 | + */ |
|
| 70 | 70 | |
| 71 | - /** client/html/email/delivery/text/intro/name |
|
| 72 | - * Name of the introduction part used by the email delivery text client implementation |
|
| 73 | - * |
|
| 74 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Intro\Myname". |
|
| 75 | - * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 76 | - * |
|
| 77 | - * @param string Last part of the client class name |
|
| 78 | - * @since 2014.03 |
|
| 79 | - * @category Developer |
|
| 80 | - */ |
|
| 71 | + /** client/html/email/delivery/text/intro/name |
|
| 72 | + * Name of the introduction part used by the email delivery text client implementation |
|
| 73 | + * |
|
| 74 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Intro\Myname". |
|
| 75 | + * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 76 | + * |
|
| 77 | + * @param string Last part of the client class name |
|
| 78 | + * @since 2014.03 |
|
| 79 | + * @category Developer |
|
| 80 | + */ |
|
| 81 | 81 | |
| 82 | - /** client/html/email/delivery/text/summary/name |
|
| 83 | - * Name of the summary part used by the email delivery text client implementation |
|
| 84 | - * |
|
| 85 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Summary\Myname". |
|
| 86 | - * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 87 | - * |
|
| 88 | - * @param string Last part of the client class name |
|
| 89 | - * @since 2014.03 |
|
| 90 | - * @category Developer |
|
| 91 | - */ |
|
| 82 | + /** client/html/email/delivery/text/summary/name |
|
| 83 | + * Name of the summary part used by the email delivery text client implementation |
|
| 84 | + * |
|
| 85 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Summary\Myname". |
|
| 86 | + * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 87 | + * |
|
| 88 | + * @param string Last part of the client class name |
|
| 89 | + * @since 2014.03 |
|
| 90 | + * @category Developer |
|
| 91 | + */ |
|
| 92 | 92 | |
| 93 | - /** client/html/email/delivery/text/outro/name |
|
| 94 | - * Name of the footer part used by the email delivery text client implementation |
|
| 95 | - * |
|
| 96 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Outro\Myname". |
|
| 97 | - * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 98 | - * |
|
| 99 | - * @param string Last part of the client class name |
|
| 100 | - * @since 2014.03 |
|
| 101 | - * @category Developer |
|
| 102 | - */ |
|
| 93 | + /** client/html/email/delivery/text/outro/name |
|
| 94 | + * Name of the footer part used by the email delivery text client implementation |
|
| 95 | + * |
|
| 96 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Outro\Myname". |
|
| 97 | + * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 98 | + * |
|
| 99 | + * @param string Last part of the client class name |
|
| 100 | + * @since 2014.03 |
|
| 101 | + * @category Developer |
|
| 102 | + */ |
|
| 103 | 103 | |
| 104 | - /** client/html/email/delivery/text/legal/name |
|
| 105 | - * Name of the legal part used by the email delivery text client implementation |
|
| 106 | - * |
|
| 107 | - * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Legal\Myname". |
|
| 108 | - * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 109 | - * |
|
| 110 | - * @param string Last part of the client class name |
|
| 111 | - * @since 2014.03 |
|
| 112 | - * @category Developer |
|
| 113 | - */ |
|
| 114 | - private $subPartNames = array( 'salutation', 'intro', 'summary', 'outro', 'legal' ); |
|
| 104 | + /** client/html/email/delivery/text/legal/name |
|
| 105 | + * Name of the legal part used by the email delivery text client implementation |
|
| 106 | + * |
|
| 107 | + * Use "Myname" if your class is named "\Aimeos\Client\Html\Email\Delivery\Text\Legal\Myname". |
|
| 108 | + * The name is case-sensitive and you should avoid camel case names like "MyName". |
|
| 109 | + * |
|
| 110 | + * @param string Last part of the client class name |
|
| 111 | + * @since 2014.03 |
|
| 112 | + * @category Developer |
|
| 113 | + */ |
|
| 114 | + private $subPartNames = array( 'salutation', 'intro', 'summary', 'outro', 'legal' ); |
|
| 115 | 115 | |
| 116 | 116 | |
| 117 | - /** |
|
| 118 | - * Returns the HTML code for insertion into the body. |
|
| 119 | - * |
|
| 120 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 121 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 122 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 123 | - * @return string HTML code |
|
| 124 | - */ |
|
| 125 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 126 | - { |
|
| 127 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 117 | + /** |
|
| 118 | + * Returns the HTML code for insertion into the body. |
|
| 119 | + * |
|
| 120 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 121 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 122 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 123 | + * @return string HTML code |
|
| 124 | + */ |
|
| 125 | + public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 126 | + { |
|
| 127 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 128 | 128 | |
| 129 | - $content = ''; |
|
| 130 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 131 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 132 | - } |
|
| 133 | - $view->textBody = $content; |
|
| 129 | + $content = ''; |
|
| 130 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 131 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 132 | + } |
|
| 133 | + $view->textBody = $content; |
|
| 134 | 134 | |
| 135 | - /** client/html/email/delivery/text/standard/template-body |
|
| 136 | - * Relative path to the text body template of the email delivery text client. |
|
| 137 | - * |
|
| 138 | - * The template file contains the text and processing instructions |
|
| 139 | - * to generate the result shown in the body of the e-mail. The |
|
| 140 | - * configuration string is the path to the template file relative |
|
| 141 | - * to the templates directory (usually in client/html/templates). |
|
| 142 | - * |
|
| 143 | - * You can overwrite the template file configuration in extensions and |
|
| 144 | - * provide alternative templates. These alternative templates should be |
|
| 145 | - * named like the default one but with the string "standard" replaced by |
|
| 146 | - * an unique name. You may use the name of your project for this. If |
|
| 147 | - * you've implemented an alternative client class as well, "standard" |
|
| 148 | - * should be replaced by the name of the new class. |
|
| 149 | - * |
|
| 150 | - * The email delivery text client allows to use a different template for |
|
| 151 | - * each delivery status value. You can create a template for each delivery |
|
| 152 | - * status and store it in the "email/delivery/<status number>/" directory |
|
| 153 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 154 | - * specific layout template is found, the common template in the |
|
| 155 | - * "email/delivery/" directory is used. |
|
| 156 | - * |
|
| 157 | - * @param string Relative path to the template creating code for the e-mail body |
|
| 158 | - * @since 2014.03 |
|
| 159 | - * @category Developer |
|
| 160 | - * @see client/html/email/delivery/text/standard/template-header |
|
| 161 | - */ |
|
| 162 | - $tplconf = 'client/html/email/delivery/text/standard/template-body'; |
|
| 135 | + /** client/html/email/delivery/text/standard/template-body |
|
| 136 | + * Relative path to the text body template of the email delivery text client. |
|
| 137 | + * |
|
| 138 | + * The template file contains the text and processing instructions |
|
| 139 | + * to generate the result shown in the body of the e-mail. The |
|
| 140 | + * configuration string is the path to the template file relative |
|
| 141 | + * to the templates directory (usually in client/html/templates). |
|
| 142 | + * |
|
| 143 | + * You can overwrite the template file configuration in extensions and |
|
| 144 | + * provide alternative templates. These alternative templates should be |
|
| 145 | + * named like the default one but with the string "standard" replaced by |
|
| 146 | + * an unique name. You may use the name of your project for this. If |
|
| 147 | + * you've implemented an alternative client class as well, "standard" |
|
| 148 | + * should be replaced by the name of the new class. |
|
| 149 | + * |
|
| 150 | + * The email delivery text client allows to use a different template for |
|
| 151 | + * each delivery status value. You can create a template for each delivery |
|
| 152 | + * status and store it in the "email/delivery/<status number>/" directory |
|
| 153 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 154 | + * specific layout template is found, the common template in the |
|
| 155 | + * "email/delivery/" directory is used. |
|
| 156 | + * |
|
| 157 | + * @param string Relative path to the template creating code for the e-mail body |
|
| 158 | + * @since 2014.03 |
|
| 159 | + * @category Developer |
|
| 160 | + * @see client/html/email/delivery/text/standard/template-header |
|
| 161 | + */ |
|
| 162 | + $tplconf = 'client/html/email/delivery/text/standard/template-body'; |
|
| 163 | 163 | |
| 164 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 165 | - $default = array( 'email/delivery/' . $status . '/text-body-default.php', 'email/common/text-body-default.php' ); |
|
| 164 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 165 | + $default = array( 'email/delivery/' . $status . '/text-body-default.php', 'email/common/text-body-default.php' ); |
|
| 166 | 166 | |
| 167 | - $text = $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | - $view->mail()->setBody( $text ); |
|
| 169 | - return $text; |
|
| 170 | - } |
|
| 167 | + $text = $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | + $view->mail()->setBody( $text ); |
|
| 169 | + return $text; |
|
| 170 | + } |
|
| 171 | 171 | |
| 172 | 172 | |
| 173 | - /** |
|
| 174 | - * Returns the HTML string for insertion into the header. |
|
| 175 | - * |
|
| 176 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 177 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 178 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 179 | - * @return string|null String including HTML tags for the header on error |
|
| 180 | - */ |
|
| 181 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 182 | - { |
|
| 183 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 173 | + /** |
|
| 174 | + * Returns the HTML string for insertion into the header. |
|
| 175 | + * |
|
| 176 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 177 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 178 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 179 | + * @return string|null String including HTML tags for the header on error |
|
| 180 | + */ |
|
| 181 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 182 | + { |
|
| 183 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 184 | 184 | |
| 185 | - $content = ''; |
|
| 186 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 187 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 188 | - } |
|
| 189 | - $view->textHeader = $content; |
|
| 185 | + $content = ''; |
|
| 186 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 187 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 188 | + } |
|
| 189 | + $view->textHeader = $content; |
|
| 190 | 190 | |
| 191 | - /** client/html/email/delivery/text/standard/template-header |
|
| 192 | - * Relative path to the text header template of the email delivery text client. |
|
| 193 | - * |
|
| 194 | - * The template file contains the text and processing instructions |
|
| 195 | - * to generate the text that is inserted into the header |
|
| 196 | - * of the e-mail. The configuration string is the |
|
| 197 | - * path to the template file relative to the templates directory (usually |
|
| 198 | - * in client/html/templates). |
|
| 199 | - * |
|
| 200 | - * You can overwrite the template file configuration in extensions and |
|
| 201 | - * provide alternative templates. These alternative templates should be |
|
| 202 | - * named like the default one but with the string "standard" replaced by |
|
| 203 | - * an unique name. You may use the name of your project for this. If |
|
| 204 | - * you've implemented an alternative client class as well, "standard" |
|
| 205 | - * should be replaced by the name of the new class. |
|
| 206 | - * |
|
| 207 | - * The email payment text client allows to use a different template for |
|
| 208 | - * each payment status value. You can create a template for each payment |
|
| 209 | - * status and store it in the "email/payment/<status number>/" directory |
|
| 210 | - * below the "templates" directory (usually in client/html/templates). If no |
|
| 211 | - * specific layout template is found, the common template in the |
|
| 212 | - * "email/payment/" directory is used. |
|
| 213 | - * |
|
| 214 | - * @param string Relative path to the template creating code for the e-mail header |
|
| 215 | - * @since 2014.03 |
|
| 216 | - * @category Developer |
|
| 217 | - * @see client/html/email/delivery/text/standard/template-body |
|
| 218 | - */ |
|
| 219 | - $tplconf = 'client/html/email/delivery/text/standard/template-header'; |
|
| 191 | + /** client/html/email/delivery/text/standard/template-header |
|
| 192 | + * Relative path to the text header template of the email delivery text client. |
|
| 193 | + * |
|
| 194 | + * The template file contains the text and processing instructions |
|
| 195 | + * to generate the text that is inserted into the header |
|
| 196 | + * of the e-mail. The configuration string is the |
|
| 197 | + * path to the template file relative to the templates directory (usually |
|
| 198 | + * in client/html/templates). |
|
| 199 | + * |
|
| 200 | + * You can overwrite the template file configuration in extensions and |
|
| 201 | + * provide alternative templates. These alternative templates should be |
|
| 202 | + * named like the default one but with the string "standard" replaced by |
|
| 203 | + * an unique name. You may use the name of your project for this. If |
|
| 204 | + * you've implemented an alternative client class as well, "standard" |
|
| 205 | + * should be replaced by the name of the new class. |
|
| 206 | + * |
|
| 207 | + * The email payment text client allows to use a different template for |
|
| 208 | + * each payment status value. You can create a template for each payment |
|
| 209 | + * status and store it in the "email/payment/<status number>/" directory |
|
| 210 | + * below the "templates" directory (usually in client/html/templates). If no |
|
| 211 | + * specific layout template is found, the common template in the |
|
| 212 | + * "email/payment/" directory is used. |
|
| 213 | + * |
|
| 214 | + * @param string Relative path to the template creating code for the e-mail header |
|
| 215 | + * @since 2014.03 |
|
| 216 | + * @category Developer |
|
| 217 | + * @see client/html/email/delivery/text/standard/template-body |
|
| 218 | + */ |
|
| 219 | + $tplconf = 'client/html/email/delivery/text/standard/template-header'; |
|
| 220 | 220 | |
| 221 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 222 | - $default = array( 'email/delivery/' . $status . '/text-header-default.php', 'email/common/text-header-default.php' ); |
|
| 221 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 222 | + $default = array( 'email/delivery/' . $status . '/text-header-default.php', 'email/common/text-header-default.php' ); |
|
| 223 | 223 | |
| 224 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 225 | - } |
|
| 224 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 225 | + } |
|
| 226 | 226 | |
| 227 | 227 | |
| 228 | - /** |
|
| 229 | - * Returns the sub-client given by its name. |
|
| 230 | - * |
|
| 231 | - * @param string $type Name of the client type |
|
| 232 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 233 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 234 | - */ |
|
| 235 | - public function getSubClient( $type, $name = null ) |
|
| 236 | - { |
|
| 237 | - /** client/html/email/delivery/text/decorators/excludes |
|
| 238 | - * Excludes decorators added by the "common" option from the "email delivery text" html client |
|
| 239 | - * |
|
| 240 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 241 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 242 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 243 | - * modify what is returned to the caller. |
|
| 244 | - * |
|
| 245 | - * This option allows you to remove a decorator added via |
|
| 246 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 247 | - * around the html client. |
|
| 248 | - * |
|
| 249 | - * client/html/email/delivery/text/decorators/excludes = array( 'decorator1' ) |
|
| 250 | - * |
|
| 251 | - * This would remove the decorator named "decorator1" from the list of |
|
| 252 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 253 | - * "client/html/common/decorators/default" to the html client. |
|
| 254 | - * |
|
| 255 | - * @param array List of decorator names |
|
| 256 | - * @since 2015.08 |
|
| 257 | - * @category Developer |
|
| 258 | - * @see client/html/common/decorators/default |
|
| 259 | - * @see client/html/email/delivery/text/decorators/global |
|
| 260 | - * @see client/html/email/delivery/text/decorators/local |
|
| 261 | - */ |
|
| 228 | + /** |
|
| 229 | + * Returns the sub-client given by its name. |
|
| 230 | + * |
|
| 231 | + * @param string $type Name of the client type |
|
| 232 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 233 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 234 | + */ |
|
| 235 | + public function getSubClient( $type, $name = null ) |
|
| 236 | + { |
|
| 237 | + /** client/html/email/delivery/text/decorators/excludes |
|
| 238 | + * Excludes decorators added by the "common" option from the "email delivery text" html client |
|
| 239 | + * |
|
| 240 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 241 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 242 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 243 | + * modify what is returned to the caller. |
|
| 244 | + * |
|
| 245 | + * This option allows you to remove a decorator added via |
|
| 246 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 247 | + * around the html client. |
|
| 248 | + * |
|
| 249 | + * client/html/email/delivery/text/decorators/excludes = array( 'decorator1' ) |
|
| 250 | + * |
|
| 251 | + * This would remove the decorator named "decorator1" from the list of |
|
| 252 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 253 | + * "client/html/common/decorators/default" to the html client. |
|
| 254 | + * |
|
| 255 | + * @param array List of decorator names |
|
| 256 | + * @since 2015.08 |
|
| 257 | + * @category Developer |
|
| 258 | + * @see client/html/common/decorators/default |
|
| 259 | + * @see client/html/email/delivery/text/decorators/global |
|
| 260 | + * @see client/html/email/delivery/text/decorators/local |
|
| 261 | + */ |
|
| 262 | 262 | |
| 263 | - /** client/html/email/delivery/text/decorators/global |
|
| 264 | - * Adds a list of globally available decorators only to the "email delivery text" html client |
|
| 265 | - * |
|
| 266 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 267 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 268 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 269 | - * modify what is returned to the caller. |
|
| 270 | - * |
|
| 271 | - * This option allows you to wrap global decorators |
|
| 272 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 273 | - * |
|
| 274 | - * client/html/email/delivery/text/decorators/global = array( 'decorator1' ) |
|
| 275 | - * |
|
| 276 | - * This would add the decorator named "decorator1" defined by |
|
| 277 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 278 | - * |
|
| 279 | - * @param array List of decorator names |
|
| 280 | - * @since 2015.08 |
|
| 281 | - * @category Developer |
|
| 282 | - * @see client/html/common/decorators/default |
|
| 283 | - * @see client/html/email/delivery/text/decorators/excludes |
|
| 284 | - * @see client/html/email/delivery/text/decorators/local |
|
| 285 | - */ |
|
| 263 | + /** client/html/email/delivery/text/decorators/global |
|
| 264 | + * Adds a list of globally available decorators only to the "email delivery text" html client |
|
| 265 | + * |
|
| 266 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 267 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 268 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 269 | + * modify what is returned to the caller. |
|
| 270 | + * |
|
| 271 | + * This option allows you to wrap global decorators |
|
| 272 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 273 | + * |
|
| 274 | + * client/html/email/delivery/text/decorators/global = array( 'decorator1' ) |
|
| 275 | + * |
|
| 276 | + * This would add the decorator named "decorator1" defined by |
|
| 277 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 278 | + * |
|
| 279 | + * @param array List of decorator names |
|
| 280 | + * @since 2015.08 |
|
| 281 | + * @category Developer |
|
| 282 | + * @see client/html/common/decorators/default |
|
| 283 | + * @see client/html/email/delivery/text/decorators/excludes |
|
| 284 | + * @see client/html/email/delivery/text/decorators/local |
|
| 285 | + */ |
|
| 286 | 286 | |
| 287 | - /** client/html/email/delivery/text/decorators/local |
|
| 288 | - * Adds a list of local decorators only to the "email delivery text" html client |
|
| 289 | - * |
|
| 290 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 291 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 292 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 293 | - * modify what is returned to the caller. |
|
| 294 | - * |
|
| 295 | - * This option allows you to wrap local decorators |
|
| 296 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 297 | - * |
|
| 298 | - * client/html/email/delivery/text/decorators/local = array( 'decorator2' ) |
|
| 299 | - * |
|
| 300 | - * This would add the decorator named "decorator2" defined by |
|
| 301 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 302 | - * |
|
| 303 | - * @param array List of decorator names |
|
| 304 | - * @since 2015.08 |
|
| 305 | - * @category Developer |
|
| 306 | - * @see client/html/common/decorators/default |
|
| 307 | - * @see client/html/email/delivery/text/decorators/excludes |
|
| 308 | - * @see client/html/email/delivery/text/decorators/global |
|
| 309 | - */ |
|
| 287 | + /** client/html/email/delivery/text/decorators/local |
|
| 288 | + * Adds a list of local decorators only to the "email delivery text" html client |
|
| 289 | + * |
|
| 290 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 291 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 292 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 293 | + * modify what is returned to the caller. |
|
| 294 | + * |
|
| 295 | + * This option allows you to wrap local decorators |
|
| 296 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 297 | + * |
|
| 298 | + * client/html/email/delivery/text/decorators/local = array( 'decorator2' ) |
|
| 299 | + * |
|
| 300 | + * This would add the decorator named "decorator2" defined by |
|
| 301 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 302 | + * |
|
| 303 | + * @param array List of decorator names |
|
| 304 | + * @since 2015.08 |
|
| 305 | + * @category Developer |
|
| 306 | + * @see client/html/common/decorators/default |
|
| 307 | + * @see client/html/email/delivery/text/decorators/excludes |
|
| 308 | + * @see client/html/email/delivery/text/decorators/global |
|
| 309 | + */ |
|
| 310 | 310 | |
| 311 | - return $this->createSubClient( 'email/delivery/text/' . $type, $name ); |
|
| 312 | - } |
|
| 311 | + return $this->createSubClient( 'email/delivery/text/' . $type, $name ); |
|
| 312 | + } |
|
| 313 | 313 | |
| 314 | 314 | |
| 315 | - /** |
|
| 316 | - * Returns the list of sub-client names configured for the client. |
|
| 317 | - * |
|
| 318 | - * @return array List of HTML client names |
|
| 319 | - */ |
|
| 320 | - protected function getSubClientNames() |
|
| 321 | - { |
|
| 322 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 323 | - } |
|
| 315 | + /** |
|
| 316 | + * Returns the list of sub-client names configured for the client. |
|
| 317 | + * |
|
| 318 | + * @return array List of HTML client names |
|
| 319 | + */ |
|
| 320 | + protected function getSubClientNames() |
|
| 321 | + { |
|
| 322 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 323 | + } |
|
| 324 | 324 | } |
| 325 | 325 | \ No newline at end of file |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * @since 2014.03 |
| 112 | 112 | * @category Developer |
| 113 | 113 | */ |
| 114 | - private $subPartNames = array( 'salutation', 'intro', 'summary', 'outro', 'legal' ); |
|
| 114 | + private $subPartNames = array('salutation', 'intro', 'summary', 'outro', 'legal'); |
|
| 115 | 115 | |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -122,13 +122,13 @@ discard block |
||
| 122 | 122 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 123 | 123 | * @return string HTML code |
| 124 | 124 | */ |
| 125 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 125 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 126 | 126 | { |
| 127 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 127 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 128 | 128 | |
| 129 | 129 | $content = ''; |
| 130 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 131 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 130 | + foreach ($this->getSubClients() as $subclient) { |
|
| 131 | + $content .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 132 | 132 | } |
| 133 | 133 | $view->textBody = $content; |
| 134 | 134 | |
@@ -162,10 +162,10 @@ discard block |
||
| 162 | 162 | $tplconf = 'client/html/email/delivery/text/standard/template-body'; |
| 163 | 163 | |
| 164 | 164 | $status = $view->extOrderItem->getDeliveryStatus(); |
| 165 | - $default = array( 'email/delivery/' . $status . '/text-body-default.php', 'email/common/text-body-default.php' ); |
|
| 165 | + $default = array('email/delivery/'.$status.'/text-body-default.php', 'email/common/text-body-default.php'); |
|
| 166 | 166 | |
| 167 | - $text = $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | - $view->mail()->setBody( $text ); |
|
| 167 | + $text = $view->render($view->config($tplconf, $default)); |
|
| 168 | + $view->mail()->setBody($text); |
|
| 169 | 169 | return $text; |
| 170 | 170 | } |
| 171 | 171 | |
@@ -178,13 +178,13 @@ discard block |
||
| 178 | 178 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 179 | 179 | * @return string|null String including HTML tags for the header on error |
| 180 | 180 | */ |
| 181 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 181 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 182 | 182 | { |
| 183 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 183 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 184 | 184 | |
| 185 | 185 | $content = ''; |
| 186 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 187 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 186 | + foreach ($this->getSubClients() as $subclient) { |
|
| 187 | + $content .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 188 | 188 | } |
| 189 | 189 | $view->textHeader = $content; |
| 190 | 190 | |
@@ -219,9 +219,9 @@ discard block |
||
| 219 | 219 | $tplconf = 'client/html/email/delivery/text/standard/template-header'; |
| 220 | 220 | |
| 221 | 221 | $status = $view->extOrderItem->getDeliveryStatus(); |
| 222 | - $default = array( 'email/delivery/' . $status . '/text-header-default.php', 'email/common/text-header-default.php' ); |
|
| 222 | + $default = array('email/delivery/'.$status.'/text-header-default.php', 'email/common/text-header-default.php'); |
|
| 223 | 223 | |
| 224 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 224 | + return $view->render($view->config($tplconf, $default)); |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | * @param string|null $name Name of the sub-client (Default if null) |
| 233 | 233 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 234 | 234 | */ |
| 235 | - public function getSubClient( $type, $name = null ) |
|
| 235 | + public function getSubClient($type, $name = null) |
|
| 236 | 236 | { |
| 237 | 237 | /** client/html/email/delivery/text/decorators/excludes |
| 238 | 238 | * Excludes decorators added by the "common" option from the "email delivery text" html client |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | * @see client/html/email/delivery/text/decorators/global |
| 309 | 309 | */ |
| 310 | 310 | |
| 311 | - return $this->createSubClient( 'email/delivery/text/' . $type, $name ); |
|
| 311 | + return $this->createSubClient('email/delivery/text/'.$type, $name); |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | |
@@ -319,6 +319,6 @@ discard block |
||
| 319 | 319 | */ |
| 320 | 320 | protected function getSubClientNames() |
| 321 | 321 | { |
| 322 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 322 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 323 | 323 | } |
| 324 | 324 | } |
| 325 | 325 | \ No newline at end of file |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
| 111 | 111 | * @param array &$tags Result array for the list of tags that are associated to the output |
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | - * @return string|null String including HTML tags for the header on error |
|
| 113 | + * @return string String including HTML tags for the header on error |
|
| 114 | 114 | */ |
| 115 | 115 | public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
| 116 | 116 | { |
@@ -19,249 +19,249 @@ |
||
| 19 | 19 | * @subpackage Html |
| 20 | 20 | */ |
| 21 | 21 | class Standard |
| 22 | - extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
| 23 | - implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 22 | + extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
| 23 | + implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 24 | 24 | { |
| 25 | - /** client/html/email/delivery/text/outro/standard/subparts |
|
| 26 | - * List of HTML sub-clients rendered within the email delivery text 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.03 |
|
| 56 | - * @category Developer |
|
| 57 | - */ |
|
| 58 | - private $subPartPath = 'client/html/email/delivery/text/outro/standard/subparts'; |
|
| 59 | - private $subPartNames = array(); |
|
| 25 | + /** client/html/email/delivery/text/outro/standard/subparts |
|
| 26 | + * List of HTML sub-clients rendered within the email delivery text 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.03 |
|
| 56 | + * @category Developer |
|
| 57 | + */ |
|
| 58 | + private $subPartPath = 'client/html/email/delivery/text/outro/standard/subparts'; |
|
| 59 | + private $subPartNames = array(); |
|
| 60 | 60 | |
| 61 | 61 | |
| 62 | - /** |
|
| 63 | - * Returns the HTML code for insertion into the body. |
|
| 64 | - * |
|
| 65 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 66 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 67 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 68 | - * @return string HTML code |
|
| 69 | - */ |
|
| 70 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 71 | - { |
|
| 72 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 62 | + /** |
|
| 63 | + * Returns the HTML code for insertion into the body. |
|
| 64 | + * |
|
| 65 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 66 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 67 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 68 | + * @return string HTML code |
|
| 69 | + */ |
|
| 70 | + public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 71 | + { |
|
| 72 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 73 | 73 | |
| 74 | - $content = ''; |
|
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | - } |
|
| 78 | - $view->outroBody = $content; |
|
| 74 | + $content = ''; |
|
| 75 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | + $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 77 | + } |
|
| 78 | + $view->outroBody = $content; |
|
| 79 | 79 | |
| 80 | - /** client/html/email/delivery/text/outro/standard/template-body |
|
| 81 | - * Relative path to the text body template of the email delivery text footer client. |
|
| 82 | - * |
|
| 83 | - * The template file contains the text and processing instructions |
|
| 84 | - * to generate the result shown in the body e-mail. The |
|
| 85 | - * configuration string is the path to the template file relative |
|
| 86 | - * to the templates directory (usually in client/html/templates). |
|
| 87 | - * |
|
| 88 | - * You can overwrite the template file configuration in extensions and |
|
| 89 | - * provide alternative templates. These alternative templates should be |
|
| 90 | - * named like the default one but with the string "standard" replaced by |
|
| 91 | - * an unique name. You may use the name of your project for this. If |
|
| 92 | - * you've implemented an alternative client class as well, "standard" |
|
| 93 | - * should be replaced by the name of the new class. |
|
| 94 | - * |
|
| 95 | - * The footer part of the email delivery text client allows to use |
|
| 96 | - * a different template for each delivery status value. You can create a |
|
| 97 | - * template for each delivery status and store it in the "email/delivery/<status number>/" |
|
| 98 | - * directory below the "templates" directory (usually in client/html/templates). |
|
| 99 | - * If no specific layout template is found, the common template in the |
|
| 100 | - * "email/delivery/" directory is used. |
|
| 101 | - * |
|
| 102 | - * @param string Relative path to the template creating code for the e-mail body |
|
| 103 | - * @since 2014.03 |
|
| 104 | - * @category Developer |
|
| 105 | - * @see client/html/email/delivery/text/outro/standard/template-header |
|
| 106 | - */ |
|
| 107 | - $tplconf = 'client/html/email/delivery/text/outro/standard/template-body'; |
|
| 80 | + /** client/html/email/delivery/text/outro/standard/template-body |
|
| 81 | + * Relative path to the text body template of the email delivery text footer client. |
|
| 82 | + * |
|
| 83 | + * The template file contains the text and processing instructions |
|
| 84 | + * to generate the result shown in the body e-mail. The |
|
| 85 | + * configuration string is the path to the template file relative |
|
| 86 | + * to the templates directory (usually in client/html/templates). |
|
| 87 | + * |
|
| 88 | + * You can overwrite the template file configuration in extensions and |
|
| 89 | + * provide alternative templates. These alternative templates should be |
|
| 90 | + * named like the default one but with the string "standard" replaced by |
|
| 91 | + * an unique name. You may use the name of your project for this. If |
|
| 92 | + * you've implemented an alternative client class as well, "standard" |
|
| 93 | + * should be replaced by the name of the new class. |
|
| 94 | + * |
|
| 95 | + * The footer part of the email delivery text client allows to use |
|
| 96 | + * a different template for each delivery status value. You can create a |
|
| 97 | + * template for each delivery status and store it in the "email/delivery/<status number>/" |
|
| 98 | + * directory below the "templates" directory (usually in client/html/templates). |
|
| 99 | + * If no specific layout template is found, the common template in the |
|
| 100 | + * "email/delivery/" directory is used. |
|
| 101 | + * |
|
| 102 | + * @param string Relative path to the template creating code for the e-mail body |
|
| 103 | + * @since 2014.03 |
|
| 104 | + * @category Developer |
|
| 105 | + * @see client/html/email/delivery/text/outro/standard/template-header |
|
| 106 | + */ |
|
| 107 | + $tplconf = 'client/html/email/delivery/text/outro/standard/template-body'; |
|
| 108 | 108 | |
| 109 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 110 | - $default = array( 'email/delivery/' . $status . '/text-outro-body-default.php', 'email/common/text-outro-body-default.php' ); |
|
| 109 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 110 | + $default = array( 'email/delivery/' . $status . '/text-outro-body-default.php', 'email/common/text-outro-body-default.php' ); |
|
| 111 | 111 | |
| 112 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 113 | - } |
|
| 112 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 113 | + } |
|
| 114 | 114 | |
| 115 | 115 | |
| 116 | - /** |
|
| 117 | - * Returns the HTML string for insertion into the header. |
|
| 118 | - * |
|
| 119 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 120 | - * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 121 | - * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 122 | - * @return string|null String including HTML tags for the header on error |
|
| 123 | - */ |
|
| 124 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 125 | - { |
|
| 126 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 116 | + /** |
|
| 117 | + * Returns the HTML string for insertion into the header. |
|
| 118 | + * |
|
| 119 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 120 | + * @param array &$tags Result array for the list of tags that are associated to the output |
|
| 121 | + * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
|
| 122 | + * @return string|null String including HTML tags for the header on error |
|
| 123 | + */ |
|
| 124 | + public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 125 | + { |
|
| 126 | + $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 127 | 127 | |
| 128 | - $content = ''; |
|
| 129 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 130 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 131 | - } |
|
| 132 | - $view->outroHeader = $content; |
|
| 128 | + $content = ''; |
|
| 129 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 130 | + $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 131 | + } |
|
| 132 | + $view->outroHeader = $content; |
|
| 133 | 133 | |
| 134 | - /** client/html/email/delivery/text/outro/standard/template-header |
|
| 135 | - * Relative path to the text header template of the email delivery text footer 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/delivery/text/outro/standard/template-body |
|
| 161 | - */ |
|
| 162 | - $tplconf = 'client/html/email/delivery/text/outro/standard/template-header'; |
|
| 134 | + /** client/html/email/delivery/text/outro/standard/template-header |
|
| 135 | + * Relative path to the text header template of the email delivery text footer 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/delivery/text/outro/standard/template-body |
|
| 161 | + */ |
|
| 162 | + $tplconf = 'client/html/email/delivery/text/outro/standard/template-header'; |
|
| 163 | 163 | |
| 164 | - $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 165 | - $default = array( 'email/delivery/' . $status . '/text-outro-header-default.php', 'email/common/text-outro-header-default.php' ); |
|
| 164 | + $status = $view->extOrderItem->getDeliveryStatus(); |
|
| 165 | + $default = array( 'email/delivery/' . $status . '/text-outro-header-default.php', 'email/common/text-outro-header-default.php' ); |
|
| 166 | 166 | |
| 167 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | - } |
|
| 167 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 168 | + } |
|
| 169 | 169 | |
| 170 | 170 | |
| 171 | - /** |
|
| 172 | - * Returns the sub-client given by its name. |
|
| 173 | - * |
|
| 174 | - * @param string $type Name of the client type |
|
| 175 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 176 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 177 | - */ |
|
| 178 | - public function getSubClient( $type, $name = null ) |
|
| 179 | - { |
|
| 180 | - /** client/html/email/delivery/text/outro/decorators/excludes |
|
| 181 | - * Excludes decorators added by the "common" option from the "email delivery text outro" html client |
|
| 182 | - * |
|
| 183 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 184 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 185 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 186 | - * modify what is returned to the caller. |
|
| 187 | - * |
|
| 188 | - * This option allows you to remove a decorator added via |
|
| 189 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 190 | - * around the html client. |
|
| 191 | - * |
|
| 192 | - * client/html/email/delivery/text/outro/decorators/excludes = array( 'decorator1' ) |
|
| 193 | - * |
|
| 194 | - * This would remove the decorator named "decorator1" from the list of |
|
| 195 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 196 | - * "client/html/common/decorators/default" to the html client. |
|
| 197 | - * |
|
| 198 | - * @param array List of decorator names |
|
| 199 | - * @since 2015.08 |
|
| 200 | - * @category Developer |
|
| 201 | - * @see client/html/common/decorators/default |
|
| 202 | - * @see client/html/email/delivery/text/outro/decorators/global |
|
| 203 | - * @see client/html/email/delivery/text/outro/decorators/local |
|
| 204 | - */ |
|
| 171 | + /** |
|
| 172 | + * Returns the sub-client given by its name. |
|
| 173 | + * |
|
| 174 | + * @param string $type Name of the client type |
|
| 175 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 176 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 177 | + */ |
|
| 178 | + public function getSubClient( $type, $name = null ) |
|
| 179 | + { |
|
| 180 | + /** client/html/email/delivery/text/outro/decorators/excludes |
|
| 181 | + * Excludes decorators added by the "common" option from the "email delivery text outro" html client |
|
| 182 | + * |
|
| 183 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 184 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 185 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 186 | + * modify what is returned to the caller. |
|
| 187 | + * |
|
| 188 | + * This option allows you to remove a decorator added via |
|
| 189 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 190 | + * around the html client. |
|
| 191 | + * |
|
| 192 | + * client/html/email/delivery/text/outro/decorators/excludes = array( 'decorator1' ) |
|
| 193 | + * |
|
| 194 | + * This would remove the decorator named "decorator1" from the list of |
|
| 195 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 196 | + * "client/html/common/decorators/default" to the html client. |
|
| 197 | + * |
|
| 198 | + * @param array List of decorator names |
|
| 199 | + * @since 2015.08 |
|
| 200 | + * @category Developer |
|
| 201 | + * @see client/html/common/decorators/default |
|
| 202 | + * @see client/html/email/delivery/text/outro/decorators/global |
|
| 203 | + * @see client/html/email/delivery/text/outro/decorators/local |
|
| 204 | + */ |
|
| 205 | 205 | |
| 206 | - /** client/html/email/delivery/text/outro/decorators/global |
|
| 207 | - * Adds a list of globally available decorators only to the "email delivery text outro" html client |
|
| 208 | - * |
|
| 209 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 210 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 211 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 212 | - * modify what is returned to the caller. |
|
| 213 | - * |
|
| 214 | - * This option allows you to wrap global decorators |
|
| 215 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 216 | - * |
|
| 217 | - * client/html/email/delivery/text/outro/decorators/global = array( 'decorator1' ) |
|
| 218 | - * |
|
| 219 | - * This would add the decorator named "decorator1" defined by |
|
| 220 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 221 | - * |
|
| 222 | - * @param array List of decorator names |
|
| 223 | - * @since 2015.08 |
|
| 224 | - * @category Developer |
|
| 225 | - * @see client/html/common/decorators/default |
|
| 226 | - * @see client/html/email/delivery/text/outro/decorators/excludes |
|
| 227 | - * @see client/html/email/delivery/text/outro/decorators/local |
|
| 228 | - */ |
|
| 206 | + /** client/html/email/delivery/text/outro/decorators/global |
|
| 207 | + * Adds a list of globally available decorators only to the "email delivery text outro" html client |
|
| 208 | + * |
|
| 209 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 210 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 211 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 212 | + * modify what is returned to the caller. |
|
| 213 | + * |
|
| 214 | + * This option allows you to wrap global decorators |
|
| 215 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 216 | + * |
|
| 217 | + * client/html/email/delivery/text/outro/decorators/global = array( 'decorator1' ) |
|
| 218 | + * |
|
| 219 | + * This would add the decorator named "decorator1" defined by |
|
| 220 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 221 | + * |
|
| 222 | + * @param array List of decorator names |
|
| 223 | + * @since 2015.08 |
|
| 224 | + * @category Developer |
|
| 225 | + * @see client/html/common/decorators/default |
|
| 226 | + * @see client/html/email/delivery/text/outro/decorators/excludes |
|
| 227 | + * @see client/html/email/delivery/text/outro/decorators/local |
|
| 228 | + */ |
|
| 229 | 229 | |
| 230 | - /** client/html/email/delivery/text/outro/decorators/local |
|
| 231 | - * Adds a list of local decorators only to the "email delivery text outro" html client |
|
| 232 | - * |
|
| 233 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 234 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 235 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 236 | - * modify what is returned to the caller. |
|
| 237 | - * |
|
| 238 | - * This option allows you to wrap local decorators |
|
| 239 | - * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 240 | - * |
|
| 241 | - * client/html/email/delivery/text/outro/decorators/local = array( 'decorator2' ) |
|
| 242 | - * |
|
| 243 | - * This would add the decorator named "decorator2" defined by |
|
| 244 | - * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 245 | - * |
|
| 246 | - * @param array List of decorator names |
|
| 247 | - * @since 2015.08 |
|
| 248 | - * @category Developer |
|
| 249 | - * @see client/html/common/decorators/default |
|
| 250 | - * @see client/html/email/delivery/text/outro/decorators/excludes |
|
| 251 | - * @see client/html/email/delivery/text/outro/decorators/global |
|
| 252 | - */ |
|
| 230 | + /** client/html/email/delivery/text/outro/decorators/local |
|
| 231 | + * Adds a list of local decorators only to the "email delivery text outro" html client |
|
| 232 | + * |
|
| 233 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 234 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 235 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 236 | + * modify what is returned to the caller. |
|
| 237 | + * |
|
| 238 | + * This option allows you to wrap local decorators |
|
| 239 | + * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client. |
|
| 240 | + * |
|
| 241 | + * client/html/email/delivery/text/outro/decorators/local = array( 'decorator2' ) |
|
| 242 | + * |
|
| 243 | + * This would add the decorator named "decorator2" defined by |
|
| 244 | + * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client. |
|
| 245 | + * |
|
| 246 | + * @param array List of decorator names |
|
| 247 | + * @since 2015.08 |
|
| 248 | + * @category Developer |
|
| 249 | + * @see client/html/common/decorators/default |
|
| 250 | + * @see client/html/email/delivery/text/outro/decorators/excludes |
|
| 251 | + * @see client/html/email/delivery/text/outro/decorators/global |
|
| 252 | + */ |
|
| 253 | 253 | |
| 254 | - return $this->createSubClient( 'email/delivery/text/outro/' . $type, $name ); |
|
| 255 | - } |
|
| 254 | + return $this->createSubClient( 'email/delivery/text/outro/' . $type, $name ); |
|
| 255 | + } |
|
| 256 | 256 | |
| 257 | 257 | |
| 258 | - /** |
|
| 259 | - * Returns the list of sub-client names configured for the client. |
|
| 260 | - * |
|
| 261 | - * @return array List of HTML client names |
|
| 262 | - */ |
|
| 263 | - protected function getSubClientNames() |
|
| 264 | - { |
|
| 265 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 266 | - } |
|
| 258 | + /** |
|
| 259 | + * Returns the list of sub-client names configured for the client. |
|
| 260 | + * |
|
| 261 | + * @return array List of HTML client names |
|
| 262 | + */ |
|
| 263 | + protected function getSubClientNames() |
|
| 264 | + { |
|
| 265 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 266 | + } |
|
| 267 | 267 | } |
| 268 | 268 | \ No newline at end of file |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 68 | 68 | * @return string HTML code |
| 69 | 69 | */ |
| 70 | - public function getBody( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 70 | + public function getBody($uid = '', array &$tags = array(), &$expire = null) |
|
| 71 | 71 | { |
| 72 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 72 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 73 | 73 | |
| 74 | 74 | $content = ''; |
| 75 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 76 | - $content .= $subclient->setView( $view )->getBody( $uid, $tags, $expire ); |
|
| 75 | + foreach ($this->getSubClients() as $subclient) { |
|
| 76 | + $content .= $subclient->setView($view)->getBody($uid, $tags, $expire); |
|
| 77 | 77 | } |
| 78 | 78 | $view->outroBody = $content; |
| 79 | 79 | |
@@ -107,9 +107,9 @@ discard block |
||
| 107 | 107 | $tplconf = 'client/html/email/delivery/text/outro/standard/template-body'; |
| 108 | 108 | |
| 109 | 109 | $status = $view->extOrderItem->getDeliveryStatus(); |
| 110 | - $default = array( 'email/delivery/' . $status . '/text-outro-body-default.php', 'email/common/text-outro-body-default.php' ); |
|
| 110 | + $default = array('email/delivery/'.$status.'/text-outro-body-default.php', 'email/common/text-outro-body-default.php'); |
|
| 111 | 111 | |
| 112 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 112 | + return $view->render($view->config($tplconf, $default)); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
@@ -121,13 +121,13 @@ discard block |
||
| 121 | 121 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 122 | 122 | * @return string|null String including HTML tags for the header on error |
| 123 | 123 | */ |
| 124 | - public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
|
| 124 | + public function getHeader($uid = '', array &$tags = array(), &$expire = null) |
|
| 125 | 125 | { |
| 126 | - $view = $this->setViewParams( $this->getView(), $tags, $expire ); |
|
| 126 | + $view = $this->setViewParams($this->getView(), $tags, $expire); |
|
| 127 | 127 | |
| 128 | 128 | $content = ''; |
| 129 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 130 | - $content .= $subclient->setView( $view )->getHeader( $uid, $tags, $expire ); |
|
| 129 | + foreach ($this->getSubClients() as $subclient) { |
|
| 130 | + $content .= $subclient->setView($view)->getHeader($uid, $tags, $expire); |
|
| 131 | 131 | } |
| 132 | 132 | $view->outroHeader = $content; |
| 133 | 133 | |
@@ -162,9 +162,9 @@ discard block |
||
| 162 | 162 | $tplconf = 'client/html/email/delivery/text/outro/standard/template-header'; |
| 163 | 163 | |
| 164 | 164 | $status = $view->extOrderItem->getDeliveryStatus(); |
| 165 | - $default = array( 'email/delivery/' . $status . '/text-outro-header-default.php', 'email/common/text-outro-header-default.php' ); |
|
| 165 | + $default = array('email/delivery/'.$status.'/text-outro-header-default.php', 'email/common/text-outro-header-default.php'); |
|
| 166 | 166 | |
| 167 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 167 | + return $view->render($view->config($tplconf, $default)); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | * @param string|null $name Name of the sub-client (Default if null) |
| 176 | 176 | * @return \Aimeos\Client\Html\Iface Sub-client object |
| 177 | 177 | */ |
| 178 | - public function getSubClient( $type, $name = null ) |
|
| 178 | + public function getSubClient($type, $name = null) |
|
| 179 | 179 | { |
| 180 | 180 | /** client/html/email/delivery/text/outro/decorators/excludes |
| 181 | 181 | * Excludes decorators added by the "common" option from the "email delivery text outro" html client |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | * @see client/html/email/delivery/text/outro/decorators/global |
| 252 | 252 | */ |
| 253 | 253 | |
| 254 | - return $this->createSubClient( 'email/delivery/text/outro/' . $type, $name ); |
|
| 254 | + return $this->createSubClient('email/delivery/text/outro/'.$type, $name); |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | |
@@ -262,6 +262,6 @@ discard block |
||
| 262 | 262 | */ |
| 263 | 263 | protected function getSubClientNames() |
| 264 | 264 | { |
| 265 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 265 | + return $this->getContext()->getConfig()->get($this->subPartPath, $this->subPartNames); |
|
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | 268 | \ No newline at end of file |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
| 111 | 111 | * @param array &$tags Result array for the list of tags that are associated to the output |
| 112 | 112 | * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry) |
| 113 | - * @return string|null String including HTML tags for the header on error |
|
| 113 | + * @return string String including HTML tags for the header on error |
|
| 114 | 114 | */ |
| 115 | 115 | public function getHeader( $uid = '', array &$tags = array(), &$expire = null ) |
| 116 | 116 | { |