Completed
Push — master ( f84d4b...e9c710 )
by Aimeos
02:56
created
src/Aimeos/Shop/Command/JobsCommand.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -43,21 +43,21 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function fire()
45 45
 	{
46
-		$aimeos = $this->getLaravel()->make( '\Aimeos\Shop\Base\Aimeos' )->get();
46
+		$aimeos = $this->getLaravel()->make('\Aimeos\Shop\Base\Aimeos')->get();
47 47
 		$context = $this->getContext();
48 48
 
49
-		$jobs = explode( ' ', $this->argument( 'jobs' ) );
50
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
49
+		$jobs = explode(' ', $this->argument('jobs'));
50
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
51 51
 
52
-		foreach( $this->getSiteItems( $context, $this->argument( 'site' ) ) as $siteItem )
52
+		foreach ($this->getSiteItems($context, $this->argument('site')) as $siteItem)
53 53
 		{
54
-			$localeItem = $localeManager->bootstrap( $siteItem->getCode(), 'en', '', false );
55
-			$context->setLocale( $localeItem );
54
+			$localeItem = $localeManager->bootstrap($siteItem->getCode(), 'en', '', false);
55
+			$context->setLocale($localeItem);
56 56
 
57
-			$this->info( sprintf( 'Executing the Aimeos jobs for "%s"', $siteItem->getCode() ) );
57
+			$this->info(sprintf('Executing the Aimeos jobs for "%s"', $siteItem->getCode()));
58 58
 
59
-			foreach( $jobs as $jobname ) {
60
-				\Aimeos\Controller\Jobs\Factory::createController( $context, $aimeos, $jobname )->run();
59
+			foreach ($jobs as $jobname) {
60
+				\Aimeos\Controller\Jobs\Factory::createController($context, $aimeos, $jobname)->run();
61 61
 			}
62 62
 		}
63 63
 	}
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 	protected function getArguments()
72 72
 	{
73 73
 		return array(
74
-			array( 'jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"' ),
75
-			array( 'site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)' ),
74
+			array('jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"'),
75
+			array('site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)'),
76 76
 		);
77 77
 	}
78 78
 
@@ -95,20 +95,20 @@  discard block
 block discarded – undo
95 95
 	protected function getContext()
96 96
 	{
97 97
 		$lv = $this->getLaravel();
98
-		$aimeos = $lv->make( '\Aimeos\Shop\Base\Aimeos' )->get();
99
-		$context = $lv->make( '\Aimeos\Shop\Base\Context' )->get( false );
98
+		$aimeos = $lv->make('\Aimeos\Shop\Base\Aimeos')->get();
99
+		$context = $lv->make('\Aimeos\Shop\Base\Context')->get(false);
100 100
 
101
-		$tmplPaths = $aimeos->getCustomPaths( 'controller/jobs/templates' );
102
-		$tmplPaths = array_merge( $tmplPaths, $aimeos->getCustomPaths( 'client/html/templates' ) );
103
-		$view = $lv->make( '\Aimeos\Shop\Base\View' )->create( $context->getConfig(), $tmplPaths );
101
+		$tmplPaths = $aimeos->getCustomPaths('controller/jobs/templates');
102
+		$tmplPaths = array_merge($tmplPaths, $aimeos->getCustomPaths('client/html/templates'));
103
+		$view = $lv->make('\Aimeos\Shop\Base\View')->create($context->getConfig(), $tmplPaths);
104 104
 
105
-		$langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context )->getSubManager( 'language' );
106
-		$langids = array_keys( $langManager->searchItems( $langManager->createSearch( true ) ) );
107
-		$i18n = $lv->make( '\Aimeos\Shop\Base\I18n' )->get( $langids );
105
+		$langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context)->getSubManager('language');
106
+		$langids = array_keys($langManager->searchItems($langManager->createSearch(true)));
107
+		$i18n = $lv->make('\Aimeos\Shop\Base\I18n')->get($langids);
108 108
 
109
-		$context->setEditor( 'aimeos:jobs' );
110
-		$context->setView( $view );
111
-		$context->setI18n( $i18n );
109
+		$context->setEditor('aimeos:jobs');
110
+		$context->setView($view);
111
+		$context->setI18n($i18n);
112 112
 
113 113
 		return $context;
114 114
 	}
Please login to merge, or discard this patch.
src/Aimeos/Shop/Controller/JqadmController.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
src/views/extadm/index.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.