@@ -22,19 +22,19 @@ |
||
22 | 22 | * @param string|array $sites Unique site codes |
23 | 23 | * @return \Aimeos\MShop\Locale\Item\Site\Iface[] List of site items |
24 | 24 | */ |
25 | - protected function getSiteItems( \Aimeos\MShop\Context\Item\Iface $context, $sites ) |
|
25 | + protected function getSiteItems(\Aimeos\MShop\Context\Item\Iface $context, $sites) |
|
26 | 26 | { |
27 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' ); |
|
27 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site'); |
|
28 | 28 | $search = $manager->createSearch(); |
29 | 29 | |
30 | - if( is_scalar( $sites ) && $sites != '' ) { |
|
31 | - $sites = explode( ' ', $sites ); |
|
30 | + if (is_scalar($sites) && $sites != '') { |
|
31 | + $sites = explode(' ', $sites); |
|
32 | 32 | } |
33 | 33 | |
34 | - if( !empty( $sites ) ) { |
|
35 | - $search->setConditions( $search->compare( '==', 'locale.site.code', $sites ) ); |
|
34 | + if (!empty($sites)) { |
|
35 | + $search->setConditions($search->compare('==', 'locale.site.code', $sites)); |
|
36 | 36 | } |
37 | 37 | |
38 | - return $manager->searchItems( $search ); |
|
38 | + return $manager->searchItems($search); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | \ No newline at end of file |
@@ -35,24 +35,24 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function fire() |
37 | 37 | { |
38 | - $context = $this->getLaravel()->make( 'Aimeos\Shop\Base\Context' )->get( false ); |
|
39 | - $context->setEditor( 'aimeos:cache' ); |
|
38 | + $context = $this->getLaravel()->make('Aimeos\Shop\Base\Context')->get(false); |
|
39 | + $context->setEditor('aimeos:cache'); |
|
40 | 40 | |
41 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
41 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
42 | 42 | |
43 | - foreach( $this->getSiteItems( $context, $this->argument( 'site' ) ) as $siteItem ) |
|
43 | + foreach ($this->getSiteItems($context, $this->argument('site')) as $siteItem) |
|
44 | 44 | { |
45 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false ); |
|
45 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false); |
|
46 | 46 | |
47 | 47 | $lcontext = clone $context; |
48 | - $lcontext->setLocale( $localeItem ); |
|
48 | + $lcontext->setLocale($localeItem); |
|
49 | 49 | |
50 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $lcontext ); |
|
51 | - $lcontext->setCache( $cache ); |
|
50 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($lcontext); |
|
51 | + $lcontext->setCache($cache); |
|
52 | 52 | |
53 | - $this->info( sprintf( 'Clearing the Aimeos cache for site "%1$s"', $siteItem->getCode() ) ); |
|
53 | + $this->info(sprintf('Clearing the Aimeos cache for site "%1$s"', $siteItem->getCode())); |
|
54 | 54 | |
55 | - \Aimeos\MAdmin\Cache\Manager\Factory::createManager( $lcontext )->getCache()->flush(); |
|
55 | + \Aimeos\MAdmin\Cache\Manager\Factory::createManager($lcontext)->getCache()->flush(); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | protected function getArguments() |
66 | 66 | { |
67 | 67 | return array( |
68 | - array( 'site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)' ), |
|
68 | + array('site', InputArgument::OPTIONAL, 'Site codes to clear the cache like "default unittest" (none for all)'), |
|
69 | 69 | ); |
70 | 70 | } |
71 | 71 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | */ |
29 | 29 | public function indexAction() |
30 | 30 | { |
31 | - $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'basket-index' ); |
|
31 | + $params = app('\Aimeos\Shop\Base\Page')->getSections('basket-index'); |
|
32 | 32 | return \View::make('shop::basket.index', $params); |
33 | 33 | } |
34 | 34 | } |
35 | 35 | \ No newline at end of file |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function countAction() |
30 | 30 | { |
31 | - $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'catalog-count' ); |
|
31 | + $params = app('\Aimeos\Shop\Base\Page')->getSections('catalog-count'); |
|
32 | 32 | $contents = \View::make('shop::catalog.count', $params); |
33 | 33 | |
34 | 34 | $response = \Response::make($contents, 200); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function detailAction() |
47 | 47 | { |
48 | - $params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-detail' ); |
|
48 | + $params = app('Aimeos\Shop\Base\Page')->getSections('catalog-detail'); |
|
49 | 49 | return \View::make('shop::catalog.detail', $params); |
50 | 50 | } |
51 | 51 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function listAction() |
59 | 59 | { |
60 | - $params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-list' ); |
|
60 | + $params = app('Aimeos\Shop\Base\Page')->getSections('catalog-list'); |
|
61 | 61 | return \View::make('shop::catalog.list', $params); |
62 | 62 | } |
63 | 63 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function stockAction() |
71 | 71 | { |
72 | - $params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-stock' ); |
|
72 | + $params = app('Aimeos\Shop\Base\Page')->getSections('catalog-stock'); |
|
73 | 73 | $contents = \View::make('shop::catalog.stock', $params); |
74 | 74 | |
75 | 75 | $response = \Response::make($contents, 200); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function suggestAction() |
88 | 88 | { |
89 | - $params = app( 'Aimeos\Shop\Base\Page' )->getSections( 'catalog-suggest' ); |
|
89 | + $params = app('Aimeos\Shop\Base\Page')->getSections('catalog-suggest'); |
|
90 | 90 | $contents = \View::make('shop::catalog.suggest', $params); |
91 | 91 | |
92 | 92 | $response = \Response::make($contents, 200); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function confirmAction() |
30 | 30 | { |
31 | - $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'checkout-confirm' ); |
|
31 | + $params = app('\Aimeos\Shop\Base\Page')->getSections('checkout-confirm'); |
|
32 | 32 | return \View::make('shop::checkout.confirm', $params); |
33 | 33 | } |
34 | 34 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function indexAction() |
42 | 42 | { |
43 | - $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'checkout-index' ); |
|
43 | + $params = app('\Aimeos\Shop\Base\Page')->getSections('checkout-index'); |
|
44 | 44 | return \View::make('shop::checkout.index', $params); |
45 | 45 | } |
46 | 46 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function updateAction() |
54 | 54 | { |
55 | - $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'checkout-update' ); |
|
55 | + $params = app('\Aimeos\Shop\Base\Page')->getSections('checkout-update'); |
|
56 | 56 | return \View::make('shop::checkout.update', $params); |
57 | 57 | } |
58 | 58 | } |
59 | 59 | \ No newline at end of file |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | * @param \Aimeos\Shop\Base\Context $context Context object |
48 | 48 | * @param \Aimeos\Shop\Base\View $view View object |
49 | 49 | */ |
50 | - public function __construct( \Illuminate\Contracts\Config\Repository $config, |
|
51 | - \Aimeos\Shop\Base\Aimeos $aimeos, \Aimeos\Shop\Base\Context $context, \Aimeos\Shop\Base\View $view ) |
|
50 | + public function __construct(\Illuminate\Contracts\Config\Repository $config, |
|
51 | + \Aimeos\Shop\Base\Aimeos $aimeos, \Aimeos\Shop\Base\Context $context, \Aimeos\Shop\Base\View $view) |
|
52 | 52 | { |
53 | 53 | $this->config = $config; |
54 | 54 | $this->aimeos = $aimeos; |
@@ -63,23 +63,23 @@ discard block |
||
63 | 63 | * @param string $pageName Name of the configured page |
64 | 64 | * @return array Associative list with body and header output separated by client name |
65 | 65 | */ |
66 | - public function getSections( $pageName ) |
|
66 | + public function getSections($pageName) |
|
67 | 67 | { |
68 | 68 | $context = $this->context->get(); |
69 | 69 | $langid = $context->getLocale()->getLanguageId(); |
70 | - $tmplPaths = $this->aimeos->get()->getCustomPaths( 'client/html/templates' ); |
|
71 | - $view = $this->view->create( $context->getConfig(), $tmplPaths, $langid ); |
|
72 | - $context->setView( $view ); |
|
70 | + $tmplPaths = $this->aimeos->get()->getCustomPaths('client/html/templates'); |
|
71 | + $view = $this->view->create($context->getConfig(), $tmplPaths, $langid); |
|
72 | + $context->setView($view); |
|
73 | 73 | |
74 | - $pagesConfig = $this->config->get( 'shop.page', array() ); |
|
75 | - $result = array( 'aibody' => array(), 'aiheader' => array() ); |
|
74 | + $pagesConfig = $this->config->get('shop.page', array()); |
|
75 | + $result = array('aibody' => array(), 'aiheader' => array()); |
|
76 | 76 | |
77 | - if( isset( $pagesConfig[$pageName] ) ) |
|
77 | + if (isset($pagesConfig[$pageName])) |
|
78 | 78 | { |
79 | - foreach( (array) $pagesConfig[$pageName] as $clientName ) |
|
79 | + foreach ((array) $pagesConfig[$pageName] as $clientName) |
|
80 | 80 | { |
81 | - $client = \Aimeos\Client\Html\Factory::createClient( $context, $tmplPaths, $clientName ); |
|
82 | - $client->setView( clone $view ); |
|
81 | + $client = \Aimeos\Client\Html\Factory::createClient($context, $tmplPaths, $clientName); |
|
82 | + $client->setView(clone $view); |
|
83 | 83 | $client->process(); |
84 | 84 | |
85 | 85 | $result['aibody'][$clientName] = $client->getBody(); |
@@ -135,7 +135,7 @@ |
||
135 | 135 | * Creates a list of all available translations. |
136 | 136 | * |
137 | 137 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
138 | - * @return array List of language IDs with labels |
|
138 | + * @return string List of language IDs with labels |
|
139 | 139 | */ |
140 | 140 | protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context ) |
141 | 141 | { |
@@ -34,64 +34,64 @@ discard block |
||
34 | 34 | * @param \Illuminate\Http\Request $request Laravel request object |
35 | 35 | * @return \Illuminate\Contracts\View\View View for rendering the output |
36 | 36 | */ |
37 | - public function indexAction( Request $request ) |
|
37 | + public function indexAction(Request $request) |
|
38 | 38 | { |
39 | - if( config( 'shop.authorize', true ) ) { |
|
40 | - $this->authorize( 'admin', [['admin']] ); |
|
39 | + if (config('shop.authorize', true)) { |
|
40 | + $this->authorize('admin', [['admin']]); |
|
41 | 41 | } |
42 | 42 | |
43 | - $site = Route::input( 'site', Input::get( 'site', 'default' ) ); |
|
44 | - $lang = Route::input( 'lang', Input::get( 'lang', config( 'app.locale', 'en' ) ) ); |
|
45 | - $tab = Route::input( 'tab', Input::get( 'tab', 0 ) ); |
|
43 | + $site = Route::input('site', Input::get('site', 'default')); |
|
44 | + $lang = Route::input('lang', Input::get('lang', config('app.locale', 'en'))); |
|
45 | + $tab = Route::input('tab', Input::get('tab', 0)); |
|
46 | 46 | |
47 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' ); |
|
47 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos'); |
|
48 | 48 | |
49 | 49 | $bootstrap = $aimeos->get(); |
50 | - $cntlPaths = $bootstrap->getCustomPaths( 'controller/extjs' ); |
|
50 | + $cntlPaths = $bootstrap->getCustomPaths('controller/extjs'); |
|
51 | 51 | |
52 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
53 | - $context = $this->setLocale( $context, $site ); |
|
52 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
53 | + $context = $this->setLocale($context, $site); |
|
54 | 54 | |
55 | - $controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths ); |
|
55 | + $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); |
|
56 | 56 | $cssFiles = array(); |
57 | 57 | |
58 | - foreach( $bootstrap->getCustomPaths( 'admin/extjs' ) as $base => $paths ) |
|
58 | + foreach ($bootstrap->getCustomPaths('admin/extjs') as $base => $paths) |
|
59 | 59 | { |
60 | - foreach( $paths as $path ) |
|
60 | + foreach ($paths as $path) |
|
61 | 61 | { |
62 | - $jsbAbsPath = $base . '/' . $path; |
|
62 | + $jsbAbsPath = $base.'/'.$path; |
|
63 | 63 | |
64 | - if( !is_file( $jsbAbsPath ) ) { |
|
65 | - throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) ); |
|
64 | + if (!is_file($jsbAbsPath)) { |
|
65 | + throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath)); |
|
66 | 66 | } |
67 | 67 | |
68 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) ); |
|
69 | - $cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) ); |
|
68 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path)); |
|
69 | + $cssFiles = array_merge($cssFiles, $jsb2->getUrls('css')); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | - $jqadmUrl = route( 'aimeos_shop_jqadm_search', array( 'site' => $site, 'resource' => 'product' ) ); |
|
74 | - $jsonUrl = route( 'aimeos_shop_extadm_json', array( 'site' => $site, '_token' => csrf_token() ) ); |
|
75 | - $adminUrl = route( 'aimeos_shop_extadm', array( 'site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>' ) ); |
|
73 | + $jqadmUrl = route('aimeos_shop_jqadm_search', array('site' => $site, 'resource' => 'product')); |
|
74 | + $jsonUrl = route('aimeos_shop_extadm_json', array('site' => $site, '_token' => csrf_token())); |
|
75 | + $adminUrl = route('aimeos_shop_extadm', array('site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>')); |
|
76 | 76 | |
77 | 77 | $vars = array( |
78 | 78 | 'lang' => $lang, |
79 | 79 | 'cssFiles' => $cssFiles, |
80 | - 'languages' => $this->getJsonLanguages( $context), |
|
81 | - 'config' => $this->getJsonClientConfig( $context ), |
|
82 | - 'site' => $this->getJsonSiteItem( $context, $site ), |
|
83 | - 'i18nContent' => $this->getJsonClientI18n( $bootstrap->getI18nPaths(), $lang ), |
|
80 | + 'languages' => $this->getJsonLanguages($context), |
|
81 | + 'config' => $this->getJsonClientConfig($context), |
|
82 | + 'site' => $this->getJsonSiteItem($context, $site), |
|
83 | + 'i18nContent' => $this->getJsonClientI18n($bootstrap->getI18nPaths(), $lang), |
|
84 | 84 | 'searchSchemas' => $controller->getJsonSearchSchemas(), |
85 | 85 | 'itemSchemas' => $controller->getJsonItemSchemas(), |
86 | - 'smd' => $controller->getJsonSmd( $jsonUrl ), |
|
87 | - 'urlTemplate' => str_replace( ['<', '>'], ['{', '}'], urldecode( $adminUrl ) ), |
|
88 | - 'uploaddir' => config( 'shop::uploaddir' ), |
|
86 | + 'smd' => $controller->getJsonSmd($jsonUrl), |
|
87 | + 'urlTemplate' => str_replace(['<', '>'], ['{', '}'], urldecode($adminUrl)), |
|
88 | + 'uploaddir' => config('shop::uploaddir'), |
|
89 | 89 | 'version' => $aimeos->getVersion(), |
90 | 90 | 'jqadmurl' => $jqadmUrl, |
91 | 91 | 'activeTab' => $tab, |
92 | 92 | ); |
93 | 93 | |
94 | - return View::make( 'shop::extadm.index', $vars ); |
|
94 | + return View::make('shop::extadm.index', $vars); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | |
@@ -101,23 +101,23 @@ discard block |
||
101 | 101 | * @param \Illuminate\Http\Request $request Laravel request object |
102 | 102 | * @return \Illuminate\Contracts\View\View View for rendering the output |
103 | 103 | */ |
104 | - public function doAction( Request $request ) |
|
104 | + public function doAction(Request $request) |
|
105 | 105 | { |
106 | - if( config( 'shop.authorize', true ) ) { |
|
107 | - $this->authorize( 'admin', [['admin']] ); |
|
106 | + if (config('shop.authorize', true)) { |
|
107 | + $this->authorize('admin', [['admin']]); |
|
108 | 108 | } |
109 | 109 | |
110 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
111 | - $cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' ); |
|
110 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
111 | + $cntlPaths = $aimeos->getCustomPaths('controller/extjs'); |
|
112 | 112 | |
113 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
114 | - $context->setView( app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), array() ) ); |
|
115 | - $context = $this->setLocale( $context ); |
|
113 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
114 | + $context->setView(app('\Aimeos\Shop\Base\View')->create($context->getConfig(), array())); |
|
115 | + $context = $this->setLocale($context); |
|
116 | 116 | |
117 | - $controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths ); |
|
117 | + $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); |
|
118 | 118 | |
119 | - $response = $controller->process( Input::instance()->request->all(), $request->getContent() ); |
|
120 | - return View::make( 'shop::extadm.do', array( 'output' => $response ) ); |
|
119 | + $response = $controller->process(Input::instance()->request->all(), $request->getContent()); |
|
120 | + return View::make('shop::extadm.do', array('output' => $response)); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | |
@@ -128,32 +128,32 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function fileAction() |
130 | 130 | { |
131 | - if( config( 'shop.authorize', true ) ) { |
|
132 | - $this->authorize( 'admin', [['admin']] ); |
|
131 | + if (config('shop.authorize', true)) { |
|
132 | + $this->authorize('admin', [['admin']]); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | $contents = ''; |
136 | 136 | $jsFiles = array(); |
137 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
137 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
138 | 138 | |
139 | - foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths ) |
|
139 | + foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths) |
|
140 | 140 | { |
141 | - foreach( $paths as $path ) |
|
141 | + foreach ($paths as $path) |
|
142 | 142 | { |
143 | - $jsbAbsPath = $base . '/' . $path; |
|
144 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) ); |
|
145 | - $jsFiles = array_merge( $jsFiles, $jsb2->getFiles( 'js' ) ); |
|
143 | + $jsbAbsPath = $base.'/'.$path; |
|
144 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath)); |
|
145 | + $jsFiles = array_merge($jsFiles, $jsb2->getFiles('js')); |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | |
149 | - foreach( $jsFiles as $file ) |
|
149 | + foreach ($jsFiles as $file) |
|
150 | 150 | { |
151 | - if( ( $content = file_get_contents( $file ) ) !== false ) { |
|
151 | + if (($content = file_get_contents($file)) !== false) { |
|
152 | 152 | $contents .= $content; |
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
156 | - return response( $contents )->header( 'Content-Type', 'application/javascript' ); |
|
156 | + return response($contents)->header('Content-Type', 'application/javascript'); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | |
@@ -163,15 +163,15 @@ discard block |
||
163 | 163 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
164 | 164 | * @return array List of language IDs with labels |
165 | 165 | */ |
166 | - protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context ) |
|
166 | + protected function getJsonLanguages(\Aimeos\MShop\Context\Item\Iface $context) |
|
167 | 167 | { |
168 | 168 | $result = array(); |
169 | 169 | |
170 | - foreach( app( '\Aimeos\Shop\Base\Aimeos' )->get()->getI18nList( 'admin' ) as $id ) { |
|
171 | - $result[] = array( 'id' => $id, 'label' => $id ); |
|
170 | + foreach (app('\Aimeos\Shop\Base\Aimeos')->get()->getI18nList('admin') as $id) { |
|
171 | + $result[] = array('id' => $id, 'label' => $id); |
|
172 | 172 | } |
173 | 173 | |
174 | - return json_encode( $result ); |
|
174 | + return json_encode($result); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | |
@@ -181,10 +181,10 @@ discard block |
||
181 | 181 | * @param \Aimeos\MShop\Context\Item\Iface $context Context item object |
182 | 182 | * @return string JSON encoded configuration object |
183 | 183 | */ |
184 | - protected function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context ) |
|
184 | + protected function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context) |
|
185 | 185 | { |
186 | - $config = $context->getConfig()->get( 'admin/extjs', array() ); |
|
187 | - return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT ); |
|
186 | + $config = $context->getConfig()->get('admin/extjs', array()); |
|
187 | + return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | |
@@ -195,16 +195,16 @@ discard block |
||
195 | 195 | * @param string $lang ISO language code like "en" or "en_GB" |
196 | 196 | * @return string JSON encoded translation object |
197 | 197 | */ |
198 | - protected function getJsonClientI18n( array $i18nPaths, $lang ) |
|
198 | + protected function getJsonClientI18n(array $i18nPaths, $lang) |
|
199 | 199 | { |
200 | - $i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $lang ); |
|
200 | + $i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $lang); |
|
201 | 201 | |
202 | 202 | $content = array( |
203 | - 'admin' => $i18n->getAll( 'admin' ), |
|
204 | - 'admin/ext' => $i18n->getAll( 'admin/ext' ), |
|
203 | + 'admin' => $i18n->getAll('admin'), |
|
204 | + 'admin/ext' => $i18n->getAll('admin/ext'), |
|
205 | 205 | ); |
206 | 206 | |
207 | - return json_encode( $content, JSON_FORCE_OBJECT ); |
|
207 | + return json_encode($content, JSON_FORCE_OBJECT); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | |
@@ -216,19 +216,19 @@ discard block |
||
216 | 216 | * @return string JSON encoded site item object |
217 | 217 | * @throws Exception If no site item was found for the code |
218 | 218 | */ |
219 | - protected function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site ) |
|
219 | + protected function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site) |
|
220 | 220 | { |
221 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' ); |
|
221 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site'); |
|
222 | 222 | |
223 | 223 | $criteria = $manager->createSearch(); |
224 | - $criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) ); |
|
225 | - $items = $manager->searchItems( $criteria ); |
|
224 | + $criteria->setConditions($criteria->compare('==', 'locale.site.code', $site)); |
|
225 | + $items = $manager->searchItems($criteria); |
|
226 | 226 | |
227 | - if( ( $item = reset( $items ) ) === false ) { |
|
228 | - throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) ); |
|
227 | + if (($item = reset($items)) === false) { |
|
228 | + throw new \Exception(sprintf('No site found for code "%1$s"', $site)); |
|
229 | 229 | } |
230 | 230 | |
231 | - return json_encode( $item->toArray() ); |
|
231 | + return json_encode($item->toArray()); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | |
@@ -240,22 +240,22 @@ discard block |
||
240 | 240 | * @param string $locale ISO language code, e.g. "en" or "en_GB" |
241 | 241 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
242 | 242 | */ |
243 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default' ) |
|
243 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default') |
|
244 | 244 | { |
245 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
245 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
246 | 246 | |
247 | 247 | try |
248 | 248 | { |
249 | - $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
|
250 | - $localeItem->setLanguageId( null ); |
|
251 | - $localeItem->setCurrencyId( null ); |
|
249 | + $localeItem = $localeManager->bootstrap($sitecode, '', '', false); |
|
250 | + $localeItem->setLanguageId(null); |
|
251 | + $localeItem->setCurrencyId(null); |
|
252 | 252 | } |
253 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
253 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
254 | 254 | { |
255 | 255 | $localeItem = $localeManager->createItem(); |
256 | 256 | } |
257 | 257 | |
258 | - $context->setLocale( $localeItem ); |
|
258 | + $context->setLocale($localeItem); |
|
259 | 259 | |
260 | 260 | return $context; |
261 | 261 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * |
35 | 35 | * @param \Illuminate\Contracts\Config\Repository $config Configuration object |
36 | 36 | */ |
37 | - public function __construct( \Illuminate\Contracts\Config\Repository $config ) |
|
37 | + public function __construct(\Illuminate\Contracts\Config\Repository $config) |
|
38 | 38 | { |
39 | 39 | $this->config = $config; |
40 | 40 | } |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function get() |
49 | 49 | { |
50 | - if( $this->object === null ) |
|
50 | + if ($this->object === null) |
|
51 | 51 | { |
52 | - $extDirs = (array) $this->config->get( 'shop.extdir', array() ); |
|
53 | - $this->object = new \Aimeos\Bootstrap( $extDirs, false ); |
|
52 | + $extDirs = (array) $this->config->get('shop.extdir', array()); |
|
53 | + $this->object = new \Aimeos\Bootstrap($extDirs, false); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | return $this->object; |
@@ -64,12 +64,12 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function getVersion() |
66 | 66 | { |
67 | - if( ( $content = @file_get_contents( base_path( 'composer.lock' ) ) ) !== false |
|
68 | - && ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] ) |
|
67 | + if (($content = @file_get_contents(base_path('composer.lock'))) !== false |
|
68 | + && ($content = json_decode($content, true)) !== null && isset($content['packages']) |
|
69 | 69 | ) { |
70 | - foreach( (array) $content['packages'] as $item ) |
|
70 | + foreach ((array) $content['packages'] as $item) |
|
71 | 71 | { |
72 | - if( $item['name'] === 'aimeos/aimeos-laravel' ) { |
|
72 | + if ($item['name'] === 'aimeos/aimeos-laravel') { |
|
73 | 73 | return $item['version']; |
74 | 74 | } |
75 | 75 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function indexAction() |
32 | 32 | { |
33 | - $params = app( '\Aimeos\Shop\Base\Page' )->getSections( 'account-index' ); |
|
33 | + $params = app('\Aimeos\Shop\Base\Page')->getSections('account-index'); |
|
34 | 34 | return View::make('shop::account.index', $params); |
35 | 35 | } |
36 | 36 | |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function downloadAction() |
44 | 44 | { |
45 | - $context = app( '\Aimeos\Shop\Base\Context' )->get(); |
|
45 | + $context = app('\Aimeos\Shop\Base\Context')->get(); |
|
46 | 46 | $langid = $context->getLocale()->getLanguageId(); |
47 | 47 | |
48 | - $view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), array(), $langid ); |
|
49 | - $context->setView( $view ); |
|
48 | + $view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), array(), $langid); |
|
49 | + $context->setView($view); |
|
50 | 50 | |
51 | - $client = \Aimeos\Client\Html\Factory::createClient( $context, array(), 'account/download' ); |
|
52 | - $client->setView( $view ); |
|
51 | + $client = \Aimeos\Client\Html\Factory::createClient($context, array(), 'account/download'); |
|
52 | + $client->setView($view); |
|
53 | 53 | $client->process(); |
54 | 54 | |
55 | 55 | $response = $view->response(); |
56 | - return Response::make( (string) $response->getBody(), $response->getStatusCode(), $response->getHeaders() ); |
|
56 | + return Response::make((string) $response->getBody(), $response->getStatusCode(), $response->getHeaders()); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | \ No newline at end of file |