' . PHP_EOL; if (isset($args['title'])) { $return .= '
'.PHP_EOL; if (isset($args['url'])) { $return .= ''; } if (isset($args['icon'])) { $return .= get_icon($args['icon']); } $return .= '<' . (isset($args['title-element']) ? $args['title-element'] : 'h3').' class="box-title"'; $return .= isset($args['title-style']) ? ' style="'.$args['title-style'].'"' : ''; $return .= '>'; $return .= escape_html($args['title']).''.PHP_EOL; if (isset($args['url'])) { $return .= ''; } if (isset($args['header-controls']) && is_array($args['header-controls']['controls'])) { $return .= '
'; foreach($args['header-controls']['controls'] as $control) { $anchor = (isset($control['anchor']) && $control['anchor']) || (isset($control['config']) && !empty($control['config'])); if ($anchor) { $return .= ' "ajax_settings('".$control['config']."', '".$control['value']."');" ]; } } else { //$return .= ' onclick="return false;"'; } // Additional class $return .= ' class="btn btn-box-tool'; if (isset($control['class'])) { $return .= ' ' . escape_html($control['class']); } $return .= '"'; // Additional params (raw string or array with params if (isset($control['data'])) { $params = is_array($control['data']) ? generate_html_attribs($control['data']) : $control['data']; $return .= ' '.$params; } $return .= '>'; if (isset($control['icon'])) { $return .= get_icon($control['icon']).' '; } if (isset($control['text'])) { $return .= $control['text']; } if ($anchor) { $return .= ''; } else { $return .= ''; } } $return .= '
'; } $return .= '
'.PHP_EOL; } $return .= '
'; $popup_contents .= generate_graph_tag($graph_array_zoom); $graph_link = overlib_link($link, generate_graph_tag($graph_array), $popup_contents, NULL); // if ($hide_lg) // { // Hide this graph on lg/xl screen since it not fit to single row (on xs always visible, since here multirow) // $graph_link = '
' . $graph_link . '
'; // } if(count($graph_rows) < $limit) { $graph_rows[] = $graph_link; } } return implode(PHP_EOL, $graph_rows); } // DOCME needs phpdoc block function generate_graph_row($graph_array, $state_marker = FALSE) { global $config; if ($_SESSION['widescreen']) { if ($config['graphs']['size'] === 'big') { if (!$graph_array['height']) { $graph_array['height'] = "110"; } if (!$graph_array['width']) { $graph_array['width'] = "372"; } $periods = array('day', 'week', 'month', 'year'); } else { if (!$graph_array['height']) { $graph_array['height'] = "110"; } if (!$graph_array['width']) { $graph_array['width'] = "287"; } $periods = array('day', 'week', 'month', 'year', 'twoyear'); } } else { if ($config['graphs']['size'] === 'big') { if (!$graph_array['height']) { $graph_array['height'] = "100"; } if (!$graph_array['width']) { $graph_array['width'] = "323"; } $periods = array('day', 'week', '!month'); } else { if (!$graph_array['height']) { $graph_array['height'] = "100"; } if (!$graph_array['width']) { $graph_array['width'] = "228"; } $periods = array('day', 'week', 'month', '!year'); } } if ($graph_array['shrink']) { $graph_array['width'] = $graph_array['width'] - $graph_array['shrink']; } // If we're printing the row inside a table cell with "state-marker", we need to make the graphs a tiny bit smaller to fit if($state_marker) { $graph_array['width'] -= 2; } $graph_array['to'] = $config['time']['now']; $graph_rows = array(); foreach ($periods as $period) { $hide_lg = $period[0] === '!'; if ($hide_lg) { $period = substr($period, 1); } $graph_array['from'] = get_time($period); $graph_array_zoom = $graph_array; $graph_array_zoom['height'] = "175"; $graph_array_zoom['width'] = "600"; unset($graph_array_zoom['legend']); $link_array = $graph_array; $link_array['page'] = "graphs"; unset($link_array['height'], $link_array['width']); $link = generate_url($link_array); $graph_link = overlib_link($link, generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL); if ($hide_lg) { // Hide this graph on lg/xl screen since it not fit to single row (on xs always visible, since here multirow) $graph_link = '
' . $graph_link . '
'; } $graph_rows[] = $graph_link; } return implode(PHP_EOL, $graph_rows); } function print_graph_row($graph_array, $state_marker = FALSE) { echo(generate_graph_row($graph_array, $state_marker)); } function print_graph_summary_row($graph_array, $state_marker = FALSE) { echo(generate_graph_summary_row($graph_array, $state_marker)); } function print_setting_row($varname, $variable) { global $config, $config_variable, $database_config, $defined_config, $default_config; // required arrays: // config definitions # $config_variable; // include($config['install_dir'] . '/includes/config-variables.inc.php'); if (safe_empty($config_variable)) { //print_warning("LOADED CONFIG DEF"); include($config['install_dir'] . '/includes/config-variables.inc.php'); //r($config_variable); } // SQL config # $database_config; // load_sqlconfig($database_config); // Defined config # $defined_config; // $defined_config = get_defined_settings(); // Default config # $default_config; // $default_config = get_default_settings(); if (isset($variable['edition']) && $variable['edition'] !== OBSERVIUM_EDITION) { // Skip variables not allowed for current Observium edition return; } $switchdescr = <<