2013-03-15 15:50:47 +01:00
|
|
|
<?php
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation for version 2.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
class Home {
|
|
|
|
private $global_search = '';
|
|
|
|
|
|
|
|
function __construct() {
|
|
|
|
$this->global_search = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function show() {
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
require_once ($config["homedir"] . '/include/functions_graph.php');
|
|
|
|
|
|
|
|
$ui = Ui::getInstance();
|
2013-11-11 20:06:43 +01:00
|
|
|
$system = System::getInstance();
|
|
|
|
|
2013-03-15 15:50:47 +01:00
|
|
|
$ui->createPage();
|
2013-11-11 20:06:43 +01:00
|
|
|
if ($system->getRequest('hide_logout', 0)) {
|
|
|
|
$left_button = null;
|
|
|
|
} else {
|
|
|
|
$left_button = $ui->createHeaderButton(
|
|
|
|
array('icon' => 'back',
|
|
|
|
'pos' => 'left',
|
|
|
|
'text' => __('Logout'),
|
|
|
|
'href' => 'index.php?action=logout'));
|
|
|
|
}
|
2014-02-11 11:37:30 +01:00
|
|
|
|
|
|
|
$user_logged = '';
|
|
|
|
if (isset($config['id_user'])) {
|
|
|
|
$user_logged = '<span id="user_logged">' . $config['id_user'] . '</span>';
|
|
|
|
}
|
|
|
|
|
|
|
|
$ui->createHeader(__("Home") . $user_logged, $left_button);
|
2013-03-15 15:50:47 +01:00
|
|
|
$ui->showFooter(false);
|
|
|
|
$ui->beginContent();
|
2013-04-05 12:49:38 +02:00
|
|
|
$ui->beginForm("index.php?page=agents");
|
2013-03-15 15:50:47 +01:00
|
|
|
$options = array(
|
2013-04-05 12:49:38 +02:00
|
|
|
'name' => 'free_search',
|
2013-03-15 15:50:47 +01:00
|
|
|
'value' => $this->global_search,
|
|
|
|
'placeholder' => __('Global search')
|
|
|
|
);
|
|
|
|
$ui->formAddInputSearch($options);
|
|
|
|
$ui->endForm();
|
|
|
|
|
|
|
|
//List of buttons
|
2014-02-06 18:39:39 +01:00
|
|
|
$options = array('icon' => 'tactical_view',
|
2013-03-15 15:50:47 +01:00
|
|
|
'pos' => 'right',
|
2013-11-28 17:54:18 +01:00
|
|
|
'text' => __('Tactical view'),
|
2013-03-15 15:50:47 +01:00
|
|
|
'href' => 'index.php?page=tactical');
|
|
|
|
$ui->contentAddHtml($ui->createButton($options));
|
2014-02-06 18:39:39 +01:00
|
|
|
$options = array('icon' => 'events',
|
2013-03-15 15:50:47 +01:00
|
|
|
'pos' => 'right',
|
|
|
|
'text' => __('Events'),
|
|
|
|
'href' => 'index.php?page=events');
|
|
|
|
$ui->contentAddHtml($ui->createButton($options));
|
2014-02-06 18:39:39 +01:00
|
|
|
$options = array('icon' => 'groups',
|
2013-03-15 15:50:47 +01:00
|
|
|
'pos' => 'right',
|
|
|
|
'text' => __('Groups'),
|
|
|
|
'href' => 'index.php?page=groups');
|
|
|
|
$ui->contentAddHtml($ui->createButton($options));
|
2014-02-06 18:39:39 +01:00
|
|
|
$options = array('icon' => 'alerts',
|
2013-03-15 15:50:47 +01:00
|
|
|
'pos' => 'right',
|
|
|
|
'text' => __('Alerts'),
|
|
|
|
'href' => 'index.php?page=alerts');
|
|
|
|
$ui->contentAddHtml($ui->createButton($options));
|
2014-02-06 18:39:39 +01:00
|
|
|
$options = array('icon' => 'agents',
|
2013-04-05 12:49:38 +02:00
|
|
|
'pos' => 'right',
|
|
|
|
'text' => __('Agents'),
|
|
|
|
'href' => 'index.php?page=agents');
|
|
|
|
$ui->contentAddHtml($ui->createButton($options));
|
2014-02-06 18:39:39 +01:00
|
|
|
$options = array('icon' => 'modules',
|
2013-04-05 12:49:38 +02:00
|
|
|
'pos' => 'right',
|
|
|
|
'text' => __('Modules'),
|
|
|
|
'href' => 'index.php?page=modules');
|
|
|
|
$ui->contentAddHtml($ui->createButton($options));
|
2014-02-06 18:39:39 +01:00
|
|
|
$options = array('icon' => 'network_maps',
|
2013-07-03 10:50:50 +02:00
|
|
|
'pos' => 'right',
|
|
|
|
'text' => __('Networkmaps'),
|
|
|
|
'href' => 'index.php?page=networkmaps');
|
|
|
|
$ui->contentAddHtml($ui->createButton($options));
|
2014-02-06 18:39:39 +01:00
|
|
|
$options = array('icon' => 'visual_console',
|
|
|
|
'pos' => 'right',
|
|
|
|
'text' => __('Visual consoles'),
|
|
|
|
'href' => 'index.php?page=visualmaps');
|
|
|
|
$ui->contentAddHtml($ui->createButton($options));
|
2013-03-15 15:50:47 +01:00
|
|
|
$ui->endContent();
|
|
|
|
$ui->showPage();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2013-11-11 20:06:43 +01:00
|
|
|
?>
|