Code

updated zone editor
[gosa.git] / plugins / admin / systems / tabs_terminal.inc
1 <?php
3 class termtabs extends tabs
4 {
6   function termtabs($config, $data, $dn)
7   {
8     /* Save dn */
9     $this->dn= $dn;
10     $this->config= $config;
12     foreach ($data as $tab){
13       if($tab['CLASS'] == "printgeneric"){
14         $this->by_name[$tab['CLASS']]= $tab['NAME'];
15         $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn,$this);
16         $this->by_object[$tab['CLASS']]->parent= &$this;
17       }else{
18         $this->by_name[$tab['CLASS']]= $tab['NAME'];
19         $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn);
20         $this->by_object[$tab['CLASS']]->parent= &$this;
21       }
22       /* Initialize current */
23       if ($this->current == ""){
24         $this->current= $tab['CLASS'];
25       }
26     }
27   }
29   function save_object($save_current= FALSE)
30   {
31     tabs::save_object($save_current);
33     /* Update reference, transfer variables */
34     if(isset($this->by_object['termstartup'])){
35       $this->by_object['termstartup']->gotoTerminalPath=
36         $this->by_object['termgeneric']->gotoTerminalPath;
37     }
38    
39     /* Assign current cn to all other plugins */ 
40     $baseobject= $this->by_object['termgeneric'];
41     foreach ($this->by_object as $key => $obj){
42       $this->by_object[$key]->cn= $baseobject->cn;
43     }
44   }
47   function save()
48   {
49     /* Check for new 'dn', in order to propagate the
50        'dn' to all plugins */
51     $baseobject= $this->by_object['termgeneric'];
52     $this->dn= "cn=".$baseobject->cn.",ou=terminals,ou=systems,".$baseobject->base;
53     $baseobject->dn= $this->dn;
55     foreach ($this->by_object as $key => $obj){
56       $this->by_object[$key]->dn= $this->dn;
57       $this->by_object[$key]->cn= $baseobject->cn;
58     }
60     tabs::save(TRUE);
61     if(isset($this->by_object['printgeneric'])){
62       if(($this->by_object['printgeneric']->is_account==false)&&($this->by_object['printgeneric']->initially_was_account==true)){
63         $this->by_object['printgeneric']->remove_from_parent();
64       }
65     }
67     /* Fix tagging if needed */
68     $baseobject->handle_object_tagging();
69   }
71 }
73 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
74 ?>