1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0 |
5
|
|
|
* @copyright Aimeos (aimeos.org), 2018-2025 |
6
|
|
|
* @package Client |
7
|
|
|
* @subpackage Html |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
|
11
|
|
|
namespace Aimeos\Client\Html\Catalog\Attribute; |
12
|
|
|
|
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Default implementation of catalog attribute HTML client |
16
|
|
|
* |
17
|
|
|
* @package Client |
18
|
|
|
* @subpackage Html |
19
|
|
|
*/ |
20
|
|
|
class Standard |
21
|
|
|
extends \Aimeos\Client\Html\Catalog\Filter\Standard |
22
|
|
|
implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
23
|
|
|
{ |
24
|
|
|
/** client/html/catalog/attribute/name |
25
|
|
|
* Class name of the used catalog attribute client implementation |
26
|
|
|
* |
27
|
|
|
* Each default HTML client can be replace by an alternative imlementation. |
28
|
|
|
* To use this implementation, you have to set the last part of the class |
29
|
|
|
* name as configuration value so the client factory knows which class it |
30
|
|
|
* has to instantiate. |
31
|
|
|
* |
32
|
|
|
* For example, if the name of the default class is |
33
|
|
|
* |
34
|
|
|
* \Aimeos\Client\Html\Catalog\Attribute\Standard |
35
|
|
|
* |
36
|
|
|
* and you want to replace it with your own version named |
37
|
|
|
* |
38
|
|
|
* \Aimeos\Client\Html\Catalog\Attribute\Myattribute |
39
|
|
|
* |
40
|
|
|
* then you have to set the this configuration option: |
41
|
|
|
* |
42
|
|
|
* client/html/catalog/attribute/name = Myattribute |
43
|
|
|
* |
44
|
|
|
* The value is the last part of your own class name and it's case sensitive, |
45
|
|
|
* so take care that the configuration value is exactly named like the last |
46
|
|
|
* part of the class name. |
47
|
|
|
* |
48
|
|
|
* The allowed characters of the class name are A-Z, a-z and 0-9. No other |
49
|
|
|
* characters are possible! You should always start the last part of the class |
50
|
|
|
* name with an upper case character and continue only with lower case characters |
51
|
|
|
* or numbers. Avoid chamel case names like "MyAttribute"! |
52
|
|
|
* |
53
|
|
|
* @param string Last part of the class name |
54
|
|
|
* @since 2018.04 |
55
|
|
|
*/ |
56
|
|
|
|
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Returns the HTML string for insertion into the header. |
60
|
|
|
* |
61
|
|
|
* @param string $uid Unique identifier for the output if the content is placed more than once on the same page |
62
|
|
|
* @return string|null String including HTML tags for the header on error |
63
|
|
|
*/ |
64
|
|
|
public function header( string $uid = '' ) : ?string |
65
|
|
|
{ |
66
|
|
|
return null; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Returns the names of the subpart clients |
72
|
|
|
* |
73
|
|
|
* @return array List of client names |
74
|
|
|
*/ |
75
|
|
|
protected function getSubClientNames() : array |
76
|
|
|
{ |
77
|
|
|
return ['attribute']; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
|
81
|
|
|
/** client/html/catalog/attribute/decorators/excludes |
82
|
|
|
* Excludes decorators added by the "common" option from the catalog attribute html client |
83
|
|
|
* |
84
|
|
|
* Decorators extend the functionality of a class by adding new aspects |
85
|
|
|
* (e.g. log what is currently done), executing the methods of the underlying |
86
|
|
|
* class only in certain conditions (e.g. only for logged in users) or |
87
|
|
|
* modify what is returned to the caller. |
88
|
|
|
* |
89
|
|
|
* This option allows you to remove a decorator added via |
90
|
|
|
* "client/html/common/decorators/default" before they are wrapped |
91
|
|
|
* around the html client. |
92
|
|
|
* |
93
|
|
|
* client/html/catalog/attribute/decorators/excludes = array( 'decorator1' ) |
94
|
|
|
* |
95
|
|
|
* This would remove the decorator named "decorator1" from the list of |
96
|
|
|
* common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
97
|
|
|
* "client/html/common/decorators/default" to the html client. |
98
|
|
|
* |
99
|
|
|
* @param array List of decorator names |
100
|
|
|
* @see client/html/common/decorators/default |
101
|
|
|
* @see client/html/catalog/attribute/decorators/global |
102
|
|
|
* @see client/html/catalog/attribute/decorators/local |
103
|
|
|
*/ |
104
|
|
|
|
105
|
|
|
/** client/html/catalog/attribute/decorators/global |
106
|
|
|
* Adds a list of globally available decorators only to the catalog attribute html client |
107
|
|
|
* |
108
|
|
|
* Decorators extend the functionality of a class by adding new aspects |
109
|
|
|
* (e.g. log what is currently done), executing the methods of the underlying |
110
|
|
|
* class only in certain conditions (e.g. only for logged in users) or |
111
|
|
|
* modify what is returned to the caller. |
112
|
|
|
* |
113
|
|
|
* This option allows you to wrap global decorators |
114
|
|
|
* ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
115
|
|
|
* |
116
|
|
|
* client/html/catalog/attribute/decorators/global = array( 'decorator1' ) |
117
|
|
|
* |
118
|
|
|
* This would add the decorator named "decorator1" defined by |
119
|
|
|
* "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
120
|
|
|
* |
121
|
|
|
* @param array List of decorator names |
122
|
|
|
* @see client/html/common/decorators/default |
123
|
|
|
* @see client/html/catalog/attribute/decorators/excludes |
124
|
|
|
* @see client/html/catalog/attribute/decorators/local |
125
|
|
|
*/ |
126
|
|
|
|
127
|
|
|
/** client/html/catalog/attribute/decorators/local |
128
|
|
|
* Adds a list of local decorators only to the catalog attribute html client |
129
|
|
|
* |
130
|
|
|
* Decorators extend the functionality of a class by adding new aspects |
131
|
|
|
* (e.g. log what is currently done), executing the methods of the underlying |
132
|
|
|
* class only in certain conditions (e.g. only for logged in users) or |
133
|
|
|
* modify what is returned to the caller. |
134
|
|
|
* |
135
|
|
|
* This option allows you to wrap local decorators |
136
|
|
|
* ("\Aimeos\Client\Html\Catalog\Decorator\*") around the html client. |
137
|
|
|
* |
138
|
|
|
* client/html/catalog/attribute/decorators/local = array( 'decorator2' ) |
139
|
|
|
* |
140
|
|
|
* This would add the decorator named "decorator2" defined by |
141
|
|
|
* "\Aimeos\Client\Html\Catalog\Decorator\Decorator2" only to the html client. |
142
|
|
|
* |
143
|
|
|
* @param array List of decorator names |
144
|
|
|
* @see client/html/common/decorators/default |
145
|
|
|
* @see client/html/catalog/attribute/decorators/excludes |
146
|
|
|
* @see client/html/catalog/attribute/decorators/global |
147
|
|
|
*/ |
148
|
|
|
} |
149
|
|
|
|