Code

63c82bda9d00d9fd1854a2964d75e491868568ab
[gosa.git] / plugins / admin / systems / tabs_workstation.inc
1 <?php
3 class worktabs extends tabs
4 {
6   function worktabs($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     }
28     /* Add references/acls/snapshots */
29     $this->addSpecialTabs();
30   }
32   function save_object($save_current= FALSE)
33   {
34     tabs::save_object($save_current);
35   }
38   function save()
39   {
40     /* Check for new 'dn', in order to propagate the
41        'dn' to all plugins */
42     $baseobject= $this->by_object['workgeneric'];
43     $this->dn= "cn=".$baseobject->cn.",ou=workstations,ou=systems,".$baseobject->base;
44     $baseobject->dn= $this->dn;
46     foreach ($this->by_object as $key => $obj){
47       $this->by_object[$key]->dn= $this->dn;
48       $this->by_object[$key]->cn= $baseobject->cn;
49     }
51     tabs::save(TRUE);
52     if(($this->by_object['printgeneric']->is_account==false)&&($this->by_object['printgeneric']->initially_was_account==true)){
53       $this->by_object['printgeneric']->remove_from_parent();
54     }
56     /* Fix tagging if needed */
57     $baseobject->handle_object_tagging();
58   }
60 }
62 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
63 ?>