Starting the useful classes for the new networkmaps.

This commit is contained in:
mdtrooper 2016-02-04 12:06:45 +01:00
parent c5baf3670b
commit f90ed7a05b
4 changed files with 79 additions and 31 deletions

View File

@ -0,0 +1,43 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 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 Lesser General Public License
// as published by the Free Software Foundation; 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.
/**
* @package Include
* @subpackage Maps
*/
class Map {
protected $id = null;
public function __construct($id) {
$this->id = $id;
}
public function show() {
?>
<div class="map">
<svg width="800" height="800" pointer-events="all" style="border: 2px solid red;">
<g>
<circle id="node_10" class="node" r="5" style="fill: rgb(128, 186, 39);" cx="100" cy="100"/>
</g>
</svg>
</div>
<?php
}
}
?>

View File

@ -0,0 +1,33 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 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 Lesser General Public License
// as published by the Free Software Foundation; 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.
/**
* @package Include
* @subpackage Networkmap
*/
class Networkmap extends Map {
public function __construct($id) {
parent::__construct($id);
}
public function show() {
parent::show();
}
}
?>

View File

@ -158,8 +158,10 @@ function maps_is_visualmap($id) {
} }
function maps_show($id) { function maps_show($id) {
require_once("include/class/Map.class.php");
if (maps_is_networkmap($id)) { if (maps_is_networkmap($id)) {
require_once("include/functions_networkmaps.php"); require_once("include/class/Networkmap.class.php");
$map = new Networkmap($id); $map = new Networkmap($id);
$map->show(); $map->show();
@ -168,24 +170,4 @@ function maps_show($id) {
//TODO VISUAL //TODO VISUAL
} }
} }
class Map {
protected $id = null;
public function __construct($id) {
$this->id = $id;
}
public function show() {
?>
<div class="map">
<svg width="800" height="800" pointer-events="all" style="border: 2px solid red;">
<g>
<circle id="node_10" class="node" r="5" style="fill: rgb(128, 186, 39);" cx="100" cy="100"/>
</g>
</svg>
</div>
<?php
}
}
?> ?>

View File

@ -27,14 +27,4 @@ function networkmaps_show($id) {
networkmaps_show_staged_area($id); networkmaps_show_staged_area($id);
networkmaps_show_black_list_staged_area($id); networkmaps_show_black_list_staged_area($id);
} }
class Networkmap extends Map {
public function __construct($id) {
parent::__construct($id);
}
public function show() {
parent::show();
}
}
?> ?>