Code

Added "Select all" tooltip
[gosa.git] / gosa-plugins / goto / admin / devices / class_deviceManagement.inc
index 97152c8d35e19c3d01b59cf449593bc9ab8d123c..6972caefa8d1069ca5fc529179b6cf5a64d35cb3 100644 (file)
@@ -4,8 +4,8 @@ class deviceManagement extends plugin
 {
 
   /* Definitions */
-  var $plHeadline     = "Devices";
-  var $plDescription  = "Manage devices";
+  var $plHeadline     = "Hotplug devices";
+  var $plDescription  = "Manage hotplug devices";
 
   /* Dialog attributes */
   var $ui                             = NULL;
@@ -181,7 +181,7 @@ class deviceManagement extends plugin
       } else {
        /* Ok. There seem to be errors regarding to the tab data,
            show message and continue as usual. */
-        msgDialog::displayChecks($message);
+        msg_dialog::displayChecks($message);
       }
     }
 
@@ -230,19 +230,14 @@ class deviceManagement extends plugin
           $this->dns[$id] = $dn;
         }
 
-        $dns_names = "<br><pre>";
+        $dns_names = array();
         foreach($this->dns as $dn){
           add_lock ($dn, $this->ui->dn);
-          $dns_names .= $dn."\n";
+          $dns_names[] =@LDAP::fix($dn);
         }
-        $dns_names .="</pre>";
 
         /* Lock the current entry, so nobody will edit it during deletion */
-        if (count($this->dns) == 1){
-          $smarty->assign("intro",     sprintf(_("You're about to delete the following entry %s"), @LDAP::fix($dns_names)));
-        } else {
-          $smarty->assign("intro",     sprintf(_("You're about to delete the following entries %s"), @LDAP::fix($dns_names)));
-        }
+        $smarty->assign("intro", msgPool::deleteInfo($dns_names),_("device"));
         $smarty->assign("multiple", true);
         return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
       }
@@ -274,7 +269,7 @@ class deviceManagement extends plugin
         } else {
           /* Normally this shouldn't be reached, send some extra
              logs to notify the administrator */
-          print_red (_("You are not allowed to delete this device type!"));
+          msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
           new log("security","devices/".get_class($this),$dn,array(),"Tried to trick deletion.");
         }
         /* Remove lock file after successfull deletion */
@@ -322,14 +317,14 @@ class deviceManagement extends plugin
         /* Lock the current entry, so nobody will edit it during deletion */
         add_lock ($this->dn, $this->ui->dn);
         $smarty= get_smarty();
-        $smarty->assign("intro", sprintf(_("You're about to delete the device '%s'."), @LDAP::fix($this->dn)));
+        $smarty->assign("intro", msgPool::deleteInfo(@LDAP::fix($this->dn),_("device")));
         $smarty->assign("multiple", false);
         return($smarty->fetch (get_template_path('remove.tpl', TRUE)));
       } else {
 
         /* Obviously the user isn't allowed to delete. Show message and
            clean session. */
-       print_red (_("You are not allowed to delete this device!"));
+          msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
       }
     }
 
@@ -358,7 +353,7 @@ class deviceManagement extends plugin
 
         /* Normally this shouldn't be reached, send some extra
            logs to notify the administrator */
-        print_red (_("You are not allowed to delete this device!"));
+        msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
         new log("security","devices/".get_class($this),$dn,array(),"Tried to trick deletion.");
       }
 
@@ -419,6 +414,9 @@ class deviceManagement extends plugin
 
   function save_object() {
     $this->DivListDevices->save_object();
+    if(is_object($this->CopyPasteHandler)){
+      $this->CopyPasteHandler->save_object();
+    }
   }