|
@@ -31,10 +31,10 @@ discard block |
|
|
block discarded – undo |
|
31
|
31
|
* @param string $site Unique site code |
|
32
|
32
|
* @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
|
33
|
33
|
*/ |
|
34
|
|
- public function deleteAction( ServerRequestInterface $request, $resource, $site = 'default' ) |
|
|
34
|
+ public function deleteAction(ServerRequestInterface $request, $resource, $site = 'default') |
|
35
|
35
|
{ |
|
36
|
|
- $client = $this->createClient( $site, $resource, $request->getAttribute( 'lang', 'en' ) ); |
|
37
|
|
- return $client->delete( $request, new Response() ); |
|
|
36
|
+ $client = $this->createClient($site, $resource, $request->getAttribute('lang', 'en')); |
|
|
37
|
+ return $client->delete($request, new Response()); |
|
38
|
38
|
} |
|
39
|
39
|
|
|
40
|
40
|
|
|
@@ -46,10 +46,10 @@ discard block |
|
|
block discarded – undo |
|
46
|
46
|
* @param string $site Unique site code |
|
47
|
47
|
* @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
|
48
|
48
|
*/ |
|
49
|
|
- public function getAction( ServerRequestInterface $request, $resource, $site = 'default' ) |
|
|
49
|
+ public function getAction(ServerRequestInterface $request, $resource, $site = 'default') |
|
50
|
50
|
{ |
|
51
|
|
- $client = $this->createClient( $site, $resource, $request->getAttribute( 'lang', 'en' ) ); |
|
52
|
|
- return $client->get( $request, new Response() ); |
|
|
51
|
+ $client = $this->createClient($site, $resource, $request->getAttribute('lang', 'en')); |
|
|
52
|
+ return $client->get($request, new Response()); |
|
53
|
53
|
} |
|
54
|
54
|
|
|
55
|
55
|
|
|
@@ -61,10 +61,10 @@ discard block |
|
|
block discarded – undo |
|
61
|
61
|
* @param string $site Unique site code |
|
62
|
62
|
* @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
|
63
|
63
|
*/ |
|
64
|
|
- public function patchAction( ServerRequestInterface $request, $resource, $site = 'default' ) |
|
|
64
|
+ public function patchAction(ServerRequestInterface $request, $resource, $site = 'default') |
|
65
|
65
|
{ |
|
66
|
|
- $client = $this->createClient( $site, $resource, $request->getAttribute( 'lang', 'en' ) ); |
|
67
|
|
- return $client->patch( $request, new Response() ); |
|
|
66
|
+ $client = $this->createClient($site, $resource, $request->getAttribute('lang', 'en')); |
|
|
67
|
+ return $client->patch($request, new Response()); |
|
68
|
68
|
} |
|
69
|
69
|
|
|
70
|
70
|
|
|
@@ -76,10 +76,10 @@ discard block |
|
|
block discarded – undo |
|
76
|
76
|
* @param string $site Unique site code |
|
77
|
77
|
* @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
|
78
|
78
|
*/ |
|
79
|
|
- public function postAction( ServerRequestInterface $request, $resource, $site = 'default' ) |
|
|
79
|
+ public function postAction(ServerRequestInterface $request, $resource, $site = 'default') |
|
80
|
80
|
{ |
|
81
|
|
- $client = $this->createClient( $site, $resource, $request->getAttribute( 'lang', 'en' ) ); |
|
82
|
|
- return $client->post( $request, new Response() ); |
|
|
81
|
+ $client = $this->createClient($site, $resource, $request->getAttribute('lang', 'en')); |
|
|
82
|
+ return $client->post($request, new Response()); |
|
83
|
83
|
} |
|
84
|
84
|
|
|
85
|
85
|
|
|
@@ -91,10 +91,10 @@ discard block |
|
|
block discarded – undo |
|
91
|
91
|
* @param string $site Unique site code |
|
92
|
92
|
* @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
|
93
|
93
|
*/ |
|
94
|
|
- public function putAction( ServerRequestInterface $request, $resource, $site = 'default' ) |
|
|
94
|
+ public function putAction(ServerRequestInterface $request, $resource, $site = 'default') |
|
95
|
95
|
{ |
|
96
|
|
- $client = $this->createClient( $site, $resource, $request->getAttribute( 'lang', 'en' ) ); |
|
97
|
|
- return $client->put( $request, new Response() ); |
|
|
96
|
+ $client = $this->createClient($site, $resource, $request->getAttribute('lang', 'en')); |
|
|
97
|
+ return $client->put($request, new Response()); |
|
98
|
98
|
} |
|
99
|
99
|
|
|
100
|
100
|
|
|
@@ -106,10 +106,10 @@ discard block |
|
|
block discarded – undo |
|
106
|
106
|
* @param string $site Unique site code |
|
107
|
107
|
* @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
|
108
|
108
|
*/ |
|
109
|
|
- public function optionsAction( ServerRequestInterface $request, $resource = '', $site = 'default' ) |
|
|
109
|
+ public function optionsAction(ServerRequestInterface $request, $resource = '', $site = 'default') |
|
110
|
110
|
{ |
|
111
|
|
- $client = $this->createClient( $site, $resource, $request->getAttribute( 'lang', 'en' ) ); |
|
112
|
|
- return $client->options( $request, new Response() ); |
|
|
111
|
+ $client = $this->createClient($site, $resource, $request->getAttribute('lang', 'en')); |
|
|
112
|
+ return $client->options($request, new Response()); |
|
113
|
113
|
} |
|
114
|
114
|
|
|
115
|
115
|
|
|
@@ -121,18 +121,18 @@ discard block |
|
|
block discarded – undo |
|
121
|
121
|
* @param string $lang Language code |
|
122
|
122
|
* @return \Aimeos\MShop\Context\Item\Iface Context item |
|
123
|
123
|
*/ |
|
124
|
|
- protected function createClient( $site, $resource, $lang ) |
|
|
124
|
+ protected function createClient($site, $resource, $lang) |
|
125
|
125
|
{ |
|
126
|
|
- $aimeos = $this->get( 'aimeos' )->get(); |
|
127
|
|
- $templatePaths = $aimeos->getCustomPaths( 'admin/jsonadm/templates' ); |
|
|
126
|
+ $aimeos = $this->get('aimeos')->get(); |
|
|
127
|
+ $templatePaths = $aimeos->getCustomPaths('admin/jsonadm/templates'); |
|
128
|
128
|
|
|
129
|
|
- $context = $this->get( 'aimeos_context' )->get( false, 'backend' ); |
|
130
|
|
- $context->setI18n( $this->get('aimeos_i18n')->get( array( $lang, 'en' ) ) ); |
|
131
|
|
- $context->setLocale( $this->get('aimeos_locale')->getBackend( $context, $site ) ); |
|
|
129
|
+ $context = $this->get('aimeos_context')->get(false, 'backend'); |
|
|
130
|
+ $context->setI18n($this->get('aimeos_i18n')->get(array($lang, 'en'))); |
|
|
131
|
+ $context->setLocale($this->get('aimeos_locale')->getBackend($context, $site)); |
|
132
|
132
|
|
|
133
|
|
- $view = $this->get('aimeos_view')->create( $context, $templatePaths, $lang ); |
|
134
|
|
- $context->setView( $view ); |
|
|
133
|
+ $view = $this->get('aimeos_view')->create($context, $templatePaths, $lang); |
|
|
134
|
+ $context->setView($view); |
|
135
|
135
|
|
|
136
|
|
- return \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $templatePaths, $resource ); |
|
|
136
|
+ return \Aimeos\Admin\JsonAdm\Factory::createClient($context, $templatePaths, $resource); |
|
137
|
137
|
} |
|
138
|
138
|
} |