Skip to content

Commit

Permalink
3860 region options (#3959)
Browse files Browse the repository at this point in the history
* Add new arguments key and target. Make it possible use not only default target for db connections

* Fix region options
  • Loading branch information
LOBsTerr committed Apr 6, 2019
1 parent 09114aa commit e952107
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Command/Generate/PluginBlockCommand.php
Expand Up @@ -224,9 +224,6 @@ protected function execute(InputInterface $input, OutputInterface $output)


protected function interact(InputInterface $input, OutputInterface $output) protected function interact(InputInterface $input, OutputInterface $output)
{ {
$theme = $this->configFactory->get('system.theme')->get('default');
$themeRegions = \system_region_list($theme, REGIONS_VISIBLE);

// --module option // --module option
$this->getModuleOption(); $this->getModuleOption();


Expand Down Expand Up @@ -265,10 +262,17 @@ function ($class) {


// --theme-region option // --theme-region option
$themeRegion = $input->getOption('theme-region'); $themeRegion = $input->getOption('theme-region');

if (!$themeRegion) { if (!$themeRegion) {
$theme = $this->configFactory->get('system.theme')->get('default');
$themeRegions = \system_region_list($theme, REGIONS_VISIBLE);
$themeRegionOptions = [];
foreach ($themeRegions as $key => $region) {
$themeRegionOptions[$key] = $region->render();
}
$themeRegion = $this->getIo()->choiceNoList( $themeRegion = $this->getIo()->choiceNoList(
$this->trans('commands.generate.plugin.block.questions.theme-region'), $this->trans('commands.generate.plugin.block.questions.theme-region'),
array_values($themeRegions), $themeRegionOptions,
'', '',
true true
); );
Expand Down

0 comments on commit e952107

Please sign in to comment.