@@ -32,56 +32,56 @@ discard block |
||
32 | 32 | * @param string|null $locale Code of the current language or null for no translation |
33 | 33 | * @return \Aimeos\MW\View\Iface View object |
34 | 34 | */ |
35 | - public function create( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null ) |
|
35 | + public function create(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null) |
|
36 | 36 | { |
37 | 37 | $params = $fixed = array(); |
38 | 38 | |
39 | - if( $locale !== null ) |
|
39 | + if ($locale !== null) |
|
40 | 40 | { |
41 | 41 | $params = Route::current()->parameters() + Input::all(); |
42 | 42 | $fixed = $this->getFixedParams(); |
43 | 43 | |
44 | - $i18n = app('\Aimeos\Shop\Base\I18n')->get( array( $locale ) ); |
|
44 | + $i18n = app('\Aimeos\Shop\Base\I18n')->get(array($locale)); |
|
45 | 45 | $translation = $i18n[$locale]; |
46 | 46 | } |
47 | 47 | else |
48 | 48 | { |
49 | - $translation = new \Aimeos\MW\Translation\None( 'en' ); |
|
49 | + $translation = new \Aimeos\MW\Translation\None('en'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | |
53 | - $view = new \Aimeos\MW\View\Standard( $templatePaths ); |
|
53 | + $view = new \Aimeos\MW\View\Standard($templatePaths); |
|
54 | 54 | |
55 | - $helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation ); |
|
56 | - $view->addHelper( 'translate', $helper ); |
|
55 | + $helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation); |
|
56 | + $view->addHelper('translate', $helper); |
|
57 | 57 | |
58 | - $helper = new \Aimeos\MW\View\Helper\Url\Laravel5( $view, app('url'), $fixed ); |
|
59 | - $view->addHelper( 'url', $helper ); |
|
58 | + $helper = new \Aimeos\MW\View\Helper\Url\Laravel5($view, app('url'), $fixed); |
|
59 | + $view->addHelper('url', $helper); |
|
60 | 60 | |
61 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params ); |
|
62 | - $view->addHelper( 'param', $helper ); |
|
61 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params); |
|
62 | + $view->addHelper('param', $helper); |
|
63 | 63 | |
64 | - $config = new \Aimeos\MW\Config\Decorator\Protect( clone $context->getConfig(), array( 'admin', 'client' ) ); |
|
65 | - $helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config ); |
|
66 | - $view->addHelper( 'config', $helper ); |
|
64 | + $config = new \Aimeos\MW\Config\Decorator\Protect(clone $context->getConfig(), array('admin', 'client')); |
|
65 | + $helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config); |
|
66 | + $view->addHelper('config', $helper); |
|
67 | 67 | |
68 | - $sepDec = $config->get( 'client/html/common/format/seperatorDecimal', '.' ); |
|
69 | - $sep1000 = $config->get( 'client/html/common/format/seperator1000', ' ' ); |
|
70 | - $decimals = $config->get( 'client/html/common/format/decimals', 2 ); |
|
71 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000, $decimals ); |
|
72 | - $view->addHelper( 'number', $helper ); |
|
68 | + $sepDec = $config->get('client/html/common/format/seperatorDecimal', '.'); |
|
69 | + $sep1000 = $config->get('client/html/common/format/seperator1000', ' '); |
|
70 | + $decimals = $config->get('client/html/common/format/decimals', 2); |
|
71 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000, $decimals); |
|
72 | + $view->addHelper('number', $helper); |
|
73 | 73 | |
74 | - $helper = new \Aimeos\MW\View\Helper\Request\Laravel5( $view, Request::instance() ); |
|
75 | - $view->addHelper( 'request', $helper ); |
|
74 | + $helper = new \Aimeos\MW\View\Helper\Request\Laravel5($view, Request::instance()); |
|
75 | + $view->addHelper('request', $helper); |
|
76 | 76 | |
77 | - $helper = new \Aimeos\MW\View\Helper\Response\Laravel5( $view ); |
|
78 | - $view->addHelper( 'response', $helper ); |
|
77 | + $helper = new \Aimeos\MW\View\Helper\Response\Laravel5($view); |
|
78 | + $view->addHelper('response', $helper); |
|
79 | 79 | |
80 | - $helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', csrf_token() ); |
|
81 | - $view->addHelper( 'csrf', $helper ); |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', csrf_token()); |
|
81 | + $view->addHelper('csrf', $helper); |
|
82 | 82 | |
83 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $this->getGroups( $context ) ); |
|
84 | - $view->addHelper( 'access', $helper ); |
|
83 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $this->getGroups($context)); |
|
84 | + $view->addHelper('access', $helper); |
|
85 | 85 | |
86 | 86 | return $view; |
87 | 87 | } |
@@ -96,15 +96,15 @@ discard block |
||
96 | 96 | { |
97 | 97 | $fixed = array(); |
98 | 98 | |
99 | - if( ( $value = Route::input( 'site' ) ) !== null ) { |
|
99 | + if (($value = Route::input('site')) !== null) { |
|
100 | 100 | $fixed['site'] = $value; |
101 | 101 | } |
102 | 102 | |
103 | - if( ( $value = Route::input( 'locale' ) ) !== null ) { |
|
103 | + if (($value = Route::input('locale')) !== null) { |
|
104 | 104 | $fixed['locale'] = $value; |
105 | 105 | } |
106 | 106 | |
107 | - if( ( $value = Route::input( 'currency' ) ) !== null ) { |
|
107 | + if (($value = Route::input('currency')) !== null) { |
|
108 | 108 | $fixed['currency'] = $value; |
109 | 109 | } |
110 | 110 | |
@@ -118,17 +118,17 @@ discard block |
||
118 | 118 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
119 | 119 | * @return \Closure Function which returns the user group codes |
120 | 120 | */ |
121 | - protected function getGroups( \Aimeos\MShop\Context\Item\Iface $context ) |
|
121 | + protected function getGroups(\Aimeos\MShop\Context\Item\Iface $context) |
|
122 | 122 | { |
123 | - return function() use ( $context ) |
|
123 | + return function() use ($context) |
|
124 | 124 | { |
125 | 125 | $list = array(); |
126 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/group' ); |
|
126 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer/group'); |
|
127 | 127 | |
128 | 128 | $search = $manager->createSearch(); |
129 | - $search->setConditions( $search->compare( '==', 'customer.group.id', $context->getGroupIds() ) ); |
|
129 | + $search->setConditions($search->compare('==', 'customer.group.id', $context->getGroupIds())); |
|
130 | 130 | |
131 | - foreach( $manager->searchItems( $search ) as $item ) { |
|
131 | + foreach ($manager->searchItems($search) as $item) { |
|
132 | 132 | $list[] = $item->getCode(); |
133 | 133 | } |
134 | 134 |