1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @license LGPLv3, http://www.gnu.org/copyleft/lgpl.html |
5
|
|
|
* @copyright Aimeos (aimeos.org), 2015-2016 |
6
|
|
|
* @package flow |
7
|
|
|
* @subpackage Controller |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
|
11
|
|
|
namespace Aimeos\Shop\Controller; |
12
|
|
|
|
13
|
|
|
use Neos\Flow\Annotations as Flow; |
14
|
|
|
|
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Aimeos catalog controller. |
18
|
|
|
* @package flow |
19
|
|
|
* @subpackage Controller |
20
|
|
|
*/ |
21
|
|
|
class CatalogController extends AbstractController |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* Returns the output of the catalog count component |
25
|
|
|
* |
26
|
|
|
* @return string Rendered HTML for the body |
27
|
|
|
*/ |
28
|
|
|
public function countComponentAction() |
29
|
|
|
{ |
30
|
|
|
$this->view->assign( 'output', $this->getOutput( 'catalog/count' ) ); |
31
|
|
|
$this->response->setHeader( 'Content-Type', 'application/javascript' ); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Returns the output of the catalog detail component |
37
|
|
|
* |
38
|
|
|
* @return string Rendered HTML for the body |
39
|
|
|
*/ |
40
|
|
|
public function detailComponentAction() |
41
|
|
|
{ |
42
|
|
|
$this->view->assign( 'output', $this->getOutput( 'catalog/detail' ) ); |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* Returns the output of the catalog filter component |
48
|
|
|
* |
49
|
|
|
* @return string Rendered HTML for the body |
50
|
|
|
*/ |
51
|
|
|
public function filterComponentAction() |
52
|
|
|
{ |
53
|
|
|
$this->view->assign( 'output', $this->getOutput( 'catalog/filter' ) ); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Returns the output of the catalog list component |
59
|
|
|
* |
60
|
|
|
* @return string Rendered HTML for the body |
61
|
|
|
*/ |
62
|
|
|
public function listComponentAction() |
63
|
|
|
{ |
64
|
|
|
$this->view->assign( 'output', $this->getOutput( 'catalog/lists' ) ); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Returns the output of the catalog session component |
70
|
|
|
* |
71
|
|
|
* @return string Rendered HTML for the body |
72
|
|
|
*/ |
73
|
|
|
public function sessionComponentAction() |
74
|
|
|
{ |
75
|
|
|
$this->view->assign( 'output', $this->getOutput( 'catalog/session' ) ); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Returns the output of the catalog stage component |
81
|
|
|
* |
82
|
|
|
* @return string Rendered HTML for the body |
83
|
|
|
*/ |
84
|
|
|
public function stageComponentAction() |
85
|
|
|
{ |
86
|
|
|
$this->view->assign( 'output', $this->getOutput( 'catalog/stage' ) ); |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* Returns the output of the catalog stock component |
92
|
|
|
* |
93
|
|
|
* @return string Rendered HTML for the body |
94
|
|
|
*/ |
95
|
|
|
public function stockComponentAction() |
96
|
|
|
{ |
97
|
|
|
$this->view->assign( 'output', $this->getOutput( 'catalog/stock' ) ); |
98
|
|
|
$this->response->setHeader( 'Content-Type', 'application/javascript' ); |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* Returns the output of the catalog suggest component |
104
|
|
|
* |
105
|
|
|
* @return string Rendered HTML for the body |
106
|
|
|
*/ |
107
|
|
|
public function suggestComponentAction() |
108
|
|
|
{ |
109
|
|
|
$this->view->assign( 'output', $this->getOutput( 'catalog/suggest' ) ); |
110
|
|
|
$this->response->setHeader( 'Content-Type', 'application/json' ); |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* Renders the catalog counts. |
116
|
|
|
*/ |
117
|
|
|
public function countAction() |
118
|
|
|
{ |
119
|
|
|
$this->view->assignMultiple( $this->get( 'catalog-count' ) ); |
120
|
|
|
$this->response->setHeader( 'Content-Type', 'application/javascript' ); |
121
|
|
|
$this->response->setHeader( 'Cache-Control', 'max-age=300' ); |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* Content for catalog detail page |
127
|
|
|
* |
128
|
|
|
* @Flow\Session(autoStart = TRUE) |
129
|
|
|
*/ |
130
|
|
|
public function detailAction() |
131
|
|
|
{ |
132
|
|
|
$this->view->assignMultiple( $this->get( 'catalog-detail' ) ); |
133
|
|
|
$this->response->setHeader( 'Cache-Control', 'max-age=10' ); |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* Content for catalog list page |
139
|
|
|
* |
140
|
|
|
* @Flow\Session(autoStart = TRUE) |
141
|
|
|
*/ |
142
|
|
|
public function listAction() |
143
|
|
|
{ |
144
|
|
|
$this->view->assignMultiple( $this->get( 'catalog-list' ) ); |
145
|
|
|
$this->response->setHeader( 'Cache-Control', 'max-age=10' ); |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* Renders the catalog stock section. |
151
|
|
|
*/ |
152
|
|
|
public function stockAction() |
153
|
|
|
{ |
154
|
|
|
$this->view->assignMultiple( $this->get( 'catalog-stock' ) ); |
155
|
|
|
$this->response->setHeader( 'Content-Type', 'application/javascript' ); |
156
|
|
|
$this->response->setHeader( 'Cache-Control', 'max-age=30' ); |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* Renders a list of product names in JSON format. |
162
|
|
|
*/ |
163
|
|
|
public function suggestAction() |
164
|
|
|
{ |
165
|
|
|
$this->view->assignMultiple( $this->get( 'catalog-suggest' ) ); |
166
|
|
|
$this->response->setHeader( 'Content-Type', 'application/json' ); |
167
|
|
|
$this->response->setHeader( 'Cache-Control', 'max-age=300' ); |
168
|
|
|
} |
169
|
|
|
|
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* Content for catalog tree page |
173
|
|
|
* |
174
|
|
|
* @Flow\Session(autoStart = TRUE) |
175
|
|
|
*/ |
176
|
|
|
public function treeAction() |
177
|
|
|
{ |
178
|
|
|
$this->view->assignMultiple( $this->get( 'catalog-tree' ) ); |
179
|
|
|
$this->response->setHeader( 'Cache-Control', 'max-age=10' ); |
180
|
|
|
} |
181
|
|
|
} |
182
|
|
|
|