From a0b7164d9fd08f67b92134564b84c29839d9abac Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Fri, 17 May 2019 14:20:01 +0200 Subject: [PATCH] lint changes --- .../godmode/wizards/HostDevices.class.php | 4 +- .../godmode/wizards/Wizard.main.php | 61 +++++++++++++++++-- pandora_console/include/styles/discovery.css | 4 +- 3 files changed, 61 insertions(+), 8 deletions(-) diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php index c6ee1b1c6b..9fab18fb58 100755 --- a/pandora_console/godmode/wizards/HostDevices.class.php +++ b/pandora_console/godmode/wizards/HostDevices.class.php @@ -608,6 +608,8 @@ class HostDevices extends Wizard $interv_manual = 1; } + $form['rows'][0]['new_form_block'] = true; + $form['rows'][0]['columns'][0] = [ 'width' => '30%', 'style' => 'padding: 9px;', @@ -799,7 +801,6 @@ class HostDevices extends Wizard ], ]; - // Hidden, page. $form['inputs'][] = [ 'arguments' => [ 'name' => 'page', @@ -813,7 +814,6 @@ class HostDevices extends Wizard 'extra' => '

Please, configure task '.io_safe_output($this->task['name']).'

', ]; - // Input: Module template. $form['inputs'][] = [ 'label' => __('Module template'), 'arguments' => [ diff --git a/pandora_console/godmode/wizards/Wizard.main.php b/pandora_console/godmode/wizards/Wizard.main.php index c05bbcf6b8..9bb0788424 100644 --- a/pandora_console/godmode/wizards/Wizard.main.php +++ b/pandora_console/godmode/wizards/Wizard.main.php @@ -567,7 +567,7 @@ class Wizard ], ]; - $this->printForm($form); + $this->printFormAsList($form); } @@ -603,14 +603,55 @@ class Wizard $output .= ''; } else { if ($input['arguments']['type'] != 'hidden') { - $output .= '
'; + if ($input['arguments']['inline'] != 'true') { + $output .= '
'; + } else { + $output .= '
'; + if (!isset($input['extra'])) { + $output .= '
'; + } + + if (isset($input['extra'])) { + $output .= '
'; + } + } + + if ($input['arguments']['inline'] == 'true' && isset($input['extra'])) { + $output .= '
'; + } + $output .= '
'; $output .= $input['label']; $output .= '
'; - if ($input['arguments']['type'] == 'text') { + + if ($input['arguments']['inline'] == 'true' && isset($input['extra'])) { + $output .= '
'; + } + + if ($input['arguments']['inline'] == 'true' && !isset($input['extra'])) { + $output .= '
'; + } + + if ($input['arguments']['type'] == 'text' || $input['arguments']['type'] == 'text_extended') { $output .= '
'; $output .= $this->printInput($input['arguments']); $output .= '
'; + } else if ($input['arguments']['inline'] == 'true') { + $output .= '
'; + + if (isset($input['extra'])) { + $output .= '
'; + } else { + $output .= '
'; + } + + $output .= $this->printInput($input['arguments']); + $output .= '
'; + $output .= '
'; + + if (isset($input['extra'])) { + $output .= '
'; + } } else { $output .= $this->printInput($input['arguments']); } @@ -725,9 +766,21 @@ class Wizard $output_submit = ''; $output = ''; - $output .= '
'; + $first_block_printed = false; foreach ($rows as $row) { + if ($row['new_form_block'] == true) { + if ($first_block_printed === true) { + // If first form block has been placed, then close it before starting a new one. + $output .= '
'; + $output .= '
'; + } else { + $output .= '
'; + } + + $first_block_printed = true; + } + $output .= '
'; foreach ($row['columns'] as $column) { diff --git a/pandora_console/include/styles/discovery.css b/pandora_console/include/styles/discovery.css index 28d4456a55..6df04ae736 100644 --- a/pandora_console/include/styles/discovery.css +++ b/pandora_console/include/styles/discovery.css @@ -230,8 +230,8 @@ li > input[type="password"], height: 100px; max-height: 100px; max-width: 100%; - -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ - -moz-box-sizing: border-box; /* Firefox, other Gecko */ + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; box-sizing: border-box; resize: none; }