@@ -163,8 +163,7 @@ |
||
| 163 | 163 | $site = \Route::input( 'site', 'default' ); |
| 164 | 164 | $lang = \Route::input( 'locale', '' ); |
| 165 | 165 | $currency = \Route::input( 'currency', '' ); |
| 166 | - } |
|
| 167 | - else |
|
| 166 | + } else |
|
| 168 | 167 | { |
| 169 | 168 | $site = 'default'; |
| 170 | 169 | $lang = $currency = ''; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * @param \Illuminate\Contracts\Config\Repository $config Configuration object |
| 50 | 50 | * @param \Illuminate\Session\Store $session Laravel session object |
| 51 | 51 | */ |
| 52 | - public function __construct( \Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session ) |
|
| 52 | + public function __construct(\Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session) |
|
| 53 | 53 | { |
| 54 | 54 | $this->config = $config; |
| 55 | 55 | $this->session = $session; |
@@ -62,48 +62,48 @@ discard block |
||
| 62 | 62 | * @param boolean $locale True to add locale object to context, false if not |
| 63 | 63 | * @return \Aimeos\MShop\Context\Item\Iface Context object |
| 64 | 64 | */ |
| 65 | - public function get( $locale = true ) |
|
| 65 | + public function get($locale = true) |
|
| 66 | 66 | { |
| 67 | - if( self::$context === null ) |
|
| 67 | + if (self::$context === null) |
|
| 68 | 68 | { |
| 69 | 69 | $context = new \Aimeos\MShop\Context\Item\Standard(); |
| 70 | 70 | |
| 71 | 71 | $config = $this->getConfig(); |
| 72 | - $context->setConfig( $config ); |
|
| 72 | + $context->setConfig($config); |
|
| 73 | 73 | |
| 74 | - $dbm = new \Aimeos\MW\DB\Manager\PDO( $config ); |
|
| 75 | - $context->setDatabaseManager( $dbm ); |
|
| 74 | + $dbm = new \Aimeos\MW\DB\Manager\PDO($config); |
|
| 75 | + $context->setDatabaseManager($dbm); |
|
| 76 | 76 | |
| 77 | - $fs = new \Aimeos\MW\Filesystem\Manager\Laravel( app( 'filesystem' ), $config, storage_path( 'aimeos' ) ); |
|
| 78 | - $context->setFilesystemManager( $fs ); |
|
| 77 | + $fs = new \Aimeos\MW\Filesystem\Manager\Laravel(app('filesystem'), $config, storage_path('aimeos')); |
|
| 78 | + $context->setFilesystemManager($fs); |
|
| 79 | 79 | |
| 80 | - $mail = new \Aimeos\MW\Mail\Swift( function() { return app( 'mailer' )->getSwiftMailer(); } ); |
|
| 81 | - $context->setMail( $mail ); |
|
| 80 | + $mail = new \Aimeos\MW\Mail\Swift(function() { return app('mailer')->getSwiftMailer(); } ); |
|
| 81 | + $context->setMail($mail); |
|
| 82 | 82 | |
| 83 | - $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context ); |
|
| 84 | - $context->setLogger( $logger ); |
|
| 83 | + $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context); |
|
| 84 | + $context->setLogger($logger); |
|
| 85 | 85 | |
| 86 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context ); |
|
| 87 | - $context->setCache( $cache ); |
|
| 86 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context); |
|
| 87 | + $context->setCache($cache); |
|
| 88 | 88 | |
| 89 | 89 | self::$context = $context; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $context = self::$context; |
| 93 | 93 | |
| 94 | - if( $locale === true ) |
|
| 94 | + if ($locale === true) |
|
| 95 | 95 | { |
| 96 | - $localeItem = $this->getLocale( $context ); |
|
| 96 | + $localeItem = $this->getLocale($context); |
|
| 97 | 97 | $langid = $localeItem->getLanguageId(); |
| 98 | 98 | |
| 99 | - $context->setLocale( $localeItem ); |
|
| 100 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $langid ) ) ); |
|
| 99 | + $context->setLocale($localeItem); |
|
| 100 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($langid))); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - $session = new \Aimeos\MW\Session\Laravel5( $this->session ); |
|
| 104 | - $context->setSession( $session ); |
|
| 103 | + $session = new \Aimeos\MW\Session\Laravel5($this->session); |
|
| 104 | + $context->setSession($session); |
|
| 105 | 105 | |
| 106 | - $this->addUser( $context ); |
|
| 106 | + $this->addUser($context); |
|
| 107 | 107 | |
| 108 | 108 | return $context; |
| 109 | 109 | } |
@@ -114,20 +114,20 @@ discard block |
||
| 114 | 114 | * |
| 115 | 115 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 116 | 116 | */ |
| 117 | - protected function addUser( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 117 | + protected function addUser(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 118 | 118 | { |
| 119 | - if( ( $userid = Auth::id() ) !== null ) |
|
| 119 | + if (($userid = Auth::id()) !== null) |
|
| 120 | 120 | { |
| 121 | - $context->setUserId( $userid ); |
|
| 122 | - $context->setGroupIds( function() use ( $context, $userid ) |
|
| 121 | + $context->setUserId($userid); |
|
| 122 | + $context->setGroupIds(function() use ($context, $userid) |
|
| 123 | 123 | { |
| 124 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' ); |
|
| 125 | - return $manager->getItem( $userid, array( 'customer/group' ) )->getGroups(); |
|
| 124 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer'); |
|
| 125 | + return $manager->getItem($userid, array('customer/group'))->getGroups(); |
|
| 126 | 126 | } ); |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - if( ( $user = Auth::user() ) !== null ) { |
|
| 130 | - $context->setEditor( $user->name ); |
|
| 129 | + if (($user = Auth::user()) !== null) { |
|
| 130 | + $context->setEditor($user->name); |
|
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
@@ -139,14 +139,14 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | protected function getConfig() |
| 141 | 141 | { |
| 142 | - $default = include dirname( dirname( dirname( __DIR__ ) ) ) . DIRECTORY_SEPARATOR . 'default.php'; |
|
| 143 | - $conf = array_replace_recursive( $default, $this->config->get( 'shop' ) ); |
|
| 142 | + $default = include dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'default.php'; |
|
| 143 | + $conf = array_replace_recursive($default, $this->config->get('shop')); |
|
| 144 | 144 | |
| 145 | - $configPaths = app( '\Aimeos\Shop\Base\Aimeos' )->get()->getConfigPaths(); |
|
| 146 | - $config = new \Aimeos\MW\Config\PHPArray( $conf, $configPaths ); |
|
| 145 | + $configPaths = app('\Aimeos\Shop\Base\Aimeos')->get()->getConfigPaths(); |
|
| 146 | + $config = new \Aimeos\MW\Config\PHPArray($conf, $configPaths); |
|
| 147 | 147 | |
| 148 | - if( function_exists( 'apc_store' ) === true && $this->config->get( 'shop.apc_enabled', false ) == true ) { |
|
| 149 | - $config = new \Aimeos\MW\Config\Decorator\APC( $config, $this->config->get( 'shop.apc_prefix', 'laravel:' ) ); |
|
| 148 | + if (function_exists('apc_store') === true && $this->config->get('shop.apc_enabled', false) == true) { |
|
| 149 | + $config = new \Aimeos\MW\Config\Decorator\APC($config, $this->config->get('shop.apc_prefix', 'laravel:')); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | return $config; |
@@ -159,15 +159,15 @@ discard block |
||
| 159 | 159 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 160 | 160 | * @return \Aimeos\MShop\Locale\Item\Iface Locale item object |
| 161 | 161 | */ |
| 162 | - protected function getLocale( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 162 | + protected function getLocale(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 163 | 163 | { |
| 164 | - if( $this->locale === null ) |
|
| 164 | + if ($this->locale === null) |
|
| 165 | 165 | { |
| 166 | - if( Route::current() !== null ) |
|
| 166 | + if (Route::current() !== null) |
|
| 167 | 167 | { |
| 168 | - $site = Route::input( 'site', 'default' ); |
|
| 169 | - $lang = Route::input( 'locale', '' ); |
|
| 170 | - $currency = Route::input( 'currency', '' ); |
|
| 168 | + $site = Route::input('site', 'default'); |
|
| 169 | + $lang = Route::input('locale', ''); |
|
| 170 | + $currency = Route::input('currency', ''); |
|
| 171 | 171 | } |
| 172 | 172 | else |
| 173 | 173 | { |
@@ -175,10 +175,10 @@ discard block |
||
| 175 | 175 | $lang = $currency = ''; |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - $disableSites = $this->config->has( 'shop.disableSites' ); |
|
| 178 | + $disableSites = $this->config->has('shop.disableSites'); |
|
| 179 | 179 | |
| 180 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 181 | - $this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites ); |
|
| 180 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 181 | + $this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites); |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | return $this->locale; |
@@ -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,12 +34,12 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function copyAction() |
| 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 | $cntl = $this->createClient(); |
| 42 | - return $this->getHtml( $cntl->copy() ); |
|
| 42 | + return $this->getHtml($cntl->copy()); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
@@ -50,12 +50,12 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function createAction() |
| 52 | 52 | { |
| 53 | - if( config( 'shop.authorize', true ) ) { |
|
| 54 | - $this->authorize( 'admin' ); |
|
| 53 | + if (config('shop.authorize', true)) { |
|
| 54 | + $this->authorize('admin'); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | $cntl = $this->createClient(); |
| 58 | - return $this->getHtml( $cntl->create() ); |
|
| 58 | + return $this->getHtml($cntl->create()); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function deleteAction() |
| 68 | 68 | { |
| 69 | - if( config( 'shop.authorize', true ) ) { |
|
| 70 | - $this->authorize( 'admin' ); |
|
| 69 | + if (config('shop.authorize', true)) { |
|
| 70 | + $this->authorize('admin'); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | $cntl = $this->createClient(); |
| 74 | - return $this->getHtml( $cntl->delete() . $cntl->search() ); |
|
| 74 | + return $this->getHtml($cntl->delete() . $cntl->search()); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
@@ -82,12 +82,12 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | public function getAction() |
| 84 | 84 | { |
| 85 | - if( config( 'shop.authorize', true ) ) { |
|
| 86 | - $this->authorize( 'admin' ); |
|
| 85 | + if (config('shop.authorize', true)) { |
|
| 86 | + $this->authorize('admin'); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | $cntl = $this->createClient(); |
| 90 | - return $this->getHtml( $cntl->get() ); |
|
| 90 | + return $this->getHtml($cntl->get()); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
@@ -98,12 +98,12 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | public function saveAction() |
| 100 | 100 | { |
| 101 | - if( config( 'shop.authorize', true ) ) { |
|
| 102 | - $this->authorize( 'admin' ); |
|
| 101 | + if (config('shop.authorize', true)) { |
|
| 102 | + $this->authorize('admin'); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | $cntl = $this->createClient(); |
| 106 | - return $this->getHtml( ( $cntl->save() ? : $cntl->search() ) ); |
|
| 106 | + return $this->getHtml(($cntl->save() ?: $cntl->search())); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
@@ -114,12 +114,12 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function searchAction() |
| 116 | 116 | { |
| 117 | - if( config( 'shop.authorize', true ) ) { |
|
| 118 | - $this->authorize( 'admin' ); |
|
| 117 | + if (config('shop.authorize', true)) { |
|
| 118 | + $this->authorize('admin'); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | $cntl = $this->createClient(); |
| 122 | - return $this->getHtml( $cntl->search() ); |
|
| 122 | + return $this->getHtml($cntl->search()); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | |
@@ -130,20 +130,20 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | protected function createClient() |
| 132 | 132 | { |
| 133 | - $site = Route::input( 'site', Input::get( 'site', 'default' ) ); |
|
| 134 | - $lang = Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
| 135 | - $resource = Route::input( 'resource' ); |
|
| 133 | + $site = Route::input('site', Input::get('site', 'default')); |
|
| 134 | + $lang = Input::get('lang', config('app.locale', 'en')); |
|
| 135 | + $resource = Route::input('resource'); |
|
| 136 | 136 | |
| 137 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 138 | - $templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' ); |
|
| 137 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 138 | + $templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates'); |
|
| 139 | 139 | |
| 140 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 141 | - $context = $this->setLocale( $context, $site, $lang ); |
|
| 140 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
| 141 | + $context = $this->setLocale($context, $site, $lang); |
|
| 142 | 142 | |
| 143 | - $view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang ); |
|
| 144 | - $context->setView( $view ); |
|
| 143 | + $view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), $templatePaths, $lang); |
|
| 144 | + $context->setView($view); |
|
| 145 | 145 | |
| 146 | - return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource ); |
|
| 146 | + return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | |
@@ -153,12 +153,12 @@ discard block |
||
| 153 | 153 | * @param string $content Content from admin client |
| 154 | 154 | * @return \Illuminate\Contracts\View\View View for rendering the output |
| 155 | 155 | */ |
| 156 | - protected function getHtml( $content ) |
|
| 156 | + protected function getHtml($content) |
|
| 157 | 157 | { |
| 158 | - $version = app( '\Aimeos\Shop\Base\Aimeos' )->getVersion(); |
|
| 159 | - $content = str_replace( ['{type}', '{version}'], ['Laravel', $version], $content ); |
|
| 158 | + $version = app('\Aimeos\Shop\Base\Aimeos')->getVersion(); |
|
| 159 | + $content = str_replace(['{type}', '{version}'], ['Laravel', $version], $content); |
|
| 160 | 160 | |
| 161 | - return View::make( 'shop::jqadm.index', array( 'content' => $content ) ); |
|
| 161 | + return View::make('shop::jqadm.index', array('content' => $content)); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | |
@@ -170,23 +170,23 @@ discard block |
||
| 170 | 170 | * @param string $lang ISO language code, e.g. "en" or "en_GB" |
| 171 | 171 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 172 | 172 | */ |
| 173 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $site, $lang ) |
|
| 173 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $site, $lang) |
|
| 174 | 174 | { |
| 175 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
| 175 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
| 176 | 176 | |
| 177 | 177 | try |
| 178 | 178 | { |
| 179 | - $localeItem = $localeManager->bootstrap( $site, '', '', false ); |
|
| 180 | - $localeItem->setLanguageId( null ); |
|
| 181 | - $localeItem->setCurrencyId( null ); |
|
| 179 | + $localeItem = $localeManager->bootstrap($site, '', '', false); |
|
| 180 | + $localeItem->setLanguageId(null); |
|
| 181 | + $localeItem->setCurrencyId(null); |
|
| 182 | 182 | } |
| 183 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 183 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
| 184 | 184 | { |
| 185 | 185 | $localeItem = $localeManager->createItem(); |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - $context->setLocale( $localeItem ); |
|
| 189 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang, 'en' ) ) ); |
|
| 188 | + $context->setLocale($localeItem); |
|
| 189 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang, 'en'))); |
|
| 190 | 190 | |
| 191 | 191 | return $context; |
| 192 | 192 | } |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | * @param \Aimeos\Shop\Base\Context $context Context object |
| 48 | 48 | * @param \Aimeos\Shop\Base\View $view View object |
| 49 | 49 | */ |
| 50 | - public function __construct( \Illuminate\Contracts\Config\Repository $config, |
|
| 51 | - \Aimeos\Shop\Base\Aimeos $aimeos, \Aimeos\Shop\Base\Context $context, \Aimeos\Shop\Base\View $view ) |
|
| 50 | + public function __construct(\Illuminate\Contracts\Config\Repository $config, |
|
| 51 | + \Aimeos\Shop\Base\Aimeos $aimeos, \Aimeos\Shop\Base\Context $context, \Aimeos\Shop\Base\View $view) |
|
| 52 | 52 | { |
| 53 | 53 | $this->config = $config; |
| 54 | 54 | $this->aimeos = $aimeos; |
@@ -63,23 +63,23 @@ discard block |
||
| 63 | 63 | * @param string $pageName Name of the configured page |
| 64 | 64 | * @return array Associative list with body and header output separated by client name |
| 65 | 65 | */ |
| 66 | - public function getSections( $pageName ) |
|
| 66 | + public function getSections($pageName) |
|
| 67 | 67 | { |
| 68 | 68 | $context = $this->context->get(); |
| 69 | 69 | $langid = $context->getLocale()->getLanguageId(); |
| 70 | - $tmplPaths = $this->aimeos->get()->getCustomPaths( 'client/html/templates' ); |
|
| 71 | - $view = $this->view->create( $context->getConfig(), $tmplPaths, $langid ); |
|
| 72 | - $context->setView( $view ); |
|
| 70 | + $tmplPaths = $this->aimeos->get()->getCustomPaths('client/html/templates'); |
|
| 71 | + $view = $this->view->create($context->getConfig(), $tmplPaths, $langid); |
|
| 72 | + $context->setView($view); |
|
| 73 | 73 | |
| 74 | - $pagesConfig = $this->config->get( 'shop.page', array() ); |
|
| 75 | - $result = array( 'aibody' => array(), 'aiheader' => array() ); |
|
| 74 | + $pagesConfig = $this->config->get('shop.page', array()); |
|
| 75 | + $result = array('aibody' => array(), 'aiheader' => array()); |
|
| 76 | 76 | |
| 77 | - if( isset( $pagesConfig[$pageName] ) ) |
|
| 77 | + if (isset($pagesConfig[$pageName])) |
|
| 78 | 78 | { |
| 79 | - foreach( (array) $pagesConfig[$pageName] as $clientName ) |
|
| 79 | + foreach ((array) $pagesConfig[$pageName] as $clientName) |
|
| 80 | 80 | { |
| 81 | - $client = \Aimeos\Client\Html\Factory::createClient( $context, $tmplPaths, $clientName ); |
|
| 82 | - $client->setView( clone $view ); |
|
| 81 | + $client = \Aimeos\Client\Html\Factory::createClient($context, $tmplPaths, $clientName); |
|
| 82 | + $client->setView(clone $view); |
|
| 83 | 83 | $client->process(); |
| 84 | 84 | |
| 85 | 85 | $result['aibody'][$clientName] = $client->getBody(); |
@@ -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 $groupcode Unique user/customer group code |
| 43 | 43 | * @return boolean True if user is part of the group, false if not |
| 44 | 44 | */ |
| 45 | - public function checkGroup( $userid, $groupcode ) |
|
| 45 | + public function checkGroup($userid, $groupcode) |
|
| 46 | 46 | { |
| 47 | 47 | $context = $this->context->get(); |
| 48 | - $group = \Aimeos\MShop\Factory::createManager( $context, 'customer/group' )->findItem( $groupcode ); |
|
| 49 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' ); |
|
| 48 | + $group = \Aimeos\MShop\Factory::createManager($context, 'customer/group')->findItem($groupcode); |
|
| 49 | + $manager = \Aimeos\MShop\Factory::createManager($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', $group->getId() ), |
|
| 55 | - $search->compare( '==', 'customer.lists.domain', 'customer/group' ), |
|
| 53 | + $search->compare('==', 'customer.lists.parentid', $userid), |
|
| 54 | + $search->compare('==', 'customer.lists.refid', $group->getId()), |
|
| 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 | \ No newline at end of file |
@@ -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 | { |
@@ -34,63 +34,63 @@ discard block |
||
| 34 | 34 | * @param \Illuminate\Http\Request $request Laravel request object |
| 35 | 35 | * @return \Illuminate\Contracts\View\View View for rendering the output |
| 36 | 36 | */ |
| 37 | - public function indexAction( Request $request ) |
|
| 37 | + public function indexAction(Request $request) |
|
| 38 | 38 | { |
| 39 | - if( config( 'shop.authorize', true ) ) { |
|
| 40 | - $this->authorize( 'admin' ); |
|
| 39 | + if (config('shop.authorize', true)) { |
|
| 40 | + $this->authorize('admin'); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - $site = Route::input( 'site', 'default' ); |
|
| 44 | - $lang = Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
| 43 | + $site = Route::input('site', 'default'); |
|
| 44 | + $lang = Input::get('lang', config('app.locale', 'en')); |
|
| 45 | 45 | |
| 46 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' ); |
|
| 46 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos'); |
|
| 47 | 47 | |
| 48 | 48 | $bootstrap = $aimeos->get(); |
| 49 | - $cntlPaths = $bootstrap->getCustomPaths( 'controller/extjs' ); |
|
| 49 | + $cntlPaths = $bootstrap->getCustomPaths('controller/extjs'); |
|
| 50 | 50 | |
| 51 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 52 | - $context = $this->setLocale( $context, $site, $lang ); |
|
| 51 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
| 52 | + $context = $this->setLocale($context, $site, $lang); |
|
| 53 | 53 | |
| 54 | - $controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths ); |
|
| 54 | + $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); |
|
| 55 | 55 | $cssFiles = array(); |
| 56 | 56 | |
| 57 | - foreach( $bootstrap->getCustomPaths( 'admin/extjs' ) as $base => $paths ) |
|
| 57 | + foreach ($bootstrap->getCustomPaths('admin/extjs') as $base => $paths) |
|
| 58 | 58 | { |
| 59 | - foreach( $paths as $path ) |
|
| 59 | + foreach ($paths as $path) |
|
| 60 | 60 | { |
| 61 | 61 | $jsbAbsPath = $base . '/' . $path; |
| 62 | 62 | |
| 63 | - if( !is_file( $jsbAbsPath ) ) { |
|
| 64 | - throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) ); |
|
| 63 | + if (!is_file($jsbAbsPath)) { |
|
| 64 | + throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath)); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) ); |
|
| 68 | - $cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) ); |
|
| 67 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path)); |
|
| 68 | + $cssFiles = array_merge($cssFiles, $jsb2->getUrls('css')); |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - $jqadmUrl = route( 'aimeos_shop_jqadm_search', array( 'site' => $site, 'resource' => 'product' ) ); |
|
| 73 | - $jsonUrl = route( 'aimeos_shop_extadm_json', array( 'site' => $site, '_token' => csrf_token() ) ); |
|
| 74 | - $adminUrl = route( 'aimeos_shop_extadm', array( 'site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>' ) ); |
|
| 72 | + $jqadmUrl = route('aimeos_shop_jqadm_search', array('site' => $site, 'resource' => 'product')); |
|
| 73 | + $jsonUrl = route('aimeos_shop_extadm_json', array('site' => $site, '_token' => csrf_token())); |
|
| 74 | + $adminUrl = route('aimeos_shop_extadm', array('site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>')); |
|
| 75 | 75 | |
| 76 | 76 | $vars = array( |
| 77 | 77 | 'lang' => $lang, |
| 78 | 78 | 'cssFiles' => $cssFiles, |
| 79 | - 'languages' => $this->getJsonLanguages( $context), |
|
| 80 | - 'config' => $this->getJsonClientConfig( $context ), |
|
| 81 | - 'site' => $this->getJsonSiteItem( $context, $site ), |
|
| 82 | - 'i18nContent' => $this->getJsonClientI18n( $bootstrap->getI18nPaths(), $lang ), |
|
| 79 | + 'languages' => $this->getJsonLanguages($context), |
|
| 80 | + 'config' => $this->getJsonClientConfig($context), |
|
| 81 | + 'site' => $this->getJsonSiteItem($context, $site), |
|
| 82 | + 'i18nContent' => $this->getJsonClientI18n($bootstrap->getI18nPaths(), $lang), |
|
| 83 | 83 | 'searchSchemas' => $controller->getJsonSearchSchemas(), |
| 84 | 84 | 'itemSchemas' => $controller->getJsonItemSchemas(), |
| 85 | - 'smd' => $controller->getJsonSmd( $jsonUrl ), |
|
| 86 | - 'urlTemplate' => str_replace( ['<', '>'], ['{', '}'], urldecode( $adminUrl ) ), |
|
| 87 | - 'uploaddir' => config( 'shop::uploaddir' ), |
|
| 88 | - 'activeTab' => Input::get( 'tab', 0 ), |
|
| 85 | + 'smd' => $controller->getJsonSmd($jsonUrl), |
|
| 86 | + 'urlTemplate' => str_replace(['<', '>'], ['{', '}'], urldecode($adminUrl)), |
|
| 87 | + 'uploaddir' => config('shop::uploaddir'), |
|
| 88 | + 'activeTab' => Input::get('tab', 0), |
|
| 89 | 89 | 'version' => $aimeos->getVersion(), |
| 90 | 90 | 'jqadmurl' => $jqadmUrl, |
| 91 | 91 | ); |
| 92 | 92 | |
| 93 | - return View::make( 'shop::extadm.index', $vars ); |
|
| 93 | + return View::make('shop::extadm.index', $vars); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
@@ -100,23 +100,23 @@ discard block |
||
| 100 | 100 | * @param \Illuminate\Http\Request $request Laravel request object |
| 101 | 101 | * @return \Illuminate\Contracts\View\View View for rendering the output |
| 102 | 102 | */ |
| 103 | - public function doAction( Request $request ) |
|
| 103 | + public function doAction(Request $request) |
|
| 104 | 104 | { |
| 105 | - if( config( 'shop.authorize', true ) ) { |
|
| 106 | - $this->authorize( 'admin' ); |
|
| 105 | + if (config('shop.authorize', true)) { |
|
| 106 | + $this->authorize('admin'); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 110 | - $cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' ); |
|
| 109 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 110 | + $cntlPaths = $aimeos->getCustomPaths('controller/extjs'); |
|
| 111 | 111 | |
| 112 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 113 | - $context->setView( app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), array() ) ); |
|
| 114 | - $context = $this->setLocale( $context ); |
|
| 112 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
| 113 | + $context->setView(app('\Aimeos\Shop\Base\View')->create($context->getConfig(), array())); |
|
| 114 | + $context = $this->setLocale($context); |
|
| 115 | 115 | |
| 116 | - $controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths ); |
|
| 116 | + $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); |
|
| 117 | 117 | |
| 118 | - $response = $controller->process( Input::instance()->request->all(), $request->getContent() ); |
|
| 119 | - return View::make( 'shop::extadm.do', array( 'output' => $response ) ); |
|
| 118 | + $response = $controller->process(Input::instance()->request->all(), $request->getContent()); |
|
| 119 | + return View::make('shop::extadm.do', array('output' => $response)); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
@@ -127,32 +127,32 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function fileAction() |
| 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 | $contents = ''; |
| 135 | 135 | $jsFiles = array(); |
| 136 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 136 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 137 | 137 | |
| 138 | - foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths ) |
|
| 138 | + foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths) |
|
| 139 | 139 | { |
| 140 | - foreach( $paths as $path ) |
|
| 140 | + foreach ($paths as $path) |
|
| 141 | 141 | { |
| 142 | 142 | $jsbAbsPath = $base . '/' . $path; |
| 143 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) ); |
|
| 144 | - $jsFiles = array_merge( $jsFiles, $jsb2->getFiles( 'js' ) ); |
|
| 143 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath)); |
|
| 144 | + $jsFiles = array_merge($jsFiles, $jsb2->getFiles('js')); |
|
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - foreach( $jsFiles as $file ) |
|
| 148 | + foreach ($jsFiles as $file) |
|
| 149 | 149 | { |
| 150 | - if( ( $content = file_get_contents( $file ) ) !== false ) { |
|
| 150 | + if (($content = file_get_contents($file)) !== false) { |
|
| 151 | 151 | $contents .= $content; |
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - return response( $contents )->header( 'Content-Type', 'application/javascript' ); |
|
| 155 | + return response($contents)->header('Content-Type', 'application/javascript'); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | |
@@ -162,15 +162,15 @@ discard block |
||
| 162 | 162 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 163 | 163 | * @return array List of language IDs with labels |
| 164 | 164 | */ |
| 165 | - protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 165 | + protected function getJsonLanguages(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 166 | 166 | { |
| 167 | 167 | $result = array(); |
| 168 | 168 | |
| 169 | - foreach( app( '\Aimeos\Shop\Base\Aimeos' )->get()->getI18nList( 'admin' ) as $id ) { |
|
| 170 | - $result[] = array( 'id' => $id, 'label' => $id ); |
|
| 169 | + foreach (app('\Aimeos\Shop\Base\Aimeos')->get()->getI18nList('admin') as $id) { |
|
| 170 | + $result[] = array('id' => $id, 'label' => $id); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - return json_encode( $result ); |
|
| 173 | + return json_encode($result); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
@@ -180,10 +180,10 @@ discard block |
||
| 180 | 180 | * @param \Aimeos\MShop\Context\Item\Iface $context Context item object |
| 181 | 181 | * @return string JSON encoded configuration object |
| 182 | 182 | */ |
| 183 | - protected function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 183 | + protected function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 184 | 184 | { |
| 185 | - $config = $context->getConfig()->get( 'admin/extjs', array() ); |
|
| 186 | - return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT ); |
|
| 185 | + $config = $context->getConfig()->get('admin/extjs', array()); |
|
| 186 | + return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | |
@@ -194,16 +194,16 @@ discard block |
||
| 194 | 194 | * @param string $lang ISO language code like "en" or "en_GB" |
| 195 | 195 | * @return string JSON encoded translation object |
| 196 | 196 | */ |
| 197 | - protected function getJsonClientI18n( array $i18nPaths, $lang ) |
|
| 197 | + protected function getJsonClientI18n(array $i18nPaths, $lang) |
|
| 198 | 198 | { |
| 199 | - $i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $lang ); |
|
| 199 | + $i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $lang); |
|
| 200 | 200 | |
| 201 | 201 | $content = array( |
| 202 | - 'admin' => $i18n->getAll( 'admin' ), |
|
| 203 | - 'admin/ext' => $i18n->getAll( 'admin/ext' ), |
|
| 202 | + 'admin' => $i18n->getAll('admin'), |
|
| 203 | + 'admin/ext' => $i18n->getAll('admin/ext'), |
|
| 204 | 204 | ); |
| 205 | 205 | |
| 206 | - return json_encode( $content, JSON_FORCE_OBJECT ); |
|
| 206 | + return json_encode($content, JSON_FORCE_OBJECT); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | |
@@ -215,19 +215,19 @@ discard block |
||
| 215 | 215 | * @return string JSON encoded site item object |
| 216 | 216 | * @throws Exception If no site item was found for the code |
| 217 | 217 | */ |
| 218 | - protected function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site ) |
|
| 218 | + protected function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site) |
|
| 219 | 219 | { |
| 220 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' ); |
|
| 220 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site'); |
|
| 221 | 221 | |
| 222 | 222 | $criteria = $manager->createSearch(); |
| 223 | - $criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) ); |
|
| 224 | - $items = $manager->searchItems( $criteria ); |
|
| 223 | + $criteria->setConditions($criteria->compare('==', 'locale.site.code', $site)); |
|
| 224 | + $items = $manager->searchItems($criteria); |
|
| 225 | 225 | |
| 226 | - if( ( $item = reset( $items ) ) === false ) { |
|
| 227 | - throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) ); |
|
| 226 | + if (($item = reset($items)) === false) { |
|
| 227 | + throw new \Exception(sprintf('No site found for code "%1$s"', $site)); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - return json_encode( $item->toArray() ); |
|
| 230 | + return json_encode($item->toArray()); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | |
@@ -239,17 +239,17 @@ discard block |
||
| 239 | 239 | * @param string $locale ISO language code, e.g. "en" or "en_GB" |
| 240 | 240 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 241 | 241 | */ |
| 242 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null ) |
|
| 242 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null) |
|
| 243 | 243 | { |
| 244 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
| 244 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
| 245 | 245 | |
| 246 | 246 | try { |
| 247 | - $localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false ); |
|
| 248 | - } catch( \Aimeos\MShop\Locale\Exception $e ) { |
|
| 247 | + $localeItem = $localeManager->bootstrap($sitecode, $locale, '', false); |
|
| 248 | + } catch (\Aimeos\MShop\Locale\Exception $e) { |
|
| 249 | 249 | $localeItem = $localeManager->createItem(); |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | - $context->setLocale( $localeItem ); |
|
| 252 | + $context->setLocale($localeItem); |
|
| 253 | 253 | |
| 254 | 254 | return $context; |
| 255 | 255 | } |
@@ -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 | - if( config( 'shop.authorize', true ) && !( Auth::check() && $request->user()->can( 'admin' ) ) ) { |
|
| 42 | - return View::make( 'shop::admin.index' ); |
|
| 41 | + if (config('shop.authorize', true) && !(Auth::check() && $request->user()->can('admin'))) { |
|
| 42 | + return View::make('shop::admin.index'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | $param = array( |
| 46 | 46 | 'resource' => 'product', |
| 47 | - 'site' => Route::input( 'site', 'default' ), |
|
| 48 | - 'lang' => Input::get( 'lang', config( 'app.locale', 'en' ) ), |
|
| 47 | + 'site' => Route::input('site', 'default'), |
|
| 48 | + 'lang' => Input::get('lang', config('app.locale', 'en')), |
|
| 49 | 49 | ); |
| 50 | 50 | |
| 51 | - return redirect()->route( 'aimeos_shop_jqadm_search', $param ); |
|
| 51 | + return redirect()->route('aimeos_shop_jqadm_search', $param); |
|
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | \ No newline at end of file |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * |
| 35 | 35 | * @param \Illuminate\Contracts\Config\Repository $config Configuration object |
| 36 | 36 | */ |
| 37 | - public function __construct( \Illuminate\Contracts\Config\Repository $config ) |
|
| 37 | + public function __construct(\Illuminate\Contracts\Config\Repository $config) |
|
| 38 | 38 | { |
| 39 | 39 | $this->config = $config; |
| 40 | 40 | } |
@@ -47,10 +47,10 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function get() |
| 49 | 49 | { |
| 50 | - if( $this->object === null ) |
|
| 50 | + if ($this->object === null) |
|
| 51 | 51 | { |
| 52 | - $extDirs = (array) $this->config->get( 'shop.extdir', array() ); |
|
| 53 | - $this->object = new \Aimeos\Bootstrap( $extDirs, false ); |
|
| 52 | + $extDirs = (array) $this->config->get('shop.extdir', array()); |
|
| 53 | + $this->object = new \Aimeos\Bootstrap($extDirs, false); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return $this->object; |
@@ -64,12 +64,12 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function getVersion() |
| 66 | 66 | { |
| 67 | - if( ( $content = @file_get_contents( base_path( 'composer.lock' ) ) ) !== false |
|
| 68 | - && ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] ) |
|
| 67 | + if (($content = @file_get_contents(base_path('composer.lock'))) !== false |
|
| 68 | + && ($content = json_decode($content, true)) !== null && isset($content['packages']) |
|
| 69 | 69 | ) { |
| 70 | - foreach( (array) $content['packages'] as $item ) |
|
| 70 | + foreach ((array) $content['packages'] as $item) |
|
| 71 | 71 | { |
| 72 | - if( $item['name'] === 'aimeos/aimeos-laravel' ) { |
|
| 72 | + if ($item['name'] === 'aimeos/aimeos-laravel') { |
|
| 73 | 73 | return $item['version']; |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | |
| 46 | 46 | <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/adapter/ext/ext-base.js"></script> |
| 47 | 47 | <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/ext-all.js"></script> |
| 48 | - <script type="text/javascript" src="<?= route( 'aimeos_shop_extadm_file', array( 'site' => 'default' ) ); ?>"></script> |
|
| 48 | + <script type="text/javascript" src="<?= route('aimeos_shop_extadm_file', array('site' => 'default')); ?>"></script> |
|
| 49 | 49 | |
| 50 | 50 | </head> |
| 51 | 51 | <body> |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | Route::group(config('shop.routes.login', ['middleware' => ['web']]), function() { |
| 4 | 4 | |
| 5 | - Route::match( array( 'GET' ), 'admin', array( |
|
| 5 | + Route::match(array('GET'), 'admin', array( |
|
| 6 | 6 | 'as' => 'aimeos_shop_admin', |
| 7 | 7 | 'uses' => 'Aimeos\Shop\Controller\AdminController@indexAction' |
| 8 | 8 | )); |
@@ -12,104 +12,104 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | Route::group(config('shop.routes.admin', ['middleware' => ['web', 'auth']]), function() { |
| 14 | 14 | |
| 15 | - Route::match( array( 'GET' ), 'extadm', array( |
|
| 15 | + Route::match(array('GET'), 'extadm', array( |
|
| 16 | 16 | 'as' => 'aimeos_shop_extadm', |
| 17 | 17 | 'uses' => 'Aimeos\Shop\Controller\ExtadmController@indexAction' |
| 18 | 18 | )); |
| 19 | 19 | |
| 20 | - Route::match( array( 'GET' ), 'extadm/file', array( |
|
| 20 | + Route::match(array('GET'), 'extadm/file', array( |
|
| 21 | 21 | 'as' => 'aimeos_shop_extadm_file', |
| 22 | 22 | 'uses' => 'Aimeos\Shop\Controller\ExtadmController@fileAction' |
| 23 | 23 | )); |
| 24 | 24 | |
| 25 | - Route::match( array( 'POST' ), 'extadm/do', array( |
|
| 25 | + Route::match(array('POST'), 'extadm/do', array( |
|
| 26 | 26 | 'as' => 'aimeos_shop_extadm_json', |
| 27 | 27 | 'uses' => 'Aimeos\Shop\Controller\ExtadmController@doAction' |
| 28 | 28 | )); |
| 29 | 29 | |
| 30 | 30 | |
| 31 | - Route::match( array( 'GET', 'POST' ), 'jqadm/copy/{resource}/{id}', array( |
|
| 31 | + Route::match(array('GET', 'POST'), 'jqadm/copy/{resource}/{id}', array( |
|
| 32 | 32 | 'as' => 'aimeos_shop_jqadm_copy', |
| 33 | 33 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@copyAction' |
| 34 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]+' ) ); |
|
| 34 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]+')); |
|
| 35 | 35 | |
| 36 | - Route::match( array( 'GET', 'POST' ), 'jqadm/create/{resource}', array( |
|
| 36 | + Route::match(array('GET', 'POST'), 'jqadm/create/{resource}', array( |
|
| 37 | 37 | 'as' => 'aimeos_shop_jqadm_create', |
| 38 | 38 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@createAction' |
| 39 | - ))->where( array( 'resource' => '[^0-9]+' ) ); |
|
| 39 | + ))->where(array('resource' => '[^0-9]+')); |
|
| 40 | 40 | |
| 41 | - Route::match( array( 'GET', 'POST' ), 'jqadm/delete/{resource}/{id}', array( |
|
| 41 | + Route::match(array('GET', 'POST'), 'jqadm/delete/{resource}/{id}', array( |
|
| 42 | 42 | 'as' => 'aimeos_shop_jqadm_delete', |
| 43 | 43 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@deleteAction' |
| 44 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]+' ) ); |
|
| 44 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]+')); |
|
| 45 | 45 | |
| 46 | - Route::match( array( 'GET' ), 'jqadm/get/{resource}/{id}', array( |
|
| 46 | + Route::match(array('GET'), 'jqadm/get/{resource}/{id}', array( |
|
| 47 | 47 | 'as' => 'aimeos_shop_jqadm_get', |
| 48 | 48 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@getAction' |
| 49 | - ))->where( array( 'resource' => '[^0-9]*', 'id' => '[0-9]+' ) ); |
|
| 49 | + ))->where(array('resource' => '[^0-9]*', 'id' => '[0-9]+')); |
|
| 50 | 50 | |
| 51 | - Route::match( array( 'POST' ), 'jqadm/save/{resource}/{id?}', array( |
|
| 51 | + Route::match(array('POST'), 'jqadm/save/{resource}/{id?}', array( |
|
| 52 | 52 | 'as' => 'aimeos_shop_jqadm_save', |
| 53 | 53 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@saveAction' |
| 54 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
| 54 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
| 55 | 55 | |
| 56 | - Route::match( array( 'GET', 'POST' ), 'jqadm/search/{resource}', array( |
|
| 56 | + Route::match(array('GET', 'POST'), 'jqadm/search/{resource}', array( |
|
| 57 | 57 | 'as' => 'aimeos_shop_jqadm_search', |
| 58 | 58 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@searchAction' |
| 59 | - ))->where( array( 'resource' => '[^0-9]+' ) ); |
|
| 59 | + ))->where(array('resource' => '[^0-9]+')); |
|
| 60 | 60 | |
| 61 | 61 | |
| 62 | - Route::match( array( 'DELETE' ), 'jsonadm/{resource}/{id?}', array( |
|
| 62 | + Route::match(array('DELETE'), 'jsonadm/{resource}/{id?}', array( |
|
| 63 | 63 | 'as' => 'aimeos_shop_jsonadm_delete', |
| 64 | 64 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@deleteAction' |
| 65 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
| 65 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
| 66 | 66 | |
| 67 | - Route::match( array( 'GET' ), 'jsonadm/{resource}/{id?}', array( |
|
| 67 | + Route::match(array('GET'), 'jsonadm/{resource}/{id?}', array( |
|
| 68 | 68 | 'as' => 'aimeos_shop_jsonadm_get', |
| 69 | 69 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@getAction' |
| 70 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
| 70 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
| 71 | 71 | |
| 72 | - Route::match( array( 'PATCH' ), 'jsonadm/{resource}/{id?}', array( |
|
| 72 | + Route::match(array('PATCH'), 'jsonadm/{resource}/{id?}', array( |
|
| 73 | 73 | 'as' => 'aimeos_shop_jsonadm_patch', |
| 74 | 74 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@patchAction' |
| 75 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
| 75 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
| 76 | 76 | |
| 77 | - Route::match( array( 'POST' ), 'jsonadm/{resource}/{id?}', array( |
|
| 77 | + Route::match(array('POST'), 'jsonadm/{resource}/{id?}', array( |
|
| 78 | 78 | 'as' => 'aimeos_shop_jsonadm_post', |
| 79 | 79 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@postAction' |
| 80 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
| 80 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
| 81 | 81 | |
| 82 | - Route::match( array( 'PUT' ), 'jsonadm/{resource}/{id?}', array( |
|
| 82 | + Route::match(array('PUT'), 'jsonadm/{resource}/{id?}', array( |
|
| 83 | 83 | 'as' => 'aimeos_shop_jsonadm_put', |
| 84 | 84 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@putAction' |
| 85 | - ))->where( array( 'resource' => '[^0-9]+', 'id' => '[0-9]*' ) ); |
|
| 85 | + ))->where(array('resource' => '[^0-9]+', 'id' => '[0-9]*')); |
|
| 86 | 86 | |
| 87 | - Route::match( array( 'OPTIONS' ), 'jsonadm/{resource?}', array( |
|
| 87 | + Route::match(array('OPTIONS'), 'jsonadm/{resource?}', array( |
|
| 88 | 88 | 'as' => 'aimeos_shop_jsonadm_options', |
| 89 | 89 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@optionsAction' |
| 90 | - ))->where( array( 'resource' => '[^0-9]*' ) ); |
|
| 90 | + ))->where(array('resource' => '[^0-9]*')); |
|
| 91 | 91 | |
| 92 | 92 | }); |
| 93 | 93 | |
| 94 | 94 | |
| 95 | 95 | Route::group(config('shop.routes.account', ['middleware' => ['web', 'auth']]), function() { |
| 96 | 96 | |
| 97 | - Route::match( array( 'GET', 'POST' ), 'myaccount', array( |
|
| 97 | + Route::match(array('GET', 'POST'), 'myaccount', array( |
|
| 98 | 98 | 'as' => 'aimeos_shop_account', |
| 99 | 99 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
| 100 | 100 | )); |
| 101 | 101 | |
| 102 | - Route::match( array( 'GET', 'POST' ), 'myaccount/favorite/{fav_action?}/{fav_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
| 102 | + Route::match(array('GET', 'POST'), 'myaccount/favorite/{fav_action?}/{fav_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
| 103 | 103 | 'as' => 'aimeos_shop_account_favorite', |
| 104 | 104 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
| 105 | 105 | )); |
| 106 | 106 | |
| 107 | - Route::match( array( 'GET', 'POST' ), 'myaccount/watch/{wat_action?}/{wat_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
| 107 | + Route::match(array('GET', 'POST'), 'myaccount/watch/{wat_action?}/{wat_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
| 108 | 108 | 'as' => 'aimeos_shop_account_watch', |
| 109 | 109 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
| 110 | 110 | )); |
| 111 | 111 | |
| 112 | - Route::match( array( 'GET', 'POST' ), 'myaccount/download/{dl_id}', array( |
|
| 112 | + Route::match(array('GET', 'POST'), 'myaccount/download/{dl_id}', array( |
|
| 113 | 113 | 'as' => 'aimeos_shop_download', |
| 114 | 114 | 'uses' => 'Aimeos\Shop\Controller\AccountController@downloadAction' |
| 115 | 115 | )); |
@@ -119,42 +119,42 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | Route::group(config('shop.routes.default', ['middleware' => ['web']]), function() { |
| 121 | 121 | |
| 122 | - Route::match( array( 'GET', 'POST' ), 'count', array( |
|
| 122 | + Route::match(array('GET', 'POST'), 'count', array( |
|
| 123 | 123 | 'as' => 'aimeos_shop_count', |
| 124 | 124 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@countAction' |
| 125 | 125 | )); |
| 126 | 126 | |
| 127 | - Route::match( array( 'GET', 'POST' ), 'detail/{d_prodid}/{d_name?}/{l_pos?}', array( |
|
| 127 | + Route::match(array('GET', 'POST'), 'detail/{d_prodid}/{d_name?}/{l_pos?}', array( |
|
| 128 | 128 | 'as' => 'aimeos_shop_detail', |
| 129 | 129 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@detailAction' |
| 130 | 130 | )); |
| 131 | 131 | |
| 132 | - Route::match( array( 'GET', 'POST' ), 'detail/pin/{pin_action?}/{pin_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
| 132 | + Route::match(array('GET', 'POST'), 'detail/pin/{pin_action?}/{pin_id?}/{d_prodid?}/{d_name?}/{l_pos?}', array( |
|
| 133 | 133 | 'as' => 'aimeos_shop_session_pinned', |
| 134 | 134 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@detailAction' |
| 135 | 135 | )); |
| 136 | 136 | |
| 137 | - Route::match( array( 'GET', 'POST' ), 'list', array( |
|
| 137 | + Route::match(array('GET', 'POST'), 'list', array( |
|
| 138 | 138 | 'as' => 'aimeos_shop_list', |
| 139 | 139 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@listAction' |
| 140 | 140 | )); |
| 141 | 141 | |
| 142 | - Route::match( array( 'GET', 'POST' ), 'suggest', array( |
|
| 142 | + Route::match(array('GET', 'POST'), 'suggest', array( |
|
| 143 | 143 | 'as' => 'aimeos_shop_suggest', |
| 144 | 144 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@suggestAction' |
| 145 | 145 | )); |
| 146 | 146 | |
| 147 | - Route::match( array( 'GET', 'POST' ), 'stock', array( |
|
| 147 | + Route::match(array('GET', 'POST'), 'stock', array( |
|
| 148 | 148 | 'as' => 'aimeos_shop_stock', |
| 149 | 149 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@stockAction' |
| 150 | 150 | )); |
| 151 | 151 | |
| 152 | - Route::match( array( 'GET', 'POST' ), 'basket', array( |
|
| 152 | + Route::match(array('GET', 'POST'), 'basket', array( |
|
| 153 | 153 | 'as' => 'aimeos_shop_basket', |
| 154 | 154 | 'uses' => 'Aimeos\Shop\Controller\BasketController@indexAction' |
| 155 | 155 | )); |
| 156 | 156 | |
| 157 | - Route::match( array( 'GET', 'POST' ), 'checkout/{c_step?}', array( |
|
| 157 | + Route::match(array('GET', 'POST'), 'checkout/{c_step?}', array( |
|
| 158 | 158 | 'as' => 'aimeos_shop_checkout', |
| 159 | 159 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@indexAction' |
| 160 | 160 | )); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | Route::group(config('shop.routes.confirm', ['middleware' => ['web']]), function() { |
| 166 | 166 | |
| 167 | - Route::match( array( 'GET', 'POST' ), 'confirm', array( |
|
| 167 | + Route::match(array('GET', 'POST'), 'confirm', array( |
|
| 168 | 168 | 'as' => 'aimeos_shop_confirm', |
| 169 | 169 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@confirmAction' |
| 170 | 170 | )); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | Route::group(config('shop.routes.update', []), function() { |
| 176 | 176 | |
| 177 | - Route::match( array( 'GET', 'POST' ), 'update', array( |
|
| 177 | + Route::match(array('GET', 'POST'), 'update', array( |
|
| 178 | 178 | 'as' => 'aimeos_shop_update', |
| 179 | 179 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@updateAction' |
| 180 | 180 | )); |