2012-06-12 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* include/functions_graph.php: Added options for progress_bar graph.
	* include/functions_modules.php: Fixed typo.
	
	Merged from branches.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6521 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2012-06-12 19:26:26 +00:00
parent 4ac482f3c4
commit 0f1abac23e
3 changed files with 21 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2012-06-12 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php: Added options for progress_bar graph.
* include/functions_modules.php: Fixed typo.
Merged from branches.
2012-06-12 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_modules.php

View File

@ -949,7 +949,7 @@ function graph_event_module ($width = 300, $height = 200, $id_agent) {
$config['fontpath'], $config['font_size']);
}
function progress_bar($progress, $width, $height, $title = '', $mode = 1, $value_text = false, $color = false) {
function progress_bar($progress, $width, $height, $title = '', $mode = 1, $value_text = false, $color = false, $options = false) {
global $config;
$out_of_lim_str = __("Out of limits");
@ -965,10 +965,21 @@ function progress_bar($progress, $width, $height, $title = '', $mode = 1, $value
$colorRGB = implode('|', $colorRGB);
}
$class_tag = '';
$id_tag = '';
if ($options !== false) {
foreach ($options as $option_type => $option_value) {
if ($option_type == 'class')
$class_tag = ' class="' . $option_value . '" ';
else if ($option_type == 'id')
$id_tag = ' id="' . $option_value . '" ';
}
}
require_once("include_graph_dependencies.php");
include_graphs_dependencies($config['homedir'].'/');
return "<img title='" . $title . "' alt='" . $title . "'" .
return "<img title='" . $title . "' alt='" . $title . "'" . $class_tag . $id_tag .
" src='" . $config['homeurl'] . "/include/graphs/fgraph.php?homeurl=../../&graph_type=progressbar" .
"&width=".$width."&height=".$height."&progress=".$progress.
"&mode=" . $mode . "&out_of_lim_str=".$out_of_lim_str .

View File

@ -29,7 +29,7 @@ include_once($config['homedir'] . '/include/functions_tags.php');
* This function avoid duplicated by comparing module names.
*
* @param int Source agent module id.
* @param int Detiny agent id.
* @param int Destiny agent id.
* @param string Forced name to the new module.
*
* @return New agent module id on success. Existing module id if it already exists.