2010-07-23 Dario Rodriguez <dario.rodriguez@gmail.com>

* operation/agentes/ver_agente.php: Changed code to use print_page_header
	to print de tabs
	* godmode/agentes/configurar_agente.php: Changed code to use print_page_header
	to print de tabs



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3056 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
darode 2010-07-23 10:55:20 +00:00
parent dc6879c41c
commit 74804a0634
3 changed files with 179 additions and 116 deletions

View File

@ -1,3 +1,10 @@
2010-07-23 Dario Rodriguez <dario.rodriguez@gmail.com>
* operation/agentes/ver_agente.php: Changed code to use print_page_header
to print de tabs
* godmode/agentes/configurar_agente.php: Changed code to use print_page_header
to print de tabs
2010-07-23 Raúl Mateos <raulofpandora@gmail.com> 2010-07-23 Raúl Mateos <raulofpandora@gmail.com>
* godmode/alerts/aler_list*.php: Cleaned code. Removed old title style. * godmode/alerts/aler_list*.php: Cleaned code. Removed old title style.

View File

@ -198,58 +198,97 @@ $img_style = array ("class" => "top", "width" => 16);
// TODO: Change to use print_page_header // TODO: Change to use print_page_header
if ($id_agente) { if ($id_agente) {
echo '<div id="menu_tab_frame"><div id="menu_tab_left"><ul class="mn">';
echo '<li class="nomn"><a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$id_agente.'">';
print_image ("images/setup.png", false, $img_style);
echo '&nbsp;'.__("Agent configuration").' -&nbsp;'.mb_substr(get_agent_name ($id_agente), 0, 21) .'</a>';
//echo '&nbsp;'. print_help_icon ('agent_manager', true);
echo "</li></ul></div>";
echo '<div id="menu_tab"><ul class="mn"><li class="nomn">'; /* View tab */
echo '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'">'; $viewtab['text'] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'">'
echo "<img src='images/zoom.png' class=top title='".__('View')."'>&nbsp;</a></li>"; . print_image ("images/zoom.png", true, array ("title" =>__('View')))
. '</a>';
echo '<li class="'.($tab == "main" ? 'nomn_high' : 'nomn').'">'; if($tab == 'view')
echo '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=main&amp;id_agente='.$id_agente.'">'; $viewtab['active'] = true;
echo "<img src='images/cog.png' class='top' title='".__('Setup')."'>&nbsp;</a></li>"; else
$viewtab['active'] = false;
echo '<li class="'.($tab == "module" ? 'nomn_high' : 'nomn').'">'; /* Main tab */
echo '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=module&amp;id_agente='.$id_agente.'">'; $maintab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=main&amp;id_agente='.$id_agente.'">'
echo "<img src='images/lightbulb.png' class='top' title='".__('Modules')."'>&nbsp;</a></li>"; . print_image ("images/cog.png", true, array ("title" =>__('Setup')))
. '</a>';
if($tab == 'main')
echo '<li class="'.($tab == "alert" ? 'nomn_high' : 'nomn').'">'; $maintab['active'] = true;
echo '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=alert&amp;id_agente='.$id_agente.'">'; else
echo "<img src='images/bell.png' class='top' title='".__('Alerts')."'>&nbsp;</a></li>"; $maintab['active'] = false;
/* Module tab */
$moduletab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=module&amp;id_agente='.$id_agente.'">'
. print_image ("images/lightbulb.png", true, array ("title" =>__('Modules')))
. '</a>';
if($tab == 'module')
$moduletab['active'] = true;
else
$moduletab['active'] = false;
/* Alert tab */
$alerttab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=alert&amp;id_agente='.$id_agente.'">'
. print_image ("images/bell.png", true, array ("title" =>__('Alerts')))
. '</a>';
if($tab == 'alert')
$alerttab['active'] = true;
else
$alerttab['active'] = false;
/* Template tab */
$templatetab['text'] = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=template&amp;id_agente='.$id_agente.'">'
. print_image ("images/network.png", true, array ("title" =>__('Module templates')))
. '</a>';
if($tab == 'template')
$templatetab['active'] = true;
else
$templatetab['active'] = false;
echo '<li class="'.($tab == "template" ? 'nomn_high' : 'nomn').'">'; /* Inventory */
echo '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;tab=template&amp;id_agente='.$id_agente.'">'; $inventorytab = enterprise_hook ('inventory_tab');
echo "<img src='images/network.png' class='top' title='".__('Module templates')."'>&nbsp;</a></li>";
enterprise_hook('inventory_tab'); if ($inventorytab == -1)
enterprise_hook('collection_tab'); $inventorytab = "";
echo '<li class="nomn">'; /* Collection */
echo '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group.'">'; $collectiontab = enterprise_hook('collection_tab');
echo "<img src='images/agents_group.png' class='top' title='".__('Group')."'>&nbsp;</a></li>";
// GIS tab if ($collectiontab == -1)
$collectiontab = "";
/* Group tab */
$grouptab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group.'">'
. print_image ("images/agents_group.png", true, array( "title=" => __('Group')))
. '</a>';
$grouptab['active'] = false;
$gistab = "";
/* GIS tab */
if ($config['activate_gis']) { if ($config['activate_gis']) {
if ($tab == "gis") {
echo "<li class='nomn_high'>"; $gistab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente.'">'
} . print_image ("images/world.png", true, array ( "title" => __('GIS data')))
else { . '</a>';
echo "<li class='nomn'>";
} if ($tab == "gis")
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente=$id_agente'><img src='images/world.png' class='top' border=0 title='".__('GIS data')."'>&nbsp;</a>"; $gistab['active'] = true;
echo "</li>"; else
$gistab['active'] = false;
} }
echo "</ul></div></div>"; $onheader = array('view' => $viewtab, 'main' => $maintab, 'module' => $moduletab, 'alert' => $alerttab, 'template' => $templatetab, 'inventory' => $inventorytab, 'collection'=> $collectiontab, 'group' => $grouptab, 'gis' => $gistab);
print_page_header (__('Agent configuration').' -&nbsp;'.mb_substr(get_agent_name ($id_agente), 0, 21), "images/setup.png", false, "", true, $onheader);
// Make some space between tabs and title
// IE might not always show an empty div, added space
echo '<div style="height: 25px;">&nbsp;</div>';
} }
// Create agent // Create agent
else { else {

View File

@ -235,93 +235,110 @@ if (isset($_GET["flag_agent"])){
} }
} }
echo "<div id='menu_tab_frame_view'>";
if ($agent["icon_path"]) { if ($agent["icon_path"]) {
$icon = get_agent_icon_map($agent["id_agente"], true); $icon = get_agent_icon_map($agent["id_agente"], true);
} }
else { else {
$icon = 'images/bricks.png'; $icon = 'images/bricks.png';
} }
echo "<div id='menu_tab_left'><ul class='mn'><li class='view'>
<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='$icon' class='top' border=0>&nbsp; ".__("Agent")."&nbsp;-&nbsp;".mb_substr(get_agent_name($id_agente),0,25)."</a>";
echo "</li>";
echo "</ul></div>";
$tab = get_parameter ("tab", "main"); $tab = get_parameter ("tab", "main");
echo "<div id='menu_tab'><ul class='mn'>";
/* Manage tab */
$managetab = "";
if (give_acl ($config['id_user'],$id_grupo, "AW")) { if (give_acl ($config['id_user'],$id_grupo, "AW")) {
if ($tab == "manage") { $managetab['text'] ='<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'">'
echo "<li class='nomn_high'>"; . print_image("images/setup.png", true, array("title=" => __('Manage')))
} else { . '</a>';
echo "<li class='nomn'>";
} if ($tab == 'manage')
// Manage agent $managetab['active'] = true;
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=$id_agente'><img src='images/setup.png' width='16' class='top' border=0 title='".__('Manage')."'>&nbsp;</a>"; else
echo "</li>"; $managetab['active'] = false;
} }
// Main view /* Main tab */
if ($tab == "main") { $maintab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">'
echo "<li class='nomn_high'>"; . print_image("images/monitor.png", true, array("title=" => __('Main')))
. '</a>';
if ($tab == 'main')
$maintab['active'] = true;
else
$maintab['active'] = false;
/* Data */
$datatab['text']= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'&tab=data">'
. print_image("images/lightbulb.png", true, array("title=" => __('Data')))
. '</a>';
if (($tab == 'data') OR ($tab == 'data_view'))
$datatab['active'] = true;
else
$datatab['active'] = false;
/* Alert tab */
$alerttab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'&tab=alert">'
. print_image("images/bell.png", true, array("title=" => __('Alerts')))
. '</a>';
if ($tab == 'alert')
$alerttab['active'] = true;
else
$alerttab['active'] = false;
/* SLA view */
$slatab['text']= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=sla&id_agente='.$id_agente.'">'
. print_image("images/images.png", true, array("title=" => __('S.L.A.')))
. '</a>';
if ($tab == 'sla') {
$slatab['active'] = true;
} else { } else {
echo "<li class='nomn'>"; $slatab['active'] = false;
} }
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente'><img src='images/monitor.png' class='top' border=0 title='".__('Main')."'>&nbsp;</a>";
echo "</li>";
// Data /* Inventory */
if (($tab == "data") OR ($tab == "data_view")) { $inventorytab = enterprise_hook ('inventory_tab');
echo "<li class='nomn_high'>";
} else {
echo "<li class='nomn'>";
}
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=data'><img src='images/lightbulb.png' class='top' border=0 title='".__('Data')."'>&nbsp;</a>";
echo "</li>";
// Alerts if ($inventorytab == -1)
if ($tab == "alert") { $inventorytab = "";
echo "<li class='nomn_high'>";
} else {
echo "<li class='nomn'>";
}
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agente&tab=alert'><img src='images/bell.png' class='top' border=0 title='".__('Alerts')."'>&nbsp;</a>";
echo "</li>";
// Go to SLA view /* Collection */
if ($tab == "sla") { $collectiontab = enterprise_hook('collection_tab');
echo "<li class='nomn_high'>";
} else {
echo "<li class='nomn'>";
}
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=sla&id_agente=$id_agente'><img src='images/images.png' class='top' border=0 title='".__('S.L.A.')."'>&nbsp;</a>";
echo "</li>";
// Inventory if ($collectiontab == -1)
enterprise_hook ('inventory_tab'); $collectiontab = "";
// Collection /* Group tab */
enterprise_hook('collection_tab');
// Group tab $grouptab['text']= '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id='.$id_grupo.'">'
echo "<li class='nomn'>"; . print_image("images/agents_group.png", true, array( "title=" => __('Group')))
echo "<a href='index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=$id_grupo'>"; . '</a>';
echo "<img src='images/agents_group.png' class='top' border=0 title='". __("Group"). "'>&nbsp;</a></li>";
// GIS tab $grouptab['active']=false;
/* GIS tab */
$gistab="";
if ($config['activate_gis']) { if ($config['activate_gis']) {
if ($tab == "gis") {
echo "<li class='nomn_high'>"; $gistab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=gis&id_agente='.$id_agente.'">'
} .print_image("images/world.png", true, array( "title=" => __('GIS data')))
else { .'</a>';
echo "<li class='nomn'>";
} if ($tab == 'gis')
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=gis&id_agente=$id_agente'><img src='images/world.png' class='top' border=0 title='".__('GIS data')."'>&nbsp;</a>"; $gistab['active'] = true;
echo "</li>"; else
$gistab['active'] = false;
} }
echo "</ul>"; $onheader = array('manage' => $managetab, 'main' => $maintab, 'data' => $datatab, 'alert' => $alerttab, 'sla' => $slatab, 'inventory' => $inventorytab, 'collection' => $collectiontab, 'group' => $grouptab, 'gis' => $gistab);
echo "</div>";
echo "</div>"; print_page_header (__('Agent').'&nbsp;-&nbsp;'.mb_substr(get_agent_name($id_agente),0,25), $icon, false, "", false, $onheader);
echo "<div style='height: 25px'> </div>";
switch ($tab) { switch ($tab) {
case "gis": case "gis":