Code

Fixed Workstation Startup
[gosa.git] / gosa-plugins / goto / admin / systems / goto / tabs_printers.inc
1 <?php
3 class printtabs extends tabs
4 {
6   function printtabs($config, $data, $dn,$category)
7   {
9     /* Save dn */
10     $this->dn= $dn;
11     $this->config= $config;
13     $baseobject= NULL;
15     foreach ($data as $tab){
16       $this->by_name[$tab['CLASS']]= $tab['NAME'];
18       if ($baseobject === NULL){
19         $baseobject= new $tab['CLASS']($this->config, $this->dn,NULL,$this);
20         $this->by_object[$tab['CLASS']]= $baseobject;
21       } else {
22         $this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn, $baseobject,$this);
23       }
25       $this->by_object[$tab['CLASS']]->parent= &$this;
26       $this->by_object[$tab['CLASS']]->set_acl_category($category);
28       /* Initialize current */
29       if ($this->current == ""){
30         $this->current= $tab['CLASS'];
31       }
32     }
34     /* Add references/acls/snapshots */
35     $this->addSpecialTabs();
36   }
38   function save_object($save_current= FALSE)
39   {
40     tabs::save_object($save_current);
42     /* Assign current cn */
43     $baseobject= $this->by_object['printgeneric'];
44     $baseobject->netConfigDNS->cn= $baseobject->cn;
45   }
48   function save($ignore_account= FALSE)
49   {
50     /* Check for new 'dn', in order to propagate the
51        'dn' to all plugins */
52     $baseobject= $this->by_object['printgeneric'];
53     $this->dn= "cn=$baseobject->cn,".get_ou('printerou').$baseobject->base;
54     $baseobject->dn= $this->dn;
56     foreach ($this->by_object as $key => $obj){
57       $this->by_object[$key]->dn= $this->dn;
58     }
60     tabs::save(FALSE);
61   }
63 }
65 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
66 ?>