Added prepareBreadcrum function
Former-commit-id: caf781a20bdd16bed7347bf755e2bf0da6ae7e99
This commit is contained in:
parent
fa3f548cdd
commit
3d2ae47543
|
@ -92,7 +92,15 @@ class HostDevices extends Wizard
|
|||
$mode = get_parameter('mode', null);
|
||||
|
||||
if ($mode === null) {
|
||||
$this->setBreadcrum(['<a href="index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd" class="text_color"><div class="arrow_box">    Host & devices</div></a>']);
|
||||
$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(
|
||||
[
|
||||
'<a href="index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd" class="text_color"><div class="arrow_box">    Host & devices</div></a>',
|
||||
'<a href="index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd&mode=importcsv" class="text_color"><div class="arrow_box">      Import CSV</div></a>',
|
||||
[
|
||||
'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(
|
||||
[
|
||||
'<a href="index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd"class="text_color"><div class="arrow_box">    Host & devices</div></a>',
|
||||
'<a href="index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd&mode=netscan" class="text_color"><div class="arrow_box">    Net scan definition</div></a>',
|
||||
[
|
||||
'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(
|
||||
[
|
||||
'<a href="index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd"class="text_color"><div class="arrow_box">    Host & devices</div></a>',
|
||||
'<a href="index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd&mode=netscan" class="text_color"><div class="arrow_box">    Net scan definition</div></a>',
|
||||
'<a href="index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=hd&mode=netscan&page=1" class="text_color"><div class="arrow_box">    Net scan features</div></a>',
|
||||
[
|
||||
'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'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@ -1096,4 +1126,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] = '<a href="'.$url['link'].'" class="text_color">';
|
||||
$bc[$i] .= '<div class="arrow_box">'.$url['label'].'</div>';
|
||||
$bc[$i++] .= '</a>';
|
||||
}
|
||||
|
||||
$this->setBreadcrum($bc);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue