From: cajus Date: Fri, 7 Mar 2008 10:48:43 +0000 (+0000) Subject: Updated pool X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=33cd83cbbf1ae8092db23b43abf962224e2d7109;p=gosa.git Updated pool git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9431 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/utils/class_msgPool.inc b/gosa-core/include/utils/class_msgPool.inc index cf25cd10f..a44b2496c 100644 --- a/gosa-core/include/utils/class_msgPool.inc +++ b/gosa-core/include/utils/class_msgPool.inc @@ -2,6 +2,79 @@ class msgPool { + public static function permDelete($name= "") + { + if ($name == "") { + return (_("You have no permission to delete this object!")); + } + + if (!is_array($name)){ + return (_("You have no permission to delete the object:")."

$name"); + } + + msgPool::buildList($name); + if (count($name) == 1){ + return (_("You have no permission to delete the object:")."
".msgPool::buildList($name)); + } + + return (_("You have no permission to delete these objects:")."
".msgPool::buildList($name)); + } + + + public static function permCreate($name= "") + { + if ($name == "") { + return (_("You have no permission to create this object!")); + } + + if (!is_array($name)){ + return (_("You have no permission to create the object:")."

$name"); + } + + if (count($name) == 1){ + return (_("You have no permission to create the object:")."
".msgPool::buildList($name)); + } + + return (_("You have no permission to create these objects:")."
".msgPool::buildList($name)); + } + + + public static function permModify($name= "") + { + if ($name == "") { + return (_("You have no permission to modify this object!")); + } + + if (!is_array($name)){ + return (_("You have no permission to modify the object:")."

$name"); + } + + if (count($name) == 1){ + return (_("You have no permission to modify the object:")."
".msgPool::buildList($name)); + } + + return (_("You have no permission to modify these objects:")."
".msgPool::buildList($name)); + } + + + public static function permMove($name= "") + { + if ($name == "") { + return (_("You have no permission to move this object!")); + } + + if (!is_array($name)){ + return (_("You have no permission to move the object:")."

$name"); + } + + if (count($name) == 1){ + return (_("You have no permission to move the object:")."
".msgPool::buildList($name)); + } + + return (_("You have no permission to move these objects:")."
".msgPool::buildList($name)); + } + + public static function dbconnect($name, $error= "", $dbinfo= "") { if ($error != ""){ @@ -183,4 +256,18 @@ class msgPool return $what == "" ? sprintf(_("Edit..."): sprintf(_("Edit %s..."), $what)); } + + public static function buildList($data) + { + $objects= ""; + foreach ($name as $key => $value){ + if (is_numeric($key)){ + $objects.= "
\n$value"; + } else { + $objects.= "
\n$key ($value)"; + } + } + } + + }