2009-02-05 Evi Vanoost <vanooste@rcbi.rochester.edu>

* general/header.php: Added alt tags to images
	
	* include/functions_db.php: Fixed get_agent_modules function
	
	* include/functions_html.php: Fixed print_image and print_table to conform
	to standards
	
	* index.php: Removed extra closing div that shouldn't be there and conform
	to standards
	
	* godmode/agentes/alert_manager.php: Fixed JavaScript messyness for XHTML

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1430 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
guruevi 2009-02-05 15:36:06 +00:00
parent 3f4e66287b
commit 0c212b40f8
6 changed files with 46 additions and 25 deletions

View File

@ -1,3 +1,17 @@
2009-02-05 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/header.php: Added alt tags to images
* include/functions_db.php: Fixed get_agent_modules function
* include/functions_html.php: Fixed print_image and print_table to conform
to standards
* index.php: Removed extra closing div that shouldn't be there and conform
to standards
* godmode/agentes/alert_manager.php: Fixed JavaScript messyness for XHTML
2009-02-05 Esteban Sanchez <estebans@artica.es> 2009-02-05 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Hide actions and templates form. * godmode/agentes/alert_manager.php: Hide actions and templates form.

View File

@ -33,15 +33,15 @@ echo '<a href="index.php"><img src="images/pandora_logo_head.png" alt="logo" sty
echo '</td><td width="20">&nbsp;</td>'; echo '</td><td width="20">&nbsp;</td>';
// First column (identifier) // First column (identifier)
echo '<td width="20%"><img src="images/user_'.((is_user_admin ($config["id_user"]) == 1) ? 'suit' : 'green' ).'.png" class="bot">&nbsp;'.'<a class="white">'.__('You are').' [<b>'.$config["id_user"].'</b>]</a>'; echo '<td width="20%"><img src="images/user_'.((is_user_admin ($config["id_user"]) == 1) ? 'suit' : 'green' ).'.png" class="bot" alt="user" />&nbsp;'.'<a class="white">'.__('You are').' [<b>'.$config["id_user"].'</b>]</a>';
//First column, second row (logout button) //First column, second row (logout button)
echo '<br /><br />'; echo '<br /><br />';
echo '<a class="white_bold" href="index.php?bye=bye"><img src="images/lock.png" class="bot">&nbsp;'. __('Logout').'</a>'; echo '<a class="white_bold" href="index.php?bye=bye"><img src="images/lock.png" alt="logout" class="bot" />&nbsp;'. __('Logout').'</a>';
// Second column (link to main page) // Second column (link to main page)
echo '</td><td width="20%">'; echo '</td><td width="20%">';
echo '<a class="white_bold" href="index.php?sec=main"><img src="images/information.png" class="bot">&nbsp;'.__('General information').'</a>'; echo '<a class="white_bold" href="index.php?sec=main"><img src="images/information.png" alt="info" class="bot" />&nbsp;'.__('General information').'</a>';
//Second column, second row (System up/down) //Second column, second row (System up/down)
echo '<br /><br />'; echo '<br /><br />';
@ -51,13 +51,13 @@ $servers["up"] = (int) check_server_status ();
$servers["down"] = $servers["all"] - $servers["up"]; $servers["down"] = $servers["all"] - $servers["up"];
if ($servers["up"] == 0) { if ($servers["up"] == 0) {
//All Servers down or no servers at all //All Servers down or no servers at all
echo '<img src="images/cross.png" class="bot" />&nbsp;'.__('All systems').': '.__('Down'); echo '<img src="images/cross.png" alt="cross" class="bot" />&nbsp;'.__('All systems').': '.__('Down');
} elseif ($servers["down"] != 0) { } elseif ($servers["down"] != 0) {
//Some servers down //Some servers down
echo '<img src="images/error.png" class="bot" />&nbsp;'.$servers["down"].' '.__('servers down'); echo '<img src="images/error.png" alt="error" class="bot" />&nbsp;'.$servers["down"].' '.__('servers down');
} else { } else {
//All servers up //All servers up
echo '<img src="images/ok.png" class="bot" />&nbsp;'.__('All systems').': '.__('Ready'); echo '<img src="images/ok.png" alt="ok" class="bot" />&nbsp;'.__('All systems').': '.__('Ready');
} }
unset ($servers); // Since this is the header, we don't like to trickle down variables. unset ($servers); // Since this is the header, we don't like to trickle down variables.
echo "</a>"; echo "</a>";
@ -68,11 +68,11 @@ echo "</a>";
echo '</td><td width="20%">'; echo '</td><td width="20%">';
$refr = (int) get_parameter ("refr"); $refr = (int) get_parameter ("refr");
if ($refr) { if ($refr) {
echo '<a id="autorefresh" class="white_grey_bold" href="'.((substr ($_SERVER['REQUEST_URI'],-1) != "/") ? $_SERVER['REQUEST_URI'] : 'index.php?' ).'&refr=0"><img src="images/page_lightning.png" class="bot" />&nbsp;'. __('Autorefresh'); echo '<a id="autorefresh" class="white_grey_bold" href="'.((substr ($_SERVER['REQUEST_URI'],-1) != "/") ? $_SERVER['REQUEST_URI'] : 'index.php?' ).'&refr=0"><img src="images/page_lightning.png" class="bot" alt="lightning" />&nbsp;'. __('Autorefresh');
echo ' (<span id="refr">'.date ("i:s", $refr).'</span>)'; echo ' (<span id="refr">'.date ("i:s", $refr).'</span>)';
echo '</a>'; echo '</a>';
} else { } else {
echo '<a id="autorefresh" class="white_bold" href="'.((substr ($_SERVER['REQUEST_URI'],-1) != "/") ? $_SERVER['REQUEST_URI'] : "index.php?" ).(count($_GET)?"&":"?").'refr="><img src="images/page_lightning.png" class="bot" />&nbsp;'.__('Autorefresh').'</a>'; echo '<a id="autorefresh" class="white_bold" href="'.((substr ($_SERVER['REQUEST_URI'],-1) != "/") ? $_SERVER['REQUEST_URI'] : "index.php?" ).(count($_GET)?"&":"?").'refr="><img src="images/page_lightning.png" class="bot" alt="lightning" />&nbsp;'.__('Autorefresh').'</a>';
$values = array ('5' => '5 '.__('seconds'), $values = array ('5' => '5 '.__('seconds'),
'10' => '10 '.__('seconds'), '10' => '10 '.__('seconds'),
'15' => '15 '.__('seconds'), '15' => '15 '.__('seconds'),
@ -90,7 +90,7 @@ if ($refr) {
//Events //Events
echo '<br /><br />'; echo '<br /><br />';
echo '<a class="white_bold" href="index.php?sec=eventos&sec2=operation/events/events&refr=5"><img src="images/lightning_go.png" class="bot" />&nbsp;'.__('Events').'</a>'; echo '<a class="white_bold" href="index.php?sec=eventos&sec2=operation/events/events&refr=5"><img src="images/lightning_go.png" alt="lightning_go" class="bot" />&nbsp;'.__('Events').'</a>';
// Styled text // Styled text
echo '</td><td width="20%"><div id="head_r"><span id="logo_text1">Pandora</span> <span id="logo_text2">FMS</span></div></td></tr></table>'; echo '</td><td width="20%"><div id="head_r"><span id="logo_text1">Pandora</span> <span id="logo_text2">FMS</span></div></td></tr></table>';
@ -98,6 +98,7 @@ echo '</td><td width="20%"><div id="head_r"><span id="logo_text1">Pandora</span>
<script type="text/javascript" src="include/javascript/jquery.countdown.js"></script> <script type="text/javascript" src="include/javascript/jquery.countdown.js"></script>
<script language="javascript" type="text/javascript"> <script language="javascript" type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () { $(document).ready (function () {
<?php if ($refr): ?> <?php if ($refr): ?>
t = new Date(); t = new Date();
@ -124,4 +125,5 @@ $(document).ready (function () {
}); });
<?php endif; ?> <?php endif; ?>
}); });
/* ]]> */
</script> </script>

View File

@ -295,6 +295,7 @@ echo '</div></form>';
<script type="text/javascript" src="include/javascript/jquery.cluetip.js"></script> <script type="text/javascript" src="include/javascript/jquery.cluetip.js"></script>
<script type="text/javascript"> <script type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () { $(document).ready (function () {
$("table.modules tr").hover ( $("table.modules tr").hover (
function () { function () {
@ -413,4 +414,5 @@ $(document).ready (function () {
} }
); );
}); });
/* ]]> */
</script> </script>

View File

@ -352,9 +352,8 @@ $modules = get_agent_modules ($id_agent, '*', 'disabled = 0 AND history_data = 0
function get_agent_modules ($id_agent, $details = false, $filter = false) { function get_agent_modules ($id_agent, $details = false, $filter = false) {
$id_agent = safe_int ($id_agent, 1); $id_agent = safe_int ($id_agent, 1);
$where = ''; if (empty ($id_agent)) {
if (! empty ($id_agent)) { $where = '';
} else { } else {
$where = sprintf (' WHERE id_agente IN (%s)', implode (",", (array) $id_agent)); $where = sprintf (' WHERE id_agente IN (%s)', implode (",", (array) $id_agent));
} }

View File

@ -436,8 +436,10 @@ function print_table (&$table, $return = false) {
$table->border = '0px'; $table->border = '0px';
} }
if (empty ($table->tablealign)) { if (empty ($table->tablealign) || $table->tablealign != 'left' || $table->tablealign != 'right') {
$table->tablealign = 'center'; $table->tablealign = '';
} else {
$table->tablealign = 'float:'.$table->tablealign.';'; //Align is deprecated. Use float instead
} }
if (!isset ($table->cellpadding)) { if (!isset ($table->cellpadding)) {
@ -454,7 +456,7 @@ function print_table (&$table, $return = false) {
$tableid = empty ($table->id) ? 'table'.$table_count : $table->id; $tableid = empty ($table->id) ? 'table'.$table_count : $table->id;
$output .= '<table width="'.$table->width.'" '; $output .= '<table width="'.$table->width.'" style="'.$table->tablealign.'"';
$output .= ' cellpadding="'.$table->cellpadding.'" cellspacing="'.$table->cellspacing.'"'; $output .= ' cellpadding="'.$table->cellpadding.'" cellspacing="'.$table->cellspacing.'"';
$output .= ' border="'.$table->border.'" class="'.$table->class.'" id="'.$tableid.'">'; $output .= ' border="'.$table->border.'" class="'.$table->class.'" id="'.$tableid.'">';
$countcols = 0; $countcols = 0;
@ -687,16 +689,19 @@ function print_help_tip ($text, $return = false) {
*/ */
function print_image ($src, $return = false, $options = false) { function print_image ($src, $return = false, $options = false) {
$output = '<img src="'.$src.'" '; $output = '<img src="'.$src.'" ';
$style = '';
if ($options) { if ($options) {
if (isset ($options['alt'])) if (!isset ($options['alt']))
$output .= 'alt="'.$options['alt'].'" '; $options['alt'] = ''; //Alt is one of those tags that has to be set for w3 compliance
$output .= 'alt="'.$options['alt'].'" ';
if (isset ($options['border'])) if (isset ($options['border']))
$output .= 'border="'.$options['border'].'" '; $style .= 'border:'.$options['border'].';'; //Border is deprecated. Use styles
if (isset ($options['style'])) if (isset ($options['style']))
$output .= 'style="'.$options['style'].'" '; $style .= $options['style'];
if (isset ($options['title'])) if (isset ($options['title']))
$output .= 'title="'.$options['title'].'" '; $output .= 'title="'.$options['title'].'" ';
@ -718,7 +723,7 @@ function print_image ($src, $return = false, $options = false) {
} }
} }
$output .= '/>'; $output .= 'style="'.$style.'" />';
if ($return) if ($return)
return $output; return $output;

View File

@ -97,7 +97,7 @@ if (!empty ($config["https"]) && empty ($_SERVER['HTTPS'])) {
exit; //Always exit after sending location headers exit; //Always exit after sending location headers
} }
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>'; echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>';
// Pure mode (without menu, header and footer). // Pure mode (without menu, header and footer).
$config["pure"] = (bool) get_parameter ("pure", 0); $config["pure"] = (bool) get_parameter ("pure", 0);
@ -157,9 +157,9 @@ echo '</head>';
// Show custom background // Show custom background
if ($config["pure"] == 0) { if ($config["pure"] == 0) {
echo '<body bgcolor="#555555">'; echo '<body style="background-color:#555555;">';
} else { } else {
echo '<body bgcolor="#ffffff">'; echo '<body>'; //Don't enforce a white background color. Let user style sheet do that
} }
$REMOTE_ADDR = $_SERVER['REMOTE_ADDR']; $REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
@ -288,8 +288,7 @@ if ($config["pure"] == 0) {
echo '<div id="foot">'; echo '<div id="foot">';
require ("general/footer.php"); require ("general/footer.php");
echo '</div>'; echo '</div>';
echo '</div>';
} }
echo '</body></html>'; echo '</body></html>';
?> ?>