@@ -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 | { |
@@ -36,18 +36,18 @@ |
||
36 | 36 | * @param \Illuminate\Http\Request $request Laravel request object |
37 | 37 | * @return \Illuminate\Contracts\View\View View for rendering the output |
38 | 38 | */ |
39 | - public function indexAction( Request $request ) |
|
39 | + public function indexAction(Request $request) |
|
40 | 40 | { |
41 | - $site = Route::input( 'site', Input::get( 'site', 'default' ) ); |
|
42 | - $lang = Route::input( 'lang', Input::get( 'lang', config( 'app.locale', 'en' ) ) ); |
|
41 | + $site = Route::input('site', Input::get('site', 'default')); |
|
42 | + $lang = Route::input('lang', Input::get('lang', config('app.locale', 'en'))); |
|
43 | 43 | |
44 | - if( config( 'shop.authorize', true ) && ( Auth::check() === false |
|
45 | - || $request->user()->can( 'admin', ['admin', 'editor'] ) ) === false |
|
44 | + if (config('shop.authorize', true) && (Auth::check() === false |
|
45 | + || $request->user()->can('admin', ['admin', 'editor'])) === false |
|
46 | 46 | ) { |
47 | - return View::make( 'shop::admin.index' ); |
|
47 | + return View::make('shop::admin.index'); |
|
48 | 48 | } |
49 | 49 | |
50 | - $param = array( 'resource' => 'product', 'site' => $site, 'lang' => $lang, ); |
|
51 | - return redirect()->route( 'aimeos_shop_jqadm_search', $param ); |
|
50 | + $param = array('resource' => 'product', 'site' => $site, 'lang' => $lang,); |
|
51 | + return redirect()->route('aimeos_shop_jqadm_search', $param); |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | \ No newline at end of file |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @param \Aimeos\Shop\Base\Context $context Context provider |
31 | 31 | */ |
32 | - public function __construct( \Aimeos\Shop\Base\Context $context, $site ) |
|
32 | + public function __construct(\Aimeos\Shop\Base\Context $context, $site) |
|
33 | 33 | { |
34 | - $this->context = $context->get( false ); |
|
35 | - $this->context = $this->setLocale( $this->context, $site ); |
|
34 | + $this->context = $context->get(false); |
|
35 | + $this->context = $this->setLocale($this->context, $site); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -43,21 +43,21 @@ discard block |
||
43 | 43 | * @param string|array $groupcodes Unique user/customer group codes that are allowed |
44 | 44 | * @return boolean True if user is part of the group, false if not |
45 | 45 | */ |
46 | - public function checkGroup( $userid, $groupcodes ) |
|
46 | + public function checkGroup($userid, $groupcodes) |
|
47 | 47 | { |
48 | - $groupItems = $this->getGroups( (array) $groupcodes ); |
|
49 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer/lists' ); |
|
48 | + $groupItems = $this->getGroups((array) $groupcodes); |
|
49 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer/lists'); |
|
50 | 50 | |
51 | 51 | $search = $manager->createSearch(); |
52 | 52 | $expr = array( |
53 | - $search->compare( '==', 'customer.lists.parentid', $userid ), |
|
54 | - $search->compare( '==', 'customer.lists.refid', array_keys( $groupItems ) ), |
|
55 | - $search->compare( '==', 'customer.lists.domain', 'customer/group' ), |
|
53 | + $search->compare('==', 'customer.lists.parentid', $userid), |
|
54 | + $search->compare('==', 'customer.lists.refid', array_keys($groupItems)), |
|
55 | + $search->compare('==', 'customer.lists.domain', 'customer/group'), |
|
56 | 56 | ); |
57 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
58 | - $search->setSlice( 0, 1 ); |
|
57 | + $search->setConditions($search->combine('&&', $expr)); |
|
58 | + $search->setSlice(0, 1); |
|
59 | 59 | |
60 | - return (bool) count( $manager->searchItems( $search ) ); |
|
60 | + return (bool) count($manager->searchItems($search)); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
@@ -67,14 +67,14 @@ discard block |
||
67 | 67 | * @param array $codes List of group codes |
68 | 68 | * @return array Associative list of group IDs as keys and \Aimeos\MShop\Customer\Item\Group\Iface as values |
69 | 69 | */ |
70 | - protected function getGroups( array $codes ) |
|
70 | + protected function getGroups(array $codes) |
|
71 | 71 | { |
72 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer/group' ); |
|
72 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer/group'); |
|
73 | 73 | |
74 | 74 | $search = $manager->createSearch(); |
75 | - $search->setConditions( $search->compare( '==', 'customer.group.code', $codes ) ); |
|
75 | + $search->setConditions($search->compare('==', 'customer.group.code', $codes)); |
|
76 | 76 | |
77 | - return $manager->searchItems( $search ); |
|
77 | + return $manager->searchItems($search); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | |
@@ -85,22 +85,22 @@ discard block |
||
85 | 85 | * @param string Unique site code |
86 | 86 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
87 | 87 | */ |
88 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $site ) |
|
88 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $site) |
|
89 | 89 | { |
90 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
90 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
91 | 91 | |
92 | 92 | try |
93 | 93 | { |
94 | - $localeItem = $localeManager->bootstrap( $site, '', '', false ); |
|
95 | - $localeItem->setLanguageId( null ); |
|
96 | - $localeItem->setCurrencyId( null ); |
|
94 | + $localeItem = $localeManager->bootstrap($site, '', '', false); |
|
95 | + $localeItem->setLanguageId(null); |
|
96 | + $localeItem->setCurrencyId(null); |
|
97 | 97 | } |
98 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
98 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
99 | 99 | { |
100 | 100 | $localeItem = $localeManager->createItem(); |
101 | 101 | } |
102 | 102 | |
103 | - $context->setLocale( $localeItem ); |
|
103 | + $context->setLocale($localeItem); |
|
104 | 104 | |
105 | 105 | return $context; |
106 | 106 | } |
@@ -97,7 +97,7 @@ |
||
97 | 97 | }); |
98 | 98 | |
99 | 99 | $this->app->singleton('\Aimeos\Shop\Base\Support', function($app) { |
100 | - $site = Route::input( 'site', Input::get( 'site', 'default' ) ); |
|
100 | + $site = Route::input('site', Input::get('site', 'default')); |
|
101 | 101 | return new \Aimeos\Shop\Base\Support($app['\Aimeos\Shop\Base\Context'], $site); |
102 | 102 | }); |
103 | 103 |