Code

Moved folder image
[gosa.git] / gosa-plugins / goto / admin / mimetypes / class_mimetypeManagement.inc
index 7af6280d70ceddc8439d09d2b68f9b252844ce6f..44fada93940f0eb0d48d640f2bb5c00c4dfd0e0f 100644 (file)
@@ -242,7 +242,7 @@ class mimetypeManagement extends plugin
       } else {
         /* Ok. There seem to be errors regarding to the tab data,
            show message and continue as usual. */
-        show_errors($message);
+        msg_dialog::displayChecks($message);
       }
     }
 
@@ -293,19 +293,14 @@ class mimetypeManagement 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("info", msgPool::deleteInfo($dns_names,_("Mime type")));
         $smarty->assign("multiple", true);
         return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
       }
@@ -339,7 +334,7 @@ class mimetypeManagement 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 mime type!"));
+          msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
           new log("security","mimetypes/".get_class($this),$dn,array(),"Tried to trick deletion.");
         }
         /* Remove lock file after successfull deletion */
@@ -387,14 +382,14 @@ class mimetypeManagement 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 mime type '%s'."), @LDAP::fix($this->dn)));
+        $smarty->assign("info", msgPool::deleteInfo(@LDAP::fix($this->dn),_("Mime type")));
         $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 mime type!"));
+        msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
       }
     }
 
@@ -423,7 +418,7 @@ class mimetypeManagement 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 mime type!"));
+        msg_dialog::display(_("Permission error"), msgPool::permDelete(), INFO_DIALOG);
         new log("security","mimetypes/".get_class($this),$dn,array(),"Tried to trick deletion.");
       }
 
@@ -449,13 +444,13 @@ class mimetypeManagement extends plugin
       /* Don't show buttons if tab dialog requests this */
       if (!$this->mimetabs->by_object[$this->mimetabs->current]->dialog){
         $display.= "<p style=\"text-align:right\">\n";
-        $display.= "<input type=\"submit\" name=\"edit_finish\" style=\"width:80px\" value=\""._("Ok")."\">\n";
+        $display.= "<input type=\"submit\" name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
         $display.= "&nbsp;\n";
         if ($this->dn != "new"){
-          $display.= "<input type=submit name=\"edit_apply\" value=\""._("Apply")."\">\n";
+          $display.= "<input type=submit name=\"edit_apply\" value=\"".msgPool::applyButton()."\">\n";
           $display.= "&nbsp;\n";
         }
-        $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
+        $display.= "<input type=\"submit\" name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
         $display.= "</p>";
       }
       return ($display);
@@ -594,12 +589,9 @@ class mimetypeManagement extends plugin
     /* Return C&P dialog */
     if($this->start_pasting_copied_objects && $this->CopyPasteHandler->entries_queued()){
 
-      /* Load entry from queue and set base */
-      $this->CopyPasteHandler->load_entry_from_queue();
-      $this->CopyPasteHandler->SetVar("base",$this->DivListMimeTypes->selectedBase);
-
       /* Get dialog */
       $data = $this->CopyPasteHandler->execute();
+      $this->CopyPasteHandler->SetVar("base",$this->DivListMimeTypes->selectedBase);
 
       /* Return dialog data */
       if(!empty($data)){
@@ -656,10 +648,13 @@ class mimetypeManagement extends plugin
 
   function save_object() {
     $this->DivListMimeTypes->save_object();
+    if(is_object($this->CopyPasteHandler)){
+      $this->CopyPasteHandler->save_object();
+    }
   }
 
   function check() {}
-  function adapt_from_template($dn) {}
+  function adapt_from_template($dn, $skip= array()) {}
   function password_change_needed() {}
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: