4e8e318aff50761bd4001f24a928c822c947b72c
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 }
19 function save($justsave = false)
20 {
21 if(!$justsave){
22 $baseobject= $this->by_object['department'];
23 $new_dn= 'ou='.preg_replace('/,/', '\\\\2C', $baseobject->ou).','.$baseobject->base;
24 $disp ="";
25 if ($this->dn != $new_dn && $this->dn != "new"){
27 /* if( new_dn is subtree of this->dn ) */
28 $cnt1 = count(split(",",$this->dn));
29 $cnt2 = count(split(",",$new_dn));
30 if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){
31 print_red(_("Try to move tree failed. Destination tree is subtree of source tree."));
32 }else{
33 $disp = ($baseobject->recursive_move($this->dn, $new_dn));
34 return($disp);
35 }
36 }
37 $this->dn= $new_dn;
38 }
39 tabs::save(TRUE);
40 return($disp);
41 }
43 }
45 ?>