mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
save changes ticket 3937
Former-commit-id: 264c0fed3ddcf7c34796af0a3c2bd4d48a6763bb
This commit is contained in:
parent
874f4764ea
commit
13b32003b3
@ -594,106 +594,120 @@ class HostDevices extends Wizard
|
|||||||
if (isset($this->page) === false
|
if (isset($this->page) === false
|
||||||
|| $this->page == 0
|
|| $this->page == 0
|
||||||
) {
|
) {
|
||||||
// Comment input
|
$form = [];
|
||||||
$comment_input = '<div class="label_select"><label>'.__('Comment').':</label></div>';
|
|
||||||
|
|
||||||
$comment_input .= $this->printInput(
|
$str = __('Next');
|
||||||
[
|
|
||||||
'name' => 'comment',
|
|
||||||
'rows' => 1,
|
|
||||||
'columns' => 1,
|
|
||||||
'value' => $this->task['description'],
|
|
||||||
'type' => 'textarea',
|
|
||||||
'size' => 25,
|
|
||||||
'class' => 'discovery_textarea_input',
|
|
||||||
'return' => true,
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
// Task input
|
if (isset($this->task['id_rt']) === true) {
|
||||||
$taskname_input_label = '<div class="label_select"><label>'.__('Task name').':</label></div>';
|
$str = __('Update and continue');
|
||||||
|
}
|
||||||
|
|
||||||
$taskname_input = $this->printInput(
|
// Interval and schedules.
|
||||||
[
|
|
||||||
'name' => 'taskname',
|
|
||||||
'value' => $this->task['name'],
|
|
||||||
'type' => 'text',
|
|
||||||
'size' => 25,
|
|
||||||
'class' => 'discovery_full_width_input',
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
// Network input
|
|
||||||
$network_input_label .= '<div class="label_select discovery_label_hint"><label>'.__('Network').':</label>'.ui_print_help_tip(__('You can specify several networks, separated by commas, for example: 192.168.50.0/24,192.168.60.0/24'), true).'</div>';
|
|
||||||
|
|
||||||
$network_input = $this->printInput(
|
|
||||||
[
|
|
||||||
'name' => 'network',
|
|
||||||
'value' => $this->task['subnet'],
|
|
||||||
'type' => 'text',
|
|
||||||
'size' => 25,
|
|
||||||
'class' => 'discovery_full_width_input',
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
// Discovery server input
|
|
||||||
$discovery_server_select_label = '<div class="label_select discovery_label_hint"><label>'.__('Discovery server').':</label>'.ui_print_help_tip(__('You must select a Discovery Server to run the Task, otherwise the Recon Task will never run'), true).'</div>';
|
|
||||||
|
|
||||||
$discovery_server_select = $this->printInput(
|
|
||||||
[
|
|
||||||
'type' => 'select_from_sql',
|
|
||||||
'sql' => sprintf(
|
|
||||||
'SELECT id_server, name
|
|
||||||
FROM tserver
|
|
||||||
WHERE server_type = %d
|
|
||||||
ORDER BY name',
|
|
||||||
SERVER_TYPE_DISCOVERY
|
|
||||||
),
|
|
||||||
'name' => 'id_recon_server',
|
|
||||||
'selected' => $this->task['id_recon_server'],
|
|
||||||
'return' => true,
|
|
||||||
'style' => 'width: 100%',
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
// Interval input
|
|
||||||
$interv_manual = 0;
|
$interv_manual = 0;
|
||||||
if ((int) $this->task['interval_sweep'] == 0) {
|
if ((int) $this->task['interval_sweep'] == 0) {
|
||||||
$interv_manual = 1;
|
$interv_manual = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$interval_input_label = '<div class="label_select discovery_label_hint" style="padding-top: 6px;"><label>'.__('Interval').':</label>'.ui_print_help_tip(__('Manual interval means that it will run only on demand.'), true).'</div>';
|
$form['rows'][0]['columns'][0] = [
|
||||||
|
'width' => '30%',
|
||||||
$interval_input = $this->printInput(
|
'style' => 'padding: 9px;',
|
||||||
[
|
'inputs' => [
|
||||||
'type' => 'select',
|
'0' => [
|
||||||
'selected' => $interv_manual,
|
'arguments' => [
|
||||||
'fields' => [
|
'name' => 'submit',
|
||||||
0 => __('Defined'),
|
'label' => $str,
|
||||||
1 => __('Manual'),
|
'type' => 'submit',
|
||||||
|
'attributes' => 'class="sub next"',
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'name' => 'interval_manual_defined',
|
'1' => '<div style="height: 50%; margin-bottom: 35px;">'.html_print_image('images/wizard/netscan_green.png', true, ['title' => __('Close')], false).'</div>',
|
||||||
'return' => true,
|
'2' => [
|
||||||
'style' => 'float: right;',
|
'label' => '<b>'.__('Interval').':</b>'.ui_print_help_tip(
|
||||||
]
|
__('Manual interval means that it will be executed only On-demand'),
|
||||||
);
|
true
|
||||||
|
),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'select',
|
||||||
|
'selected' => $interv_manual,
|
||||||
|
'fields' => [
|
||||||
|
0 => __('Defined'),
|
||||||
|
1 => __('Manual'),
|
||||||
|
],
|
||||||
|
'name' => 'interval_manual_defined',
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
'extra' => '<span id="interval_manual_container">'.html_print_extended_select_for_time(
|
||||||
|
'interval',
|
||||||
|
$this->task['interval_sweep'],
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'0',
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
).ui_print_help_tip(
|
||||||
|
__('The minimum recomended interval for Recon Task is 5 minutes'),
|
||||||
|
true
|
||||||
|
).'</span>',
|
||||||
|
|
||||||
$interval_input_extra = '<span id="interval_manual_container">'.html_print_extended_select_for_time(
|
],
|
||||||
'interval',
|
],
|
||||||
$this->task['interval_sweep'],
|
];
|
||||||
'',
|
|
||||||
'',
|
|
||||||
'0',
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false
|
|
||||||
).ui_print_help_tip(
|
|
||||||
__('The minimum recomended interval for Recon Task is 5 minutes'),
|
|
||||||
true
|
|
||||||
).'</span>';
|
|
||||||
|
|
||||||
// Group select
|
$form['rows'][0]['columns'][1] = [
|
||||||
|
'width' => '40%',
|
||||||
|
'padding-right' => '12%',
|
||||||
|
'padding-left' => '5%',
|
||||||
|
'inputs' => [
|
||||||
|
'0' => [
|
||||||
|
'label' => '<b>'.__('Task name').':</b>',
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'taskname',
|
||||||
|
'value' => $this->task['name'],
|
||||||
|
'type' => 'text',
|
||||||
|
'size' => 25,
|
||||||
|
'class' => 'discovery_full_width_input',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'1' => [
|
||||||
|
'label' => '<b>'.__('Discovery server').':</b>'.ui_print_help_tip(
|
||||||
|
__('You must select a Discovery Server to run the Task, otherwise the Recon Task will never run'),
|
||||||
|
true
|
||||||
|
),
|
||||||
|
'arguments' => [
|
||||||
|
'type' => 'select_from_sql',
|
||||||
|
'sql' => sprintf(
|
||||||
|
'SELECT id_server, name
|
||||||
|
FROM tserver
|
||||||
|
WHERE server_type = %d
|
||||||
|
ORDER BY name',
|
||||||
|
SERVER_TYPE_DISCOVERY
|
||||||
|
),
|
||||||
|
'name' => 'id_recon_server',
|
||||||
|
'style' => 'width: 100%;',
|
||||||
|
'selected' => $this->task['id_recon_server'],
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'2' => [
|
||||||
|
'label' => '<b>'.__('Network').':</b>'.ui_print_help_tip(
|
||||||
|
__('You can specify several networks, separated by commas, for example: 192.168.50.0/24,192.168.60.0/24'),
|
||||||
|
true
|
||||||
|
),
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'network',
|
||||||
|
'value' => $this->task['subnet'],
|
||||||
|
'type' => 'text',
|
||||||
|
'size' => 25,
|
||||||
|
'class' => 'discovery_full_width_input',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Group select (custom for this section)
|
||||||
$group_select = '<div class="label_select"><label>'.__('Group').':</label></div>';
|
$group_select = '<div class="label_select"><label>'.__('Group').':</label></div>';
|
||||||
|
|
||||||
$group_select .= $this->printInput(
|
$group_select .= $this->printInput(
|
||||||
@ -710,22 +724,41 @@ class HostDevices extends Wizard
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($this->task['id_rt']) === true) {
|
$form['rows'][0]['columns'][2] = [
|
||||||
// Propagate ID
|
'width' => '30%',
|
||||||
$task_hidden = $this->printInput(
|
'inputs' => ['0' => $group_select],
|
||||||
[
|
];
|
||||||
'name' => 'task',
|
|
||||||
'value' => $this->task['id_rt'],
|
$form['rows'][1]['style'] = 'style de row';
|
||||||
'type' => 'hidden',
|
$form['rows'][1]['columns'][0] = [
|
||||||
]
|
'padding-right' => '0',
|
||||||
);
|
'inputs' => [
|
||||||
}
|
'0' => [
|
||||||
|
'label' => '<b>'.__('Comment').':</b>',
|
||||||
|
'arguments' => [
|
||||||
|
'name' => 'comment',
|
||||||
|
'rows' => 1,
|
||||||
|
'columns' => 1,
|
||||||
|
'value' => $this->task['description'],
|
||||||
|
'type' => 'textarea',
|
||||||
|
'size' => 25,
|
||||||
|
'class' => 'discovery_textarea_input',
|
||||||
|
'return' => true,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
$task_url = '';
|
$task_url = '';
|
||||||
if (isset($this->task['id_rt'])) {
|
if (isset($this->task['id_rt'])) {
|
||||||
$task_url = '&task='.$this->task['id_rt'];
|
$task_url = '&task='.$this->task['id_rt'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$form['form'] = [
|
||||||
|
'method' => 'POST',
|
||||||
|
'action' => $this->url.'&mode=netscan&page='.($this->page + 1).$task_url,
|
||||||
|
];
|
||||||
|
|
||||||
// Default.
|
// Default.
|
||||||
$interval = 600;
|
$interval = 600;
|
||||||
$unit = 60;
|
$unit = 60;
|
||||||
@ -734,34 +767,7 @@ class HostDevices extends Wizard
|
|||||||
$unit = $this->getTimeUnit($interval);
|
$unit = $this->getTimeUnit($interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX: Could be improved validating inputs before continue (JS)
|
$form['js'] = '
|
||||||
// Print NetScan page 0.
|
|
||||||
// $this->printForm($form);
|
|
||||||
echo '<form action="'.$this->url.'&mode=netscan&page='.($this->page + 1).$task_url.'" method="POST">';
|
|
||||||
echo $task_hidden;
|
|
||||||
|
|
||||||
echo '<div class="white_box">
|
|
||||||
<div class="edit_discovery_info" style="margin-bottom: 15px;">
|
|
||||||
<div style="width: 25%; padding: 9px;">'.'<div style="height: 50%; margin-bottom: 35px;">'.html_print_image('images/wizard/netscan_green.png', true, ['title' => __('Close')], false).'</div>'.'<div class="edit_discovery_input"><div style="display: flex;">'.$interval_input_label.'<div style="margin-left: 15 px; width: 50%;">'.$interval_input.'</div></div>'.$interval_input_extra.'</div>'.'</div>
|
|
||||||
|
|
||||||
<div style="width: 40%; padding-left: 5%; padding-right: 12%;">
|
|
||||||
<div class="edit_discovery_input">'.$taskname_input_label.'<div class="discovery_text_input">'.$taskname_input.'</div></div>'.'<div class="edit_discovery_input discovery_select_input">'.$discovery_server_select_label.$discovery_server_select.'<div class="discovery_hint"></div></div>'.'<div class="edit_discovery_input">'.$network_input_label.'<div class="discovery_text_input">'.$network_input.'</div></div>'.'</div>'.'<div style="width: 35%;">'.$group_select.'</div>'.'</div>'.'<div class="edit_discovery_info">
|
|
||||||
<div style="width: 100%;">
|
|
||||||
'.$comment_input.'
|
|
||||||
</div>
|
|
||||||
</div>'.'</div>';
|
|
||||||
|
|
||||||
$str = __('Next');
|
|
||||||
|
|
||||||
if (isset($this->task['id_rt']) === true) {
|
|
||||||
$str = __('Update and continue');
|
|
||||||
}
|
|
||||||
|
|
||||||
echo '<div class="action-buttons" style="width: 100%; margin-top: 10px;">'.html_print_submit_button($str, 'submit', false, 'class="sub next"', true).'</div>';
|
|
||||||
echo '</form>';
|
|
||||||
|
|
||||||
echo '<script>
|
|
||||||
|
|
||||||
$("select#interval_manual_defined").change(function() {
|
$("select#interval_manual_defined").change(function() {
|
||||||
if ($("#interval_manual_defined").val() == 1) {
|
if ($("#interval_manual_defined").val() == 1) {
|
||||||
$("#interval_manual_container").hide();
|
$("#interval_manual_container").hide();
|
||||||
@ -774,9 +780,9 @@ class HostDevices extends Wizard
|
|||||||
$("#hidden-interval").val('.$interval.');
|
$("#hidden-interval").val('.$interval.');
|
||||||
$("#interval_units").val('.$unit.');
|
$("#interval_units").val('.$unit.');
|
||||||
}
|
}
|
||||||
}).change();
|
}).change();';
|
||||||
|
|
||||||
</script>';
|
$this->printFormAsGrid($form);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -870,7 +876,7 @@ class HostDevices extends Wizard
|
|||||||
'action' => $this->url.'&mode=netscan&page='.($this->page + 1).'&task='.$this->task['id_rt'],
|
'action' => $this->url.'&mode=netscan&page='.($this->page + 1).'&task='.$this->task['id_rt'],
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->printForm($form, false, true);
|
$this->printFormAsList($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->page == 2) {
|
if ($this->page == 2) {
|
||||||
|
@ -572,14 +572,14 @@ class Wizard
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a block of inputs.
|
* Print a block of inputs with grid format.
|
||||||
*
|
*
|
||||||
* @param array $input Definition of target block to be printed.
|
* @param array $input Definition of target block to be printed.
|
||||||
* @param boolean $return Return as string or direct output.
|
* @param boolean $return Return as string or direct output.
|
||||||
*
|
*
|
||||||
* @return string HTML content.
|
* @return string HTML content.
|
||||||
*/
|
*/
|
||||||
public function printBlock(array $input, bool $return=false)
|
public function printBlockAsGrid(array $input, bool $return=false)
|
||||||
{
|
{
|
||||||
$output = '';
|
$output = '';
|
||||||
if ($input['hidden'] == 1) {
|
if ($input['hidden'] == 1) {
|
||||||
@ -597,7 +597,69 @@ class Wizard
|
|||||||
$output .= '<li id="'.$input['block_id'].'" class="'.$class.'">';
|
$output .= '<li id="'.$input['block_id'].'" class="'.$class.'">';
|
||||||
$output .= '<ul class="wizard">';
|
$output .= '<ul class="wizard">';
|
||||||
foreach ($input['block_content'] as $input) {
|
foreach ($input['block_content'] as $input) {
|
||||||
$output .= $this->printBlock($input, $return);
|
$output .= $this->printBlockAsGrid($input, $return);
|
||||||
|
}
|
||||||
|
|
||||||
|
$output .= '</ul></li>';
|
||||||
|
} else {
|
||||||
|
if ($input['arguments']['type'] != 'hidden') {
|
||||||
|
$output .= '<div class="edit_discovery_input">';
|
||||||
|
$output .= '<div class="label_select">';
|
||||||
|
$output .= $input['label'];
|
||||||
|
$output .= '</div>';
|
||||||
|
if ($input['arguments']['type'] == 'text') {
|
||||||
|
$output .= '<div class="discovery_text_input">';
|
||||||
|
$output .= $this->printInput($input['arguments']);
|
||||||
|
$output .= '</div>';
|
||||||
|
} else {
|
||||||
|
$output .= $this->printInput($input['arguments']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Allow dynamic content.
|
||||||
|
$output .= $input['extra'];
|
||||||
|
$output .= '</div>';
|
||||||
|
} else {
|
||||||
|
$output .= $this->printInput($input['arguments']);
|
||||||
|
// Allow dynamic content.
|
||||||
|
$output .= $input['extra'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($return === false) {
|
||||||
|
echo $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print a block of inputs as a list element.
|
||||||
|
*
|
||||||
|
* @param array $input Definition of target block to be printed.
|
||||||
|
* @param boolean $return Return as string or direct output.
|
||||||
|
*
|
||||||
|
* @return string HTML content.
|
||||||
|
*/
|
||||||
|
public function printBlockAsList(array $input, bool $return=false)
|
||||||
|
{
|
||||||
|
$output = '';
|
||||||
|
if ($input['hidden'] == 1) {
|
||||||
|
$class = ' hidden';
|
||||||
|
} else {
|
||||||
|
$class = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($input['class']) === true) {
|
||||||
|
$class = $input['class'].$class;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_array($input['block_content']) === true) {
|
||||||
|
// Print independent block of inputs.
|
||||||
|
$output .= '<li id="'.$input['block_id'].'" class="'.$class.'">';
|
||||||
|
$output .= '<ul class="wizard">';
|
||||||
|
foreach ($input['block_content'] as $input) {
|
||||||
|
$output .= $this->printBlockAsList($input, $return);
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= '</ul></li>';
|
$output .= '</ul></li>';
|
||||||
@ -625,17 +687,19 @@ class Wizard
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print a form.
|
* Print a form as a grid of inputs.
|
||||||
*
|
*
|
||||||
* @param array $data Definition of target form to be printed.
|
* @param array $data Definition of target form to be printed.
|
||||||
* @param boolean $return Return as string or direct output.
|
* @param boolean $return Return as string or direct output.
|
||||||
*
|
*
|
||||||
* @return string HTML code.
|
* @return string HTML code.
|
||||||
*/
|
*/
|
||||||
public function printForm(array $data, bool $return=false, bool $print_white_box=false)
|
public function printFormAsGrid(array $data, bool $return=false)
|
||||||
{
|
{
|
||||||
$form = $data['form'];
|
$form = $data['form'];
|
||||||
$inputs = $data['inputs'];
|
|
||||||
|
$rows = $data['rows'];
|
||||||
|
|
||||||
$js = $data['js'];
|
$js = $data['js'];
|
||||||
$cb_function = $data['cb_function'];
|
$cb_function = $data['cb_function'];
|
||||||
$cb_args = $data['cb_args'];
|
$cb_args = $data['cb_args'];
|
||||||
@ -661,26 +725,99 @@ class Wizard
|
|||||||
$output_submit = '';
|
$output_submit = '';
|
||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
if ($print_white_box === true) {
|
$output .= '<div class="white_box">';
|
||||||
$output .= '<div class="white_box">';
|
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
$output .= '<div class="edit_discovery_info" style="'.$row['style'].'">';
|
||||||
|
|
||||||
|
foreach ($row['columns'] as $column) {
|
||||||
|
$width = isset($column['width']) ? 'width: '.$column['width'].';' : 'width: 100%;';
|
||||||
|
$padding_left = isset($column['padding-left']) ? 'padding-left: '.$column['padding-left'].';' : 'padding-left: 0;';
|
||||||
|
$padding_right = isset($column['padding-right']) ? 'padding-right: '.$column['padding-right'].';' : 'padding-right: 0;';
|
||||||
|
$extra_styles = isset($column['style']) ? $column['style'] : '';
|
||||||
|
|
||||||
|
$output .= '<div style="'.$width.$padding_left.$padding_right.$extra_styles.'">';
|
||||||
|
|
||||||
|
foreach ($column['inputs'] as $input) {
|
||||||
|
if (is_array($input)) {
|
||||||
|
if ($input['arguments']['type'] != 'submit') {
|
||||||
|
$output .= $this->printBlockAsGrid($input, true);
|
||||||
|
} else {
|
||||||
|
$output_submit .= $this->printBlockAsGrid($input, true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$output .= $input;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$output .= '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$output .= '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$output .= '</div>';
|
||||||
|
|
||||||
|
$output .= '<ul class="wizard">'.$output_submit.'</ul>';
|
||||||
|
$output .= '</form>';
|
||||||
|
$output .= '<script>'.$js.'</script>';
|
||||||
|
|
||||||
|
if ($return === false) {
|
||||||
|
echo $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $output_head.$output;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print a form as a list.
|
||||||
|
*
|
||||||
|
* @param array $data Definition of target form to be printed.
|
||||||
|
* @param boolean $return Return as string or direct output.
|
||||||
|
*
|
||||||
|
* @return string HTML code.
|
||||||
|
*/
|
||||||
|
public function printFormAsList(array $data, bool $return=false)
|
||||||
|
{
|
||||||
|
$form = $data['form'];
|
||||||
|
$inputs = $data['inputs'];
|
||||||
|
$js = $data['js'];
|
||||||
|
$cb_function = $data['cb_function'];
|
||||||
|
$cb_args = $data['cb_args'];
|
||||||
|
|
||||||
|
$output_head = '<form enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
|
||||||
|
$output_head .= '" '.$form['extra'].'>';
|
||||||
|
|
||||||
|
if ($return === false) {
|
||||||
|
echo $output_head;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (isset($cb_function) === true) {
|
||||||
|
call_user_func_array(
|
||||||
|
$cb_function,
|
||||||
|
(isset($cb_args) === true) ? $cb_args : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
error_log('Error executing wizard callback: ', $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$output = '<div class="white_box">';
|
||||||
$output .= '<ul class="wizard">';
|
$output .= '<ul class="wizard">';
|
||||||
|
|
||||||
foreach ($inputs as $input) {
|
foreach ($inputs as $input) {
|
||||||
if ($input['arguments']['type'] != 'submit') {
|
if ($input['arguments']['type'] != 'submit') {
|
||||||
$output .= $this->printBlock($input, true);
|
$output .= $this->printBlockAsList($input, true);
|
||||||
} else {
|
} else {
|
||||||
$output_submit .= $this->printBlock($input, true);
|
$output_submit .= $this->printBlockAsList($input, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= '</ul>';
|
$output .= '</ul>';
|
||||||
|
$output .= '</div>';
|
||||||
if ($print_white_box === true) {
|
|
||||||
$output .= '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
$output .= '<ul class="wizard">'.$output_submit.'</ul>';
|
$output .= '<ul class="wizard">'.$output_submit.'</ul>';
|
||||||
$output .= '</form>';
|
$output .= '</form>';
|
||||||
$output .= '<script>'.$js.'</script>';
|
$output .= '<script>'.$js.'</script>';
|
||||||
|
@ -594,7 +594,7 @@ class CustomNetScan extends Wizard
|
|||||||
|
|
||||||
// XXX: Could be improved validating inputs before continue (JS)
|
// XXX: Could be improved validating inputs before continue (JS)
|
||||||
// Print NetScan page 0.
|
// Print NetScan page 0.
|
||||||
$this->printForm($form, false, true);
|
$this->printFormAsList($form);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -742,7 +742,7 @@ class CustomNetScan extends Wizard
|
|||||||
get_explanation_recon_script($(this).val(), "'.$id_task.'", "'.$url_ajax.'");
|
get_explanation_recon_script($(this).val(), "'.$id_task.'", "'.$url_ajax.'");
|
||||||
})'.$change;
|
})'.$change;
|
||||||
|
|
||||||
$this->printForm($form, false, true);
|
$this->printFormAsList($form);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->page) === true && $this->page === 2) {
|
if (isset($this->page) === true && $this->page === 2) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user