Code

Fix encoding of base
[gosa.git] / gosa-core / include / utils / class_msgPool.inc
index 0f81f961eeae85b9c195cd81b76eb914b819b3a2..5309dfa54687a5d4011496613074ca8443b05300 100644 (file)
@@ -12,9 +12,15 @@ class msgPool
   public static function selectToView($type,$o_type = "")
   {
     if($o_type == ""){
-      return(_("Select to list objects of type '%s'."));
+      return(sprintf(_("Select to list objects of type '%s'."),$type));
     }elseif($o_type == "contains"){
-      return(_("Select to list objects containig '%s'."));
+      return(sprintf(_("Select to list objects containig '%s'."),$type));
+    }elseif($o_type == "enabled"){
+      return(sprintf(_("Select to list objects that have '%s' enabled"),$type));
+    }elseif($o_type == "subsearch"){
+      return(_("Select to search within subtrees"));
+    }elseif($o_type == "subsearch_small"){
+      return(_("Search in subtrees"));
     }
 
   }
@@ -40,7 +46,7 @@ class msgPool
       if($type == ""){
         return (_("This object will be deleted:")."<br>".msgPool::buildList($name));
       }else{
-        return (sprintf(_("This '%s' object will be deleted:"),$type, "<br>".msgPool::buildList($name)));
+        return (sprintf(_("This '%s' object will be deleted:"),$type). "<br>".msgPool::buildList($name));
       }
     }
     if($type == ""){
@@ -194,37 +200,41 @@ class msgPool
     return (sprintf(_("Command specified as %s hook for plugin '%s' does not exist!"), $type, $plugin));
   }
 
+
   public static function cmdinvalid($type, $command = "",$plugin="")
   {
     if(empty($command)){
-      return (sprintf(_("The configured '%s' command is not a valid command."), $type));
+      return (sprintf(_("'%s' command is invalid!"), $type));
     }elseif($command != "" && $plugin != ""){
-      return (sprintf(_("The configured '%s' command (%s) in plugin %s is not a valid command."), $type,$command,$plugin));
+      return (sprintf(_("'%s' command (%s) for plugin %s is invalid!"), $type,$command,$plugin));
     }elseif($plugin != "" && $command =""){
-      return (sprintf(_("The configured '%s' command in plugin %s is not a valid command."), $type,$plugin));
+      return (sprintf(_("'%s' command for plugin %s is invalid!"), $type,$plugin));
     }else{
-      return (sprintf(_("The configured '%s' command (%s) is not a valid command."), $type,$command));
+      return (sprintf(_("'%s' command (%s) is invalid!"), $type,$command));
     }
   }
 
+
   public static function cmdexecfailed($type, $command = "",$plugin="")
   {
     if(empty($command)){
-      return (sprintf(_("The configured '%s' command wasn't successfully executed."), $type));
+      return (sprintf(_("Cannot execute '%s' command!"), $type));
     }elseif($command != "" && $plugin != ""){
-      return (sprintf(_("The configured '%s' command (%s) in plugin %s wasn't successfully executed."), $type,$command,$plugin));
+      return (sprintf(_("Cannot execute '%s' command (%s) for plugin %s!"), $type,$command,$plugin));
     }elseif($plugin != "" && $command =""){
-      return (sprintf(_("The configured '%s' command in plugin %s wasn't successfully executed."), $type,$plugin));
+      return (sprintf(_("Cannot execute '%s' command for plugin %s!"), $type,$plugin));
     }else{
-      return (sprintf(_("The configured '%s' command (%s) wasn't successfully executed."), $type,$command));
+      return (sprintf(_("Cannot execute '%s' command (%s)!"), $type,$command));
     }
   }
+
+
   public static function toobig($name, $min= "")
   {
     if ($min == ""){
       return (sprintf(_("Value for '%s' is too large!"), $name));
     } else {
-      return (sprintf(_("'%s' must be smaller than %d!"), $name, $min));
+      return (sprintf(_("'%s' must be smaller than %s!"), $name, $min));
     }
   }
 
@@ -279,10 +289,10 @@ class msgPool
       }
 
       return sprintf(_("The Field '%s' contains invalid characters"), $name).". ".
-        (strlen($mismatch)==1?sprintf(_("'%s' is not allowed:"), htmlentities($mismatch)):sprintf(_("'%s' are not allowed."), htmlentities($mismatch))).
+        (strlen($mismatch)==1?sprintf(_("'%s' is not allowed:"), htmlentities($mismatch)):sprintf(_("'%s' are not allowed!"), htmlentities($mismatch))).
         "<br><br> \"$result\"$example";
     } else {
-      return sprintf(_("The Field '%s' contains invalid characters"), $name)."!$example";
+      return sprintf(_("The Field '%s' contains invalid characters!"), $name)."!$example";
     }
   }
 
@@ -349,14 +359,16 @@ class msgPool
 
   public static function buildList($data)
   {
-    $objects= "";
+    $objects= "<ul>";
     foreach ($data as $key => $value){
       if (is_numeric($key)){
-        $objects.= "<br>\n<i>$value</i>";
+        $objects.= "<li>\n<i>$value</i></li>";
       } else {
-        $objects.= "<br>\n$value (<i>$key</i>)";
+        $objects.= "<li>\n$value (<i>$key</i>)</li>";
       }
     }
+    $objects.= "</ul>";
+    return($objects);
   }
 
   public static function noValidExtension($name)
@@ -396,7 +408,7 @@ class msgPool
           $deps.= "$dep / ";
         }
         $deps= preg_replace("/ \/ $/", "", $deps);
-        return sprintf(_("This account has %s features settings. To disable them, you'll need to add the %s settings first!"), $name, $deps);
+        return sprintf(_("This account has %s settings disabled. To enable them, you'll need to add the %s settings first!"), $name, $deps);
       }
     }
   }
@@ -434,6 +446,14 @@ class msgPool
   }
 
 
+  public static function mysqlerror($error,  $plugin= "")
+  {
+    /* Assign headline depending on type */
+    $headline= _("MySQL operation failed!");
+    return $headline."<br><br><i>"._("Error").":</i> ".$error;
+  }
+
+
   public static function ldaperror($error, $dn= "", $type= 0, $plugin= "")
   {
     /* Assign headline depending on type */
@@ -455,7 +475,7 @@ class msgPool
   }
 
 
-  function incorrectUpload($reason= "")
+  public static function incorrectUpload($reason= "")
   {
     if ($reason == ""){
       return _("Upload failed!");
@@ -464,6 +484,89 @@ class msgPool
     return sprintf(_("Upload failed: %s"), "<br><br><i>$reason</i>");
   }
 
+
+  public static function siError($error= "")
+  {
+    if ($error == ""){
+      return _("Communication failure with the infrastructure service!");
+    }
+    return sprintf(_("Communication failure with the infrastructure service: %s"), "<br><br>"._("Error").": ".$error);
+  }
+
+
+  public static function stillInUse($type, $objects= array())
+  {
+    if (!is_array($objects)){
+      return sprintf(_("This '%s' is still in use by this object: %s"), $type, "<br><br>".$objects);
+    }
+    if (count($objects) == 1){
+      return sprintf(_("This '%s' is still in use by this object: %s"), $type, "<br>".msgPool::buildList($objects));
+    }
+    if (count($objects) == 0){
+      return sprintf(_("This '%s' is still in use."), $type);
+    }
+    return sprintf(_("This '%s' is still in use by these objects: %s"), $type, "<br>".msgPool::buildList($objects));
+  }
+
+
+  public static function fileDoesNotExist($file)
+  {
+    return sprintf(_("File '%s' does not exist!"), $file);
+  }
+
+
+  public static function cannotReadFile($file)
+  {
+    return sprintf(_("Cannot open file '%s' for reading!"), $file);
+  }
+
+
+  public static function cannotWriteFile($file)
+  {
+    return sprintf(_("Cannot open file '%s' for writing!"), $file);
+  }
+
+
+  public static function invalidConfigurationAttribute($attr)
+  {
+    return sprintf(_("The value for '%s' is currently unconfigured or invalid, please check your configuration file!"), $attr);
+  }
+
+
+  public static function cannotDeleteFile($file)
+  {
+    return sprintf(_("Cannot delete file '%s'!"), $file);
+  }
+
+
+  public static function cannotCreateFolder($path)
+  {
+    return sprintf(_("Cannot create folder '%s'!"), $path);
+  }
+
+
+  public static function cannotDeleteFolder($path)
+  {
+    return sprintf(_("Cannot delete folder '%s'!"), $path);
+  }
+
+
+  public static function checkingFor($what)
+  {
+    return sprintf(_("Checking for %s support"), $what);
+  }
+
+
+  public static function installPhpModule($what)
+  {
+    return sprintf(_("Install and activate the %s PHP module."), $what);
+  }
+
+
+  public static function class_not_found($plugin)
+  {
+    return (sprintf(_("Cannot initialize class '%s'! Maybe there is a plugin missing in your gosa setup?"), $plugin));
+  }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>