Code

print_red replacements, translation updates
[gosa.git] / gosa-plugins / fai / admin / fai / tabsTemplate.inc
1 <?php
3 class tabsTemplate extends tabs
4 {
5   var $base= "";
7   function tabsTemplate($config, $data, $dn,$category)
8   {
9         tabs::tabs($config, $data, $dn, $category);
11         /* Add references/acls/snapshots */
12         $this->addSpecialTabs();
13   }
15   function check($ignore_account= FALSE)
16   {
17         return (tabs::check(TRUE));
18   }
19   
21   function save($ignore_account= FALSE)
22   {
23         $baseobject= $this->by_object['faiTemplate'];
25         $new_dn= 'cn='.$baseobject->cn.",".get_ou('faitemplateou').get_ou('faiou').session::get('CurrentMainBase');
27         $faifilter = session::get('faifilter');
28         if($faifilter['branch']!="main"){
29                 $new_dn ='cn='.$baseobject->cn.",".get_ou('faitemplateou').$faifilter['branch'];
30         }
32         if ($this->dn != $new_dn && $this->dn != "new"){
33                 
34                 /* if( new_dn is subtree of this->dn ) */
35                 $cnt1 = count(split(",",$this->dn));
36                 $cnt2 = count(split(",",$new_dn));
37                 if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){
38                         msg_dialog::display(_("Error"), _("Moving the tree failed. Destination tree is subtree of source tree."), ERROR_DIALOG);
39                 }else{
40 //                      $baseobject->recursive_move($this->dn, $new_dn);
41                 }
42         }
43         $this->dn= $new_dn;
45         tabs::save(TRUE);
46   }
48 }
50 ?>