@@ 57-77 (lines=21) @@ | ||
54 | * @Route("/%eccube_admin_route%/content/block", name="admin_content_block") |
|
55 | * @Template("@admin/Content/block.twig") |
|
56 | */ |
|
57 | public function index(Request $request) |
|
58 | { |
|
59 | $DeviceType = $this->deviceTypeRepository |
|
60 | ->find(DeviceType::DEVICE_TYPE_PC); |
|
61 | ||
62 | // 登録されているブロック一覧の取得 |
|
63 | $Blocks = $this->blockRepository->getList($DeviceType); |
|
64 | ||
65 | $event = new EventArgs( |
|
66 | [ |
|
67 | 'DeviceType' => $DeviceType, |
|
68 | 'Blocks' => $Blocks, |
|
69 | ], |
|
70 | $request |
|
71 | ); |
|
72 | $this->eventDispatcher->dispatch(EccubeEvents::ADMIN_CONTENT_BLOCK_INDEX_COMPLETE, $event); |
|
73 | ||
74 | return [ |
|
75 | 'Blocks' => $Blocks, |
|
76 | ]; |
|
77 | } |
|
78 | ||
79 | /** |
|
80 | * @Route("/%eccube_admin_route%/content/block/new", name="admin_content_block_new") |
@@ 59-80 (lines=22) @@ | ||
56 | * |
|
57 | * @return array |
|
58 | */ |
|
59 | public function index(Request $request, $page_no = 1, Paginator $paginator) |
|
60 | { |
|
61 | $qb = $this->newsRepository->getQueryBuilderAll(); |
|
62 | ||
63 | $event = new EventArgs( |
|
64 | [ |
|
65 | 'qb' => $qb, |
|
66 | ], |
|
67 | $request |
|
68 | ); |
|
69 | $this->eventDispatcher->dispatch(EccubeEvents::ADMIN_CONTENT_NEWS_INDEX_INITIALIZE, $event); |
|
70 | ||
71 | $pagination = $paginator->paginate( |
|
72 | $qb, |
|
73 | $page_no, |
|
74 | $this->eccubeConfig->get('eccube_default_page_count') |
|
75 | ); |
|
76 | ||
77 | return [ |
|
78 | 'pagination' => $pagination, |
|
79 | ]; |
|
80 | } |
|
81 | ||
82 | /** |
|
83 | * 新着情報を登録・編集する。 |