@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $this->pdf->setFont( 'dejavusans', '', 10 ); |
| 25 | 25 | |
| 26 | 26 | $vmargin = [ |
| 27 | - 'h1' => [ // HTML tag |
|
| 27 | + 'h1' => [// HTML tag |
|
| 28 | 28 | 0 => ['h' => 1.5, 'n' => 0], // space before = h * n |
| 29 | 29 | 1 => ['h' => 1.5, 'n' => 3] // space after = h * n |
| 30 | 30 | ], |
@@ -97,14 +97,14 @@ discard block |
||
| 97 | 97 | $data = [ |
| 98 | 98 | 'BCD', // required |
| 99 | 99 | '002', // Version 2 (required, 1=UTF-8, 2=ISO 8859-1, 3=ISO 8859-2, 4=ISO 8859-4, 5=ISO 8859-5, 6=ISO 8859-7, 7=ISO 8859-10, 8=ISO 8859-15) |
| 100 | - 1, // UTF-8 (required) |
|
| 100 | + 1, // UTF-8 (required) |
|
| 101 | 101 | 'SCT', // SEPA Credit Transfer (required) |
| 102 | - '', // BIC (optional) |
|
| 103 | - '', // Name of recipient (required, name of your company) |
|
| 104 | - '', // IBAN (required) |
|
| 105 | - $this->summaryBasket->getPrice()->getCurrencyId() . $total, // Currency and value (required) |
|
| 106 | - '', // Purpose (optional, 4 char code, https://wiki.windata.de/index.php?title=Purpose-SEPA-Codes) |
|
| 107 | - '', // ISO 11649 RF Creditor Reference (optional, 35 characters structured code) |
|
| 102 | + '', // BIC (optional) |
|
| 103 | + '', // Name of recipient (required, name of your company) |
|
| 104 | + '', // IBAN (required) |
|
| 105 | + $this->summaryBasket->getPrice()->getCurrencyId() . $total, // Currency and value (required) |
|
| 106 | + '', // Purpose (optional, 4 char code, https://wiki.windata.de/index.php?title=Purpose-SEPA-Codes) |
|
| 107 | + '', // ISO 11649 RF Creditor Reference (optional, 35 characters structured code) |
|
| 108 | 108 | $this->translate( 'client', 'Order' ) . ' ' . $this->extOrderItem->getId(), // Reference of order and other data (optional, max. 140 characters) |
| 109 | 109 | $this->extOrderBaseItem->getCustomerReference(), // Notice to the customer (optional, max. 70 characters) |
| 110 | 110 | ]; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @see client/html/account/profile/url/config |
| 87 | 87 | */ |
| 88 | 88 | |
| 89 | -$passwordErrors = $this->get('passwordErrors', []); |
|
| 89 | +$passwordErrors = $this->get( 'passwordErrors', [] ); |
|
| 90 | 90 | |
| 91 | 91 | ?> |
| 92 | 92 | <?php $this->block()->start( 'account/profile/account' ) ?> |
@@ -95,13 +95,13 @@ discard block |
||
| 95 | 95 | <h1 class="header"><?= $enc->html( $this->translate( 'client', 'account' ) ) ?></h1> |
| 96 | 96 | <form class="container-fluid" method="POST" action="<?= $enc->attr( $this->link( 'client/html/account/profile/url' ) ) ?>"> |
| 97 | 97 | <?= $this->csrf()->formfield() ?> |
| 98 | - <?php if ( $this->get('passwordChanged', null) === true ) : ?> |
|
| 98 | + <?php if( $this->get( 'passwordChanged', null ) === true ) : ?> |
|
| 99 | 99 | <div class="row d-flex justify-content-center"> |
| 100 | - <h2 class="text-success"><?= $this->translate('client', 'Password changed successfull!') ?></h2> |
|
| 100 | + <h2 class="text-success"><?= $this->translate( 'client', 'Password changed successfull!' ) ?></h2> |
|
| 101 | 101 | </div> |
| 102 | - <?php elseif ($this->get('passwordChanged', null) === false) :?> |
|
| 102 | + <?php elseif( $this->get( 'passwordChanged', null ) === false ) :?> |
|
| 103 | 103 | <div class="row d-flex justify-content-center"> |
| 104 | - <h2 class="text-danger"><?= $this->translate('client', 'Error(s) occured!') ?></h2> |
|
| 104 | + <h2 class="text-danger"><?= $this->translate( 'client', 'Error(s) occured!' ) ?></h2> |
|
| 105 | 105 | </div> |
| 106 | 106 | <?php endif ?> |
| 107 | 107 | <div class="row"> |
@@ -118,9 +118,9 @@ discard block |
||
| 118 | 118 | name="<?= $enc->attr( $this->formparam( array( 'account', 'customer.oldpassword' ) ) ) ?>" |
| 119 | 119 | placeholder="<?= $enc->attr( $this->translate( 'client', 'Old password' ) ) ?>" |
| 120 | 120 | > |
| 121 | - <?php if( isset($passwordErrors['oldPassword']) ) : ?> |
|
| 121 | + <?php if( isset( $passwordErrors['oldPassword'] ) ) : ?> |
|
| 122 | 122 | <span class="invalid-feedback d-block" role="alert"> |
| 123 | - <strong><?= $enc->html($this->translate('client', $passwordErrors['oldPassword'])) ?></strong> |
|
| 123 | + <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['oldPassword'] ) ) ?></strong> |
|
| 124 | 124 | </span> |
| 125 | 125 | <?php endif ?> |
| 126 | 126 | </div> |
@@ -137,19 +137,19 @@ discard block |
||
| 137 | 137 | name="<?= $enc->attr( $this->formparam( array( 'account', 'customer.newpassword' ) ) ) ?>" |
| 138 | 138 | placeholder="<?= $enc->attr( $this->translate( 'client', 'New password' ) ) ?>" |
| 139 | 139 | > |
| 140 | - <?php if( isset($passwordErrors['confirm']) ) : ?> |
|
| 140 | + <?php if( isset( $passwordErrors['confirm'] ) ) : ?> |
|
| 141 | 141 | <span class="invalid-feedback d-block" role="alert"> |
| 142 | - <strong><?= $enc->html($this->translate('client', $passwordErrors['confirm'])) ?></strong> |
|
| 142 | + <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['confirm'] ) ) ?></strong> |
|
| 143 | 143 | </span> |
| 144 | 144 | <?php endif ?> |
| 145 | - <?php if( isset($passwordErrors['isNew']) ) : ?> |
|
| 145 | + <?php if( isset( $passwordErrors['isNew'] ) ) : ?> |
|
| 146 | 146 | <span class="invalid-feedback d-block" role="alert"> |
| 147 | - <strong><?= $enc->html($this->translate('client', $passwordErrors['isNew'])) ?></strong> |
|
| 147 | + <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['isNew'] ) ) ?></strong> |
|
| 148 | 148 | </span> |
| 149 | 149 | <?php endif ?> |
| 150 | - <?php if( isset($passwordErrors['passwordRules']) ) : ?> |
|
| 150 | + <?php if( isset( $passwordErrors['passwordRules'] ) ) : ?> |
|
| 151 | 151 | <span class="invalid-feedback d-block" role="alert"> |
| 152 | - <strong><?= $enc->html($this->translate('client', $passwordErrors['passwordRules'])) ?></strong> |
|
| 152 | + <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['passwordRules'] ) ) ?></strong> |
|
| 153 | 153 | </span> |
| 154 | 154 | <?php endif ?> |
| 155 | 155 | </div> |
@@ -165,14 +165,14 @@ discard block |
||
| 165 | 165 | name="<?= $enc->attr( $this->formparam( array( 'account', 'customer.confirmnewpassword' ) ) ) ?>" |
| 166 | 166 | placeholder="<?= $enc->attr( $this->translate( 'client', 'Confirm password' ) ) ?>" |
| 167 | 167 | > |
| 168 | - <?php if( isset($passwordErrors['confirm']) ) : ?> |
|
| 168 | + <?php if( isset( $passwordErrors['confirm'] ) ) : ?> |
|
| 169 | 169 | <span class="invalid-feedback d-block" role="alert"> |
| 170 | - <strong><?= $enc->html($this->translate('client', $passwordErrors['confirm'])) ?></strong> |
|
| 170 | + <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['confirm'] ) ) ?></strong> |
|
| 171 | 171 | </span> |
| 172 | 172 | <?php endif ?> |
| 173 | - <?php if( isset($passwordErrors['isNew']) ) : ?> |
|
| 173 | + <?php if( isset( $passwordErrors['isNew'] ) ) : ?> |
|
| 174 | 174 | <span class="invalid-feedback d-block" role="alert"> |
| 175 | - <strong><?= $enc->html($this->translate('client', $passwordErrors['isNew'])) ?></strong> |
|
| 175 | + <strong><?= $enc->html( $this->translate( 'client', $passwordErrors['isNew'] ) ) ?></strong> |
|
| 176 | 176 | </span> |
| 177 | 177 | <?php endif ?> |
| 178 | 178 | </div> |
@@ -13,252 +13,252 @@ |
||
| 13 | 13 | * @subpackage Html |
| 14 | 14 | */ |
| 15 | 15 | class Standard |
| 16 | - extends \Aimeos\Client\Html\Common\Client\Summary\Base |
|
| 17 | - implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 16 | + extends \Aimeos\Client\Html\Common\Client\Summary\Base |
|
| 17 | + implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
| 18 | 18 | { |
| 19 | 19 | |
| 20 | - /** client/html/account/profile/account/subparts |
|
| 21 | - * List of HTML sub-clients rendered within the account profile account section |
|
| 22 | - * |
|
| 23 | - * The output of the frontend is composed of the code generated by the HTML |
|
| 24 | - * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 25 | - * that are responsible for rendering certain sub-parts of the output. The |
|
| 26 | - * sub-clients can contain HTML clients themselves and therefore a |
|
| 27 | - * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 28 | - * the output that is placed inside the container of its parent. |
|
| 29 | - * |
|
| 30 | - * At first, always the HTML code generated by the parent is printed, then |
|
| 31 | - * the HTML code of its sub-clients. The account of the HTML sub-clients |
|
| 32 | - * determines the account of the output of these sub-clients inside the parent |
|
| 33 | - * container. If the configured list of clients is |
|
| 34 | - * |
|
| 35 | - * array( "subclient1", "subclient2" ) |
|
| 36 | - * |
|
| 37 | - * you can easily change the account of the output by readdressing the subparts: |
|
| 38 | - * |
|
| 39 | - * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 40 | - * |
|
| 41 | - * You can also remove one or more parts if they shouldn't be rendered: |
|
| 42 | - * |
|
| 43 | - * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 44 | - * |
|
| 45 | - * As the clients only generates structural HTML, the layout defined via CSS |
|
| 46 | - * should support adding, removing or readdressing content by a fluid like |
|
| 47 | - * design. |
|
| 48 | - * |
|
| 49 | - * @param array List of sub-client names |
|
| 50 | - * @since 2019.07 |
|
| 51 | - * @category Developer |
|
| 52 | - */ |
|
| 53 | - private $subPartPath = 'client/html/account/profile/account/subparts'; |
|
| 54 | - private $subPartNames = []; |
|
| 20 | + /** client/html/account/profile/account/subparts |
|
| 21 | + * List of HTML sub-clients rendered within the account profile account section |
|
| 22 | + * |
|
| 23 | + * The output of the frontend is composed of the code generated by the HTML |
|
| 24 | + * clients. Each HTML client can consist of serveral (or none) sub-clients |
|
| 25 | + * that are responsible for rendering certain sub-parts of the output. The |
|
| 26 | + * sub-clients can contain HTML clients themselves and therefore a |
|
| 27 | + * hierarchical tree of HTML clients is composed. Each HTML client creates |
|
| 28 | + * the output that is placed inside the container of its parent. |
|
| 29 | + * |
|
| 30 | + * At first, always the HTML code generated by the parent is printed, then |
|
| 31 | + * the HTML code of its sub-clients. The account of the HTML sub-clients |
|
| 32 | + * determines the account of the output of these sub-clients inside the parent |
|
| 33 | + * container. If the configured list of clients is |
|
| 34 | + * |
|
| 35 | + * array( "subclient1", "subclient2" ) |
|
| 36 | + * |
|
| 37 | + * you can easily change the account of the output by readdressing the subparts: |
|
| 38 | + * |
|
| 39 | + * client/html/<clients>/subparts = array( "subclient1", "subclient2" ) |
|
| 40 | + * |
|
| 41 | + * You can also remove one or more parts if they shouldn't be rendered: |
|
| 42 | + * |
|
| 43 | + * client/html/<clients>/subparts = array( "subclient1" ) |
|
| 44 | + * |
|
| 45 | + * As the clients only generates structural HTML, the layout defined via CSS |
|
| 46 | + * should support adding, removing or readdressing content by a fluid like |
|
| 47 | + * design. |
|
| 48 | + * |
|
| 49 | + * @param array List of sub-client names |
|
| 50 | + * @since 2019.07 |
|
| 51 | + * @category Developer |
|
| 52 | + */ |
|
| 53 | + private $subPartPath = 'client/html/account/profile/account/subparts'; |
|
| 54 | + private $subPartNames = []; |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * Returns the list of sub-client names configured for the client. |
|
| 58 | - * |
|
| 59 | - * @return array List of HTML client names |
|
| 60 | - */ |
|
| 61 | - protected function getSubClientNames() : array |
|
| 62 | - { |
|
| 63 | - return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 64 | - } |
|
| 56 | + /** |
|
| 57 | + * Returns the list of sub-client names configured for the client. |
|
| 58 | + * |
|
| 59 | + * @return array List of HTML client names |
|
| 60 | + */ |
|
| 61 | + protected function getSubClientNames() : array |
|
| 62 | + { |
|
| 63 | + return $this->getContext()->getConfig()->get( $this->subPartPath, $this->subPartNames ); |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * Returns the sub-client given by its name. |
|
| 68 | - * |
|
| 69 | - * @param string $type Name of the client type |
|
| 70 | - * @param string|null $name Name of the sub-client (Default if null) |
|
| 71 | - * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 72 | - * @throws \Aimeos\Client\Html\Exception |
|
| 73 | - */ |
|
| 74 | - public function getSubClient( string $type, string $name = null ) : \Aimeos\Client\Html\Iface |
|
| 75 | - { |
|
| 76 | - /** client/html/account/profile/account/decorators/excludes |
|
| 77 | - * Excludes decorators added by the "common" option from the account profile account html client |
|
| 78 | - * |
|
| 79 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 80 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 81 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 82 | - * modify what is returned to the caller. |
|
| 83 | - * |
|
| 84 | - * This option allows you to remove a decorator added via |
|
| 85 | - * "client/html/common/decorators/default" before they are wrapped |
|
| 86 | - * around the html client. |
|
| 87 | - * |
|
| 88 | - * client/html/account/profile/account/decorators/excludes = array( 'decorator1' ) |
|
| 89 | - * |
|
| 90 | - * This would remove the decorator named "decorator1" from the list of |
|
| 91 | - * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 92 | - * "client/html/common/decorators/default" to the html client. |
|
| 93 | - * |
|
| 94 | - * @param array List of decorator names |
|
| 95 | - * @since 2019.07 |
|
| 96 | - * @category Developer |
|
| 97 | - * @see client/html/common/decorators/default |
|
| 98 | - * @see client/html/account/profile/account/decorators/global |
|
| 99 | - * @see client/html/account/profile/account/decorators/local |
|
| 100 | - */ |
|
| 66 | + /** |
|
| 67 | + * Returns the sub-client given by its name. |
|
| 68 | + * |
|
| 69 | + * @param string $type Name of the client type |
|
| 70 | + * @param string|null $name Name of the sub-client (Default if null) |
|
| 71 | + * @return \Aimeos\Client\Html\Iface Sub-client object |
|
| 72 | + * @throws \Aimeos\Client\Html\Exception |
|
| 73 | + */ |
|
| 74 | + public function getSubClient( string $type, string $name = null ) : \Aimeos\Client\Html\Iface |
|
| 75 | + { |
|
| 76 | + /** client/html/account/profile/account/decorators/excludes |
|
| 77 | + * Excludes decorators added by the "common" option from the account profile account html client |
|
| 78 | + * |
|
| 79 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 80 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 81 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 82 | + * modify what is returned to the caller. |
|
| 83 | + * |
|
| 84 | + * This option allows you to remove a decorator added via |
|
| 85 | + * "client/html/common/decorators/default" before they are wrapped |
|
| 86 | + * around the html client. |
|
| 87 | + * |
|
| 88 | + * client/html/account/profile/account/decorators/excludes = array( 'decorator1' ) |
|
| 89 | + * |
|
| 90 | + * This would remove the decorator named "decorator1" from the list of |
|
| 91 | + * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
|
| 92 | + * "client/html/common/decorators/default" to the html client. |
|
| 93 | + * |
|
| 94 | + * @param array List of decorator names |
|
| 95 | + * @since 2019.07 |
|
| 96 | + * @category Developer |
|
| 97 | + * @see client/html/common/decorators/default |
|
| 98 | + * @see client/html/account/profile/account/decorators/global |
|
| 99 | + * @see client/html/account/profile/account/decorators/local |
|
| 100 | + */ |
|
| 101 | 101 | |
| 102 | - /** client/html/account/profile/account/decorators/global |
|
| 103 | - * Adds a list of globally available decorators only to the account profile account html client |
|
| 104 | - * |
|
| 105 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 106 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 107 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 108 | - * modify what is returned to the caller. |
|
| 109 | - * |
|
| 110 | - * This option allows you to wrap global decorators |
|
| 111 | - * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 112 | - * |
|
| 113 | - * client/html/account/profile/account/decorators/global = array( 'decorator1' ) |
|
| 114 | - * |
|
| 115 | - * This would add the decorator named "decorator1" defined by |
|
| 116 | - * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 117 | - * |
|
| 118 | - * @param array List of decorator names |
|
| 119 | - * @since 2019.07 |
|
| 120 | - * @category Developer |
|
| 121 | - * @see client/html/common/decorators/default |
|
| 122 | - * @see client/html/account/profile/account/decorators/excludes |
|
| 123 | - * @see client/html/account/profile/account/decorators/local |
|
| 124 | - */ |
|
| 102 | + /** client/html/account/profile/account/decorators/global |
|
| 103 | + * Adds a list of globally available decorators only to the account profile account html client |
|
| 104 | + * |
|
| 105 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 106 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 107 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 108 | + * modify what is returned to the caller. |
|
| 109 | + * |
|
| 110 | + * This option allows you to wrap global decorators |
|
| 111 | + * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
|
| 112 | + * |
|
| 113 | + * client/html/account/profile/account/decorators/global = array( 'decorator1' ) |
|
| 114 | + * |
|
| 115 | + * This would add the decorator named "decorator1" defined by |
|
| 116 | + * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
|
| 117 | + * |
|
| 118 | + * @param array List of decorator names |
|
| 119 | + * @since 2019.07 |
|
| 120 | + * @category Developer |
|
| 121 | + * @see client/html/common/decorators/default |
|
| 122 | + * @see client/html/account/profile/account/decorators/excludes |
|
| 123 | + * @see client/html/account/profile/account/decorators/local |
|
| 124 | + */ |
|
| 125 | 125 | |
| 126 | - /** client/html/account/profile/account/decorators/local |
|
| 127 | - * Adds a list of local decorators only to the account profile account html client |
|
| 128 | - * |
|
| 129 | - * Decorators extend the functionality of a class by adding new aspects |
|
| 130 | - * (e.g. log what is currently done), executing the methods of the underlying |
|
| 131 | - * class only in certain conditions (e.g. only for logged in users) or |
|
| 132 | - * modify what is returned to the caller. |
|
| 133 | - * |
|
| 134 | - * This option allows you to wrap local decorators |
|
| 135 | - * ("\Aimeos\Client\Html\Account\Decorator\*") around the html client. |
|
| 136 | - * |
|
| 137 | - * client/html/account/profile/account/decorators/local = array( 'decorator2' ) |
|
| 138 | - * |
|
| 139 | - * This would add the decorator named "decorator2" defined by |
|
| 140 | - * "\Aimeos\Client\Html\Account\Decorator\Decorator2" only to the html client. |
|
| 141 | - * |
|
| 142 | - * @param array List of decorator names |
|
| 143 | - * @since 2019.07 |
|
| 144 | - * @category Developer |
|
| 145 | - * @see client/html/common/decorators/default |
|
| 146 | - * @see client/html/account/profile/account/decorators/excludes |
|
| 147 | - * @see client/html/account/profile/account/decorators/global |
|
| 148 | - */ |
|
| 126 | + /** client/html/account/profile/account/decorators/local |
|
| 127 | + * Adds a list of local decorators only to the account profile account html client |
|
| 128 | + * |
|
| 129 | + * Decorators extend the functionality of a class by adding new aspects |
|
| 130 | + * (e.g. log what is currently done), executing the methods of the underlying |
|
| 131 | + * class only in certain conditions (e.g. only for logged in users) or |
|
| 132 | + * modify what is returned to the caller. |
|
| 133 | + * |
|
| 134 | + * This option allows you to wrap local decorators |
|
| 135 | + * ("\Aimeos\Client\Html\Account\Decorator\*") around the html client. |
|
| 136 | + * |
|
| 137 | + * client/html/account/profile/account/decorators/local = array( 'decorator2' ) |
|
| 138 | + * |
|
| 139 | + * This would add the decorator named "decorator2" defined by |
|
| 140 | + * "\Aimeos\Client\Html\Account\Decorator\Decorator2" only to the html client. |
|
| 141 | + * |
|
| 142 | + * @param array List of decorator names |
|
| 143 | + * @since 2019.07 |
|
| 144 | + * @category Developer |
|
| 145 | + * @see client/html/common/decorators/default |
|
| 146 | + * @see client/html/account/profile/account/decorators/excludes |
|
| 147 | + * @see client/html/account/profile/account/decorators/global |
|
| 148 | + */ |
|
| 149 | 149 | |
| 150 | - return $this->createSubClient( 'account/profile/account/' . $type, $name ); |
|
| 151 | - } |
|
| 150 | + return $this->createSubClient( 'account/profile/account/' . $type, $name ); |
|
| 151 | + } |
|
| 152 | 152 | |
| 153 | - /** |
|
| 154 | - * Returns the HTML code for insertion into the body. |
|
| 155 | - * |
|
| 156 | - * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 157 | - * @return string HTML code |
|
| 158 | - * @throws \Aimeos\MW\View\Exception|\Aimeos\Client\Html\Exception |
|
| 159 | - */ |
|
| 160 | - public function getBody(string $uid = ''): string |
|
| 161 | - { |
|
| 162 | - $view = $this->getView(); |
|
| 153 | + /** |
|
| 154 | + * Returns the HTML code for insertion into the body. |
|
| 155 | + * |
|
| 156 | + * @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
|
| 157 | + * @return string HTML code |
|
| 158 | + * @throws \Aimeos\MW\View\Exception|\Aimeos\Client\Html\Exception |
|
| 159 | + */ |
|
| 160 | + public function getBody(string $uid = ''): string |
|
| 161 | + { |
|
| 162 | + $view = $this->getView(); |
|
| 163 | 163 | |
| 164 | - $html = ''; |
|
| 165 | - foreach( $this->getSubClients() as $subclient ) { |
|
| 166 | - $html .= $subclient->setView( $view )->getBody( $uid ); |
|
| 167 | - } |
|
| 168 | - $view->accountBody = $html; |
|
| 164 | + $html = ''; |
|
| 165 | + foreach( $this->getSubClients() as $subclient ) { |
|
| 166 | + $html .= $subclient->setView( $view )->getBody( $uid ); |
|
| 167 | + } |
|
| 168 | + $view->accountBody = $html; |
|
| 169 | 169 | |
| 170 | - /** client/html/account/profile/account/template-body |
|
| 171 | - * Relative path to the HTML body template of the account profile account client. |
|
| 172 | - * |
|
| 173 | - * The template file contains the HTML code and processing instructions |
|
| 174 | - * to generate the result shown in the body of the frontend. The |
|
| 175 | - * configuration string is the path to the template file relative |
|
| 176 | - * to the templates directory (usually 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 HTML page body |
|
| 186 | - * @since 2019.07 |
|
| 187 | - * @category Developer |
|
| 188 | - * @see client/html/account/profile/account/template-header |
|
| 189 | - */ |
|
| 190 | - $tplconf = 'client/html/account/profile/account/template-body'; |
|
| 191 | - $default = 'account/profile/account-body-standard'; |
|
| 170 | + /** client/html/account/profile/account/template-body |
|
| 171 | + * Relative path to the HTML body template of the account profile account client. |
|
| 172 | + * |
|
| 173 | + * The template file contains the HTML code and processing instructions |
|
| 174 | + * to generate the result shown in the body of the frontend. The |
|
| 175 | + * configuration string is the path to the template file relative |
|
| 176 | + * to the templates directory (usually 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 HTML page body |
|
| 186 | + * @since 2019.07 |
|
| 187 | + * @category Developer |
|
| 188 | + * @see client/html/account/profile/account/template-header |
|
| 189 | + */ |
|
| 190 | + $tplconf = 'client/html/account/profile/account/template-body'; |
|
| 191 | + $default = 'account/profile/account-body-standard'; |
|
| 192 | 192 | |
| 193 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
| 194 | - } |
|
| 193 | + return $view->render( $view->config( $tplconf, $default ) ); |
|
| 194 | + } |
|
| 195 | 195 | |
| 196 | - /** |
|
| 197 | - * Processes the input, e.g. store given values. |
|
| 198 | - * |
|
| 199 | - * A view must be available and this method doesn't generate any output |
|
| 200 | - * besides setting view variables if necessary. |
|
| 201 | - * @throws \Aimeos\Client\Html\Exception|\Aimeos\Controller\Frontend\Exception |
|
| 202 | - */ |
|
| 203 | - public function process() |
|
| 204 | - { |
|
| 205 | - $view = $this->getView(); |
|
| 196 | + /** |
|
| 197 | + * Processes the input, e.g. store given values. |
|
| 198 | + * |
|
| 199 | + * A view must be available and this method doesn't generate any output |
|
| 200 | + * besides setting view variables if necessary. |
|
| 201 | + * @throws \Aimeos\Client\Html\Exception|\Aimeos\Controller\Frontend\Exception |
|
| 202 | + */ |
|
| 203 | + public function process() |
|
| 204 | + { |
|
| 205 | + $view = $this->getView(); |
|
| 206 | 206 | |
| 207 | - if( !$view->param( 'account/save' , false) ) { |
|
| 208 | - parent::process(); |
|
| 209 | - return; |
|
| 210 | - } |
|
| 207 | + if( !$view->param( 'account/save' , false) ) { |
|
| 208 | + parent::process(); |
|
| 209 | + return; |
|
| 210 | + } |
|
| 211 | 211 | |
| 212 | - /** @var \Aimeos\Controller\Frontend\Customer\Standard $cntl */ |
|
| 213 | - $cntl = \Aimeos\Controller\Frontend::create( $this->getContext(), 'customer' ); |
|
| 214 | - $oldPassword = $cntl->get()->getPassword(); |
|
| 215 | - $values = $view->param('account', []); |
|
| 212 | + /** @var \Aimeos\Controller\Frontend\Customer\Standard $cntl */ |
|
| 213 | + $cntl = \Aimeos\Controller\Frontend::create( $this->getContext(), 'customer' ); |
|
| 214 | + $oldPassword = $cntl->get()->getPassword(); |
|
| 215 | + $values = $view->param('account', []); |
|
| 216 | 216 | |
| 217 | - $isNew = $values['customer.newpassword'] !== $values['customer.oldpassword']; |
|
| 218 | - $confirmed = $values['customer.newpassword'] === $values['customer.confirmnewpassword']; |
|
| 217 | + $isNew = $values['customer.newpassword'] !== $values['customer.oldpassword']; |
|
| 218 | + $confirmed = $values['customer.newpassword'] === $values['customer.confirmnewpassword']; |
|
| 219 | 219 | |
| 220 | - $errors = []; |
|
| 220 | + $errors = []; |
|
| 221 | 221 | |
| 222 | - $isValid = true; |
|
| 223 | - try { |
|
| 224 | - Validator::make([ |
|
| 225 | - 'password' => $values['customer.newpassword'], |
|
| 226 | - 'password_confirmation' => $values['customer.confirmnewpassword'] |
|
| 227 | - ], [ |
|
| 228 | - 'password' => ['required', 'string', new Password, 'confirmed'] |
|
| 229 | - ])->validate(); |
|
| 230 | - } catch (\Exception $ex) { |
|
| 231 | - $isValid = false; |
|
| 232 | - $errors['passwordRules'] = "The password does not meet the password requirements!"; |
|
| 233 | - } |
|
| 222 | + $isValid = true; |
|
| 223 | + try { |
|
| 224 | + Validator::make([ |
|
| 225 | + 'password' => $values['customer.newpassword'], |
|
| 226 | + 'password_confirmation' => $values['customer.confirmnewpassword'] |
|
| 227 | + ], [ |
|
| 228 | + 'password' => ['required', 'string', new Password, 'confirmed'] |
|
| 229 | + ])->validate(); |
|
| 230 | + } catch (\Exception $ex) { |
|
| 231 | + $isValid = false; |
|
| 232 | + $errors['passwordRules'] = "The password does not meet the password requirements!"; |
|
| 233 | + } |
|
| 234 | 234 | |
| 235 | - if ($isValid) { |
|
| 236 | - /** is the password realy new? */ |
|
| 237 | - if (!$isNew) { |
|
| 238 | - $errors['isNew'] = "The given password is not new!"; |
|
| 239 | - } |
|
| 235 | + if ($isValid) { |
|
| 236 | + /** is the password realy new? */ |
|
| 237 | + if (!$isNew) { |
|
| 238 | + $errors['isNew'] = "The given password is not new!"; |
|
| 239 | + } |
|
| 240 | 240 | |
| 241 | - /** does the confirm password is the same? */ |
|
| 242 | - if (!$confirmed) { |
|
| 243 | - $errors["confirm"] = "New passwords doesnt match!"; |
|
| 244 | - } |
|
| 241 | + /** does the confirm password is the same? */ |
|
| 242 | + if (!$confirmed) { |
|
| 243 | + $errors["confirm"] = "New passwords doesnt match!"; |
|
| 244 | + } |
|
| 245 | 245 | |
| 246 | - $cntl = $cntl->add($values); |
|
| 246 | + $cntl = $cntl->add($values); |
|
| 247 | 247 | |
| 248 | - } |
|
| 249 | - /** if the pasword is new and confirmed, but is not changed, the given old password must be wrong */ |
|
| 250 | - if ($isValid && $isNew && $confirmed && $oldPassword === $cntl->get()->getPassword() ) { |
|
| 251 | - $errors['oldPassword'] = "Wrong password!"; |
|
| 252 | - } |
|
| 248 | + } |
|
| 249 | + /** if the pasword is new and confirmed, but is not changed, the given old password must be wrong */ |
|
| 250 | + if ($isValid && $isNew && $confirmed && $oldPassword === $cntl->get()->getPassword() ) { |
|
| 251 | + $errors['oldPassword'] = "Wrong password!"; |
|
| 252 | + } |
|
| 253 | 253 | |
| 254 | - $view->passwordChanged = count(array_keys($errors)) === 0; |
|
| 254 | + $view->passwordChanged = count(array_keys($errors)) === 0; |
|
| 255 | 255 | |
| 256 | - if (count(array_keys($errors)) > 0) { |
|
| 257 | - $view->passwordErrors = $errors; |
|
| 258 | - } else { |
|
| 259 | - $cntl->store(); |
|
| 260 | - } |
|
| 256 | + if (count(array_keys($errors)) > 0) { |
|
| 257 | + $view->passwordErrors = $errors; |
|
| 258 | + } else { |
|
| 259 | + $cntl->store(); |
|
| 260 | + } |
|
| 261 | 261 | |
| 262 | - parent::process(); |
|
| 263 | - } |
|
| 262 | + parent::process(); |
|
| 263 | + } |
|
| 264 | 264 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * @return string HTML code |
| 158 | 158 | * @throws \Aimeos\MW\View\Exception|\Aimeos\Client\Html\Exception |
| 159 | 159 | */ |
| 160 | - public function getBody(string $uid = ''): string |
|
| 160 | + public function getBody( string $uid = '' ): string |
|
| 161 | 161 | { |
| 162 | 162 | $view = $this->getView(); |
| 163 | 163 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | { |
| 205 | 205 | $view = $this->getView(); |
| 206 | 206 | |
| 207 | - if( !$view->param( 'account/save' , false) ) { |
|
| 207 | + if( !$view->param( 'account/save', false ) ) { |
|
| 208 | 208 | parent::process(); |
| 209 | 209 | return; |
| 210 | 210 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | /** @var \Aimeos\Controller\Frontend\Customer\Standard $cntl */ |
| 213 | 213 | $cntl = \Aimeos\Controller\Frontend::create( $this->getContext(), 'customer' ); |
| 214 | 214 | $oldPassword = $cntl->get()->getPassword(); |
| 215 | - $values = $view->param('account', []); |
|
| 215 | + $values = $view->param( 'account', [] ); |
|
| 216 | 216 | |
| 217 | 217 | $isNew = $values['customer.newpassword'] !== $values['customer.oldpassword']; |
| 218 | 218 | $confirmed = $values['customer.newpassword'] === $values['customer.confirmnewpassword']; |
@@ -221,39 +221,39 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | $isValid = true; |
| 223 | 223 | try { |
| 224 | - Validator::make([ |
|
| 224 | + Validator::make( [ |
|
| 225 | 225 | 'password' => $values['customer.newpassword'], |
| 226 | 226 | 'password_confirmation' => $values['customer.confirmnewpassword'] |
| 227 | 227 | ], [ |
| 228 | 228 | 'password' => ['required', 'string', new Password, 'confirmed'] |
| 229 | - ])->validate(); |
|
| 230 | - } catch (\Exception $ex) { |
|
| 229 | + ] )->validate(); |
|
| 230 | + } catch( \Exception $ex ) { |
|
| 231 | 231 | $isValid = false; |
| 232 | 232 | $errors['passwordRules'] = "The password does not meet the password requirements!"; |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | - if ($isValid) { |
|
| 235 | + if( $isValid ) { |
|
| 236 | 236 | /** is the password realy new? */ |
| 237 | - if (!$isNew) { |
|
| 237 | + if( !$isNew ) { |
|
| 238 | 238 | $errors['isNew'] = "The given password is not new!"; |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** does the confirm password is the same? */ |
| 242 | - if (!$confirmed) { |
|
| 242 | + if( !$confirmed ) { |
|
| 243 | 243 | $errors["confirm"] = "New passwords doesnt match!"; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - $cntl = $cntl->add($values); |
|
| 246 | + $cntl = $cntl->add( $values ); |
|
| 247 | 247 | |
| 248 | 248 | } |
| 249 | 249 | /** if the pasword is new and confirmed, but is not changed, the given old password must be wrong */ |
| 250 | - if ($isValid && $isNew && $confirmed && $oldPassword === $cntl->get()->getPassword() ) { |
|
| 250 | + if( $isValid && $isNew && $confirmed && $oldPassword === $cntl->get()->getPassword() ) { |
|
| 251 | 251 | $errors['oldPassword'] = "Wrong password!"; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | - $view->passwordChanged = count(array_keys($errors)) === 0; |
|
| 254 | + $view->passwordChanged = count( array_keys( $errors ) ) === 0; |
|
| 255 | 255 | |
| 256 | - if (count(array_keys($errors)) > 0) { |
|
| 256 | + if( count( array_keys( $errors ) ) > 0 ) { |
|
| 257 | 257 | $view->passwordErrors = $errors; |
| 258 | 258 | } else { |
| 259 | 259 | $cntl->store(); |