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\Tree; |
12
|
|
|
|
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* Default implementation of catalog tree 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/tree/name |
25
|
|
|
* Class name of the used catalog tree 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\Tree\Standard |
35
|
|
|
* |
36
|
|
|
* and you want to replace it with your own version named |
37
|
|
|
* |
38
|
|
|
* \Aimeos\Client\Html\Catalog\Tree\Mytree |
39
|
|
|
* |
40
|
|
|
* then you have to set the this configuration option: |
41
|
|
|
* |
42
|
|
|
* client/html/catalog/tree/name = Mytree |
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 "MyTree"! |
52
|
|
|
* |
53
|
|
|
* @param string Last part of the class name |
54
|
|
|
* @since 2018.04 |
55
|
|
|
*/ |
56
|
|
|
|
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Returns the names of the subpart clients |
60
|
|
|
* |
61
|
|
|
* @return array List of client names |
62
|
|
|
*/ |
63
|
|
|
protected function getSubClientNames() : array |
64
|
|
|
{ |
65
|
|
|
return ['tree']; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** client/html/catalog/tree/decorators/excludes |
69
|
|
|
* Excludes decorators added by the "common" option from the catalog tree html client |
70
|
|
|
* |
71
|
|
|
* Decorators extend the functionality of a class by adding new aspects |
72
|
|
|
* (e.g. log what is currently done), executing the methods of the underlying |
73
|
|
|
* class only in certain conditions (e.g. only for logged in users) or |
74
|
|
|
* modify what is returned to the caller. |
75
|
|
|
* |
76
|
|
|
* This option allows you to remove a decorator added via |
77
|
|
|
* "client/html/common/decorators/default" before they are wrapped |
78
|
|
|
* around the html client. |
79
|
|
|
* |
80
|
|
|
* client/html/catalog/tree/decorators/excludes = array( 'decorator1' ) |
81
|
|
|
* |
82
|
|
|
* This would remove the decorator named "decorator1" from the list of |
83
|
|
|
* common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via |
84
|
|
|
* "client/html/common/decorators/default" to the html client. |
85
|
|
|
* |
86
|
|
|
* @param array List of decorator names |
87
|
|
|
* @see client/html/common/decorators/default |
88
|
|
|
* @see client/html/catalog/tree/decorators/global |
89
|
|
|
* @see client/html/catalog/tree/decorators/local |
90
|
|
|
*/ |
91
|
|
|
|
92
|
|
|
/** client/html/catalog/tree/decorators/global |
93
|
|
|
* Adds a list of globally available decorators only to the catalog tree html client |
94
|
|
|
* |
95
|
|
|
* Decorators extend the functionality of a class by adding new aspects |
96
|
|
|
* (e.g. log what is currently done), executing the methods of the underlying |
97
|
|
|
* class only in certain conditions (e.g. only for logged in users) or |
98
|
|
|
* modify what is returned to the caller. |
99
|
|
|
* |
100
|
|
|
* This option allows you to wrap global decorators |
101
|
|
|
* ("\Aimeos\Client\Html\Common\Decorator\*") around the html client. |
102
|
|
|
* |
103
|
|
|
* client/html/catalog/tree/decorators/global = array( 'decorator1' ) |
104
|
|
|
* |
105
|
|
|
* This would add the decorator named "decorator1" defined by |
106
|
|
|
* "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client. |
107
|
|
|
* |
108
|
|
|
* @param array List of decorator names |
109
|
|
|
* @see client/html/common/decorators/default |
110
|
|
|
* @see client/html/catalog/tree/decorators/excludes |
111
|
|
|
* @see client/html/catalog/tree/decorators/local |
112
|
|
|
*/ |
113
|
|
|
|
114
|
|
|
/** client/html/catalog/tree/decorators/local |
115
|
|
|
* Adds a list of local decorators only to the catalog tree html client |
116
|
|
|
* |
117
|
|
|
* Decorators extend the functionality of a class by adding new aspects |
118
|
|
|
* (e.g. log what is currently done), executing the methods of the underlying |
119
|
|
|
* class only in certain conditions (e.g. only for logged in users) or |
120
|
|
|
* modify what is returned to the caller. |
121
|
|
|
* |
122
|
|
|
* This option allows you to wrap local decorators |
123
|
|
|
* ("\Aimeos\Client\Html\Catalog\Decorator\*") around the html client. |
124
|
|
|
* |
125
|
|
|
* client/html/catalog/tree/decorators/local = array( 'decorator2' ) |
126
|
|
|
* |
127
|
|
|
* This would add the decorator named "decorator2" defined by |
128
|
|
|
* "\Aimeos\Client\Html\Catalog\Decorator\Decorator2" only to the html client. |
129
|
|
|
* |
130
|
|
|
* @param array List of decorator names |
131
|
|
|
* @see client/html/common/decorators/default |
132
|
|
|
* @see client/html/catalog/tree/decorators/excludes |
133
|
|
|
* @see client/html/catalog/tree/decorators/global |
134
|
|
|
*/ |
135
|
|
|
} |
136
|
|
|
|