Code

* Cosmetic changes
[gosa.git] / plugins / admin / fai / tabsTemplate.inc
1 <?php
3 class tabsTemplate extends tabs
4 {
5   var $base= "";
7   function tabsTemplate($config, $data, $dn)
8   {
9         tabs::tabs($config, $data, $dn);
10   }
12   function check()
13   {
14         return (tabs::check(TRUE));
15   }
16   
18   function save()
19   {
20         $baseobject= $this->by_object['faiTemplate'];
22         $new_dn= 'cn='.$baseobject->cn.",ou=templates,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
23         
24         if ($this->dn != $new_dn && $this->dn != "new"){
25                 
26                 /* if( new_dn is subtree of this->dn ) */
27                 $cnt1 = count(split(",",$this->dn));
28                 $cnt2 = count(split(",",$new_dn));
29                 if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){
30                         print_red(_("Try to move tree failed. Destination tree is subtree of source tree."));
31                 }else{
32                         $baseobject->recursive_move($this->dn, $new_dn);
33                 }
34         }
35         $this->dn= $new_dn;
37         tabs::save(TRUE);
38   }
40 }
42 ?>