@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/tether/1.2.0/css/tether.min.css"> |
| 11 | 11 | <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css"> |
| 12 | 12 | <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css"> |
| 13 | - <link rel="stylesheet" href="<?= route( 'aimeos_shop_jqadm_file', array( 'site' => 'default', 'type' => 'css' ) ); ?>"> |
|
| 13 | + <link rel="stylesheet" href="<?= route('aimeos_shop_jqadm_file', array('site' => 'default', 'type' => 'css')); ?>"> |
|
| 14 | 14 | |
| 15 | 15 | <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> |
| 16 | 16 | <!--[if lt IE 9]> |
@@ -29,6 +29,6 @@ discard block |
||
| 29 | 29 | <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/js/bootstrap.min.js"></script> |
| 30 | 30 | <script src="//cdnjs.cloudflare.com/ajax/libs/ckeditor/4.5.4/ckeditor.js"></script> |
| 31 | 31 | <script src="//cdnjs.cloudflare.com/ajax/libs/ckeditor/4.5.4/adapters/jquery.js"></script> |
| 32 | - <script src="<?= route( 'aimeos_shop_jqadm_file', array( 'site' => 'default', 'type' => 'js' ) ); ?>"></script> |
|
| 32 | + <script src="<?= route('aimeos_shop_jqadm_file', array('site' => 'default', 'type' => 'js')); ?>"></script> |
|
| 33 | 33 | </body> |
| 34 | 34 | </html> |
@@ -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 | |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | <link type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/resources/css/ext-all.css" /> |
| 10 | 10 | <link type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/extjs/3.4.1-1/resources/css/xtheme-gray.css" /> |
| 11 | 11 | @foreach ($cssFiles as $cssFile) |
| 12 | - <link rel="stylesheet" href="<?= asset('packages/aimeos/shop/' . $cssFile) ?>" /> |
|
| 12 | + <link rel="stylesheet" href="<?= asset('packages/aimeos/shop/'.$cssFile) ?>" /> |
|
| 13 | 13 | @endforeach |
| 14 | 14 | |
| 15 | 15 | <script type="text/javascript"> |
@@ -45,7 +45,7 @@ discard block |
||
| 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> |
@@ -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 | } |
@@ -42,18 +42,18 @@ discard block |
||
| 42 | 42 | * @param string $classname Name of the setup task class |
| 43 | 43 | * @return boolean True if class is found, false if not |
| 44 | 44 | */ |
| 45 | - public static function autoload( $classname ) |
|
| 45 | + public static function autoload($classname) |
|
| 46 | 46 | { |
| 47 | - if( strncmp( $classname, 'Aimeos\\MW\\Setup\\Task\\', 21 ) === 0 ) |
|
| 47 | + if (strncmp($classname, 'Aimeos\\MW\\Setup\\Task\\', 21) === 0) |
|
| 48 | 48 | { |
| 49 | - $fileName = substr( $classname, 21 ) . '.php'; |
|
| 50 | - $paths = explode( PATH_SEPARATOR, get_include_path() ); |
|
| 49 | + $fileName = substr($classname, 21).'.php'; |
|
| 50 | + $paths = explode(PATH_SEPARATOR, get_include_path()); |
|
| 51 | 51 | |
| 52 | - foreach( $paths as $path ) |
|
| 52 | + foreach ($paths as $path) |
|
| 53 | 53 | { |
| 54 | - $file = $path . DIRECTORY_SEPARATOR . $fileName; |
|
| 54 | + $file = $path.DIRECTORY_SEPARATOR.$fileName; |
|
| 55 | 55 | |
| 56 | - if( file_exists( $file ) === true && ( include_once $file ) !== false ) { |
|
| 56 | + if (file_exists($file) === true && (include_once $file) !== false) { |
|
| 57 | 57 | return true; |
| 58 | 58 | } |
| 59 | 59 | } |
@@ -70,33 +70,33 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function fire() |
| 72 | 72 | { |
| 73 | - $ctx = $this->getLaravel()->make( '\Aimeos\Shop\Base\Context' )->get( false ); |
|
| 74 | - $ctx->setEditor( 'aimeos:setup' ); |
|
| 73 | + $ctx = $this->getLaravel()->make('\Aimeos\Shop\Base\Context')->get(false); |
|
| 74 | + $ctx->setEditor('aimeos:setup'); |
|
| 75 | 75 | |
| 76 | 76 | $config = $ctx->getConfig(); |
| 77 | - $site = $this->argument( 'site' ); |
|
| 78 | - $template = $this->argument( 'tplsite' ); |
|
| 77 | + $site = $this->argument('site'); |
|
| 78 | + $template = $this->argument('tplsite'); |
|
| 79 | 79 | |
| 80 | - $config->set( 'setup/site', $site ); |
|
| 81 | - $dbconfig = $this->getDbConfig( $config ); |
|
| 82 | - $this->setOptions( $config ); |
|
| 80 | + $config->set('setup/site', $site); |
|
| 81 | + $dbconfig = $this->getDbConfig($config); |
|
| 82 | + $this->setOptions($config); |
|
| 83 | 83 | |
| 84 | - $taskPaths = $this->getLaravel()->make( '\Aimeos\Shop\Base\Aimeos' )->get()->getSetupPaths( $template ); |
|
| 84 | + $taskPaths = $this->getLaravel()->make('\Aimeos\Shop\Base\Aimeos')->get()->getSetupPaths($template); |
|
| 85 | 85 | |
| 86 | 86 | $includePaths = $taskPaths; |
| 87 | 87 | $includePaths[] = get_include_path(); |
| 88 | 88 | |
| 89 | - if( set_include_path( implode( PATH_SEPARATOR, $includePaths ) ) === false ) { |
|
| 90 | - throw new Exception( 'Unable to extend include path' ); |
|
| 89 | + if (set_include_path(implode(PATH_SEPARATOR, $includePaths)) === false) { |
|
| 90 | + throw new Exception('Unable to extend include path'); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - spl_autoload_register( '\Aimeos\Shop\Command\SetupCommand::autoload', true ); |
|
| 93 | + spl_autoload_register('\Aimeos\Shop\Command\SetupCommand::autoload', true); |
|
| 94 | 94 | |
| 95 | - $manager = new \Aimeos\MW\Setup\Manager\Multiple( $ctx->getDatabaseManager(), $dbconfig, $taskPaths, $ctx ); |
|
| 95 | + $manager = new \Aimeos\MW\Setup\Manager\Multiple($ctx->getDatabaseManager(), $dbconfig, $taskPaths, $ctx); |
|
| 96 | 96 | |
| 97 | - $this->info( sprintf( 'Initializing or updating the Aimeos database tables for site "%1$s"', $site ) ); |
|
| 97 | + $this->info(sprintf('Initializing or updating the Aimeos database tables for site "%1$s"', $site)); |
|
| 98 | 98 | |
| 99 | - $manager->run( 'mysql' ); |
|
| 99 | + $manager->run('mysql'); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | |
@@ -108,8 +108,8 @@ discard block |
||
| 108 | 108 | protected function getArguments() |
| 109 | 109 | { |
| 110 | 110 | return array( |
| 111 | - array( 'site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default' ), |
|
| 112 | - array( 'tplsite', InputArgument::OPTIONAL, 'Site used as template for creating the new one', 'default' ), |
|
| 111 | + array('site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default'), |
|
| 112 | + array('tplsite', InputArgument::OPTIONAL, 'Site used as template for creating the new one', 'default'), |
|
| 113 | 113 | ); |
| 114 | 114 | } |
| 115 | 115 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | protected function getOptions() |
| 123 | 123 | { |
| 124 | 124 | return array( |
| 125 | - array( 'option', null, InputOption::VALUE_REQUIRED, 'Optional setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array() ), |
|
| 125 | + array('option', null, InputOption::VALUE_REQUIRED, 'Optional setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array()), |
|
| 126 | 126 | ); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -133,14 +133,14 @@ discard block |
||
| 133 | 133 | * @param \Aimeos\MW\Config\Iface $conf Config object |
| 134 | 134 | * @return array Multi-dimensional associative list of database configuration parameters |
| 135 | 135 | */ |
| 136 | - protected function getDbConfig( \Aimeos\MW\Config\Iface $conf ) |
|
| 136 | + protected function getDbConfig(\Aimeos\MW\Config\Iface $conf) |
|
| 137 | 137 | { |
| 138 | - $dbconfig = $conf->get( 'resource', array() ); |
|
| 138 | + $dbconfig = $conf->get('resource', array()); |
|
| 139 | 139 | |
| 140 | - foreach( $dbconfig as $rname => $dbconf ) |
|
| 140 | + foreach ($dbconfig as $rname => $dbconf) |
|
| 141 | 141 | { |
| 142 | - if( strncmp( $rname, 'db', 2 ) !== 0 ) { |
|
| 143 | - unset( $dbconfig[$rname] ); |
|
| 142 | + if (strncmp($rname, 'db', 2) !== 0) { |
|
| 143 | + unset($dbconfig[$rname]); |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
@@ -155,12 +155,12 @@ discard block |
||
| 155 | 155 | * @param array Associative list of database configurations |
| 156 | 156 | * @throws \RuntimeException If the format of the options is invalid |
| 157 | 157 | */ |
| 158 | - protected function setOptions( \Aimeos\MW\Config\Iface $conf ) |
|
| 158 | + protected function setOptions(\Aimeos\MW\Config\Iface $conf) |
|
| 159 | 159 | { |
| 160 | - foreach( (array) $this->option( 'option' ) as $option ) |
|
| 160 | + foreach ((array) $this->option('option') as $option) |
|
| 161 | 161 | { |
| 162 | - list( $name, $value ) = explode( ':', $option ); |
|
| 163 | - $conf->set( $name, $value ); |
|
| 162 | + list($name, $value) = explode(':', $option); |
|
| 163 | + $conf->set($name, $value); |
|
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | * @param \Aimeos\Shop\Base\Aimeos $aimeos Aimeos object |
| 41 | 41 | * @param \Illuminate\Contracts\Config\Repository $config Configuration object |
| 42 | 42 | */ |
| 43 | - public function __construct( \Aimeos\Shop\Base\Aimeos $aimeos, \Illuminate\Contracts\Config\Repository $config ) |
|
| 43 | + public function __construct(\Aimeos\Shop\Base\Aimeos $aimeos, \Illuminate\Contracts\Config\Repository $config) |
|
| 44 | 44 | { |
| 45 | 45 | $this->aimeos = $aimeos; |
| 46 | 46 | $this->config = $config; |
@@ -53,22 +53,22 @@ discard block |
||
| 53 | 53 | * @param array $languageIds List of two letter ISO language IDs |
| 54 | 54 | * @return \Aimeos\MW\Translation\Iface[] List of translation objects |
| 55 | 55 | */ |
| 56 | - public function get( array $languageIds ) |
|
| 56 | + public function get(array $languageIds) |
|
| 57 | 57 | { |
| 58 | 58 | $i18nPaths = $this->aimeos->get()->getI18nPaths(); |
| 59 | 59 | |
| 60 | - foreach( $languageIds as $langid ) |
|
| 60 | + foreach ($languageIds as $langid) |
|
| 61 | 61 | { |
| 62 | - if( !isset( $this->i18n[$langid] ) ) |
|
| 62 | + if (!isset($this->i18n[$langid])) |
|
| 63 | 63 | { |
| 64 | - $i18n = new \Aimeos\MW\Translation\Gettext( $i18nPaths, $langid ); |
|
| 64 | + $i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $langid); |
|
| 65 | 65 | |
| 66 | - if( function_exists( 'apc_store' ) === true && $this->config->get( 'shop.apc_enabled', false ) == true ) { |
|
| 67 | - $i18n = new \Aimeos\MW\Translation\Decorator\APC( $i18n, $this->config->get( 'shop.apc_prefix', 'laravel:' ) ); |
|
| 66 | + if (function_exists('apc_store') === true && $this->config->get('shop.apc_enabled', false) == true) { |
|
| 67 | + $i18n = new \Aimeos\MW\Translation\Decorator\APC($i18n, $this->config->get('shop.apc_prefix', 'laravel:')); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if( $this->config->has( 'shop.i18n.' . $langid ) ) { |
|
| 71 | - $i18n = new \Aimeos\MW\Translation\Decorator\Memory( $i18n, $this->config->get( 'shop.i18n.' . $langid ) ); |
|
| 70 | + if ($this->config->has('shop.i18n.'.$langid)) { |
|
| 71 | + $i18n = new \Aimeos\MW\Translation\Decorator\Memory($i18n, $this->config->get('shop.i18n.'.$langid)); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $this->i18n[$langid] = $i18n; |
@@ -4,20 +4,20 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | 'apc_enabled' => false, |
| 6 | 6 | 'apc_prefix' => 'laravel:', |
| 7 | - 'extdir' => ( is_dir(base_path('ext')) ? base_path('ext') : dirname(__DIR__) . DIRECTORY_SEPARATOR . 'ext' ), |
|
| 7 | + 'extdir' => (is_dir(base_path('ext')) ? base_path('ext') : dirname(__DIR__).DIRECTORY_SEPARATOR.'ext'), |
|
| 8 | 8 | 'uploaddir' => '/', |
| 9 | 9 | |
| 10 | 10 | 'page' => array( |
| 11 | - 'account-index' => array( 'account/history','account/favorite','account/watch','basket/mini','catalog/session' ), |
|
| 12 | - 'basket-index' => array( 'basket/standard','basket/related' ), |
|
| 13 | - 'catalog-count' => array( 'catalog/count' ), |
|
| 14 | - 'catalog-detail' => array( 'basket/mini','catalog/stage','catalog/detail','catalog/session' ), |
|
| 15 | - 'catalog-list' => array( 'basket/mini','catalog/filter','catalog/stage','catalog/lists' ), |
|
| 16 | - 'catalog-stock' => array( 'catalog/stock' ), |
|
| 17 | - 'catalog-suggest' => array( 'catalog/suggest' ), |
|
| 18 | - 'checkout-confirm' => array( 'checkout/confirm' ), |
|
| 19 | - 'checkout-index' => array( 'checkout/standard' ), |
|
| 20 | - 'checkout-update' => array( 'checkout/update'), |
|
| 11 | + 'account-index' => array('account/history', 'account/favorite', 'account/watch', 'basket/mini', 'catalog/session'), |
|
| 12 | + 'basket-index' => array('basket/standard', 'basket/related'), |
|
| 13 | + 'catalog-count' => array('catalog/count'), |
|
| 14 | + 'catalog-detail' => array('basket/mini', 'catalog/stage', 'catalog/detail', 'catalog/session'), |
|
| 15 | + 'catalog-list' => array('basket/mini', 'catalog/filter', 'catalog/stage', 'catalog/lists'), |
|
| 16 | + 'catalog-stock' => array('catalog/stock'), |
|
| 17 | + 'catalog-suggest' => array('catalog/suggest'), |
|
| 18 | + 'checkout-confirm' => array('checkout/confirm'), |
|
| 19 | + 'checkout-index' => array('checkout/standard'), |
|
| 20 | + 'checkout-update' => array('checkout/update'), |
|
| 21 | 21 | ), |
| 22 | 22 | |
| 23 | 23 | 'resource' => array( |
@@ -28,24 +28,24 @@ discard block |
||
| 28 | 28 | 'database' => env('DB_DATABASE', 'laravel'), |
| 29 | 29 | 'username' => env('DB_USERNAME', 'root'), |
| 30 | 30 | 'password' => env('DB_PASSWORD', ''), |
| 31 | - 'stmt' => array( "SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'" ), |
|
| 31 | + 'stmt' => array("SET NAMES 'utf8'", "SET SESSION sql_mode='ANSI'"), |
|
| 32 | 32 | 'opt-persistent' => 0, |
| 33 | 33 | 'limit' => 2, |
| 34 | 34 | ), |
| 35 | 35 | 'fs' => array( |
| 36 | 36 | 'adapter' => 'Standard', |
| 37 | 37 | 'basedir' => public_path(), |
| 38 | - 'tempdir' => storage_path( 'tmp' ), |
|
| 38 | + 'tempdir' => storage_path('tmp'), |
|
| 39 | 39 | ), |
| 40 | 40 | 'fs-admin' => array( |
| 41 | 41 | 'adapter' => 'Standard', |
| 42 | - 'basedir' => public_path( 'uploads' ), |
|
| 43 | - 'tempdir' => storage_path( 'tmp' ), |
|
| 42 | + 'basedir' => public_path('uploads'), |
|
| 43 | + 'tempdir' => storage_path('tmp'), |
|
| 44 | 44 | ), |
| 45 | 45 | 'fs-secure' => array( |
| 46 | 46 | 'adapter' => 'Standard', |
| 47 | - 'basedir' => storage_path( 'secure' ), |
|
| 48 | - 'tempdir' => storage_path( 'tmp' ), |
|
| 47 | + 'basedir' => storage_path('secure'), |
|
| 48 | + 'tempdir' => storage_path('tmp'), |
|
| 49 | 49 | ), |
| 50 | 50 | 'mq' => array( |
| 51 | 51 | 'adapter' => 'Standard', |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | # in the "maxwidth" parameter |
| 268 | 268 | # 'maxheight' => 280, |
| 269 | 269 | ), |
| 270 | - 'tempdir' => storage_path( 'aimeos' ), |
|
| 270 | + 'tempdir' => storage_path('aimeos'), |
|
| 271 | 271 | ), |
| 272 | 272 | ), |
| 273 | 273 | ), |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * @param \Illuminate\Contracts\Config\Repository $config Configuration object |
| 51 | 51 | * @param \Illuminate\Session\Store $session Laravel session object |
| 52 | 52 | */ |
| 53 | - public function __construct( \Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session ) |
|
| 53 | + public function __construct(\Illuminate\Contracts\Config\Repository $config, \Illuminate\Session\Store $session) |
|
| 54 | 54 | { |
| 55 | 55 | $this->config = $config; |
| 56 | 56 | $this->session = $session; |
@@ -63,51 +63,51 @@ discard block |
||
| 63 | 63 | * @param boolean $locale True to add locale object to context, false if not |
| 64 | 64 | * @return \Aimeos\MShop\Context\Item\Iface Context object |
| 65 | 65 | */ |
| 66 | - public function get( $locale = true ) |
|
| 66 | + public function get($locale = true) |
|
| 67 | 67 | { |
| 68 | - if( self::$context === null ) |
|
| 68 | + if (self::$context === null) |
|
| 69 | 69 | { |
| 70 | 70 | $context = new \Aimeos\MShop\Context\Item\Standard(); |
| 71 | 71 | |
| 72 | 72 | $config = $this->getConfig(); |
| 73 | - $context->setConfig( $config ); |
|
| 73 | + $context->setConfig($config); |
|
| 74 | 74 | |
| 75 | - $dbm = new \Aimeos\MW\DB\Manager\DBAL( $config ); |
|
| 76 | - $context->setDatabaseManager( $dbm ); |
|
| 75 | + $dbm = new \Aimeos\MW\DB\Manager\DBAL($config); |
|
| 76 | + $context->setDatabaseManager($dbm); |
|
| 77 | 77 | |
| 78 | - $fs = new \Aimeos\MW\Filesystem\Manager\Laravel( app( 'filesystem' ), $config, storage_path( 'aimeos' ) ); |
|
| 79 | - $context->setFilesystemManager( $fs ); |
|
| 78 | + $fs = new \Aimeos\MW\Filesystem\Manager\Laravel(app('filesystem'), $config, storage_path('aimeos')); |
|
| 79 | + $context->setFilesystemManager($fs); |
|
| 80 | 80 | |
| 81 | - $mq = new \Aimeos\MW\MQueue\Manager\Standard( $config ); |
|
| 82 | - $context->setMessageQueueManager( $mq ); |
|
| 81 | + $mq = new \Aimeos\MW\MQueue\Manager\Standard($config); |
|
| 82 | + $context->setMessageQueueManager($mq); |
|
| 83 | 83 | |
| 84 | - $mail = new \Aimeos\MW\Mail\Swift( function() { return app( 'mailer' )->getSwiftMailer(); } ); |
|
| 85 | - $context->setMail( $mail ); |
|
| 84 | + $mail = new \Aimeos\MW\Mail\Swift(function() { return app('mailer')->getSwiftMailer(); } ); |
|
| 85 | + $context->setMail($mail); |
|
| 86 | 86 | |
| 87 | - $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager( $context ); |
|
| 88 | - $context->setLogger( $logger ); |
|
| 87 | + $logger = \Aimeos\MAdmin\Log\Manager\Factory::createManager($context); |
|
| 88 | + $context->setLogger($logger); |
|
| 89 | 89 | |
| 90 | - $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $context ); |
|
| 91 | - $context->setCache( $cache ); |
|
| 90 | + $cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context); |
|
| 91 | + $context->setCache($cache); |
|
| 92 | 92 | |
| 93 | 93 | self::$context = $context; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | $context = self::$context; |
| 97 | 97 | |
| 98 | - if( $locale === true ) |
|
| 98 | + if ($locale === true) |
|
| 99 | 99 | { |
| 100 | - $localeItem = $this->getLocale( $context ); |
|
| 100 | + $localeItem = $this->getLocale($context); |
|
| 101 | 101 | $langid = $localeItem->getLanguageId(); |
| 102 | 102 | |
| 103 | - $context->setLocale( $localeItem ); |
|
| 104 | - $context->setI18n( app('\Aimeos\Shop\Base\I18n')->get( array( $langid ) ) ); |
|
| 103 | + $context->setLocale($localeItem); |
|
| 104 | + $context->setI18n(app('\Aimeos\Shop\Base\I18n')->get(array($langid))); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - $session = new \Aimeos\MW\Session\Laravel5( $this->session ); |
|
| 108 | - $context->setSession( $session ); |
|
| 107 | + $session = new \Aimeos\MW\Session\Laravel5($this->session); |
|
| 108 | + $context->setSession($session); |
|
| 109 | 109 | |
| 110 | - $this->addUser( $context ); |
|
| 110 | + $this->addUser($context); |
|
| 111 | 111 | |
| 112 | 112 | return $context; |
| 113 | 113 | } |
@@ -118,20 +118,20 @@ discard block |
||
| 118 | 118 | * |
| 119 | 119 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 120 | 120 | */ |
| 121 | - protected function addUser( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 121 | + protected function addUser(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 122 | 122 | { |
| 123 | - if( ( $userid = Auth::id() ) !== null ) |
|
| 123 | + if (($userid = Auth::id()) !== null) |
|
| 124 | 124 | { |
| 125 | - $context->setUserId( $userid ); |
|
| 126 | - $context->setGroupIds( function() use ( $context, $userid ) |
|
| 125 | + $context->setUserId($userid); |
|
| 126 | + $context->setGroupIds(function() use ($context, $userid) |
|
| 127 | 127 | { |
| 128 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' ); |
|
| 129 | - return $manager->getItem( $userid, array( 'customer/group' ) )->getGroups(); |
|
| 128 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'customer'); |
|
| 129 | + return $manager->getItem($userid, array('customer/group'))->getGroups(); |
|
| 130 | 130 | } ); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - if( ( $user = Auth::user() ) !== null ) { |
|
| 134 | - $context->setEditor( $user->name ); |
|
| 133 | + if (($user = Auth::user()) !== null) { |
|
| 134 | + $context->setEditor($user->name); |
|
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | |
@@ -143,11 +143,11 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | protected function getConfig() |
| 145 | 145 | { |
| 146 | - $configPaths = app( '\Aimeos\Shop\Base\Aimeos' )->get()->getConfigPaths(); |
|
| 147 | - $config = new \Aimeos\MW\Config\PHPArray( $this->config->get( 'shop' ), $configPaths ); |
|
| 146 | + $configPaths = app('\Aimeos\Shop\Base\Aimeos')->get()->getConfigPaths(); |
|
| 147 | + $config = new \Aimeos\MW\Config\PHPArray($this->config->get('shop'), $configPaths); |
|
| 148 | 148 | |
| 149 | - if( function_exists( 'apc_store' ) === true && $this->config->get( 'shop.apc_enabled', false ) == true ) { |
|
| 150 | - $config = new \Aimeos\MW\Config\Decorator\APC( $config, $this->config->get( 'shop.apc_prefix', 'laravel:' ) ); |
|
| 149 | + if (function_exists('apc_store') === true && $this->config->get('shop.apc_enabled', false) == true) { |
|
| 150 | + $config = new \Aimeos\MW\Config\Decorator\APC($config, $this->config->get('shop.apc_prefix', 'laravel:')); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | return $config; |
@@ -160,18 +160,18 @@ discard block |
||
| 160 | 160 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object |
| 161 | 161 | * @return \Aimeos\MShop\Locale\Item\Iface Locale item object |
| 162 | 162 | */ |
| 163 | - protected function getLocale( \Aimeos\MShop\Context\Item\Iface $context ) |
|
| 163 | + protected function getLocale(\Aimeos\MShop\Context\Item\Iface $context) |
|
| 164 | 164 | { |
| 165 | - if( $this->locale === null ) |
|
| 165 | + if ($this->locale === null) |
|
| 166 | 166 | { |
| 167 | - $site = Route::input( 'site', Input::get( 'site', 'default' ) ); |
|
| 168 | - $currency = Route::input( 'currency', Input::get( 'currency', '' ) ); |
|
| 169 | - $lang = Route::input( 'locale', Input::get( 'locale', '' ) ); |
|
| 167 | + $site = Route::input('site', Input::get('site', 'default')); |
|
| 168 | + $currency = Route::input('currency', Input::get('currency', '')); |
|
| 169 | + $lang = Route::input('locale', Input::get('locale', '')); |
|
| 170 | 170 | |
| 171 | - $disableSites = $this->config->get( 'shop.disableSites', true ); |
|
| 171 | + $disableSites = $this->config->get('shop.disableSites', true); |
|
| 172 | 172 | |
| 173 | - $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context ); |
|
| 174 | - $this->locale = $localeManager->bootstrap( $site, $lang, $currency, $disableSites ); |
|
| 173 | + $localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context); |
|
| 174 | + $this->locale = $localeManager->bootstrap($site, $lang, $currency, $disableSites); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | return $this->locale; |
@@ -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', [['admin']] ); |
|
| 40 | + if (config('shop.authorize', true)) { |
|
| 41 | + $this->authorize('admin', [['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', [['admin', 'editor']] ); |
|
| 62 | + if (config('shop.authorize', true)) { |
|
| 63 | + $this->authorize('admin', [['admin', 'editor']]); |
|
| 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', [['admin']] ); |
|
| 84 | + if (config('shop.authorize', true)) { |
|
| 85 | + $this->authorize('admin', [['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', [['admin']] ); |
|
| 106 | + if (config('shop.authorize', true)) { |
|
| 107 | + $this->authorize('admin', [['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', [['admin']] ); |
|
| 128 | + if (config('shop.authorize', true)) { |
|
| 129 | + $this->authorize('admin', [['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', [['admin', 'editor']] ); |
|
| 150 | + if (config('shop.authorize', true)) { |
|
| 151 | + $this->authorize('admin', [['admin', 'editor']]); |
|
| 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 | } |