@@ -39,8 +39,7 @@ |
||
| 39 | 39 | |
| 40 | 40 | $i18n = app('\Aimeos\Shop\Base\I18n')->get( array( $locale ) ); |
| 41 | 41 | $translation = $i18n[$locale]; |
| 42 | - } |
|
| 43 | - else |
|
| 42 | + } else |
|
| 44 | 43 | { |
| 45 | 44 | $translation = new \Aimeos\MW\Translation\None( 'en' ); |
| 46 | 45 | } |
@@ -32,52 +32,52 @@ 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\MW\Config\Iface $config, array $templatePaths, $locale = null ) |
|
| 35 | + public function create(\Aimeos\MW\Config\Iface $config, 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 $config, 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 $config, 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 | - $helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000 ); |
|
| 71 | - $view->addHelper( 'number', $helper ); |
|
| 68 | + $sepDec = $config->get('client/html/common/format/seperatorDecimal', '.'); |
|
| 69 | + $sep1000 = $config->get('client/html/common/format/seperator1000', ' '); |
|
| 70 | + $helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000); |
|
| 71 | + $view->addHelper('number', $helper); |
|
| 72 | 72 | |
| 73 | - $helper = new \Aimeos\MW\View\Helper\Request\Laravel5( $view, Request::instance() ); |
|
| 74 | - $view->addHelper( 'request', $helper ); |
|
| 73 | + $helper = new \Aimeos\MW\View\Helper\Request\Laravel5($view, Request::instance()); |
|
| 74 | + $view->addHelper('request', $helper); |
|
| 75 | 75 | |
| 76 | - $helper = new \Aimeos\MW\View\Helper\Response\Laravel5( $view ); |
|
| 77 | - $view->addHelper( 'response', $helper ); |
|
| 76 | + $helper = new \Aimeos\MW\View\Helper\Response\Laravel5($view); |
|
| 77 | + $view->addHelper('response', $helper); |
|
| 78 | 78 | |
| 79 | - $helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', csrf_token() ); |
|
| 80 | - $view->addHelper( 'csrf', $helper ); |
|
| 79 | + $helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', csrf_token()); |
|
| 80 | + $view->addHelper('csrf', $helper); |
|
| 81 | 81 | |
| 82 | 82 | return $view; |
| 83 | 83 | } |
@@ -92,15 +92,15 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | $fixed = array(); |
| 94 | 94 | |
| 95 | - if( ( $value = Route::input( 'site' ) ) !== null ) { |
|
| 95 | + if (($value = Route::input('site')) !== null) { |
|
| 96 | 96 | $fixed['site'] = $value; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if( ( $value = Route::input( 'locale' ) ) !== null ) { |
|
| 99 | + if (($value = Route::input('locale')) !== null) { |
|
| 100 | 100 | $fixed['locale'] = $value; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - if( ( $value = Route::input( 'currency' ) ) !== null ) { |
|
| 103 | + if (($value = Route::input('currency')) !== null) { |
|
| 104 | 104 | $fixed['currency'] = $value; |
| 105 | 105 | } |
| 106 | 106 | |
@@ -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 |
@@ -207,8 +207,7 @@ |
||
| 207 | 207 | $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
| 208 | 208 | $localeItem->setLanguageId( null ); |
| 209 | 209 | $localeItem->setCurrencyId( null ); |
| 210 | - } |
|
| 211 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 210 | + } catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 212 | 211 | { |
| 213 | 212 | $localeItem = $localeManager->createItem(); |
| 214 | 213 | } |
@@ -35,19 +35,19 @@ discard block |
||
| 35 | 35 | * @param \Illuminate\Http\Request $request Request object |
| 36 | 36 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 37 | 37 | */ |
| 38 | - public function deleteAction( Request $request ) |
|
| 38 | + public function deleteAction(Request $request) |
|
| 39 | 39 | { |
| 40 | - if( config( 'shop.authorize', true ) ) { |
|
| 41 | - $this->authorize( 'admin' ); |
|
| 40 | + if (config('shop.authorize', true)) { |
|
| 41 | + $this->authorize('admin'); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $status = 500; |
| 45 | 45 | $header = $request->headers->all(); |
| 46 | 46 | |
| 47 | 47 | $client = $this->createClient(); |
| 48 | - $result = $client->delete( (string) $request->getContent(), $header, $status ); |
|
| 48 | + $result = $client->delete((string) $request->getContent(), $header, $status); |
|
| 49 | 49 | |
| 50 | - return $this->createResponse( $result, $status, $header ); |
|
| 50 | + return $this->createResponse($result, $status, $header); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
@@ -57,19 +57,19 @@ discard block |
||
| 57 | 57 | * @param \Illuminate\Http\Request $request Request object |
| 58 | 58 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 59 | 59 | */ |
| 60 | - public function getAction( Request $request ) |
|
| 60 | + public function getAction(Request $request) |
|
| 61 | 61 | { |
| 62 | - if( config( 'shop.authorize', true ) ) { |
|
| 63 | - $this->authorize( 'admin' ); |
|
| 62 | + if (config('shop.authorize', true)) { |
|
| 63 | + $this->authorize('admin'); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $status = 500; |
| 67 | 67 | $header = $request->headers->all(); |
| 68 | 68 | |
| 69 | 69 | $client = $this->createClient(); |
| 70 | - $result = $client->get( (string) $request->getContent(), $header, $status ); |
|
| 70 | + $result = $client->get((string) $request->getContent(), $header, $status); |
|
| 71 | 71 | |
| 72 | - return $this->createResponse( $result, $status, $header ); |
|
| 72 | + return $this->createResponse($result, $status, $header); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
@@ -79,19 +79,19 @@ discard block |
||
| 79 | 79 | * @param \Illuminate\Http\Request $request Request object |
| 80 | 80 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 81 | 81 | */ |
| 82 | - public function patchAction( Request $request ) |
|
| 82 | + public function patchAction(Request $request) |
|
| 83 | 83 | { |
| 84 | - if( config( 'shop.authorize', true ) ) { |
|
| 85 | - $this->authorize( 'admin' ); |
|
| 84 | + if (config('shop.authorize', true)) { |
|
| 85 | + $this->authorize('admin'); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | $status = 500; |
| 89 | 89 | $header = $request->headers->all(); |
| 90 | 90 | |
| 91 | 91 | $client = $this->createClient(); |
| 92 | - $result = $client->patch( (string) $request->getContent(), $header, $status ); |
|
| 92 | + $result = $client->patch((string) $request->getContent(), $header, $status); |
|
| 93 | 93 | |
| 94 | - return $this->createResponse( $result, $status, $header ); |
|
| 94 | + return $this->createResponse($result, $status, $header); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
@@ -101,19 +101,19 @@ discard block |
||
| 101 | 101 | * @param \Illuminate\Http\Request $request Request object |
| 102 | 102 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 103 | 103 | */ |
| 104 | - public function postAction( Request $request ) |
|
| 104 | + public function postAction(Request $request) |
|
| 105 | 105 | { |
| 106 | - if( config( 'shop.authorize', true ) ) { |
|
| 107 | - $this->authorize( 'admin' ); |
|
| 106 | + if (config('shop.authorize', true)) { |
|
| 107 | + $this->authorize('admin'); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | $status = 500; |
| 111 | 111 | $header = $request->headers->all(); |
| 112 | 112 | |
| 113 | 113 | $client = $this->createClient(); |
| 114 | - $result = $client->post( (string) $request->getContent(), $header, $status ); |
|
| 114 | + $result = $client->post((string) $request->getContent(), $header, $status); |
|
| 115 | 115 | |
| 116 | - return $this->createResponse( $result, $status, $header ); |
|
| 116 | + return $this->createResponse($result, $status, $header); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
@@ -123,19 +123,19 @@ discard block |
||
| 123 | 123 | * @param \Illuminate\Http\Request $request Request object |
| 124 | 124 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 125 | 125 | */ |
| 126 | - public function putAction( Request $request ) |
|
| 126 | + public function putAction(Request $request) |
|
| 127 | 127 | { |
| 128 | - if( config( 'shop.authorize', true ) ) { |
|
| 129 | - $this->authorize( 'admin' ); |
|
| 128 | + if (config('shop.authorize', true)) { |
|
| 129 | + $this->authorize('admin'); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | $status = 500; |
| 133 | 133 | $header = $request->headers->all(); |
| 134 | 134 | |
| 135 | 135 | $client = $this->createClient(); |
| 136 | - $result = $client->put( (string) $request->getContent(), $header, $status ); |
|
| 136 | + $result = $client->put((string) $request->getContent(), $header, $status); |
|
| 137 | 137 | |
| 138 | - return $this->createResponse( $result, $status, $header ); |
|
| 138 | + return $this->createResponse($result, $status, $header); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | |
@@ -145,19 +145,19 @@ discard block |
||
| 145 | 145 | * @param \Illuminate\Http\Request $request Request object |
| 146 | 146 | * @return \Illuminate\Http\Response Response object containing the generated output |
| 147 | 147 | */ |
| 148 | - public function optionsAction( Request $request ) |
|
| 148 | + public function optionsAction(Request $request) |
|
| 149 | 149 | { |
| 150 | - if( config( 'shop.authorize', true ) ) { |
|
| 151 | - $this->authorize( 'admin' ); |
|
| 150 | + if (config('shop.authorize', true)) { |
|
| 151 | + $this->authorize('admin'); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | $status = 500; |
| 155 | 155 | $header = $request->headers->all(); |
| 156 | 156 | |
| 157 | 157 | $client = $this->createClient(); |
| 158 | - $result = $client->options( (string) $request->getContent(), $header, $status ); |
|
| 158 | + $result = $client->options((string) $request->getContent(), $header, $status); |
|
| 159 | 159 | |
| 160 | - return $this->createResponse( $result, $status, $header ); |
|
| 160 | + return $this->createResponse($result, $status, $header); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | |
@@ -168,20 +168,20 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | protected function createClient() |
| 170 | 170 | { |
| 171 | - $site = Route::input( 'site', Input::get( 'site', 'default' ) ); |
|
| 172 | - $lang = Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
| 173 | - $resource = Route::input( 'resource' ); |
|
| 171 | + $site = Route::input('site', Input::get('site', 'default')); |
|
| 172 | + $lang = Input::get('lang', config('app.locale', 'en')); |
|
| 173 | + $resource = Route::input('resource'); |
|
| 174 | 174 | |
| 175 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 176 | - $templatePaths = $aimeos->getCustomPaths( 'admin/jsonadm/templates' ); |
|
| 175 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 176 | + $templatePaths = $aimeos->getCustomPaths('admin/jsonadm/templates'); |
|
| 177 | 177 | |
| 178 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 179 | - $context = $this->setLocale( $context, $site, $lang ); |
|
| 178 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
| 179 | + $context = $this->setLocale($context, $site, $lang); |
|
| 180 | 180 | |
| 181 | - $view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang ); |
|
| 182 | - $context->setView( $view ); |
|
| 181 | + $view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), $templatePaths, $lang); |
|
| 182 | + $context->setView($view); |
|
| 183 | 183 | |
| 184 | - return \Aimeos\Admin\JsonAdm\Factory::createClient( $context, $templatePaths, $resource ); |
|
| 184 | + return \Aimeos\Admin\JsonAdm\Factory::createClient($context, $templatePaths, $resource); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | |
@@ -193,12 +193,12 @@ discard block |
||
| 193 | 193 | * @param array $header List of HTTP headers |
| 194 | 194 | * @return \Illuminate\Http\Response HTTP response object |
| 195 | 195 | */ |
| 196 | - protected function createResponse( $content, $status, array $header ) |
|
| 196 | + protected function createResponse($content, $status, array $header) |
|
| 197 | 197 | { |
| 198 | - $response = Response::make( $content, $status ); |
|
| 198 | + $response = Response::make($content, $status); |
|
| 199 | 199 | |
| 200 | - foreach( $header as $key => $value ) { |
|
| 201 | - $response->header( $key, $value ); |
|
| 200 | + foreach ($header as $key => $value) { |
|
| 201 | + $response->header($key, $value); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | return $response; |
@@ -213,23 +213,23 @@ discard block |
||
| 213 | 213 | * @param string $lang ISO language code, e.g. "en" or "en_GB" |
| 214 | 214 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 215 | 215 | */ |
| 216 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang ) |
|
| 216 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode, $lang) |
|
| 217 | 217 | { |
| 218 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
| 218 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
| 219 | 219 | |
| 220 | 220 | try |
| 221 | 221 | { |
| 222 | - $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
|
| 223 | - $localeItem->setLanguageId( null ); |
|
| 224 | - $localeItem->setCurrencyId( null ); |
|
| 222 | + $localeItem = $localeManager->bootstrap($sitecode, '', '', false); |
|
| 223 | + $localeItem->setLanguageId(null); |
|
| 224 | + $localeItem->setCurrencyId(null); |
|
| 225 | 225 | } |
| 226 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 226 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
| 227 | 227 | { |
| 228 | 228 | $localeItem = $localeManager->createItem(); |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - $context->setLocale( $localeItem ); |
|
| 232 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang ) ) ); |
|
| 231 | + $context->setLocale($localeItem); |
|
| 232 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang))); |
|
| 233 | 233 | |
| 234 | 234 | return $context; |
| 235 | 235 | } |
@@ -177,8 +177,7 @@ |
||
| 177 | 177 | try |
| 178 | 178 | { |
| 179 | 179 | $item = $manager->getItem( $code ); |
| 180 | - } |
|
| 181 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 180 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 182 | 181 | { |
| 183 | 182 | $item = $manager->createItem(); |
| 184 | 183 | $item->setLabel( $code ); |
@@ -43,21 +43,21 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function fire() |
| 45 | 45 | { |
| 46 | - $code = $this->argument( 'email' ); |
|
| 47 | - if( ( $password = $this->option( 'password' ) ) === null ) { |
|
| 48 | - $password = $this->secret( 'Password' ); |
|
| 46 | + $code = $this->argument('email'); |
|
| 47 | + if (($password = $this->option('password')) === null) { |
|
| 48 | + $password = $this->secret('Password'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - $context = $this->getLaravel()->make( 'Aimeos\Shop\Base\Context' )->get( false ); |
|
| 52 | - $context->setEditor( 'aimeos:account' ); |
|
| 51 | + $context = $this->getLaravel()->make('Aimeos\Shop\Base\Context')->get(false); |
|
| 52 | + $context->setEditor('aimeos:account'); |
|
| 53 | 53 | |
| 54 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 55 | - $context->setLocale( $localeManager->createItem() ); |
|
| 54 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 55 | + $context->setLocale($localeManager->createItem()); |
|
| 56 | 56 | |
| 57 | - $user = $this->createCustomerItem( $context, $code, $password ); |
|
| 57 | + $user = $this->createCustomerItem($context, $code, $password); |
|
| 58 | 58 | |
| 59 | - if( $this->option( 'admin' ) ) { |
|
| 60 | - $this->addPrivilege( $context, $user, 'admin' ); |
|
| 59 | + if ($this->option('admin')) { |
|
| 60 | + $this->addPrivilege($context, $user, 'admin'); |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
@@ -69,31 +69,31 @@ discard block |
||
| 69 | 69 | * @param string $userid Unique user ID |
| 70 | 70 | * @param string $groupid Unique group ID |
| 71 | 71 | */ |
| 72 | - protected function addListItem( \Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid ) |
|
| 72 | + protected function addListItem(\Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid) |
|
| 73 | 73 | { |
| 74 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'lists' ); |
|
| 75 | - $typeid = $manager->getSubmanager( 'type' )->findItem( 'default', array(), 'customer/group' )->getId(); |
|
| 74 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context)->getSubmanager('lists'); |
|
| 75 | + $typeid = $manager->getSubmanager('type')->findItem('default', array(), 'customer/group')->getId(); |
|
| 76 | 76 | |
| 77 | 77 | $search = $manager->createSearch(); |
| 78 | 78 | $expr = array( |
| 79 | - $search->compare( '==', 'customer.lists.parentid', $userid ), |
|
| 80 | - $search->compare( '==', 'customer.lists.refid', $groupid ), |
|
| 81 | - $search->compare( '==', 'customer.lists.domain', 'customer/group' ), |
|
| 82 | - $search->compare( '==', 'customer.lists.typeid', $typeid ), |
|
| 79 | + $search->compare('==', 'customer.lists.parentid', $userid), |
|
| 80 | + $search->compare('==', 'customer.lists.refid', $groupid), |
|
| 81 | + $search->compare('==', 'customer.lists.domain', 'customer/group'), |
|
| 82 | + $search->compare('==', 'customer.lists.typeid', $typeid), |
|
| 83 | 83 | ); |
| 84 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 85 | - $search->setSlice( 0, 1 ); |
|
| 84 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 85 | + $search->setSlice(0, 1); |
|
| 86 | 86 | |
| 87 | - if( count( $manager->searchItems( $search ) ) === 0 ) |
|
| 87 | + if (count($manager->searchItems($search)) === 0) |
|
| 88 | 88 | { |
| 89 | 89 | $item = $manager->createItem(); |
| 90 | - $item->setDomain( 'customer/group' ); |
|
| 91 | - $item->setParentId( $userid ); |
|
| 92 | - $item->setTypeId( $typeid ); |
|
| 93 | - $item->setRefId( $groupid ); |
|
| 94 | - $item->setStatus( 1 ); |
|
| 90 | + $item->setDomain('customer/group'); |
|
| 91 | + $item->setParentId($userid); |
|
| 92 | + $item->setTypeId($typeid); |
|
| 93 | + $item->setRefId($groupid); |
|
| 94 | + $item->setStatus(1); |
|
| 95 | 95 | |
| 96 | - $manager->saveItem( $item, false ); |
|
| 96 | + $manager->saveItem($item, false); |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
@@ -105,23 +105,23 @@ discard block |
||
| 105 | 105 | * @param \Aimeos\MShop\Customer\Item\Iface $user Aimeos customer object |
| 106 | 106 | * @param string $privilege Unique customer group code |
| 107 | 107 | */ |
| 108 | - protected function addPrivilege( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $privilege ) |
|
| 108 | + protected function addPrivilege(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $privilege) |
|
| 109 | 109 | { |
| 110 | - $this->info( sprintf( 'Add "%1$s" privilege to user "%2$s" for sites', $privilege, $user->getCode() ) ); |
|
| 110 | + $this->info(sprintf('Add "%1$s" privilege to user "%2$s" for sites', $privilege, $user->getCode())); |
|
| 111 | 111 | |
| 112 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 112 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 113 | 113 | |
| 114 | - foreach( $this->getSiteItems( $context, $this->argument( 'site' ) ) as $siteItem ) |
|
| 114 | + foreach ($this->getSiteItems($context, $this->argument('site')) as $siteItem) |
|
| 115 | 115 | { |
| 116 | - $localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false ); |
|
| 116 | + $localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false); |
|
| 117 | 117 | |
| 118 | 118 | $lcontext = clone $context; |
| 119 | - $lcontext->setLocale( $localeItem ); |
|
| 119 | + $lcontext->setLocale($localeItem); |
|
| 120 | 120 | |
| 121 | - $this->info( '- ' . $siteItem->getCode() ); |
|
| 121 | + $this->info('- '.$siteItem->getCode()); |
|
| 122 | 122 | |
| 123 | - $groupItem = $this->getGroupItem( $lcontext, $privilege ); |
|
| 124 | - $this->addListItem( $lcontext, $user->getId(), $groupItem->getId() ); |
|
| 123 | + $groupItem = $this->getGroupItem($lcontext, $privilege); |
|
| 124 | + $this->addListItem($lcontext, $user->getId(), $groupItem->getId()); |
|
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | |
@@ -136,21 +136,21 @@ discard block |
||
| 136 | 136 | * @param string $password New user password |
| 137 | 137 | * @return \Aimeos\MShop\Customer\Item\Iface Aimeos customer item object |
| 138 | 138 | */ |
| 139 | - protected function createCustomerItem( \Aimeos\MShop\Context\Item\Iface $context, $email, $password ) |
|
| 139 | + protected function createCustomerItem(\Aimeos\MShop\Context\Item\Iface $context, $email, $password) |
|
| 140 | 140 | { |
| 141 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' ); |
|
| 141 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer'); |
|
| 142 | 142 | |
| 143 | 143 | try { |
| 144 | - $item = $manager->findItem( $email ); |
|
| 145 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
| 144 | + $item = $manager->findItem($email); |
|
| 145 | + } catch (\Aimeos\MShop\Exception $e) { |
|
| 146 | 146 | $item = $manager->createItem(); |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - $item->setCode( $email ); |
|
| 150 | - $item->getPaymentAddress()->setEmail( $email ); |
|
| 151 | - $item->setPassword( $password ); |
|
| 149 | + $item->setCode($email); |
|
| 150 | + $item->getPaymentAddress()->setEmail($email); |
|
| 151 | + $item->setPassword($password); |
|
| 152 | 152 | |
| 153 | - $manager->saveItem( $item ); |
|
| 153 | + $manager->saveItem($item); |
|
| 154 | 154 | |
| 155 | 155 | return $item; |
| 156 | 156 | } |
@@ -164,8 +164,8 @@ discard block |
||
| 164 | 164 | protected function getArguments() |
| 165 | 165 | { |
| 166 | 166 | return array( |
| 167 | - array( 'email', InputArgument::REQUIRED, 'E-mail address of the account that should be created' ), |
|
| 168 | - array( 'site', InputArgument::OPTIONAL, 'Site codes to create accounts for like "default unittest" (none for all)' ), |
|
| 167 | + array('email', InputArgument::REQUIRED, 'E-mail address of the account that should be created'), |
|
| 168 | + array('site', InputArgument::OPTIONAL, 'Site codes to create accounts for like "default unittest" (none for all)'), |
|
| 169 | 169 | ); |
| 170 | 170 | } |
| 171 | 171 | |
@@ -177,21 +177,21 @@ discard block |
||
| 177 | 177 | * @param string $code Unique customer group code |
| 178 | 178 | * @return \Aimeos\MShop\Customer\Item\Group\Iface Aimeos customer group item object |
| 179 | 179 | */ |
| 180 | - protected function getGroupItem( \Aimeos\MShop\Context\Item\Iface $context, $code ) |
|
| 180 | + protected function getGroupItem(\Aimeos\MShop\Context\Item\Iface $context, $code) |
|
| 181 | 181 | { |
| 182 | - $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'group' ); |
|
| 182 | + $manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context)->getSubmanager('group'); |
|
| 183 | 183 | |
| 184 | 184 | try |
| 185 | 185 | { |
| 186 | - $item = $manager->findItem( $code ); |
|
| 186 | + $item = $manager->findItem($code); |
|
| 187 | 187 | } |
| 188 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 188 | + catch (\Aimeos\MShop\Exception $e) |
|
| 189 | 189 | { |
| 190 | 190 | $item = $manager->createItem(); |
| 191 | - $item->setLabel( $code ); |
|
| 192 | - $item->setCode( $code ); |
|
| 191 | + $item->setLabel($code); |
|
| 192 | + $item->setCode($code); |
|
| 193 | 193 | |
| 194 | - $manager->saveItem( $item ); |
|
| 194 | + $manager->saveItem($item); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | return $item; |
@@ -206,8 +206,8 @@ discard block |
||
| 206 | 206 | protected function getOptions() |
| 207 | 207 | { |
| 208 | 208 | return array( |
| 209 | - array( 'password', null, InputOption::VALUE_REQUIRED, 'Optional password for the account (will ask for if not given)' ), |
|
| 210 | - array( 'admin', null, InputOption::VALUE_NONE, 'If account should have administrator privileges' ), |
|
| 209 | + array('password', null, InputOption::VALUE_REQUIRED, 'Optional password for the account (will ask for if not given)'), |
|
| 210 | + array('admin', null, InputOption::VALUE_NONE, 'If account should have administrator privileges'), |
|
| 211 | 211 | ); |
| 212 | 212 | } |
| 213 | 213 | } |
@@ -207,8 +207,7 @@ |
||
| 207 | 207 | $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
| 208 | 208 | $localeItem->setLanguageId( null ); |
| 209 | 209 | $localeItem->setCurrencyId( null ); |
| 210 | - } |
|
| 211 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 210 | + } catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 212 | 211 | { |
| 213 | 212 | $localeItem = $localeManager->createItem(); |
| 214 | 213 | } |
@@ -34,38 +34,38 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function fileAction() |
| 36 | 36 | { |
| 37 | - if( config( 'shop.authorize', true ) ) { |
|
| 38 | - $this->authorize( 'admin' ); |
|
| 37 | + if (config('shop.authorize', true)) { |
|
| 38 | + $this->authorize('admin'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | $contents = ''; |
| 42 | 42 | $files = array(); |
| 43 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 44 | - $type = Route::input( 'type', Input::get( 'type', 'js' ) ); |
|
| 43 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 44 | + $type = Route::input('type', Input::get('type', 'js')); |
|
| 45 | 45 | |
| 46 | - foreach( $aimeos->getCustomPaths( 'admin/jqadm' ) as $base => $paths ) |
|
| 46 | + foreach ($aimeos->getCustomPaths('admin/jqadm') as $base => $paths) |
|
| 47 | 47 | { |
| 48 | - foreach( $paths as $path ) |
|
| 48 | + foreach ($paths as $path) |
|
| 49 | 49 | { |
| 50 | - $jsbAbsPath = $base . '/' . $path; |
|
| 51 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) ); |
|
| 52 | - $files = array_merge( $files, $jsb2->getFiles( $type ) ); |
|
| 50 | + $jsbAbsPath = $base.'/'.$path; |
|
| 51 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath)); |
|
| 52 | + $files = array_merge($files, $jsb2->getFiles($type)); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - foreach( $files as $file ) |
|
| 56 | + foreach ($files as $file) |
|
| 57 | 57 | { |
| 58 | - if( ( $content = file_get_contents( $file ) ) !== false ) { |
|
| 58 | + if (($content = file_get_contents($file)) !== false) { |
|
| 59 | 59 | $contents .= $content; |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - $response = response( $contents ); |
|
| 63 | + $response = response($contents); |
|
| 64 | 64 | |
| 65 | - if( $type === 'js' ) { |
|
| 66 | - $response->header( 'Content-Type', 'application/javascript' ); |
|
| 67 | - } elseif( $type === 'css' ) { |
|
| 68 | - $response->header( 'Content-Type', 'text/css' ); |
|
| 65 | + if ($type === 'js') { |
|
| 66 | + $response->header('Content-Type', 'application/javascript'); |
|
| 67 | + } elseif ($type === 'css') { |
|
| 68 | + $response->header('Content-Type', 'text/css'); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | return $response; |
@@ -79,12 +79,12 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public function copyAction() |
| 81 | 81 | { |
| 82 | - if( config( 'shop.authorize', true ) ) { |
|
| 83 | - $this->authorize( 'admin' ); |
|
| 82 | + if (config('shop.authorize', true)) { |
|
| 83 | + $this->authorize('admin'); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | $cntl = $this->createClient(); |
| 87 | - return $this->getHtml( $cntl->copy() ); |
|
| 87 | + return $this->getHtml($cntl->copy()); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
@@ -95,12 +95,12 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public function createAction() |
| 97 | 97 | { |
| 98 | - if( config( 'shop.authorize', true ) ) { |
|
| 99 | - $this->authorize( 'admin' ); |
|
| 98 | + if (config('shop.authorize', true)) { |
|
| 99 | + $this->authorize('admin'); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | $cntl = $this->createClient(); |
| 103 | - return $this->getHtml( $cntl->create() ); |
|
| 103 | + return $this->getHtml($cntl->create()); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
@@ -111,12 +111,12 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function deleteAction() |
| 113 | 113 | { |
| 114 | - if( config( 'shop.authorize', true ) ) { |
|
| 115 | - $this->authorize( 'admin' ); |
|
| 114 | + if (config('shop.authorize', true)) { |
|
| 115 | + $this->authorize('admin'); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $cntl = $this->createClient(); |
| 119 | - return $this->getHtml( $cntl->delete() . $cntl->search() ); |
|
| 119 | + return $this->getHtml($cntl->delete().$cntl->search()); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
@@ -127,12 +127,12 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function getAction() |
| 129 | 129 | { |
| 130 | - if( config( 'shop.authorize', true ) ) { |
|
| 131 | - $this->authorize( 'admin' ); |
|
| 130 | + if (config('shop.authorize', true)) { |
|
| 131 | + $this->authorize('admin'); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | $cntl = $this->createClient(); |
| 135 | - return $this->getHtml( $cntl->get() ); |
|
| 135 | + return $this->getHtml($cntl->get()); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
@@ -143,12 +143,12 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function saveAction() |
| 145 | 145 | { |
| 146 | - if( config( 'shop.authorize', true ) ) { |
|
| 147 | - $this->authorize( 'admin' ); |
|
| 146 | + if (config('shop.authorize', true)) { |
|
| 147 | + $this->authorize('admin'); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | $cntl = $this->createClient(); |
| 151 | - return $this->getHtml( ( $cntl->save() ? : $cntl->search() ) ); |
|
| 151 | + return $this->getHtml(($cntl->save() ?: $cntl->search())); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
@@ -159,12 +159,12 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | public function searchAction() |
| 161 | 161 | { |
| 162 | - if( config( 'shop.authorize', true ) ) { |
|
| 163 | - $this->authorize( 'admin' ); |
|
| 162 | + if (config('shop.authorize', true)) { |
|
| 163 | + $this->authorize('admin'); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | $cntl = $this->createClient(); |
| 167 | - return $this->getHtml( $cntl->search() ); |
|
| 167 | + return $this->getHtml($cntl->search()); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | |
@@ -175,20 +175,20 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | protected function createClient() |
| 177 | 177 | { |
| 178 | - $site = Route::input( 'site', Input::get( 'site', 'default' ) ); |
|
| 179 | - $lang = Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
| 180 | - $resource = Route::input( 'resource' ); |
|
| 178 | + $site = Route::input('site', Input::get('site', 'default')); |
|
| 179 | + $lang = Input::get('lang', config('app.locale', 'en')); |
|
| 180 | + $resource = Route::input('resource'); |
|
| 181 | 181 | |
| 182 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 183 | - $templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' ); |
|
| 182 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 183 | + $templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates'); |
|
| 184 | 184 | |
| 185 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 186 | - $context = $this->setLocale( $context, $site, $lang ); |
|
| 185 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
| 186 | + $context = $this->setLocale($context, $site, $lang); |
|
| 187 | 187 | |
| 188 | - $view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang ); |
|
| 189 | - $context->setView( $view ); |
|
| 188 | + $view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), $templatePaths, $lang); |
|
| 189 | + $context->setView($view); |
|
| 190 | 190 | |
| 191 | - return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource ); |
|
| 191 | + return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | |
@@ -198,12 +198,12 @@ discard block |
||
| 198 | 198 | * @param string $content Content from admin client |
| 199 | 199 | * @return \Illuminate\Contracts\View\View View for rendering the output |
| 200 | 200 | */ |
| 201 | - protected function getHtml( $content ) |
|
| 201 | + protected function getHtml($content) |
|
| 202 | 202 | { |
| 203 | - $version = app( '\Aimeos\Shop\Base\Aimeos' )->getVersion(); |
|
| 204 | - $content = str_replace( ['{type}', '{version}'], ['Laravel', $version], $content ); |
|
| 203 | + $version = app('\Aimeos\Shop\Base\Aimeos')->getVersion(); |
|
| 204 | + $content = str_replace(['{type}', '{version}'], ['Laravel', $version], $content); |
|
| 205 | 205 | |
| 206 | - return View::make( 'shop::jqadm.index', array( 'content' => $content ) ); |
|
| 206 | + return View::make('shop::jqadm.index', array('content' => $content)); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | |
@@ -215,23 +215,23 @@ discard block |
||
| 215 | 215 | * @param string $lang ISO language code, e.g. "en" or "en_GB" |
| 216 | 216 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 217 | 217 | */ |
| 218 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $site, $lang ) |
|
| 218 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $site, $lang) |
|
| 219 | 219 | { |
| 220 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
| 220 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
| 221 | 221 | |
| 222 | 222 | try |
| 223 | 223 | { |
| 224 | - $localeItem = $localeManager->bootstrap( $site, '', '', false ); |
|
| 225 | - $localeItem->setLanguageId( null ); |
|
| 226 | - $localeItem->setCurrencyId( null ); |
|
| 224 | + $localeItem = $localeManager->bootstrap($site, '', '', false); |
|
| 225 | + $localeItem->setLanguageId(null); |
|
| 226 | + $localeItem->setCurrencyId(null); |
|
| 227 | 227 | } |
| 228 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 228 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
| 229 | 229 | { |
| 230 | 230 | $localeItem = $localeManager->createItem(); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - $context->setLocale( $localeItem ); |
|
| 234 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang, 'en' ) ) ); |
|
| 233 | + $context->setLocale($localeItem); |
|
| 234 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang, 'en'))); |
|
| 235 | 235 | |
| 236 | 236 | return $context; |
| 237 | 237 | } |