Code

First try, to implement an iframe for tagging
[gosa.git] / plugins / admin / departments / tabs_department.inc
1 <?php
3 class deptabs extends tabs
4 {
5   var $base= "";
7   function deptabs($config, $data, $dn)
8   {
9         tabs::tabs($config, $data, $dn);
10         $this->base= $this->by_object['department']->base;
11   }
13   function check()
14   {
15         return (tabs::check(TRUE));
16   }
17   
19   function save($justsave = false)
20   {
21         if(!$justsave){
22                 $baseobject= $this->by_object['department'];
23                 $ou= preg_replace('/,/', '\,', $baseobject->ou);
24                 $new_dn= @LDAP::convert('ou='.$ou.','.$baseobject->base);
25                 $disp ="";
26                 if ($this->dn != $new_dn && $this->dn != "new"){
27                         
28                         /* if( new_dn is subtree of this->dn ) */
29                         $cnt1 = count(split(",",$this->dn));
30                         $cnt2 = count(split(",",$new_dn));
31                         if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){
32                                 print_red(_("Try to move tree failed. Destination tree is subtree of source tree."));
33                         }else{
34                                 $disp = ($baseobject->recursive_move($this->dn, $new_dn));
35                                 return($disp);
36                         }
37                 }
38                 $this->dn= $new_dn;
39         }
40         return(tabs::save(TRUE));
41   }
43 }
45 ?>