Code

Updated gotomasses.
[gosa.git] / gosa-core / plugins / addons / gotomasses / class_goto_task.inc
1 <?php
3 class goto_task extends plugin
4 {
5   /* Definitions */
6   var $plHeadline     = "System mass deployment";
7   var $plDescription  = "This does something";
8  
9   var $parent   = NULL;
10   var $data     = array();
12   var $attributes = array("MACADDRESS","ID","STATUS","HEADERTAG");
14   function goto_task(&$config, &$parent, $data = array())
15   {
16     /* Set parent object */
17     $this->parent = &$parent;
18     $this->data = $data;
20     /* Intialize plugin */
21     $this->config = &$config;
22   }
25   function execute()
26   {
27     $smarty = get_smarty();
28     $smarty->assign("Actions",$this->parent->get_actions());
29     foreach($this->attributes as $attr){
30       if(isset($this->data[$attr])){
31         $smarty->assign($attr,$this->data[$attr]);
32       }else{
33         $smarty->assign($attr,"");
34       }
35     }
36     return ($smarty->fetch (get_template_path('goto_task.tpl', TRUE)));
37   }
40   function save_object()
41   {
42     if(isset($_POST['HeaderTag'])){
43       $possible_tags = $this->parent->get_actions();
44       $tag = $_POST['HeaderTag'];
45       if(isset($possible_tags[$tag])){
46         $this->data['HEADERTAG'] = $tag;
47       }
48     }
49   }
51   function save()
52   {
53     return($this->data);
54   }
55 }
56 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
57 ?>