change discovery headers and add breadcrumbs to them

Former-commit-id: 93183474aabaeccfd3893cacd78c4d6ddf764502
This commit is contained in:
alejandro-campos 2019-03-26 15:42:33 +01:00
parent d1bd5fbb1a
commit ec999341ba
9 changed files with 104 additions and 29 deletions

View File

@ -15,9 +15,6 @@ if (! check_acl($config['id_user'], 0, 'AW')) {
ui_require_css_file('discovery'); ui_require_css_file('discovery');
ui_print_page_header(__('Discovery'), '', false, '', true);
/** /**
* Mask class names. * Mask class names.
* *

View File

@ -96,7 +96,8 @@ class DiscoveryTaskList extends Wizard
] ]
); );
$this->printHeader(); // Header
ui_print_page_header(__('Task list'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true));
// Show redirected messages from discovery.php. // Show redirected messages from discovery.php.
if ($status === 0) { if ($status === 0) {

View File

@ -152,7 +152,7 @@ class HostDevices extends Wizard
] ]
); );
$this->printHeader(); ui_print_page_header(__('Host & devices'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true));
$this->printBigButtonsList($buttons); $this->printBigButtonsList($buttons);
return; return;
@ -527,7 +527,7 @@ class HostDevices extends Wizard
if ($this->page < $this->maxPagesNetScan) { if ($this->page < $this->maxPagesNetScan) {
// Avoid to print header out of wizard. // Avoid to print header out of wizard.
$this->prepareBreadcrum($breadcrum); $this->prepareBreadcrum($breadcrum);
$this->printHeader(); ui_print_page_header(__('NetScan definition'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true));
} }
if (isset($this->page) === true if (isset($this->page) === true

View File

@ -196,20 +196,34 @@ class Wizard
* *
* @return void * @return void
*/ */
public function prepareBreadcrum(array $urls, bool $add=false) public function prepareBreadcrum(array $urls, bool $add=false, bool $separator_beginning=false)
{ {
$bc = []; $bc = [];
$i = 0; $i = 0;
$count = 0;
$array_size = count($urls);
foreach ($urls as $url) { foreach ($urls as $url) {
$count++;
if ($url['selected'] == 1) { if ($url['selected'] == 1) {
$class = 'selected'; $class = 'selected';
} else { } else {
$class = ''; $class = '';
} }
$bc[$i] = '<a href="'.$url['link'].'" class="text_color">'; $bc[$i] = '';
$bc[$i] .= '<div class="arrow_box '.$class.'">'.$url['label'];
$bc[$i++] .= '</div></a>'; if ($separator_beginning === true) $bc[$i] .= '<span class="breadcrumb_link">&nbsp/&nbsp</span>';
$bc[$i] .= '<span><a class="breadcrumb_link '.$class.'" href="'.$url['link'].'">';
$bc[$i] .= $url['label'];
$bc[$i] .= '</a>';
if ($count < $array_size) $bc[$i] .= '<span class="breadcrumb_link">&nbsp/&nbsp</span>';
$bc[$i] .= '</span>';
$i++;
} }
if ($add === true) { if ($add === true) {
@ -257,7 +271,7 @@ class Wizard
*/ */
public function printBreadcrum() public function printBreadcrum()
{ {
return '<h1 class="wizard">'.implode('', $this->breadcrum).'</h1>'; return implode('', $this->breadcrum);
} }

View File

@ -353,7 +353,10 @@ class CustomNetScan extends Wizard
if ($this->page < $this->MAXPAGES) { if ($this->page < $this->MAXPAGES) {
// Avoid to print header out of wizard. // Avoid to print header out of wizard.
$this->prepareBreadcrum($breadcrum); $this->prepareBreadcrum($breadcrum);
$this->printHeader();
// Header
ui_print_page_header(__('NetScan Custom definition'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true));
} }
$task_url = ''; $task_url = '';
@ -376,7 +379,9 @@ class CustomNetScan extends Wizard
if ($this->page < $this->maxPagesNetScan) { if ($this->page < $this->maxPagesNetScan) {
// Avoid to print header out of wizard. // Avoid to print header out of wizard.
$this->prepareBreadcrum($breadcrum); $this->prepareBreadcrum($breadcrum);
$this->printHeader();
// Header
ui_print_page_header(__('NetScan Custom definition'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true));
} }
if (isset($this->page) === true if (isset($this->page) === true

View File

@ -108,7 +108,10 @@ class ManageNetScanScripts extends Wizard
if ($this->page < $this->MAXPAGES) { if ($this->page < $this->MAXPAGES) {
// Avoid to print header out of wizard. // Avoid to print header out of wizard.
$this->prepareBreadcrum($breadcrum); $this->prepareBreadcrum($breadcrum);
$this->printHeader();
// Header
ui_print_page_header(__('List net scan scripts'), '', false, '', true, '', false, '', GENERIC_SIZE_TEXT, '', $this->printHeader(true));
} }
$id_script = get_parameter('id_script', 0); $id_script = get_parameter('id_script', 0);

View File

@ -2768,7 +2768,8 @@ function ui_print_page_header(
$modal=false, $modal=false,
$message='', $message='',
$numChars=GENERIC_SIZE_TEXT, $numChars=GENERIC_SIZE_TEXT,
$alias='' $alias='',
$breadcrumbs=''
) { ) {
$title = io_safe_input_html($title); $title = io_safe_input_html($title);
if (($icon == '') && ($godmode == true)) { if (($icon == '') && ($godmode == true)) {
@ -2781,15 +2782,20 @@ function ui_print_page_header(
if ($godmode == true) { if ($godmode == true) {
$type = 'view'; $type = 'view';
$type2 = 'menu_tab_frame_view'; $type2 = (empty($breadcrumbs)) ? 'menu_tab_frame_view' : 'menu_tab_frame_view_bc';
$separator_class = 'separator'; $separator_class = 'separator';
} else { } else {
$type = 'view'; $type = 'view';
$type2 = 'menu_tab_frame_view'; $type2 = (empty($breadcrumbs)) ? 'menu_tab_frame_view' : 'menu_tab_frame_view_bc';
$separator_class = 'separator_view'; $separator_class = 'separator_view';
} }
$buffer = '<div id="'.$type2.'" style=""><div id="menu_tab_left">'; $buffer = '<div id="'.$type2.'" style="">';
if (!empty($breadcrumbs))
$buffer .= '<div class="breadcrumbs_container">'.$breadcrumbs.'</div>';
$buffer .= '<div id="menu_tab_left">';
$buffer .= '<ul class="mn"><li class="'.$type.'">'; $buffer .= '<ul class="mn"><li class="'.$type.'">';

View File

@ -64,7 +64,6 @@ h1.wizard a:hover {
div.arrow_box { div.arrow_box {
display: inline-block; display: inline-block;
position: relative; position: relative;
background: #ccc;
color: #888; color: #888;
padding: 1.3em; padding: 1.3em;
margin-left: 20px; margin-left: 20px;
@ -72,16 +71,6 @@ div.arrow_box {
padding-left: 3em; padding-left: 3em;
} }
.arrow_box:before {
top: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
z-index: 1;
}
.arrow_box.selected { .arrow_box.selected {
background: #424242; background: #424242;
color: #ccc; color: #ccc;
@ -110,3 +99,35 @@ div.arrow_box:before {
.arrow_box:hover { .arrow_box:hover {
color: #000; color: #000;
} }
.breadcrumb_link {
color: #d0d0d0;
font-size: 12pt !important;
font-family: "Open Sans", sans-serif !important;
text-decoration: none !important;
}
span.breadcrumb_link {
color: #d0d0d0;
font-size: 12pt !important;
}
.breadcrumb_link.selected {
color: #95b750;
}
.breadcrumb_link.selected:hover {
color: #95b750;
}
.breadcrumb_link:hover {
color: #95b750;
}
.form_grid_items {
overflow: hidden;
}
.form_grid_items .form_grid_item {
float: left;
box-sizing: border-box;
padding: 10px;
}

View File

@ -1272,6 +1272,34 @@ div.title_line {
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1); box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
} }
#menu_tab_frame_view_bc {
display: flex;
justify-content: space-between;
border-bottom: 2px solid #82b92e;
max-height: 70px;
min-height: 50px;
width: 100%;
padding-right: 0px;
margin-left: 0px !important;
margin-bottom: 20px;
height: 70px;
box-sizing: border-box;
background-color: #fff;
border-top-right-radius: 7px;
border-top-left-radius: 7px;
box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.1);
flex-direction: column;
}
#menu_tab_frame_view_bc .breadcrumbs_container {
align-self: flex-start;
}
.breadcrumbs_container {
padding-left: 10px;
padding-top: 4px;
}
#menu_tab { #menu_tab {
margin-right: 10px; margin-right: 10px;
} }