reports_Core Class Reference

Help class for reports. More...

Public Member Functions

 lib_reports_assert_handler ($filename, $line, $code)
 Called by PHP as an assert callback to format errors usefully.
 convert_hex_color ($color_str)
 Converts an html hexadecimal color from the form "#rrggbb" to its separate components.

Static Public Member Functions

static percent ($dividend, $divisor)
 Generate a percentage easily.
static get_color_values ($labels=false)
 Assigns color to labels to be used in a piechart.
static get_date_ranges ()
 Fetch date ranges from reports class.
static format_report_value ($val)
 Format report value output.
static is_proper_report_item ($k, $data)
 Validate report item.
static js_strings ()
 Create common translated javascript strings.
static get_included_states ($report_type, $options)
 Return a text string representing the included host or service states.
static _state_colors ($type='host', $state=false)
 Determine what color to assign to an event.
static _state_color_table ($type='host')

Static Public Attributes

static $colors
 Colors for status in trends graph and such.
static $days_per_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
 Array of month_number => days_in_month.
static $valid_weekdays = array('sunday','monday','tuesday','wednesday','thursday','friday','saturday')
 Array of weekday names.
static $valid_months
 Array of month names.

Detailed Description

Help class for reports.


Member Function Documentation

static reports_Core::_state_color_table ( type = 'host'  )  [static]
Parameters:
$type string = 'host'
Returns:
array
reports_Core::convert_hex_color ( color_str  ) 

Converts an html hexadecimal color from the form "#rrggbb" to its separate components.

Parameters:
$color_str string: Color in html hex
Returns:
False on error. Array of 3 decimal values on success
static reports_Core::get_date_ranges (  )  [static]

Fetch date ranges from reports class.

Returns:
Array of date ranges
static reports_Core::is_proper_report_item ( k,
data 
) [static]

Validate report item.

Parameters:
$k Unused FIXME
$data A data array that should have states return true if valid, false otherwise
static reports_Core::percent ( dividend,
divisor 
) [static]

Generate a percentage easily.

Parameters:
$dividend The whole
$divisor The part
Returns:
The percentage

Field Documentation

reports_Core::$colors [static]
Initial value:
 array(
                'green' => '#aade53',
                'yellow' => '#ffd92f',
                'orange' => '#ff9d08',
                'red'   => '#f7261b',
                'grey'  => '#a19e95',
                'lightblue' => '#EAF0F2', # actual color is #ddeceb, but it is hardly visible
                'white' => '#ffffff',
                'transparent' => 'transparent'
        )

Colors for status in trends graph and such.

reports_Core::$valid_months [static]
Initial value:
 array
        (
                1  => 'january',
                2  => 'february',
                3  => 'march',
                4  => 'april',
                5  => 'may',
                6  => 'june',
                7  => 'july',
                8  => 'august',
                9  => 'september',
                10 => 'october',
                11 => 'november',
                12 => 'december'
        )

Array of month names.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables

Generated on 7 May 2013 for ninja by  doxygen 1.6.1