Code

Moved goto partly
[gosa.git] / gosa-plugins / goto / admin / applications / tabs_application.inc
1 <?php
3 class apptabs extends tabs
4 {
5   var $Release= "";
7   function apptabs($config, $data, $dn,$category)
8   {
9     tabs::tabs($config, $data, $dn,$category);
11     /* Add references/acls/snapshots */
12     $this->addSpecialTabs();
13   }
15   function set_release($newRelease)
16   {
17     $this->Release= preg_replace('/,'.get_ou('applicationou').'.*$/', '', $newRelease);
18     if ($this->Release != ""){
19       $this->Release= ",".$this->Release;
20     }
21   }
23   function save($ignore_account= FALSE)
24   {
25     $baseobject= $this->by_object['application'];
27     /* Check for new 'dn', in order to propagate the
28        'dn' to all plugins */
29     $tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs'));
30     $appfilter = session::get('appfilter');
31     if((!empty($tmp)) && (isset($appfilter['release']))){
32       if(!$baseobject->isReleaseApplikation){
33         $new_dn= "cn=".$baseobject->cn.",".get_ou('applicationou').$baseobject->base;
34       }else{
35         $new_dn ="cn=".$baseobject->cn.",".$appfilter['release'];
36       }
37     }else{
38       $new_dn= "cn=".$baseobject->cn.",".get_ou('applicationou').$baseobject->base;
39     }
41     /* Move group? */
42     if ($this->dn != $new_dn){
44       /* Write entry on new 'dn' */
45       if ($this->dn != "new"){
46         $baseobject->move($this->dn, $new_dn);
47         $this->by_object['application']= $baseobject;
48       }
50       /* Happen to use the new one */
51       $this->dn= $new_dn;
52     }
54     tabs::save();
55   }
57 }
58 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
59 ?>