@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | * @param \Aimeos\Shop\Base\Locale $locale Locale object |
| 54 | 54 | * @param \Aimeos\Shop\Base\View $view View object |
| 55 | 55 | */ |
| 56 | - public function __construct( \Illuminate\Contracts\Config\Repository $config, |
|
| 56 | + public function __construct(\Illuminate\Contracts\Config\Repository $config, |
|
| 57 | 57 | \Aimeos\Shop\Base\Aimeos $aimeos, \Aimeos\Shop\Base\Context $context, |
| 58 | - \Aimeos\Shop\Base\Locale $locale, \Aimeos\Shop\Base\View $view ) |
|
| 58 | + \Aimeos\Shop\Base\Locale $locale, \Aimeos\Shop\Base\View $view) |
|
| 59 | 59 | { |
| 60 | 60 | $this->config = $config; |
| 61 | 61 | $this->aimeos = $aimeos; |
@@ -71,21 +71,21 @@ discard block |
||
| 71 | 71 | * @param string $pageName Name of the configured page |
| 72 | 72 | * @return array Associative list with body and header output separated by client name |
| 73 | 73 | */ |
| 74 | - public function getSections( $pageName ) |
|
| 74 | + public function getSections($pageName) |
|
| 75 | 75 | { |
| 76 | 76 | $context = $this->context->get(); |
| 77 | 77 | $langid = $context->getLocale()->getLanguageId(); |
| 78 | - $tmplPaths = $this->aimeos->get()->getCustomPaths( 'client/html/templates' ); |
|
| 79 | - $view = $this->view->create( $context, $tmplPaths, $langid ); |
|
| 80 | - $context->setView( $view ); |
|
| 78 | + $tmplPaths = $this->aimeos->get()->getCustomPaths('client/html/templates'); |
|
| 79 | + $view = $this->view->create($context, $tmplPaths, $langid); |
|
| 80 | + $context->setView($view); |
|
| 81 | 81 | |
| 82 | - $result = array( 'aibody' => array(), 'aiheader' => array() ); |
|
| 83 | - $page = $context->getConfig()->get( 'page/' . $pageName, array() ); |
|
| 82 | + $result = array('aibody' => array(), 'aiheader' => array()); |
|
| 83 | + $page = $context->getConfig()->get('page/'.$pageName, array()); |
|
| 84 | 84 | |
| 85 | - foreach( (array) $page as $clientName ) |
|
| 85 | + foreach ((array) $page as $clientName) |
|
| 86 | 86 | { |
| 87 | - $client = \Aimeos\Client\Html\Factory::createClient( $context, $clientName ); |
|
| 88 | - $client->setView( clone $view ); |
|
| 87 | + $client = \Aimeos\Client\Html\Factory::createClient($context, $clientName); |
|
| 88 | + $client->setView(clone $view); |
|
| 89 | 89 | $client->process(); |
| 90 | 90 | |
| 91 | 91 | $result['aibody'][$clientName] = $client->getBody(); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function indexAction() |
| 31 | 31 | { |
| 32 | - $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'account-index' ); |
|
| 32 | + $params = app('\Aimeos\Shop\Base\Page')->getSections('account-index'); |
|
| 33 | 33 | return Response::view('shop::account.index', $params); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -41,17 +41,17 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function downloadAction() |
| 43 | 43 | { |
| 44 | - $context = app( '\Aimeos\Shop\Base\Context' )->get(); |
|
| 44 | + $context = app('\Aimeos\Shop\Base\Context')->get(); |
|
| 45 | 45 | $langid = $context->getLocale()->getLanguageId(); |
| 46 | 46 | |
| 47 | - $view = app( '\Aimeos\Shop\Base\View' )->create( $context, array(), $langid ); |
|
| 48 | - $context->setView( $view ); |
|
| 47 | + $view = app('\Aimeos\Shop\Base\View')->create($context, array(), $langid); |
|
| 48 | + $context->setView($view); |
|
| 49 | 49 | |
| 50 | - $client = \Aimeos\Client\Html\Factory::createClient( $context, 'account/download' ); |
|
| 51 | - $client->setView( $view ); |
|
| 50 | + $client = \Aimeos\Client\Html\Factory::createClient($context, 'account/download'); |
|
| 51 | + $client->setView($view); |
|
| 52 | 52 | $client->process(); |
| 53 | 53 | |
| 54 | 54 | $response = $view->response(); |
| 55 | - return Response::make( (string) $response->getBody(), $response->getStatusCode(), $response->getHeaders() ); |
|
| 55 | + return Response::make((string) $response->getBody(), $response->getStatusCode(), $response->getHeaders()); |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | \ No newline at end of file |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 32 | 32 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 33 | 33 | */ |
| 34 | - public function deleteAction( ServerRequestInterface $request ) |
|
| 34 | + public function deleteAction(ServerRequestInterface $request) |
|
| 35 | 35 | { |
| 36 | - return $this->createClient()->delete( $request, new Response() ); |
|
| 36 | + return $this->createClient()->delete($request, new Response()); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 44 | 44 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 45 | 45 | */ |
| 46 | - public function getAction( ServerRequestInterface $request ) |
|
| 46 | + public function getAction(ServerRequestInterface $request) |
|
| 47 | 47 | { |
| 48 | - return $this->createClient()->get( $request, new Response() ); |
|
| 48 | + return $this->createClient()->get($request, new Response()); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
@@ -55,9 +55,9 @@ discard block |
||
| 55 | 55 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 56 | 56 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 57 | 57 | */ |
| 58 | - public function patchAction( ServerRequestInterface $request ) |
|
| 58 | + public function patchAction(ServerRequestInterface $request) |
|
| 59 | 59 | { |
| 60 | - return $this->createClient()->patch( $request, new Response() ); |
|
| 60 | + return $this->createClient()->patch($request, new Response()); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
@@ -67,9 +67,9 @@ discard block |
||
| 67 | 67 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 68 | 68 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 69 | 69 | */ |
| 70 | - public function postAction( ServerRequestInterface $request ) |
|
| 70 | + public function postAction(ServerRequestInterface $request) |
|
| 71 | 71 | { |
| 72 | - return $this->createClient()->post( $request, new Response() ); |
|
| 72 | + return $this->createClient()->post($request, new Response()); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
@@ -79,9 +79,9 @@ discard block |
||
| 79 | 79 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 80 | 80 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 81 | 81 | */ |
| 82 | - public function putAction( ServerRequestInterface $request ) |
|
| 82 | + public function putAction(ServerRequestInterface $request) |
|
| 83 | 83 | { |
| 84 | - return $this->createClient()->put( $request, new Response() ); |
|
| 84 | + return $this->createClient()->put($request, new Response()); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
@@ -91,9 +91,9 @@ discard block |
||
| 91 | 91 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 92 | 92 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 93 | 93 | */ |
| 94 | - public function optionsAction( ServerRequestInterface $request ) |
|
| 94 | + public function optionsAction(ServerRequestInterface $request) |
|
| 95 | 95 | { |
| 96 | - return $this->createClient()->options( $request, new Response() ); |
|
| 96 | + return $this->createClient()->options($request, new Response()); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
@@ -104,17 +104,17 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | protected function createClient() |
| 106 | 106 | { |
| 107 | - $resource = Route::input( 'resource' ); |
|
| 108 | - $related = Route::input( 'related', Input::get( 'related' ) ); |
|
| 107 | + $resource = Route::input('resource'); |
|
| 108 | + $related = Route::input('related', Input::get('related')); |
|
| 109 | 109 | |
| 110 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 111 | - $tmplPaths = $aimeos->getCustomPaths( 'client/jsonapi/templates' ); |
|
| 110 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 111 | + $tmplPaths = $aimeos->getCustomPaths('client/jsonapi/templates'); |
|
| 112 | 112 | |
| 113 | - $context = app( '\Aimeos\Shop\Base\Context' )->get(); |
|
| 113 | + $context = app('\Aimeos\Shop\Base\Context')->get(); |
|
| 114 | 114 | $langid = $context->getLocale()->getLanguageId(); |
| 115 | 115 | |
| 116 | - $context->setView( app( '\Aimeos\Shop\Base\View' )->create( $context, $tmplPaths, $langid ) ); |
|
| 116 | + $context->setView(app('\Aimeos\Shop\Base\View')->create($context, $tmplPaths, $langid)); |
|
| 117 | 117 | |
| 118 | - return \Aimeos\Client\JsonApi\Factory::createClient( $context, $resource . '/' . $related ); |
|
| 118 | + return \Aimeos\Client\JsonApi\Factory::createClient($context, $resource.'/'.$related); |
|
| 119 | 119 | } |
| 120 | 120 | } |
@@ -36,13 +36,13 @@ discard block |
||
| 36 | 36 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 37 | 37 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 38 | 38 | */ |
| 39 | - public function deleteAction( ServerRequestInterface $request ) |
|
| 39 | + public function deleteAction(ServerRequestInterface $request) |
|
| 40 | 40 | { |
| 41 | - if( config( 'shop.authorize', true ) ) { |
|
| 42 | - $this->authorize( 'admin', [JsonadmController::class, ['admin', 'api', 'super']] ); |
|
| 41 | + if (config('shop.authorize', true)) { |
|
| 42 | + $this->authorize('admin', [JsonadmController::class, ['admin', 'api', 'super']]); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - return $this->createClient()->delete( $request, new Response() ); |
|
| 45 | + return $this->createClient()->delete($request, new Response()); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
@@ -52,13 +52,13 @@ discard block |
||
| 52 | 52 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 53 | 53 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 54 | 54 | */ |
| 55 | - public function getAction( ServerRequestInterface $request ) |
|
| 55 | + public function getAction(ServerRequestInterface $request) |
|
| 56 | 56 | { |
| 57 | - if( config( 'shop.authorize', true ) ) { |
|
| 58 | - $this->authorize( 'admin', [JsonadmController::class, ['admin', 'api', 'editor', 'super']] ); |
|
| 57 | + if (config('shop.authorize', true)) { |
|
| 58 | + $this->authorize('admin', [JsonadmController::class, ['admin', 'api', 'editor', 'super']]); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - return $this->createClient()->get( $request, new Response() ); |
|
| 61 | + return $this->createClient()->get($request, new Response()); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
@@ -68,13 +68,13 @@ discard block |
||
| 68 | 68 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 69 | 69 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 70 | 70 | */ |
| 71 | - public function patchAction( ServerRequestInterface $request ) |
|
| 71 | + public function patchAction(ServerRequestInterface $request) |
|
| 72 | 72 | { |
| 73 | - if( config( 'shop.authorize', true ) ) { |
|
| 74 | - $this->authorize( 'admin', [JsonadmController::class, ['admin', 'api', 'super']] ); |
|
| 73 | + if (config('shop.authorize', true)) { |
|
| 74 | + $this->authorize('admin', [JsonadmController::class, ['admin', 'api', 'super']]); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - return $this->createClient()->patch( $request, new Response() ); |
|
| 77 | + return $this->createClient()->patch($request, new Response()); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
@@ -84,13 +84,13 @@ discard block |
||
| 84 | 84 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 85 | 85 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 86 | 86 | */ |
| 87 | - public function postAction( ServerRequestInterface $request ) |
|
| 87 | + public function postAction(ServerRequestInterface $request) |
|
| 88 | 88 | { |
| 89 | - if( config( 'shop.authorize', true ) ) { |
|
| 90 | - $this->authorize( 'admin', [JsonadmController::class, ['admin', 'api', 'super']] ); |
|
| 89 | + if (config('shop.authorize', true)) { |
|
| 90 | + $this->authorize('admin', [JsonadmController::class, ['admin', 'api', 'super']]); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - return $this->createClient()->post( $request, new Response() ); |
|
| 93 | + return $this->createClient()->post($request, new Response()); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
@@ -100,13 +100,13 @@ discard block |
||
| 100 | 100 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 101 | 101 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 102 | 102 | */ |
| 103 | - public function putAction( ServerRequestInterface $request ) |
|
| 103 | + public function putAction(ServerRequestInterface $request) |
|
| 104 | 104 | { |
| 105 | - if( config( 'shop.authorize', true ) ) { |
|
| 106 | - $this->authorize( 'admin', [JsonadmController::class, ['admin', 'api', 'super']] ); |
|
| 105 | + if (config('shop.authorize', true)) { |
|
| 106 | + $this->authorize('admin', [JsonadmController::class, ['admin', 'api', 'super']]); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - return $this->createClient()->put( $request, new Response() ); |
|
| 109 | + return $this->createClient()->put($request, new Response()); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | |
@@ -116,13 +116,13 @@ discard block |
||
| 116 | 116 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 117 | 117 | * @return \Psr\Http\Message\ResponseInterface Response object containing the generated output |
| 118 | 118 | */ |
| 119 | - public function optionsAction( ServerRequestInterface $request ) |
|
| 119 | + public function optionsAction(ServerRequestInterface $request) |
|
| 120 | 120 | { |
| 121 | - if( config( 'shop.authorize', true ) ) { |
|
| 122 | - $this->authorize( 'admin', [JsonadmController::class, ['admin', 'api', 'editor', 'super']] ); |
|
| 121 | + if (config('shop.authorize', true)) { |
|
| 122 | + $this->authorize('admin', [JsonadmController::class, ['admin', 'api', 'editor', 'super']]); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - return $this->createClient()->options( $request, new Response() ); |
|
| 125 | + return $this->createClient()->options($request, new Response()); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
@@ -133,18 +133,18 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | protected function createClient() |
| 135 | 135 | { |
| 136 | - $site = Route::input( 'site', Input::get( 'site', 'default' ) ); |
|
| 137 | - $lang = Input::get( 'locale', config( 'app.locale', 'en' ) ); |
|
| 138 | - $resource = Route::input( 'resource' ); |
|
| 136 | + $site = Route::input('site', Input::get('site', 'default')); |
|
| 137 | + $lang = Input::get('locale', config('app.locale', 'en')); |
|
| 138 | + $resource = Route::input('resource'); |
|
| 139 | 139 | |
| 140 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 141 | - $templatePaths = $aimeos->getCustomPaths( 'admin/jsonadm/templates' ); |
|
| 140 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 141 | + $templatePaths = $aimeos->getCustomPaths('admin/jsonadm/templates'); |
|
| 142 | 142 | |
| 143 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false, 'backend' ); |
|
| 144 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang, 'en' ) ) ); |
|
| 145 | - $context->setLocale( app('\Aimeos\Shop\Base\Locale')->getBackend( $context, $site ) ); |
|
| 146 | - $context->setView( app( '\Aimeos\Shop\Base\View' )->create( $context, $templatePaths, $lang ) ); |
|
| 143 | + $context = app('\Aimeos\Shop\Base\Context')->get(false, 'backend'); |
|
| 144 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang, 'en'))); |
|
| 145 | + $context->setLocale(app('\Aimeos\Shop\Base\Locale')->getBackend($context, $site)); |
|
| 146 | + $context->setView(app('\Aimeos\Shop\Base\View')->create($context, $templatePaths, $lang)); |
|
| 147 | 147 | |
| 148 | - return \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $aimeos, $resource ); |
|
| 148 | + return \Aimeos\Admin\JsonAdm\Factory::createClient($context, $aimeos, $resource); |
|
| 149 | 149 | } |
| 150 | 150 | } |