@@ -35,17 +35,17 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function indexAction() |
| 37 | 37 | { |
| 38 | - if( config( 'shop.authorize', true ) ) { |
|
| 39 | - $this->authorize( 'admin' ); |
|
| 38 | + if (config('shop.authorize', true)) { |
|
| 39 | + $this->authorize('admin'); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $param = array( |
| 43 | 43 | 'resource' => 'product', |
| 44 | - 'site' => Route::input( 'site', 'default' ), |
|
| 45 | - 'lang' => Input::get( 'lang', config( 'app.locale', 'en' ) ), |
|
| 44 | + 'site' => Route::input('site', 'default'), |
|
| 45 | + 'lang' => Input::get('lang', config('app.locale', 'en')), |
|
| 46 | 46 | ); |
| 47 | 47 | |
| 48 | - return redirect()->route( 'aimeos_shop_jqadm_search', $param ); |
|
| 48 | + return redirect()->route('aimeos_shop_jqadm_search', $param); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
@@ -56,12 +56,12 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | protected function getVersion() |
| 58 | 58 | { |
| 59 | - if( ( $content = @file_get_contents( base_path( 'composer.lock' ) ) ) !== false |
|
| 60 | - && ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] ) |
|
| 59 | + if (($content = @file_get_contents(base_path('composer.lock'))) !== false |
|
| 60 | + && ($content = json_decode($content, true)) !== null && isset($content['packages']) |
|
| 61 | 61 | ) { |
| 62 | - foreach( (array) $content['packages'] as $item ) |
|
| 62 | + foreach ((array) $content['packages'] as $item) |
|
| 63 | 63 | { |
| 64 | - if( $item['name'] === 'aimeos/aimeos-laravel' ) { |
|
| 64 | + if ($item['name'] === 'aimeos/aimeos-laravel') { |
|
| 65 | 65 | return $item['version']; |
| 66 | 66 | } |
| 67 | 67 | } |
@@ -79,23 +79,23 @@ discard block |
||
| 79 | 79 | * @param string $lang ISO language code, e.g. "en" or "en_GB" |
| 80 | 80 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 81 | 81 | */ |
| 82 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $lang = null ) |
|
| 82 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $lang = null) |
|
| 83 | 83 | { |
| 84 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
| 84 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
| 85 | 85 | |
| 86 | 86 | try |
| 87 | 87 | { |
| 88 | - $localeItem = $localeManager->bootstrap( $sitecode, '', '', false ); |
|
| 89 | - $localeItem->setLanguageId( null ); |
|
| 90 | - $localeItem->setCurrencyId( null ); |
|
| 88 | + $localeItem = $localeManager->bootstrap($sitecode, '', '', false); |
|
| 89 | + $localeItem->setLanguageId(null); |
|
| 90 | + $localeItem->setCurrencyId(null); |
|
| 91 | 91 | } |
| 92 | - catch( \Aimeos\MShop\Locale\Exception $e ) |
|
| 92 | + catch (\Aimeos\MShop\Locale\Exception $e) |
|
| 93 | 93 | { |
| 94 | 94 | $localeItem = $localeManager->createItem(); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - $context->setLocale( $localeItem ); |
|
| 98 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $lang ) ) ); |
|
| 97 | + $context->setLocale($localeItem); |
|
| 98 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($lang))); |
|
| 99 | 99 | |
| 100 | 100 | return $context; |
| 101 | 101 | } |
@@ -34,54 +34,54 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function indexAction() |
| 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 | - $site = Route::input( 'site', 'default' ); |
|
| 42 | - $lang = Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
| 41 | + $site = Route::input('site', 'default'); |
|
| 42 | + $lang = Input::get('lang', config('app.locale', 'en')); |
|
| 43 | 43 | |
| 44 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 45 | - $cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' ); |
|
| 44 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 45 | + $cntlPaths = $aimeos->getCustomPaths('controller/extjs'); |
|
| 46 | 46 | |
| 47 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 48 | - $context = $this->setLocale( $context, $site, $lang ); |
|
| 47 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
| 48 | + $context = $this->setLocale($context, $site, $lang); |
|
| 49 | 49 | |
| 50 | - $controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths ); |
|
| 50 | + $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); |
|
| 51 | 51 | $cssFiles = array(); |
| 52 | 52 | |
| 53 | - foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths ) |
|
| 53 | + foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths) |
|
| 54 | 54 | { |
| 55 | - foreach( $paths as $path ) |
|
| 55 | + foreach ($paths as $path) |
|
| 56 | 56 | { |
| 57 | 57 | $jsbAbsPath = $base . '/' . $path; |
| 58 | 58 | |
| 59 | - if( !is_file( $jsbAbsPath ) ) { |
|
| 60 | - throw new \Exception( sprintf( 'JSB2 file "%1$s" not found', $jsbAbsPath ) ); |
|
| 59 | + if (!is_file($jsbAbsPath)) { |
|
| 60 | + throw new \Exception(sprintf('JSB2 file "%1$s" not found', $jsbAbsPath)); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $path ) ); |
|
| 64 | - $cssFiles = array_merge( $cssFiles, $jsb2->getUrls( 'css' ) ); |
|
| 63 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($path)); |
|
| 64 | + $cssFiles = array_merge($cssFiles, $jsb2->getUrls('css')); |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - $jqadmUrl = route( 'aimeos_shop_jqadm_search', array( 'site' => $site, 'resource' => 'product' ) ); |
|
| 69 | - $jsonUrl = route( 'aimeos_shop_extadm_json', array( 'site' => $site, '_token' => csrf_token() ) ); |
|
| 70 | - $adminUrl = route( 'aimeos_shop_extadm', array( 'site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>' ) ); |
|
| 68 | + $jqadmUrl = route('aimeos_shop_jqadm_search', array('site' => $site, 'resource' => 'product')); |
|
| 69 | + $jsonUrl = route('aimeos_shop_extadm_json', array('site' => $site, '_token' => csrf_token())); |
|
| 70 | + $adminUrl = route('aimeos_shop_extadm', array('site' => '<site>', 'lang' => '<lang>', 'tab' => '<tab>')); |
|
| 71 | 71 | |
| 72 | 72 | $vars = array( |
| 73 | 73 | 'lang' => $lang, |
| 74 | 74 | 'cssFiles' => $cssFiles, |
| 75 | - 'languages' => $this->getJsonLanguages( $context), |
|
| 76 | - 'config' => $this->getJsonClientConfig( $context ), |
|
| 77 | - 'site' => $this->getJsonSiteItem( $context, $site ), |
|
| 78 | - 'i18nContent' => $this->getJsonClientI18n( $aimeos->getI18nPaths(), $lang ), |
|
| 75 | + 'languages' => $this->getJsonLanguages($context), |
|
| 76 | + 'config' => $this->getJsonClientConfig($context), |
|
| 77 | + 'site' => $this->getJsonSiteItem($context, $site), |
|
| 78 | + 'i18nContent' => $this->getJsonClientI18n($aimeos->getI18nPaths(), $lang), |
|
| 79 | 79 | 'searchSchemas' => $controller->getJsonSearchSchemas(), |
| 80 | 80 | 'itemSchemas' => $controller->getJsonItemSchemas(), |
| 81 | - 'smd' => $controller->getJsonSmd( $jsonUrl ), |
|
| 82 | - 'urlTemplate' => str_replace( ['<', '>'], ['{', '}'], urldecode( $adminUrl ) ), |
|
| 83 | - 'uploaddir' => config( 'shop::uploaddir' ), |
|
| 84 | - 'activeTab' => Input::get( 'tab', 0 ), |
|
| 81 | + 'smd' => $controller->getJsonSmd($jsonUrl), |
|
| 82 | + 'urlTemplate' => str_replace(['<', '>'], ['{', '}'], urldecode($adminUrl)), |
|
| 83 | + 'uploaddir' => config('shop::uploaddir'), |
|
| 84 | + 'activeTab' => Input::get('tab', 0), |
|
| 85 | 85 | 'version' => $this->getVersion(), |
| 86 | 86 | 'jqadmurl' => $jqadmUrl, |
| 87 | 87 | ); |
@@ -97,20 +97,20 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public function doAction() |
| 99 | 99 | { |
| 100 | - if( config( 'shop.authorize', true ) ) { |
|
| 101 | - $this->authorize( 'admin' ); |
|
| 100 | + if (config('shop.authorize', true)) { |
|
| 101 | + $this->authorize('admin'); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 105 | - $cntlPaths = $aimeos->getCustomPaths( 'controller/extjs' ); |
|
| 104 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 105 | + $cntlPaths = $aimeos->getCustomPaths('controller/extjs'); |
|
| 106 | 106 | |
| 107 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 108 | - $context = $this->setLocale( $context ); |
|
| 107 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
| 108 | + $context = $this->setLocale($context); |
|
| 109 | 109 | |
| 110 | - $controller = new \Aimeos\Controller\ExtJS\JsonRpc( $context, $cntlPaths ); |
|
| 110 | + $controller = new \Aimeos\Controller\ExtJS\JsonRpc($context, $cntlPaths); |
|
| 111 | 111 | |
| 112 | - $response = $controller->process( Input::instance()->request->all(), 'php://input' ); |
|
| 113 | - return View::make('shop::admin.extadm-do', array( 'output' => $response )); |
|
| 112 | + $response = $controller->process(Input::instance()->request->all(), 'php://input'); |
|
| 113 | + return View::make('shop::admin.extadm-do', array('output' => $response)); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | |
@@ -121,32 +121,32 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function fileAction() |
| 123 | 123 | { |
| 124 | - if( config( 'shop.authorize', true ) ) { |
|
| 125 | - $this->authorize( 'admin' ); |
|
| 124 | + if (config('shop.authorize', true)) { |
|
| 125 | + $this->authorize('admin'); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | $contents = ''; |
| 129 | 129 | $jsFiles = array(); |
| 130 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 130 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 131 | 131 | |
| 132 | - foreach( $aimeos->getCustomPaths( 'admin/extjs' ) as $base => $paths ) |
|
| 132 | + foreach ($aimeos->getCustomPaths('admin/extjs') as $base => $paths) |
|
| 133 | 133 | { |
| 134 | - foreach( $paths as $path ) |
|
| 134 | + foreach ($paths as $path) |
|
| 135 | 135 | { |
| 136 | 136 | $jsbAbsPath = $base . '/' . $path; |
| 137 | - $jsb2 = new \Aimeos\MW\Jsb2\Standard( $jsbAbsPath, dirname( $jsbAbsPath ) ); |
|
| 138 | - $jsFiles = array_merge( $jsFiles, $jsb2->getUrls( 'js', '' ) ); |
|
| 137 | + $jsb2 = new \Aimeos\MW\Jsb2\Standard($jsbAbsPath, dirname($jsbAbsPath)); |
|
| 138 | + $jsFiles = array_merge($jsFiles, $jsb2->getUrls('js', '')); |
|
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - foreach( $jsFiles as $file ) |
|
| 142 | + foreach ($jsFiles as $file) |
|
| 143 | 143 | { |
| 144 | - if( ( $content = file_get_contents( $file ) ) !== false ) { |
|
| 144 | + if (($content = file_get_contents($file)) !== false) { |
|
| 145 | 145 | $contents .= $content; |
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - return response( $contents )->header( 'Content-Type', 'application/javascript' ); |
|
| 149 | + return response($contents)->header('Content-Type', 'application/javascript'); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
@@ -156,30 +156,30 @@ discard block |
||
| 156 | 156 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 157 | 157 | * @return array List of language IDs with labels |
| 158 | 158 | */ |
| 159 | - protected function getJsonLanguages( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 159 | + protected function getJsonLanguages(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 160 | 160 | { |
| 161 | - $paths = app( '\Aimeos\Shop\Base\Aimeos' )->get()->getI18nPaths(); |
|
| 161 | + $paths = app('\Aimeos\Shop\Base\Aimeos')->get()->getI18nPaths(); |
|
| 162 | 162 | $langs = array(); |
| 163 | 163 | |
| 164 | - if( !isset( $paths['admin'] ) ) { |
|
| 165 | - return json_encode( array() ); |
|
| 164 | + if (!isset($paths['admin'])) { |
|
| 165 | + return json_encode(array()); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - foreach( $paths['admin'] as $path ) |
|
| 168 | + foreach ($paths['admin'] as $path) |
|
| 169 | 169 | { |
| 170 | - $iter = new \DirectoryIterator( $path ); |
|
| 170 | + $iter = new \DirectoryIterator($path); |
|
| 171 | 171 | |
| 172 | - foreach( $iter as $file ) |
|
| 172 | + foreach ($iter as $file) |
|
| 173 | 173 | { |
| 174 | 174 | $name = $file->getFilename(); |
| 175 | 175 | |
| 176 | - if( preg_match('/^[a-z]{2,3}(_[A-Z]{2})?$/', $name ) ) { |
|
| 176 | + if (preg_match('/^[a-z]{2,3}(_[A-Z]{2})?$/', $name)) { |
|
| 177 | 177 | $langs[$name] = null; |
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | - return json_encode( $this->getLanguages( $context, array_keys( $langs ) ) ); |
|
| 182 | + return json_encode($this->getLanguages($context, array_keys($langs))); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
@@ -189,10 +189,10 @@ discard block |
||
| 189 | 189 | * @param \Aimeos\MShop\Context\Item\Iface $context Context item object |
| 190 | 190 | * @return string JSON encoded configuration object |
| 191 | 191 | */ |
| 192 | - protected function getJsonClientConfig( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 192 | + protected function getJsonClientConfig(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 193 | 193 | { |
| 194 | - $config = $context->getConfig()->get( 'admin/extjs', array() ); |
|
| 195 | - return json_encode( array( 'admin' => array( 'extjs' => $config ) ), JSON_FORCE_OBJECT ); |
|
| 194 | + $config = $context->getConfig()->get('admin/extjs', array()); |
|
| 195 | + return json_encode(array('admin' => array('extjs' => $config)), JSON_FORCE_OBJECT); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | |
@@ -203,16 +203,16 @@ discard block |
||
| 203 | 203 | * @param string $lang ISO language code like "en" or "en_GB" |
| 204 | 204 | * @return string JSON encoded translation object |
| 205 | 205 | */ |
| 206 | - protected function getJsonClientI18n( array $i18nPaths, $lang ) |
|
| 206 | + protected function getJsonClientI18n(array $i18nPaths, $lang) |
|
| 207 | 207 | { |
| 208 | - $i18n = new \Aimeos\MW\Translation\Zend2( $i18nPaths, 'gettext', $lang, array( 'disableNotices' => true ) ); |
|
| 208 | + $i18n = new \Aimeos\MW\Translation\Zend2($i18nPaths, 'gettext', $lang, array('disableNotices' => true)); |
|
| 209 | 209 | |
| 210 | 210 | $content = array( |
| 211 | - 'admin' => $i18n->getAll( 'admin' ), |
|
| 212 | - 'admin/ext' => $i18n->getAll( 'admin/ext' ), |
|
| 211 | + 'admin' => $i18n->getAll('admin'), |
|
| 212 | + 'admin/ext' => $i18n->getAll('admin/ext'), |
|
| 213 | 213 | ); |
| 214 | 214 | |
| 215 | - return json_encode( $content, JSON_FORCE_OBJECT ); |
|
| 215 | + return json_encode($content, JSON_FORCE_OBJECT); |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | |
@@ -224,19 +224,19 @@ discard block |
||
| 224 | 224 | * @return string JSON encoded site item object |
| 225 | 225 | * @throws Exception If no site item was found for the code |
| 226 | 226 | */ |
| 227 | - protected function getJsonSiteItem( \Aimeos\MShop\Context\Item\Iface $context, $site ) |
|
| 227 | + protected function getJsonSiteItem(\Aimeos\MShop\Context\Item\Iface $context, $site) |
|
| 228 | 228 | { |
| 229 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'locale/site' ); |
|
| 229 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'locale/site'); |
|
| 230 | 230 | |
| 231 | 231 | $criteria = $manager->createSearch(); |
| 232 | - $criteria->setConditions( $criteria->compare( '==', 'locale.site.code', $site ) ); |
|
| 233 | - $items = $manager->searchItems( $criteria ); |
|
| 232 | + $criteria->setConditions($criteria->compare('==', 'locale.site.code', $site)); |
|
| 233 | + $items = $manager->searchItems($criteria); |
|
| 234 | 234 | |
| 235 | - if( ( $item = reset( $items ) ) === false ) { |
|
| 236 | - throw new \Exception( sprintf( 'No site found for code "%1$s"', $site ) ); |
|
| 235 | + if (($item = reset($items)) === false) { |
|
| 236 | + throw new \Exception(sprintf('No site found for code "%1$s"', $site)); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | - return json_encode( $item->toArray() ); |
|
| 239 | + return json_encode($item->toArray()); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
@@ -247,18 +247,18 @@ discard block |
||
| 247 | 247 | * @param array $langIds List of language IDs |
| 248 | 248 | * @return array List of associative lists with "id" and "label" as keys |
| 249 | 249 | */ |
| 250 | - protected function getLanguages( \Aimeos\MShop\Context\Item\Iface $context, array $langIds ) |
|
| 250 | + protected function getLanguages(\Aimeos\MShop\Context\Item\Iface $context, array $langIds) |
|
| 251 | 251 | { |
| 252 | - $languageManager = \Aimeos\MShop\Factory::createManager( $context, 'locale/language' ); |
|
| 252 | + $languageManager = \Aimeos\MShop\Factory::createManager($context, 'locale/language'); |
|
| 253 | 253 | $result = array(); |
| 254 | 254 | |
| 255 | 255 | $search = $languageManager->createSearch(); |
| 256 | - $search->setConditions( $search->compare('==', 'locale.language.id', $langIds ) ); |
|
| 257 | - $search->setSortations( array( $search->sort( '-', 'locale.language.status' ), $search->sort( '+', 'locale.language.label' ) ) ); |
|
| 258 | - $langItems = $languageManager->searchItems( $search ); |
|
| 256 | + $search->setConditions($search->compare('==', 'locale.language.id', $langIds)); |
|
| 257 | + $search->setSortations(array($search->sort('-', 'locale.language.status'), $search->sort('+', 'locale.language.label'))); |
|
| 258 | + $langItems = $languageManager->searchItems($search); |
|
| 259 | 259 | |
| 260 | - foreach( $langItems as $id => $item ) { |
|
| 261 | - $result[] = array( 'id' => $id, 'label' => $item->getLabel() ); |
|
| 260 | + foreach ($langItems as $id => $item) { |
|
| 261 | + $result[] = array('id' => $id, 'label' => $item->getLabel()); |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | return $result; |
@@ -273,17 +273,17 @@ discard block |
||
| 273 | 273 | * @param string $locale ISO language code, e.g. "en" or "en_GB" |
| 274 | 274 | * @return \Aimeos\MShop\Context\Item\Iface Modified context object |
| 275 | 275 | */ |
| 276 | - protected function setLocale( \Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null ) |
|
| 276 | + protected function setLocale(\Aimeos\MShop\Context\Item\Iface $context, $sitecode = 'default', $locale = null) |
|
| 277 | 277 | { |
| 278 | - $localeManager = \Aimeos\MShop\Factory::createManager( $context, 'locale' ); |
|
| 278 | + $localeManager = \Aimeos\MShop\Factory::createManager($context, 'locale'); |
|
| 279 | 279 | |
| 280 | 280 | try { |
| 281 | - $localeItem = $localeManager->bootstrap( $sitecode, $locale, '', false ); |
|
| 282 | - } catch( \Aimeos\MShop\Locale\Exception $e ) { |
|
| 281 | + $localeItem = $localeManager->bootstrap($sitecode, $locale, '', false); |
|
| 282 | + } catch (\Aimeos\MShop\Locale\Exception $e) { |
|
| 283 | 283 | $localeItem = $localeManager->createItem(); |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | - $context->setLocale( $localeItem ); |
|
| 286 | + $context->setLocale($localeItem); |
|
| 287 | 287 | |
| 288 | 288 | return $context; |
| 289 | 289 | } |
@@ -34,14 +34,14 @@ discard block |
||
| 34 | 34 | * @param integer $id Unique resource ID |
| 35 | 35 | * @return string Generated output |
| 36 | 36 | */ |
| 37 | - public function copyAction( $site = 'default', $resource, $id ) |
|
| 37 | + public function copyAction($site = 'default', $resource, $id) |
|
| 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 | - $cntl = $this->createClient( $site, $resource ); |
|
| 44 | - return $this->getHtml( $site, $cntl->copy( $id ) ); |
|
| 43 | + $cntl = $this->createClient($site, $resource); |
|
| 44 | + return $this->getHtml($site, $cntl->copy($id)); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
@@ -52,14 +52,14 @@ discard block |
||
| 52 | 52 | * @param string $sitecode Unique site code |
| 53 | 53 | * @return string Generated output |
| 54 | 54 | */ |
| 55 | - public function createAction( $site = 'default', $resource ) |
|
| 55 | + public function createAction($site = 'default', $resource) |
|
| 56 | 56 | { |
| 57 | - if( config( 'shop.authorize', true ) ) { |
|
| 58 | - $this->authorize( 'admin' ); |
|
| 57 | + if (config('shop.authorize', true)) { |
|
| 58 | + $this->authorize('admin'); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - $cntl = $this->createClient( $site, $resource ); |
|
| 62 | - return $this->getHtml( $site, $cntl->create() ); |
|
| 61 | + $cntl = $this->createClient($site, $resource); |
|
| 62 | + return $this->getHtml($site, $cntl->create()); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
@@ -71,14 +71,14 @@ discard block |
||
| 71 | 71 | * @param integer $id Unique resource ID |
| 72 | 72 | * @return string Generated output |
| 73 | 73 | */ |
| 74 | - public function deleteAction( $site = 'default', $resource, $id ) |
|
| 74 | + public function deleteAction($site = 'default', $resource, $id) |
|
| 75 | 75 | { |
| 76 | - if( config( 'shop.authorize', true ) ) { |
|
| 77 | - $this->authorize( 'admin' ); |
|
| 76 | + if (config('shop.authorize', true)) { |
|
| 77 | + $this->authorize('admin'); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - $cntl = $this->createClient( $site, $resource ); |
|
| 81 | - return $this->getHtml( $site, $cntl->delete( $id ) . $cntl->search() ); |
|
| 80 | + $cntl = $this->createClient($site, $resource); |
|
| 81 | + return $this->getHtml($site, $cntl->delete($id) . $cntl->search()); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
@@ -90,14 +90,14 @@ discard block |
||
| 90 | 90 | * @param integer $id Unique resource ID |
| 91 | 91 | * @return string Generated output |
| 92 | 92 | */ |
| 93 | - public function getAction( $site = 'default', $resource, $id ) |
|
| 93 | + public function getAction($site = 'default', $resource, $id) |
|
| 94 | 94 | { |
| 95 | - if( config( 'shop.authorize', true ) ) { |
|
| 96 | - $this->authorize( 'admin' ); |
|
| 95 | + if (config('shop.authorize', true)) { |
|
| 96 | + $this->authorize('admin'); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - $cntl = $this->createClient( $site, $resource ); |
|
| 100 | - return $this->getHtml( $site, $cntl->get( $id ) ); |
|
| 99 | + $cntl = $this->createClient($site, $resource); |
|
| 100 | + return $this->getHtml($site, $cntl->get($id)); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | |
@@ -108,14 +108,14 @@ discard block |
||
| 108 | 108 | * @param string $sitecode Unique site code |
| 109 | 109 | * @return string Generated output |
| 110 | 110 | */ |
| 111 | - public function saveAction( $site = 'default', $resource ) |
|
| 111 | + public function saveAction($site = 'default', $resource) |
|
| 112 | 112 | { |
| 113 | - if( config( 'shop.authorize', true ) ) { |
|
| 114 | - $this->authorize( 'admin' ); |
|
| 113 | + if (config('shop.authorize', true)) { |
|
| 114 | + $this->authorize('admin'); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - $cntl = $this->createClient( $site, $resource ); |
|
| 118 | - return $this->getHtml( $site, ( $cntl->save() ? : $cntl->search() ) ); |
|
| 117 | + $cntl = $this->createClient($site, $resource); |
|
| 118 | + return $this->getHtml($site, ($cntl->save() ?: $cntl->search())); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
@@ -126,14 +126,14 @@ discard block |
||
| 126 | 126 | * @param string $sitecode Unique site code |
| 127 | 127 | * @return string Generated output |
| 128 | 128 | */ |
| 129 | - public function searchAction( $site = 'default', $resource ) |
|
| 129 | + public function searchAction($site = 'default', $resource) |
|
| 130 | 130 | { |
| 131 | - if( config( 'shop.authorize', true ) ) { |
|
| 132 | - $this->authorize( 'admin' ); |
|
| 131 | + if (config('shop.authorize', true)) { |
|
| 132 | + $this->authorize('admin'); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - $cntl = $this->createClient( $site, $resource ); |
|
| 136 | - return $this->getHtml( $site, $cntl->search() ); |
|
| 135 | + $cntl = $this->createClient($site, $resource); |
|
| 136 | + return $this->getHtml($site, $cntl->search()); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
@@ -143,20 +143,20 @@ discard block |
||
| 143 | 143 | * @param string $sitecode Unique site code |
| 144 | 144 | * @return \Aimeos\MShop\Context\Item\Iface Context item |
| 145 | 145 | */ |
| 146 | - protected function createClient( $sitecode, $resource ) |
|
| 146 | + protected function createClient($sitecode, $resource) |
|
| 147 | 147 | { |
| 148 | - $lang = Input::get( 'lang', config( 'app.locale', 'en' ) ); |
|
| 148 | + $lang = Input::get('lang', config('app.locale', 'en')); |
|
| 149 | 149 | |
| 150 | - $aimeos = app( '\Aimeos\Shop\Base\Aimeos' )->get(); |
|
| 151 | - $templatePaths = $aimeos->getCustomPaths( 'admin/jqadm/templates' ); |
|
| 150 | + $aimeos = app('\Aimeos\Shop\Base\Aimeos')->get(); |
|
| 151 | + $templatePaths = $aimeos->getCustomPaths('admin/jqadm/templates'); |
|
| 152 | 152 | |
| 153 | - $context = app( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 154 | - $context = $this->setLocale( $context, $sitecode, $lang ); |
|
| 153 | + $context = app('\Aimeos\Shop\Base\Context')->get(false); |
|
| 154 | + $context = $this->setLocale($context, $sitecode, $lang); |
|
| 155 | 155 | |
| 156 | - $view = app( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $templatePaths, $lang ); |
|
| 157 | - $context->setView( $view ); |
|
| 156 | + $view = app('\Aimeos\Shop\Base\View')->create($context->getConfig(), $templatePaths, $lang); |
|
| 157 | + $context->setView($view); |
|
| 158 | 158 | |
| 159 | - return \Aimeos\Admin\JQAdm\Factory::createClient( $context, $templatePaths, $resource ); |
|
| 159 | + return \Aimeos\Admin\JQAdm\Factory::createClient($context, $templatePaths, $resource); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
@@ -166,11 +166,11 @@ discard block |
||
| 166 | 166 | * @param string $site |
| 167 | 167 | * @param string $content |
| 168 | 168 | */ |
| 169 | - protected function getHtml( $site, $content ) |
|
| 169 | + protected function getHtml($site, $content) |
|
| 170 | 170 | { |
| 171 | - $content = str_replace( ['{type}', '{version}'], ['Laravel', $this->getVersion()], $content ); |
|
| 172 | - $params = array( 'site' => $site, 'content' => $content ); |
|
| 171 | + $content = str_replace(['{type}', '{version}'], ['Laravel', $this->getVersion()], $content); |
|
| 172 | + $params = array('site' => $site, 'content' => $content); |
|
| 173 | 173 | |
| 174 | - return View::make('shop::admin.jqadm', $params ); |
|
| 174 | + return View::make('shop::admin.jqadm', $params); |
|
| 175 | 175 | } |
| 176 | 176 | } |