Code

2fe1c65db90bc5a40f52a5816ce33ec71af6b6c7
[gosa.git] / plugins / admin / systems / tabs_printers.inc
1 <?php
3 class printtabs extends tabs
4 {
6   function printtabs($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);
32   }
35   function save()
36   {
37     /* Check for new 'dn', in order to propagate the
38        'dn' to all plugins */
39     $baseobject= $this->by_object['printgeneric'];
40     $this->dn= "cn=$baseobject->cn,ou=printers,ou=systems,".$baseobject->base;
42     foreach ($this->by_object as $key => $obj){
43       $this->by_object[$key]->dn= $this->dn;
44     }
46     tabs::save(FALSE);
48     /* Fix tagging if needed */
49     $baseobject->handle_object_tagging();
50   }
52 }
54 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
55 ?>