gui_class Class Reference

The gui_class is responsible for drawing all the various elements of the page. More...

Public Member Functions

 gui_class ()
 Constructor.
 run_import ($reason, $user=false)
 Import configuration from files to database.
 import_if_changes ($user=false)
 Import the configuration if there are changes in the files.
 html_start ($subtitle=false)
 Print HTML header.
 html_end ($exit_code=0)
 Print HTML footer.
 js_remove_save_warning ()
 Remove save prompt from page top.
 form_start ($name= 'foo_form', $method= 'post', $action=false)
 Create a form.
 form_end ($return=false)
 Close a form.
 get_flashed_messages ()
 Get messages stored in session, deletes them after retreival.
 submit_button ($text=false, $name=false, $skinny=false, $extra=false)
 Draw a form submit button.
 hidden_var ($name, $value, $return=false)
 Add a hidden form variable.
 draw_object ($obj)
 Print the current object on the webpage.
 make_filtered_selection ($values, $dflt= '', $select_name= 'selection')
 Create a filtered selection inside a webform.
 make_multi_obj_selection ($obj_type, $exclude=array(), $target_type=false)
 Generic function to create selection lists from any type of object that also has a group-type (hosts, services and contacts).
 make_multi_host_selection ($exclude=array())
 Simple wrapper around make_multi_obj_selection().
 make_multi_service_selection ($exclude=array())
 Simple wrapper around make_multi_obj_selection().
 print_problem_array ($subject, $ary)
 Prints an array of entries, using $subject as the table header and then printing one line of text per row.
 print_validation_error_table ($obj, $ary=false)
 Print a list of object validation errors.
 print_related ($obj)
 Print links and info related to object type.
 print_services_link ($obj)
 Create the link "Services for {host,hostgroup}".
 make_drop_down ($objects=false, $dflt='', $selection_name='', $classname='xlarge', $onchange= '')
 Create drop-down (select) with the option of specifying classname and onchange action.
 get_index_property ($type='', $id=0)
 Get an object from $Object_Index_Table.
 pretty_print_custom_vars ($obj)
 Print custom variables for one object.
 print_propagate_checkbox ($token)
 Returns a checkbox used for selecting variables to propagate.
 pretty_print_one ($obj)
 Print form for each object.
 insert_widget ($name, $obj, $token, $value)
 Include and render the correct widget for the specified token.
 get_page_vars ($obj)
 Get variables is shown on page.
 help_link ($obj, $help_page= 'help.php')
 Generate help_link.
 draw_command_bar ($obj)
 Draws the border and frames of the object listing in the gui.
 hidden_var_array ($name, $ary)
 Print out the contents of an array as hidden variables.
 print_message ($input=false, $left_margin=false)
 Print message to user.
 draw_object_selector ($obj)
 Draw the object selector that is on top of most object editing pages.
 make_multi_selection ($tokenvalues, $dflt, $select_name= 'selection')
 Render a multi-select widget.
 make_selection ($tokenvalues, $dflt, $select_name= 'selection', $class_name= 'xlarge')
 Render a select widget.

Detailed Description

The gui_class is responsible for drawing all the various elements of the page.


Member Function Documentation

gui_class::draw_command_bar ( obj  ) 

Draws the border and frames of the object listing in the gui.

Parameters:
$obj A Nagios-specific php object class.
gui_class::draw_object ( obj  ) 

Print the current object on the webpage.

Parameters:
$obj class_object A class related to a specific object type
gui_class::form_end ( return = false  ) 

Close a form.

Parameters:
$return Unused
gui_class::form_start ( name = 'foo_form',
method = 'post',
action = false 
)

Create a form.

Parameters:
$name Form name
$method Form method
$action Form action
gui_class::get_flashed_messages (  ) 

Get messages stored in session, deletes them after retreival.

Returns:
array of strings
gui_class::get_index_property ( type = '',
id = 0 
)

Get an object from $Object_Index_Table.

Parameters:
$type string: Nagios-style object type
$id int: Id of the object
Returns:
string: The object name
gui_class::get_page_vars ( obj  ) 

Get variables is shown on page.

Parameters:
$obj A Nagios-specific php object class
Returns:
array: key => value indexed array
gui_class::gui_class (  ) 

Constructor.

Responsible for validating that the user is authorized to use the GUI and to make sure this is no poller system in a distributed setup.

gui_class::help_link ( obj,
help_page = 'help.php' 
)

Generate help_link.

Parameters:
$obj A Nagios-specific php object class.
$help_page Name of the help-page
Returns:
string: The created link text
gui_class::hidden_var ( name,
value,
return = false 
)

Add a hidden form variable.

Parameters:
$name Name of the variable
$value Value of the variable
$return Unused
gui_class::hidden_var_array ( name,
ary 
)

Print out the contents of an array as hidden variables.

Parameters:
$name Base name of the array
$ary The variable array in 'key => value' form
gui_class::html_start ( subtitle = false  ) 

Print HTML header.

Parameters:
$subtitle string: Page subtitle
gui_class::import_if_changes ( user = false  ) 

Import the configuration if there are changes in the files.

Parameters:
$user The user running the import
gui_class::make_drop_down ( objects = false,
dflt = '',
selection_name = '',
classname = 'xlarge',
onchange = '' 
)

Create drop-down (select) with the option of specifying classname and onchange action.

Parameters:
$objects array: Objects to list
$dflt string: Default object
$selection_name string: Name of the selection
$classname string: css class name
$onchange javascript gunk to add to form
gui_class::make_filtered_selection ( values,
dflt = '',
select_name = 'selection' 
)

Create a filtered selection inside a webform.

Parameters:
$values Array of values in the form
$dflt The default selected value
$select_name The form name of this variable
gui_class::make_multi_host_selection ( exclude = array()  ) 

Simple wrapper around make_multi_obj_selection().

Parameters:
$exclude array: Hosts to exclude
gui_class::make_multi_obj_selection ( obj_type,
exclude = array(),
target_type = false 
)

Generic function to create selection lists from any type of object that also has a group-type (hosts, services and contacts).

The input_class understands the format we create here and can parse them correctly, which aids the various programs rather nicely.

Parameters:
$obj_type Object type
$exclude Objects to exclude from listing
$target_type Ultimate target type
gui_class::make_multi_service_selection ( exclude = array()  ) 

Simple wrapper around make_multi_obj_selection().

Parameters:
$exclude array: Services to exclude
gui_class::pretty_print_custom_vars ( obj  ) 

Print custom variables for one object.

Parameters:
$obj A Nagios-specific php object class
gui_class::pretty_print_one ( obj  ) 

Print form for each object.

Parameters:
$obj Nagios-specific php object class
gui_class::print_problem_array ( subject,
ary 
)

Prints an array of entries, using $subject as the table header and then printing one line of text per row.

If $ary is empty, this function does nothing.

Returns:
The number of entries printed.
gui_class::print_propagate_checkbox ( token  ) 

Returns a checkbox used for selecting variables to propagate.

Parameters:
$token The name of the variable
gui_class::print_related ( obj  ) 

Print links and info related to object type.

REWRITE ME PLEASE!!!

Parameters:
$obj A Nagios-object-specific php class object
gui_class::print_services_link ( obj  ) 

Create the link "Services for {host,hostgroup}".

Returns:
string: The link, complete with image and all
gui_class::print_validation_error_table ( obj,
ary = false 
)

Print a list of object validation errors.

Parameters:
$obj A Nagios-object-specific php object
$ary The validation errors, if not set in $obj
gui_class::run_import ( reason,
user = false 
)

Import configuration from files to database.

Parameters:
$reason Reason why import was run
$user The user running the import
gui_class::submit_button ( text = false,
name = false,
skinny = false,
extra = false 
)

Draw a form submit button.

Parameters:
$text The text on the button, or FALSE for default
$name The form name of the button, or FALSE for default
$skinny If false, the button will take up a comfortable amount of space. If true, it will be narrower
$extra An array of HTML attribute key-vals to append/replace the automatic ones

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

Generated on 17 Dec 2012 for nacoma by  doxygen 1.6.1