|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* @license MIT, http://opensource.org/licenses/MIT |
|
5
|
|
|
* @copyright Aimeos (aimeos.org), 2014-2016 |
|
6
|
|
|
* @package symfony |
|
7
|
|
|
* @subpackage Controller |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
|
|
11
|
|
|
namespace Aimeos\ShopBundle\Controller; |
|
12
|
|
|
|
|
13
|
|
|
use Symfony\Component\HttpFoundation\Response; |
|
14
|
|
|
|
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Aimeos controller for account related functionality. |
|
18
|
|
|
* |
|
19
|
|
|
* @package symfony |
|
20
|
|
|
* @subpackage Controller |
|
21
|
|
|
*/ |
|
22
|
|
|
class AccountController extends AbstractController |
|
23
|
|
|
{ |
|
24
|
|
|
/** |
|
25
|
|
|
* Returns the html for the "My account" page. |
|
26
|
|
|
* |
|
27
|
|
|
* @return Response Response object containing the generated output |
|
28
|
|
|
*/ |
|
29
|
|
|
public function indexAction() |
|
30
|
|
|
{ |
|
31
|
|
|
$params = $this->get( 'aimeos_page' )->getSections( 'account-index' ); |
|
32
|
|
|
return $this->render( 'AimeosShopBundle:Account:index.html.twig', $params ); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* Returns the html for the "My account" download page. |
|
38
|
|
|
* |
|
39
|
|
|
* @return Response Response object containing the generated output |
|
40
|
|
|
*/ |
|
41
|
|
|
public function downloadAction() |
|
42
|
|
|
{ |
|
43
|
|
|
$context = $this->container->get('aimeos_context')->get(); |
|
44
|
|
|
$langid = $context->getLocale()->getLanguageId(); |
|
45
|
|
|
|
|
46
|
|
|
$view = $this->container->get('aimeos_view')->create( $context, array(), $langid ); |
|
47
|
|
|
$context->setView( $view ); |
|
48
|
|
|
|
|
49
|
|
|
$client = \Aimeos\Client\Html\Factory::createClient( $context, array(), 'account/download' ); |
|
50
|
|
|
$client->setView( $view ); |
|
51
|
|
|
$client->process(); |
|
52
|
|
|
|
|
53
|
|
|
$response = $view->response(); |
|
54
|
|
|
return new Response( (string) $response->getBody(), $response->getStatusCode(), $response->getHeaders() ); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* Returns the output of the account favorite component |
|
60
|
|
|
* |
|
61
|
|
|
* @return Response Response object containing the generated output |
|
62
|
|
|
*/ |
|
63
|
|
|
public function favoriteComponentAction() |
|
64
|
|
|
{ |
|
65
|
|
|
return $this->getOutput( 'account/favorite' ); |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* Returns the output of the account history component |
|
71
|
|
|
* |
|
72
|
|
|
* @return Response Response object containing the generated output |
|
73
|
|
|
*/ |
|
74
|
|
|
public function historyComponentAction() |
|
75
|
|
|
{ |
|
76
|
|
|
return $this->getOutput( 'account/history' ); |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* Returns the output of the account watch component |
|
82
|
|
|
* |
|
83
|
|
|
* @return Response Response object containing the generated output |
|
84
|
|
|
*/ |
|
85
|
|
|
public function watchComponentAction() |
|
86
|
|
|
{ |
|
87
|
|
|
return $this->getOutput( 'account/watch' ); |
|
88
|
|
|
} |
|
89
|
|
|
} |
|
90
|
|
|
|