@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @param \Illuminate\Contracts\Config\Repository $config Configuration object |
51 | 51 | * @param \Illuminate\Session\Store $session Laravel session object |
52 | 52 | */ |
53 | - public function __construct( \Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session ) |
|
53 | + public function __construct(\Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session) |
|
54 | 54 | { |
55 | 55 | $this->config = $config; |
56 | 56 | $this->session = $session; |
@@ -63,51 +63,51 @@ discard block |
||
63 | 63 | * @param boolean $locale True to add locale object to context, false if not |
64 | 64 | * @return \Aimeos\MShop\Context\Item\Iface Context object |
65 | 65 | */ |
66 | - public function get( $locale = true ) |
|
66 | + public function get($locale = true) |
|
67 | 67 | { |
68 | - if( self::$context === null ) |
|
68 | + if (self::$context === null) |
|
69 | 69 | { |
70 | 70 | $context = new \Aimeos\MShop\Context\Item\Standard(); |
71 | 71 | |
72 | 72 | $config = $this->getConfig(); |
73 | - $context->setConfig( $config ); |
|
73 | + $context->setConfig($config); |
|
74 | 74 | |
75 | - $dbm = new \Aimeos\MW\DB\Manager\DBAL( $config ); |
|
76 | - $context->setDatabaseManager( $dbm ); |
|
75 | + $dbm = new \Aimeos\MW\DB\Manager\DBAL($config); |
|
76 | + $context->setDatabaseManager($dbm); |
|
77 | 77 | |
78 | - $fs = new \Aimeos\MW\Filesystem\Manager\Laravel( app( 'filesystem' ), $config, storage_path( 'aimeos' ) ); |
|
79 | - $context->setFilesystemManager( $fs ); |
|
78 | + $fs = new \Aimeos\MW\Filesystem\Manager\Laravel(app('filesystem'), $config, storage_path('aimeos')); |
|
79 | + $context->setFilesystemManager($fs); |
|
80 | 80 | |
81 | - $mq = new \Aimeos\MW\MQueue\Manager\Standard( $config ); |
|
82 | - $context->setMessageQueueManager( $mq ); |
|
81 | + $mq = new \Aimeos\MW\MQueue\Manager\Standard($config); |
|
82 | + $context->setMessageQueueManager($mq); |
|
83 | 83 | |
84 | - $mail = new \Aimeos\MW\Mail\Swift( function() { return app( 'mailer' )->getSwiftMailer(); } ); |
|
85 | - $context->setMail( $mail ); |
|
84 | + $mail = new \Aimeos\MW\Mail\Swift(function() { return app('mailer')->getSwiftMailer(); } ); |
|
85 | + $context->setMail($mail); |
|
86 | 86 | |
87 | - $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context ); |
|
88 | - $context->setLogger( $logger ); |
|
87 | + $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context); |
|
88 | + $context->setLogger($logger); |
|
89 | 89 | |
90 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context ); |
|
91 | - $context->setCache( $cache ); |
|
90 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context); |
|
91 | + $context->setCache($cache); |
|
92 | 92 | |
93 | 93 | self::$context = $context; |
94 | 94 | } |
95 | 95 | |
96 | 96 | $context = self::$context; |
97 | 97 | |
98 | - if( $locale === true ) |
|
98 | + if ($locale === true) |
|
99 | 99 | { |
100 | - $localeItem = $this->getLocale( $context ); |
|
100 | + $localeItem = $this->getLocale($context); |
|
101 | 101 | $langid = $localeItem->getLanguageId(); |
102 | 102 | |
103 | - $context->setLocale( $localeItem ); |
|
104 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $langid ) ) ); |
|
103 | + $context->setLocale($localeItem); |
|
104 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($langid))); |
|
105 | 105 | } |
106 | 106 | |
107 | - $session = new \Aimeos\MW\Session\Laravel5( $this->session ); |
|
108 | - $context->setSession( $session ); |
|
107 | + $session = new \Aimeos\MW\Session\Laravel5($this->session); |
|
108 | + $context->setSession($session); |
|
109 | 109 | |
110 | - $this->addUser( $context ); |
|
110 | + $this->addUser($context); |
|
111 | 111 | |
112 | 112 | return $context; |
113 | 113 | } |
@@ -118,20 +118,20 @@ discard block |
||
118 | 118 | * |
119 | 119 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
120 | 120 | */ |
121 | - protected function addUser( \Aimeos\MShop\Context\Item\Iface $context ) |
|
121 | + protected function addUser(\Aimeos\MShop\Context\Item\Iface $context) |
|
122 | 122 | { |
123 | - if( ( $userid = Auth::id() ) !== null ) |
|
123 | + if (($userid = Auth::id()) !== null) |
|
124 | 124 | { |
125 | - $context->setUserId( $userid ); |
|
126 | - $context->setGroupIds( function() use ( $context, $userid ) |
|
125 | + $context->setUserId($userid); |
|
126 | + $context->setGroupIds(function() use ($context, $userid) |
|
127 | 127 | { |
128 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' ); |
|
129 | - return $manager->getItem( $userid, array( 'customer/group' ) )->getGroups(); |
|
128 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer'); |
|
129 | + return $manager->getItem($userid, array('customer/group'))->getGroups(); |
|
130 | 130 | } ); |
131 | 131 | } |
132 | 132 | |
133 | - if( ( $user = Auth::user() ) !== null ) { |
|
134 | - $context->setEditor( $user->name ); |
|
133 | + if (($user = Auth::user()) !== null) { |
|
134 | + $context->setEditor($user->name); |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | */ |
144 | 144 | protected function getConfig() |
145 | 145 | { |
146 | - $configPaths = app( '\Aimeos\Shop\Base\Aimeos' )->get()->getConfigPaths(); |
|
147 | - $config = new \Aimeos\MW\Config\PHPArray( $this->config->get( 'shop' ), $configPaths ); |
|
146 | + $configPaths = app('\Aimeos\Shop\Base\Aimeos')->get()->getConfigPaths(); |
|
147 | + $config = new \Aimeos\MW\Config\PHPArray($this->config->get('shop'), $configPaths); |
|
148 | 148 | |
149 | - if( function_exists( 'apc_store' ) === true && $this->config->get( 'shop.apc_enabled', false ) == true ) { |
|
150 | - $config = new \Aimeos\MW\Config\Decorator\APC( $config, $this->config->get( 'shop.apc_prefix', 'laravel:' ) ); |
|
149 | + if (function_exists('apc_store') === true && $this->config->get('shop.apc_enabled', false) == true) { |
|
150 | + $config = new \Aimeos\MW\Config\Decorator\APC($config, $this->config->get('shop.apc_prefix', 'laravel:')); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | return $config; |
@@ -160,18 +160,18 @@ discard block |
||
160 | 160 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
161 | 161 | * @return \Aimeos\MShop\Locale\Item\Iface Locale item object |
162 | 162 | */ |
163 | - protected function getLocale( \Aimeos\MShop\Context\Item\Iface $context ) |
|
163 | + protected function getLocale(\Aimeos\MShop\Context\Item\Iface $context) |
|
164 | 164 | { |
165 | - if( $this->locale === null ) |
|
165 | + if ($this->locale === null) |
|
166 | 166 | { |
167 | - $site = Route::input( 'site', Input::get( 'site', 'default' ) ); |
|
168 | - $currency = Route::input( 'currency', Input::get( 'currency', '' ) ); |
|
169 | - $lang = Route::input( 'locale', Input::get( 'locale', '' ) ); |
|
167 | + $site = Route::input('site', Input::get('site', 'default')); |
|
168 | + $currency = Route::input('currency', Input::get('currency', '')); |
|
169 | + $lang = Route::input('locale', Input::get('locale', '')); |
|
170 | 170 | |
171 | - $disableSites = $this->config->get( 'shop.disableSites', true ); |
|
171 | + $disableSites = $this->config->get('shop.disableSites', true); |
|
172 | 172 | |
173 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
174 | - $this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites ); |
|
173 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
174 | + $this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | return $this->locale; |
@@ -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 |