@@ -38,7 +38,7 @@ |
||
38 | 38 | protected function getBoundForm(Application $app, $type) |
39 | 39 | { |
40 | 40 | $form = $app['form.factory'] |
41 | - ->createBuilder($app['eccube.form.type.' . $type], $app['eccube.entity.' . $type]) |
|
41 | + ->createBuilder($app['eccube.form.type.'.$type], $app['eccube.entity.'.$type]) |
|
42 | 42 | ->getForm(); |
43 | 43 | $form->handleRequest($app['request']); |
44 | 44 |
@@ -52,11 +52,17 @@ |
||
52 | 52 | return $form; |
53 | 53 | } |
54 | 54 | |
55 | + /** |
|
56 | + * @param Application $app |
|
57 | + */ |
|
55 | 58 | protected function getSecurity($app) |
56 | 59 | { |
57 | 60 | return $app['security.token_storage']; |
58 | 61 | } |
59 | 62 | |
63 | + /** |
|
64 | + * @param Application $app |
|
65 | + */ |
|
60 | 66 | protected function isTokenValid($app) |
61 | 67 | { |
62 | 68 | $csrf = $app['form.csrf_provider']; |
@@ -88,19 +88,19 @@ discard block |
||
88 | 88 | // ファイル生成・更新 |
89 | 89 | $tplDir = $app['config']['block_realdir']; |
90 | 90 | |
91 | - $filePath = $tplDir . '/' . $Block->getFileName() . '.twig'; |
|
91 | + $filePath = $tplDir.'/'.$Block->getFileName().'.twig'; |
|
92 | 92 | |
93 | 93 | $fs = new Filesystem(); |
94 | 94 | $fs->dumpFile($filePath, $form->get('block_html')->getData()); |
95 | 95 | // 更新でファイル名を変更した場合、以前のファイルを削除 |
96 | 96 | if ($Block->getFileName() != $previous_filename && !is_null($previous_filename)) { |
97 | - $oldFilePath = $tplDir . $previous_filename; |
|
97 | + $oldFilePath = $tplDir.$previous_filename; |
|
98 | 98 | if ($fs->exists($oldFilePath)) { |
99 | 99 | $fs->remove($oldFilePath); |
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | - \Eccube\Util\Cache::clear($app,false); |
|
103 | + \Eccube\Util\Cache::clear($app, false); |
|
104 | 104 | |
105 | 105 | $app->addSuccess('admin.register.complete', 'admin'); |
106 | 106 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | // テンプレートが変更されていた場合、DBからはブロック削除されるがtwigファイルは残る |
138 | 138 | if ($Block->getDeletableFlg() > 0) { |
139 | 139 | $tplDir = $app['config']['block_realdir']; |
140 | - $file = $tplDir . '/' . $Block->getFileName() . '.twig'; |
|
140 | + $file = $tplDir.'/'.$Block->getFileName().'.twig'; |
|
141 | 141 | $fs = new Filesystem(); |
142 | 142 | if ($fs->exists($file)) { |
143 | 143 | $fs->remove($file); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $app['orm.em']->flush(); |
147 | 147 | |
148 | 148 | $app->addSuccess('admin.delete.complete', 'admin'); |
149 | - \Eccube\Util\Cache::clear($app,false); |
|
149 | + \Eccube\Util\Cache::clear($app, false); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 |
@@ -28,7 +28,6 @@ |
||
28 | 28 | use Eccube\Entity\Master\DeviceType; |
29 | 29 | use Eccube\Util\Str; |
30 | 30 | use Symfony\Component\Filesystem\Filesystem; |
31 | -use Symfony\Component\Finder\Finder; |
|
32 | 31 | use Symfony\Component\Form\FormError; |
33 | 32 | use Symfony\Component\HttpFoundation\Request; |
34 | 33 | use Symfony\Component\HttpFoundation\Response; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if ($form->isValid()) { |
48 | 48 | $data = $form->getData(); |
49 | 49 | $fs = new Filesystem(); |
50 | - $fs->dumpFile($this->getCssDir($app) . $data['file_name'], $data['content']); |
|
50 | + $fs->dumpFile($this->getCssDir($app).$data['file_name'], $data['content']); |
|
51 | 51 | $app['session']->getFlashBag()->add('admin.content.css.complete', 'admin.register.complete'); |
52 | 52 | |
53 | 53 | return $app->redirect($app['url_generator']->generate('admin_content_css')); |
@@ -113,6 +113,6 @@ discard block |
||
113 | 113 | |
114 | 114 | protected function getCssDir($app) |
115 | 115 | { |
116 | - return $app['config']['user_template_realdir'] . $this->cssDir; |
|
116 | + return $app['config']['user_template_realdir'].$this->cssDir; |
|
117 | 117 | } |
118 | 118 | } |
@@ -89,20 +89,20 @@ discard block |
||
89 | 89 | $max = count($Blocks); |
90 | 90 | for ($i = 0; $i < $max; $i++) { |
91 | 91 | // block_id が取得できない場合は INSERT しない |
92 | - if (!isset($data['id_' . $i])) { |
|
92 | + if (!isset($data['id_'.$i])) { |
|
93 | 93 | continue; |
94 | 94 | } |
95 | 95 | // 未使用は INSERT しない |
96 | - if ($data['target_id_' . $i] == \Eccube\Entity\PageLayout::TARGET_ID_UNUSED) { |
|
96 | + if ($data['target_id_'.$i] == \Eccube\Entity\PageLayout::TARGET_ID_UNUSED) { |
|
97 | 97 | continue; |
98 | 98 | } |
99 | 99 | // 他のページに anywhere が存在する場合は INSERT しない |
100 | - $anywhere = (isset($data['anywhere_' . $i]) && $data['anywhere_' . $i] == 1) ? 1 : 0; |
|
101 | - if (isset($data['anywhere_' . $i]) && $data['anywhere_' . $i] == 1) { |
|
100 | + $anywhere = (isset($data['anywhere_'.$i]) && $data['anywhere_'.$i] == 1) ? 1 : 0; |
|
101 | + if (isset($data['anywhere_'.$i]) && $data['anywhere_'.$i] == 1) { |
|
102 | 102 | $Other = $app['orm.em']->getRepository('Eccube\Entity\BlockPosition') |
103 | 103 | ->findBy(array( |
104 | 104 | 'anywhere' => 1, |
105 | - 'block_id' => $data['id_' . $i], |
|
105 | + 'block_id' => $data['id_'.$i], |
|
106 | 106 | )); |
107 | 107 | if (count($Other) > 0) { |
108 | 108 | continue; |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | $BlockPosition = new \Eccube\Entity\BlockPosition(); |
113 | 113 | $Block = $app['orm.em']->getRepository('Eccube\Entity\Block') |
114 | 114 | ->findOneBy(array( |
115 | - 'id' => $data['id_' . $i], |
|
115 | + 'id' => $data['id_'.$i], |
|
116 | 116 | 'DeviceType' => $DeviceType, |
117 | 117 | )); |
118 | 118 | $BlockPosition |
119 | 119 | ->setPageId($id) |
120 | - ->setBlockId($data['id_' . $i]) |
|
121 | - ->setBlockRow($data['top_' . $i]) |
|
122 | - ->setTargetId($data['target_id_' . $i]) |
|
120 | + ->setBlockId($data['id_'.$i]) |
|
121 | + ->setBlockRow($data['top_'.$i]) |
|
122 | + ->setTargetId($data['target_id_'.$i]) |
|
123 | 123 | ->setBlock($Block) |
124 | 124 | ->setPageLayout($TargetPageLayout) |
125 | 125 | ->setAnywhere($anywhere); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | // ファイル生成・更新 |
91 | 91 | $templatePath = $app['eccube.repository.page_layout']->getWriteTemplatePath($editable); |
92 | - $filePath = $templatePath . '/' . $PageLayout->getFileName() . '.twig'; |
|
92 | + $filePath = $templatePath.'/'.$PageLayout->getFileName().'.twig'; |
|
93 | 93 | |
94 | 94 | $fs = new Filesystem(); |
95 | 95 | $fs->dumpFile($filePath, $form->get('tpl_data')->getData()); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $app->addSuccess('admin.register.complete', 'admin'); |
98 | 98 | |
99 | 99 | // twig キャッシュの削除. |
100 | - $finder = Finder::create()->in($app['config']['root_dir'] . '/app/cache/twig'); |
|
100 | + $finder = Finder::create()->in($app['config']['root_dir'].'/app/cache/twig'); |
|
101 | 101 | $fs->remove($finder); |
102 | 102 | |
103 | 103 | return $app->redirect($app->url('admin_content_page_edit', array('id' => $PageLayout->getId()))); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | if ($PageLayout->getEditFlg() == PageLayout::EDIT_FLG_USER) { |
137 | 137 | $templatePath = $app['eccube.repository.page_layout'] |
138 | 138 | ->getWriteTemplatePath($DeviceType, true); |
139 | - $file = $templatePath . '/' . $PageLayout->getFileName() . '.twig'; |
|
139 | + $file = $templatePath.'/'.$PageLayout->getFileName().'.twig'; |
|
140 | 140 | $fs = new Filesystem(); |
141 | 141 | if ($fs->exists($file)) { |
142 | 142 | $fs->remove($file); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $em->getConfiguration()->setSQLLogger(null); |
172 | 172 | |
173 | 173 | $response = new StreamedResponse(); |
174 | - $response->setCallback(function () use ($app, $request) { |
|
174 | + $response->setCallback(function() use ($app, $request) { |
|
175 | 175 | |
176 | 176 | // CSV種別を元に初期化. |
177 | 177 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_CUSTOMER); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | |
186 | 186 | // データ行の出力. |
187 | 187 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
188 | - $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) { |
|
188 | + $app['eccube.service.csv.export']->exportData(function($entity, $csvService) { |
|
189 | 189 | |
190 | 190 | $Csvs = $csvService->getCsvs(); |
191 | 191 | |
@@ -207,9 +207,9 @@ discard block |
||
207 | 207 | }); |
208 | 208 | |
209 | 209 | $now = new \DateTime(); |
210 | - $filename = 'customer_' . $now->format('YmdHis') . '.csv'; |
|
210 | + $filename = 'customer_'.$now->format('YmdHis').'.csv'; |
|
211 | 211 | $response->headers->set('Content-Type', 'application/octet-stream'); |
212 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
212 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
213 | 213 | $response->send(); |
214 | 214 | |
215 | 215 | return $response; |
@@ -109,7 +109,7 @@ |
||
109 | 109 | 'id' => $Customer->getId(), |
110 | 110 | ))); |
111 | 111 | } else { |
112 | - $app->addError('admin.customer.save.failed','admin'); |
|
112 | + $app->addError('admin.customer.save.failed', 'admin'); |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 |
@@ -23,7 +23,6 @@ |
||
23 | 23 | |
24 | 24 | namespace Eccube\Controller\Admin\Setting\System; |
25 | 25 | |
26 | -use Doctrine\Common\Util\Debug; |
|
27 | 26 | use Eccube\Application; |
28 | 27 | use Eccube\Controller\AbstractController; |
29 | 28 | use Symfony\Component\HttpFoundation\Request; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $em->getConfiguration()->setSQLLogger(null); |
185 | 185 | |
186 | 186 | $response = new StreamedResponse(); |
187 | - $response->setCallback(function () use ($app, $request) { |
|
187 | + $response->setCallback(function() use ($app, $request) { |
|
188 | 188 | |
189 | 189 | // CSV種別を元に初期化. |
190 | 190 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_ORDER); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | // データ行の出力. |
200 | 200 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
201 | - $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) { |
|
201 | + $app['eccube.service.csv.export']->exportData(function($entity, $csvService) { |
|
202 | 202 | |
203 | 203 | $Csvs = $csvService->getCsvs(); |
204 | 204 | |
@@ -228,9 +228,9 @@ discard block |
||
228 | 228 | }); |
229 | 229 | |
230 | 230 | $now = new \DateTime(); |
231 | - $filename = 'order_' . $now->format('YmdHis') . '.csv'; |
|
231 | + $filename = 'order_'.$now->format('YmdHis').'.csv'; |
|
232 | 232 | $response->headers->set('Content-Type', 'application/octet-stream'); |
233 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
233 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
234 | 234 | $response->send(); |
235 | 235 | |
236 | 236 | return $response; |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $em->getConfiguration()->setSQLLogger(null); |
254 | 254 | |
255 | 255 | $response = new StreamedResponse(); |
256 | - $response->setCallback(function () use ($app, $request) { |
|
256 | + $response->setCallback(function() use ($app, $request) { |
|
257 | 257 | |
258 | 258 | // CSV種別を元に初期化. |
259 | 259 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_SHIPPING); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | |
268 | 268 | // データ行の出力. |
269 | 269 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
270 | - $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) { |
|
270 | + $app['eccube.service.csv.export']->exportData(function($entity, $csvService) { |
|
271 | 271 | |
272 | 272 | $Csvs = $csvService->getCsvs(); |
273 | 273 | |
@@ -305,9 +305,9 @@ discard block |
||
305 | 305 | }); |
306 | 306 | |
307 | 307 | $now = new \DateTime(); |
308 | - $filename = 'shipping_' . $now->format('YmdHis') . '.csv'; |
|
308 | + $filename = 'shipping_'.$now->format('YmdHis').'.csv'; |
|
309 | 309 | $response->headers->set('Content-Type', 'application/octet-stream'); |
310 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
310 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
311 | 311 | $response->send(); |
312 | 312 | |
313 | 313 | return $response; |
@@ -42,7 +42,7 @@ |
||
42 | 42 | ->getRepository('\Eccube\Entity\Master\OrderStatus') |
43 | 43 | ->findAllArray() |
44 | 44 | ; |
45 | - $CurrentStatus = $app['orm.em'] |
|
45 | + $CurrentStatus = $app['orm.em'] |
|
46 | 46 | ->getRepository('\Eccube\Entity\Master\OrderStatus') |
47 | 47 | ->find($id) |
48 | 48 | ; |