@@ -36,20 +36,20 @@ |
||
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 | - if( config( 'shop.authorize', true ) && ( Auth::check() === false |
|
42 | - || $request->user()->can( 'admin', ['admin', 'editor'] ) ) === false |
|
41 | + if (config('shop.authorize', true) && (Auth::check() === false |
|
42 | + || $request->user()->can('admin', ['admin', 'editor'])) === false |
|
43 | 43 | ) { |
44 | - return View::make( 'shop::admin.index' ); |
|
44 | + return View::make('shop::admin.index'); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | $param = array( |
48 | 48 | 'resource' => 'product', |
49 | - 'site' => Route::input( 'site', 'default' ), |
|
50 | - 'lang' => Input::get( 'lang', config( 'app.locale', 'en' ) ), |
|
49 | + 'site' => Route::input('site', 'default'), |
|
50 | + 'lang' => Input::get('lang', config('app.locale', 'en')), |
|
51 | 51 | ); |
52 | 52 | |
53 | - return redirect()->route( 'aimeos_shop_jqadm_search', $param ); |
|
53 | + return redirect()->route('aimeos_shop_jqadm_search', $param); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | \ No newline at end of file |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @param \Aimeos\Shop\Base\Context $context Context object |
31 | 31 | */ |
32 | - public function __construct( \Aimeos\Shop\Base\Context $context ) |
|
32 | + public function __construct(\Aimeos\Shop\Base\Context $context) |
|
33 | 33 | { |
34 | 34 | $this->context = $context; |
35 | 35 | } |
@@ -42,21 +42,21 @@ discard block |
||
42 | 42 | * @param string|array $groupcodes Unique user/customer group codes that are allowed |
43 | 43 | * @return boolean True if user is part of the group, false if not |
44 | 44 | */ |
45 | - public function checkGroup( $userid, $groupcodes ) |
|
45 | + public function checkGroup($userid, $groupcodes) |
|
46 | 46 | { |
47 | - $groupItems = $this->getGroups( (array) $groupcodes ); |
|
48 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context->get(), 'customer/lists' ); |
|
47 | + $groupItems = $this->getGroups((array) $groupcodes); |
|
48 | + $manager = \Aimeos\MShop\Factory::createManager($this->context->get(), 'customer/lists'); |
|
49 | 49 | |
50 | 50 | $search = $manager->createSearch(); |
51 | 51 | $expr = array( |
52 | - $search->compare( '==', 'customer.lists.parentid', $userid ), |
|
53 | - $search->compare( '==', 'customer.lists.refid', array_keys( $groupItems ) ), |
|
54 | - $search->compare( '==', 'customer.lists.domain', 'customer/group' ), |
|
52 | + $search->compare('==', 'customer.lists.parentid', $userid), |
|
53 | + $search->compare('==', 'customer.lists.refid', array_keys($groupItems)), |
|
54 | + $search->compare('==', 'customer.lists.domain', 'customer/group'), |
|
55 | 55 | ); |
56 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
57 | - $search->setSlice( 0, 1 ); |
|
56 | + $search->setConditions($search->combine('&&', $expr)); |
|
57 | + $search->setSlice(0, 1); |
|
58 | 58 | |
59 | - return (bool) count( $manager->searchItems( $search ) ); |
|
59 | + return (bool) count($manager->searchItems($search)); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | * @param array $codes List of group codes |
67 | 67 | * @return array Associative list of group IDs as keys and \Aimeos\MShop\Customer\Item\Group\Iface as values |
68 | 68 | */ |
69 | - protected function getGroups( array $codes ) |
|
69 | + protected function getGroups(array $codes) |
|
70 | 70 | { |
71 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context->get(), 'customer/group' ); |
|
71 | + $manager = \Aimeos\MShop\Factory::createManager($this->context->get(), 'customer/group'); |
|
72 | 72 | |
73 | 73 | $search = $manager->createSearch(); |
74 | - $search->setConditions( $search->compare( '==', 'customer.group.code', $codes ) ); |
|
74 | + $search->setConditions($search->compare('==', 'customer.group.code', $codes)); |
|
75 | 75 | |
76 | - return $manager->searchItems( $search ); |
|
76 | + return $manager->searchItems($search); |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | \ No newline at end of file |