Update orderinterpreter class and css
This commit is contained in:
parent
a89a64cc1b
commit
1430e6ee11
|
@ -97,25 +97,108 @@ class OrderInterpreter extends Wizard
|
||||||
$ajax_controller='include/ajax/order_interpreter'
|
$ajax_controller='include/ajax/order_interpreter'
|
||||||
) {
|
) {
|
||||||
$this->ajaxController = $ajax_controller;
|
$this->ajaxController = $ajax_controller;
|
||||||
|
|
||||||
|
// Example pages names.
|
||||||
$this->pages_name = [
|
$this->pages_name = [
|
||||||
0 => __('Tactical View'),
|
0 => __('Tactical View'),
|
||||||
1 => __('Agent Management'),
|
1 => __('Agent Management'),
|
||||||
2 => __('List Alerts'),
|
2 => __('List Alerts'),
|
||||||
3 => __('Manage Policies'),
|
3 => __('Manage Policies'),
|
||||||
|
4 => __('Tactical View'),
|
||||||
|
5 => __('Agent Management'),
|
||||||
|
7 => __('List Alerts'),
|
||||||
|
8 => __('Manage Policies'),
|
||||||
|
9 => __('Tactical View'),
|
||||||
|
10 => __('Agent Management'),
|
||||||
|
11 => __('List Alerts'),
|
||||||
|
12 => __('Manage Policies'),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Example ICON.
|
||||||
|
$this->pages_icon = [
|
||||||
|
0 => ui_get_full_url(
|
||||||
|
'images/op_monitoring.menu_gray.png'
|
||||||
|
),
|
||||||
|
1 => ui_get_full_url(
|
||||||
|
'images/gm_resources.menu_gray.png'
|
||||||
|
),
|
||||||
|
2 => ui_get_full_url(
|
||||||
|
'images/gm_alerts.menu_gray.png'
|
||||||
|
),
|
||||||
|
3 => ui_get_full_url(
|
||||||
|
'images/gm_configuration.menu_gray.png'
|
||||||
|
),
|
||||||
|
4 => ui_get_full_url(
|
||||||
|
'images/op_monitoring.menu_gray.png'
|
||||||
|
),
|
||||||
|
5 => ui_get_full_url(
|
||||||
|
'images/gm_resources.menu_gray.png'
|
||||||
|
),
|
||||||
|
6 => ui_get_full_url(
|
||||||
|
'images/gm_alerts.menu_gray.png'
|
||||||
|
),
|
||||||
|
7 => ui_get_full_url(
|
||||||
|
'images/gm_configuration.menu_gray.png'
|
||||||
|
),
|
||||||
|
8 => ui_get_full_url(
|
||||||
|
'images/op_monitoring.menu_gray.png'
|
||||||
|
),
|
||||||
|
9 => ui_get_full_url(
|
||||||
|
'images/gm_resources.menu_gray.png'
|
||||||
|
),
|
||||||
|
10 => ui_get_full_url(
|
||||||
|
'images/gm_alerts.menu_gray.png'
|
||||||
|
),
|
||||||
|
11 => ui_get_full_url(
|
||||||
|
'images/gm_configuration.menu_gray.png'
|
||||||
|
),
|
||||||
|
12 => ui_get_full_url(
|
||||||
|
'images/gm_configuration.menu_gray.png'
|
||||||
|
),
|
||||||
|
|
||||||
|
];
|
||||||
|
// Example URLS.
|
||||||
$this->pages_url = [
|
$this->pages_url = [
|
||||||
0 => ui_get_full_url(
|
0 => ui_get_full_url(
|
||||||
'index.php?sec=view&sec2=operation/agentes/tactical'
|
'index.php?sec=view&sec2=operation/agentes/tactical'
|
||||||
),
|
),
|
||||||
1 => ui_get_full_url(
|
1 => ui_get_full_url(
|
||||||
'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente'
|
'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente'
|
||||||
),
|
),
|
||||||
2 => ui_get_full_url(
|
2 => ui_get_full_url(
|
||||||
'index.php?sec=galertas&sec2=godmode/alerts/alert_list'
|
'index.php?sec=galertas&sec2=godmode/alerts/alert_list'
|
||||||
),
|
),
|
||||||
3 => ui_get_full_url(
|
3 => ui_get_full_url(
|
||||||
'index.php?sec=gmodules&sec2=enterprise/godmode/policies/policies'
|
'index.php?sec=gmodules&sec2=enterprise/godmode/policies/policies'
|
||||||
),
|
),
|
||||||
|
4 => ui_get_full_url(
|
||||||
|
'index.php?sec=view&sec2=operation/agentes/tactical'
|
||||||
|
),
|
||||||
|
5 => ui_get_full_url(
|
||||||
|
'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente'
|
||||||
|
),
|
||||||
|
6 => ui_get_full_url(
|
||||||
|
'index.php?sec=galertas&sec2=godmode/alerts/alert_list'
|
||||||
|
),
|
||||||
|
7 => ui_get_full_url(
|
||||||
|
'index.php?sec=gmodules&sec2=enterprise/godmode/policies/policies'
|
||||||
|
),
|
||||||
|
8 => ui_get_full_url(
|
||||||
|
'index.php?sec=view&sec2=operation/agentes/tactical'
|
||||||
|
),
|
||||||
|
9 => ui_get_full_url(
|
||||||
|
'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente'
|
||||||
|
),
|
||||||
|
10 => ui_get_full_url(
|
||||||
|
'index.php?sec=galertas&sec2=godmode/alerts/alert_list'
|
||||||
|
),
|
||||||
|
11 => ui_get_full_url(
|
||||||
|
'index.php?sec=gmodules&sec2=enterprise/godmode/policies/policies'
|
||||||
|
),
|
||||||
|
12 => ui_get_full_url(
|
||||||
|
'index.php?sec=gmodules&sec2=enterprise/godmode/policies/policies'
|
||||||
|
),
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -131,28 +214,42 @@ class OrderInterpreter extends Wizard
|
||||||
// Take value from input search.
|
// Take value from input search.
|
||||||
$text = get_parameter('text', '');
|
$text = get_parameter('text', '');
|
||||||
$array_found = [];
|
$array_found = [];
|
||||||
|
$iterator = 0;
|
||||||
|
$more_results = 0;
|
||||||
|
|
||||||
if ($text !== '') {
|
if ($text !== '') {
|
||||||
echo '<div id="result_order" class="show_result_interpreter">';
|
echo '<div id="result_order" class="show_result_interpreter">';
|
||||||
echo '<ul>';
|
echo '<ul>';
|
||||||
|
|
||||||
if (io_safe_output($text) === __('GO TO ')) {
|
foreach ($this->pages_name as $key => $value) {
|
||||||
foreach ($this->pages_name as $key => $value) {
|
if (preg_match(
|
||||||
|
'/.*'.io_safe_output($text).'.*/i',
|
||||||
|
__('GO TO '.$value)
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
if ($iterator <= 9) {
|
||||||
echo '<li>';
|
echo '<li>';
|
||||||
echo '<img src="http://localhost/pandora_console/images/arrow_right_green.png">';
|
echo '
|
||||||
|
Go to
|
||||||
|
<img src="'.$this->pages_icon[$key].'">';
|
||||||
echo '
|
echo '
|
||||||
<a href="'.$this->pages_url[$key].'">'.$value.'</a><br>';
|
<a href="'.$this->pages_url[$key].'">
|
||||||
}
|
'.$value.'</a><br>';
|
||||||
} else {
|
}
|
||||||
foreach ($this->pages_name as $key => $value) {
|
|
||||||
if (preg_match('/.*'.io_safe_output($text).'.*/i', __('GO TO '.$value))) {
|
$iterator ++;
|
||||||
echo '<li>';
|
|
||||||
echo '<img src="http://localhost/pandora_console/images/arrow_right_green.png">';
|
if ($iterator > 10) {
|
||||||
echo '
|
$more_results ++;
|
||||||
<a href="'.$this->pages_url[$key].'">'.$value.'</a><br>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($iterator > 9) {
|
||||||
|
echo '<li class="more_results"><br>';
|
||||||
|
echo '+ '.$more_results.' results found';
|
||||||
|
}
|
||||||
|
|
||||||
echo '</ul></div';
|
echo '</ul></div';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,9 +258,7 @@ class OrderInterpreter extends Wizard
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load JS content.
|
* Load JS content.
|
||||||
* function that enables the functions to the buttons when its action is
|
* function to create JS actions.
|
||||||
* completed.
|
|
||||||
* Assign the url of each button.
|
|
||||||
*
|
*
|
||||||
* @return string HTML code for javascript functionality.
|
* @return string HTML code for javascript functionality.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -12,3 +12,9 @@ div.show_result_interpreter {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.more_results {
|
||||||
|
text-align: right;
|
||||||
|
margin-right: 20px;
|
||||||
|
display: grid;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue