Code

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