diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php index e4e0e97fdc..b46828c271 100755 --- a/pandora_console/godmode/wizards/HostDevices.class.php +++ b/pandora_console/godmode/wizards/HostDevices.class.php @@ -149,7 +149,8 @@ class HostDevices extends Wizard ), 'label' => __('Discovery'), ], - ] + ], + true ); ui_print_page_header(__('Host & devices'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true)); @@ -533,7 +534,19 @@ class HostDevices extends Wizard if ($this->page < $this->maxPagesNetScan) { // Avoid to print header out of wizard. $this->prepareBreadcrum($breadcrum); - ui_print_page_header(__('NetScan'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true)); + ui_print_page_header( + __('NetScan'), + '', + false, + '', + true, + '', + false, + '', + GENERIC_SIZE_TEXT, + '', + $this->printHeader(true) + ); } if (isset($this->page) === true diff --git a/pandora_console/godmode/wizards/Wizard.main.php b/pandora_console/godmode/wizards/Wizard.main.php index d8a829e277..f043f143db 100644 --- a/pandora_console/godmode/wizards/Wizard.main.php +++ b/pandora_console/godmode/wizards/Wizard.main.php @@ -191,21 +191,20 @@ class Wizard * Builder for breadcrum * * @param array $urls Array of urls to be stored in breadcrum. - * @param boolean $add True if breadcrum should be added instead of - * overwrite it. + * @param boolean $add True if breadcrum should be added + * instead of overwrite it. * * @return void */ - public function prepareBreadcrum(array $urls, bool $add=false, bool $separator_beginning=false) - { + public function prepareBreadcrum( + array $urls, + bool $add=false + ) { $bc = []; $i = 0; - $count = 0; - $array_size = count($urls); + $array_size = (count($urls) - 1); foreach ($urls as $url) { - $count++; - if ($url['selected'] == 1) { $class = 'selected'; } else { @@ -213,20 +212,10 @@ class Wizard } $bc[$i] = ''; - - if ($separator_beginning === true) { - $bc[$i] .= ' / '; - } - - $bc[$i] .= ''; - $bc[$i] .= $url['label']; - $bc[$i] .= ''; - if ($count < $array_size) { - $bc[$i] .= ' / '; - } - + $bc[$i] .= ''; + $bc[$i] .= $url['label']; + $bc[$i] .= ''; $bc[$i] .= ''; - $i++; } @@ -235,7 +224,6 @@ class Wizard } else { $this->setBreadcrum($bc); } - } @@ -275,7 +263,10 @@ class Wizard */ public function printBreadcrum() { - return implode('', $this->breadcrum); + return implode( + ' / ', + $this->breadcrum + ); } diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index fd68b77e54..d22dd5dc1e 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -54,10 +54,13 @@ function snmp_browser_print_tree( $last=0, $last_array=[], $sufix=false, - $checked=[] + $checked=[], + $return=false ) { static $url = false; + $output = ''; + // Get the base URL for images. if ($url === false) { $url = ui_get_full_url('operation/tree', false, false, false); @@ -73,9 +76,9 @@ function snmp_browser_print_tree( $last_array[$depth] = $last; if ($depth > 0) { - echo "