diff --git a/pandora_console/godmode/wizards/HostDevices.class.php b/pandora_console/godmode/wizards/HostDevices.class.php index 27e611f982..1e94b4332a 100755 --- a/pandora_console/godmode/wizards/HostDevices.class.php +++ b/pandora_console/godmode/wizards/HostDevices.class.php @@ -92,7 +92,15 @@ class HostDevices extends Wizard $mode = get_parameter('mode', null); if ($mode === null) { - $this->setBreadcrum(['
    Host & devices
']); + $this->prepareBreadcrum( + [ + [ + 'link' => $this->url.'&wiz=hd', + 'label' => __('    Host & devices'), + ], + ] + ); + $this->printHeader(); $this->printBigButtonsList( [ @@ -115,10 +123,16 @@ class HostDevices extends Wizard if (enterprise_installed()) { if ($mode == 'importcsv') { - $this->setBreadcrum( + $this->prepareBreadcrum( [ - '
    Host & devices
', - '
      Import CSV
', + [ + 'link' => $this->url.'&wiz=hd', + 'label' => __('    Host & devices'), + ], + [ + 'link' => $this->url.'&wiz=hd&mode=importcsv', + 'label' => __('      Import CSV'), + ], ] ); $this->printHeader(); @@ -130,18 +144,34 @@ class HostDevices extends Wizard if ($mode == 'netscan') { if ($this->page != 2) { // Do not paint breadcrum in last page. Redirected. - $this->setBreadcrum( + $this->prepareBreadcrum( [ - '
    Host & devices
', - '
    Net scan definition
', + [ + 'link' => $this->url.'&wiz=hd', + 'label' => __('    Host & devices'), + ], + [ + 'link' => $this->url.'&wiz=hd&mode=netscan', + 'label' => __('      Net scan definition'), + ], ] ); + if ($this->page == 1) { - $this->setBreadcrum( + $this->prepareBreadcrum( [ - '
    Host & devices
', - '
    Net scan definition
', - '
    Net scan features
', + [ + 'link' => $this->url.'&wiz=hd', + 'label' => __('    Host & devices'), + ], + [ + 'link' => $this->url.'&wiz=hd&mode=netscan', + 'label' => __('      Net scan definition'), + ], + [ + 'link' => $this->url.'&wiz=hd&mode=netscan&page=1', + 'label' => __('      Net scan features'), + ], ] ); } @@ -1078,4 +1108,26 @@ $(function() { } + /** + * Builder for breadcrum + * + * @param array $urls Array of urls to be stored in breadcrum. + * + * @return void + */ + public function prepareBreadcrum(array $urls) + { + $bc = []; + $i = 0; + foreach ($urls as $url) { + $bc[$i] = ''; + $bc[$i] .= '
'.$url['label'].'
'; + $bc[$i++] .= '
'; + } + + $this->setBreadcrum($bc); + + } + + }