Skip to content

Commit e952107

Browse files
authored
3860 region options (#3959)
* Add new arguments key and target. Make it possible use not only default target for db connections * Fix region options
1 parent 09114aa commit e952107

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Command/Generate/PluginBlockCommand.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
224224

225225
protected function interact(InputInterface $input, OutputInterface $output)
226226
{
227-
$theme = $this->configFactory->get('system.theme')->get('default');
228-
$themeRegions = \system_region_list($theme, REGIONS_VISIBLE);
229-
230227
// --module option
231228
$this->getModuleOption();
232229

@@ -265,10 +262,17 @@ function ($class) {
265262

266263
// --theme-region option
267264
$themeRegion = $input->getOption('theme-region');
265+
268266
if (!$themeRegion) {
267+
$theme = $this->configFactory->get('system.theme')->get('default');
268+
$themeRegions = \system_region_list($theme, REGIONS_VISIBLE);
269+
$themeRegionOptions = [];
270+
foreach ($themeRegions as $key => $region) {
271+
$themeRegionOptions[$key] = $region->render();
272+
}
269273
$themeRegion = $this->getIo()->choiceNoList(
270274
$this->trans('commands.generate.plugin.block.questions.theme-region'),
271-
array_values($themeRegions),
275+
$themeRegionOptions,
272276
'',
273277
true
274278
);

0 commit comments

Comments
 (0)