From b3e004f116c660d5b1d0fa27347f322dc0337365 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 26 Feb 2008 13:51:51 +0000 Subject: [PATCH] Updated gotomasses. -Added class/function comments git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9127 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../gotomasses/events/class_DaemonEvent.inc | 162 ++++++++++++------ 1 file changed, 108 insertions(+), 54 deletions(-) diff --git a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc index 8da1e500e..0568bfeea 100644 --- a/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc +++ b/gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc @@ -1,53 +1,66 @@ + \version 1.00 + \date 26.02.2008 + This is the base class for all new daemon events. + It implements most of the required functionality. + */ class DaemonEvent { /* Menu Strings */ protected $s_Menu_Name = "s_Menu_Name not set"; // Diplayed in the ActionsMenu->CreateNew protected $s_Event_Name = "s_Event_Name not set"; // Will be displayed in the Management list. - protected $s_Menu_Image = "images/empty.png"; // The deamon command name. - protected $s_List_Image = ""; // The deamon command name. + protected $s_Menu_Image = "images/empty.png"; // Image displayed in Actions->New + protected $s_List_Image = ""; // Image displayed in event listing - protected $target_add_list_used = FALSE; // Indicates that the target add list was used. - protected $time_select_used = FALSE; // Indicates that we have used the timestamp select boxes. - protected $target_list_used = FALSE; // Target list was diaplayed? - protected $target_divlist = NULL; // The divlist used by the target add dialog + protected $config; // GOsa configuration object + protected $data; // The event data, when edited - protected $config; // GOsa configuration file - protected $data; // The event data - - protected $s_New_Action = ""; // The deamon command name. - protected $s_Edit_Action= ""; // The deamon command name. - protected $a_targets = array(); // The list of assigned Targets + protected $a_targets = array(); // The list of assigned Targets (When newly created) + protected $s_New_Action = ""; // The deamon command name when newly created. (e.g. job_trigger_action_halt) + protected $s_Edit_Action= ""; // The deamon command name when edited. (e.g. trigger_action_halt) protected $timestamp = 0; // Event execution time; protected $id = -1; // The Table ID protected $status = "unknown";// The current event status protected $is_new = TRUE; // Is TRUE if this is a new event - protected $_target_list = array(); // Object Cache of those objects displayed in the target add dialog - protected $workstation_list = array(); - protected $server_list = array(); + /* Sub dialog hanlding */ + protected $target_divlist = NULL; // The divlist used by the target add dialog + protected $target_add_list_used = FALSE; // Indicates that the target add list was used. + protected $time_select_used = FALSE; // Indicates that we have used the timestamp select boxes. + protected $target_list_used = FALSE; // Target list was diaplayed? + protected $_target_list = array(); // Object Cache of those objects displayed in the target add dialog + protected $workstation_list = array(); // Used as cache in the target list. + protected $server_list = array(); // Used as cache in the target list. + + /*! \brief Class contructor. + @param Array GOsa configuration object. + @param Array Event data, only given when edited. + */ public function __construct($config,$data = array()) { $this->data = $data; @@ -58,7 +71,7 @@ class DaemonEvent /* Load values from given data */ if(count($data)){ $this->is_new = FALSE; - + $attrs = array("id" => "ID"); foreach($attrs as $to => $from){ $this->$to = $data[$from]; @@ -66,6 +79,10 @@ class DaemonEvent } } + + /*! \brief Create the HTML output for the plugin. + @return String The generated HTML output. + */ public function execute() { $this->time_select_used = FALSE; @@ -74,12 +91,14 @@ class DaemonEvent $str = "

"._("This event has no template.")."

"; $str.= "

"; $str.= "
- -
"; + + "; return($str); } - + /*! \brief Returns the plugin header, displayed in the template. + @return String HTML header part. + */ public function get_header() { if($this->target_add_list_used){ @@ -90,6 +109,9 @@ class DaemonEvent } + /*! \brief Returns the plugin footer (save cancel), displayed in the template. + @return String HTML footer part. + */ public function get_footer() { if($this->target_add_list_used){ @@ -97,13 +119,16 @@ class DaemonEvent } $str = "

"; $str.= "
-   - -
"; +   + + "; return($str); } - + + /*! \brief Returns HTML representation of a timestamp using