From: hickert Date: Thu, 13 Mar 2008 08:07:00 +0000 (+0000) Subject: msgPool X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1ff4a2907283858f29eea394eb167f4643871ffb;p=gosa.git msgPool git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9724 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/fai/class_askClassName.inc b/gosa-plugins/fai/admin/fai/class_askClassName.inc index 2a40c6366..c803e64dc 100644 --- a/gosa-plugins/fai/admin/fai/class_askClassName.inc +++ b/gosa-plugins/fai/admin/fai/class_askClassName.inc @@ -77,13 +77,13 @@ class askClassName extends plugin * Depending on the object type we want to create, a different headline will be shown */ switch($this->objectClass) { - case "FAIpartitionTable": $str =_("Create new FAI object - partition table.");break; - case "FAIpackageList" : $str =_("Create new FAI object - package bundle.");break; - case "FAIscript" : $str =_("Create new FAI object - script bundle.");break; - case "FAIvariable" : $str =_("Create new FAI object - variable bundle.");break; - case "FAIhook" : $str =_("Create new FAI object - hook bundle.");break; - case "FAIprofile" : $str =_("Create new FAI object - profile.");break; - case "FAItemplate" : $str =_("Create new FAI object - template.");break; + case "FAIpartitionTable": $str =_("Create new FAI object")." - "._("Partition table");break; + case "FAIpackageList" : $str =_("Create new FAI object")." - "._("Package bundle");break; + case "FAIscript" : $str =_("Create new FAI object")." - "._("Script bundle");break; + case "FAIvariable" : $str =_("Create new FAI object")." - "._("Variable bundle");break; + case "FAIhook" : $str =_("Create new FAI object")." - "._("Hook bundle");break; + case "FAIprofile" : $str =_("Create new FAI object")." - "._("Profile");break; + case "FAItemplate" : $str =_("Create new FAI object")." - "._("Template bundle");break; default : $str =_("Create new FAI object");break; } $smarty->assign("headline",$str); @@ -140,15 +140,15 @@ class askClassName extends plugin $message= plugin::check(); if($this->ClassName != preg_replace("/ /","",trim($this->ClassName))){ - $message[] = _("Spaces are not allowed within class names."); + $message[] = msgPool::invalid(_("Name"),preg_replace("/ /","_",$this->ClassName),"/[^_]/"); } if(empty($this->ClassName)){ - $message[]=_("The given class name is empty."); + $message[]= msgPool::required(_("Name")); } if(in_array($this->ClassName,$this->forbidden)){ - $message[]=_("The specified class name is already in use for this object type."); + $message[]= msgPool::duplicated(_("Name")); } return ($message); diff --git a/gosa-plugins/fai/admin/fai/class_divListFai.inc b/gosa-plugins/fai/admin/fai/class_divListFai.inc index 4994be565..8c151c79d 100644 --- a/gosa-plugins/fai/admin/fai/class_divListFai.inc +++ b/gosa-plugins/fai/admin/fai/class_divListFai.inc @@ -69,13 +69,13 @@ class divListFai extends MultiSelectWindow $this->AddHeader(array("string" => _("Class type"), "attach" => "style='width:200px;'")); $this->AddHeader(array("string" => _("Actions"), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'")); - $this->AddCheckBox("ShowProfiles" , _("Display FAI profile objects") ,_("Show profiles") ,true); - $this->AddCheckBox("ShowTemplates" , _("Display FAI template objects") ,_("Show templates") ,true); - $this->AddCheckBox("ShowScripts" , _("Display FAI scripts") ,_("Show scripts") ,true); - $this->AddCheckBox("ShowHooks" , _("Display FAI hooks") ,_("Show hooks") ,true); - $this->AddCheckBox("ShowVariables" , _("Display FAI variables") ,_("Show variables") ,true); - $this->AddCheckBox("ShowPackages" , _("Display FAI packages") ,_("Show packages") ,true); - $this->AddCheckBox("ShowPartitions" , _("Display FAI partitions") ,_("Show partitions") ,true); + $this->AddCheckBox("ShowProfiles" , sprintf(_("Display objects of type '%s'."),_("Profile")) ,_("Show profiles") ,true); + $this->AddCheckBox("ShowTemplates" , sprintf(_("Display objects of type '%s'."),_("Variable")) ,_("Show templates") ,true); + $this->AddCheckBox("ShowScripts" , sprintf(_("Display objects of type '%s'."),_("Script")) ,_("Show scripts") ,true); + $this->AddCheckBox("ShowHooks" , sprintf(_("Display objects of type '%s'."),_("Hook")) ,_("Show hooks") ,true); + $this->AddCheckBox("ShowVariables" , sprintf(_("Display objects of type '%s'."),_("Variable")) ,_("Show variables") ,true); + $this->AddCheckBox("ShowPackages" , sprintf(_("Display objects of type '%s'."),_("Package")) ,_("Show packages") ,true); + $this->AddCheckBox("ShowPartitions" , sprintf(_("Display objects of type '%s'."),_("Partition")),_("Show partitions") ,true); /* Add SubSearch checkbox */ //$this->AddCheckBox(SEPERATOR); @@ -369,14 +369,14 @@ class divListFai extends MultiSelectWindow $num_deps = count($this->Added_Departments); } - $profile_str = _("Number of listed profiles"); - $partition_str = _("Number of listed partitions"); - $script_str = _("Number of listed scripts"); - $hook_str = _("Number of listed hooks"); - $variable_str = _("Number of listed variables"); - $template_str = _("Number of listed templates"); - $package_str = _("Number of listed packages"); - $dep_str = _("Number of listed departments"); + $profile_str = sprintf(_("Number of listed '%s'"),_("profiles")); + $partition_str = sprintf(_("Number of listed '%s'"),_("partitions")); + $script_str = sprintf(_("Number of listed '%s'"),_("scripts")); + $hook_str = sprintf(_("Number of listed '%s'"),_("hooks")); + $variable_str = sprintf(_("Number of listed '%s'"),_("variables")); + $template_str = sprintf(_("Number of listed '%s'"),_("templates")); + $package_str = sprintf(_("Number of listed '%s'"),_("packages")); + $dep_str = sprintf(_("Number of listed '%s'"),_("departments")); $str = "".$profile_str." ".$cnts['FAIprofile']."    "; diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc index 89bb6559d..9d935081d 100644 --- a/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -210,7 +210,7 @@ class faiManagement extends plugin } else { /* Obviously the user isn't allowed to delete. Show message and clean session. */ - msg_dialog::display(_("Permission error"), _("You have no permission to delete this entry!"), ERROR_DIALOG); + msg_dialog::display(_("Permission error"), msgPool::permDelete(),ERROR_DIALOG); } } @@ -297,7 +297,7 @@ class faiManagement extends plugin /* Normally this shouldn't be reached, send some extra logs to notify the administrator */ - msg_dialog::display(_("Permission error"), _("You have no permission to delete this entry!"), ERROR_DIALOG); + msg_dialog::display(_("Permission error"), msgPool::permDelete(), ERROR_DIALOG); new log("security","fai/".get_class($this),$dn,array(),"Tried to trick deletion."); } @@ -368,7 +368,7 @@ class faiManagement extends plugin /* Normally this shouldn't be reached, send some extra logs to notify the administrator */ - msg_dialog::display(_("Permission error"), _("You have no permission to delete this entry!"), ERROR_DIALOG); + msg_dialog::display(_("Permission error"), msgPool::permDelete(), ERROR_DIALOG); new log("security","fai/".get_class($this),$dn,array(),"Tried to trick deletion."); } @@ -494,17 +494,13 @@ class faiManagement extends plugin /* Check used characters */ if(preg_match("/[^0-9a-z \ö\ä\ü\.-_:,]/i",$name)){ - if($type == "branch"){ - msg_dialog::display(_("Error"), _("Branch name is not valid!"), ERROR_DIALOG); - }else{ - msg_dialog::display(_("Error"), _("Freeze name is not valid!"), ERROR_DIALOG); - } + msg_dialog::display(_("Error"), msgPool::invalid(_("Name"),$name,"/[0-9a-z \ö\ä\ü\.-_:,]/i"), ERROR_DIALOG); $is_ok = false; } /* Check if this name is already in use */ if(!$this->CheckNewBranchName($_POST['BranchName'],$this->DivListFai->selectedBranch)){ - msg_dialog::display(_("Error"), _("Name is already in use!"), ERROR_DIALOG); + msg_dialog::display(_("Error"), msgPool::duplicated(_("Name")), ERROR_DIALOG); $is_ok = false; } @@ -533,7 +529,7 @@ class faiManagement extends plugin if(isset($_GET['PerformBranch'])){ if(!$this->acl_is_createable()){ - msg_dialog::display(_("Permission error"), _("You have no permission to create a new branch!"), ERROR_DIALOG); + msg_dialog::display(_("Permission error"), msgPool::permCreate(_("Branch")), ERROR_DIALOG); }else{ /* Create it know */ @@ -667,7 +663,7 @@ class faiManagement extends plugin if("" != $this->config->search("faiManagement", "POSTCREATE",array('menu','tabs'))){ if(($s_action == "branch_branch")||($this->dispNewBranch)){ if(!$this->acl_is_createable()){ - msg_dialog::display(_("Permission error"), _("You have no permission to create a new branch!"), ERROR_DIALOG); + msg_dialog::display(_("Permission error"), msgPool::permCreate(_("Branch")), ERROR_DIALOG); }else{ $this->dispNewBranch=true; $smarty->assign("iframe",false); @@ -688,7 +684,7 @@ class faiManagement extends plugin if("" != $this->config->search("faiManagement", "POSTCREATE",array('menu','tabs'))){ if(($s_action == "freeze_branch")||($this->dispNewFreeze)){ if(!$this->acl_is_createable()){ - msg_dialog::display(_("Permission error"), _("You have no permission to create a new branch!"), ERROR_DIALOG); + msg_dialog::display(_("Permission error"), msgPool::permCreate(_("Branch")), ERROR_DIALOG); }else{ $this->dispNewFreeze = true; $smarty->assign("iframe",false); diff --git a/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/gosa-plugins/fai/admin/fai/class_faiPackage.inc index 44cb460fb..dba5a7a20 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPackage.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPackage.inc @@ -371,7 +371,7 @@ class faiPackage extends plugin $message= plugin::check(); if(count($this->usedPackages)==0){ - $message[]=_("Please select a least one package!"); + $message[]= _("Please select a least one package!"); } if((empty($this->FAIdebianRelease))||(empty($this->FAIdebianSection))){ diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc index a49dad40e..8e29422fb 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc @@ -400,7 +400,7 @@ class faiPartitionTableEntry extends plugin /* Check for an empty disk name */ if(empty($this->DISKcn)){ - $message[] = _("Please specify a valid disc name."); + $message[] = msgPool::required(_("Name")); } /* check every partition. @@ -428,7 +428,7 @@ class faiPartitionTableEntry extends plugin if($part['FAIfsType']!="swap" && $part['FAImountPoint'] != "-"){ if((empty($part['FAImountPoint']))||(!((preg_match("/^\/.*/",$part['FAImountPoint']))||(preg_match("/^swap$/",$part['FAImountPoint']))))){ - $message[]=sprintf(_("Please enter a valid mount point for partition %s." ),($key)); + $message[]= msgPool::invalid(sprintf(_("partition %s mount point"),$key)); } } if($part['FAIfsType'] == "swap"){ @@ -443,24 +443,24 @@ class faiPartitionTableEntry extends plugin $tmp = split("-",$part['FAIpartitionSize']); switch (count($tmp)){ case 0: - $message[]= sprintf(_("Please enter a valid partition size for partition %s."),($key)); + $message[]= msgPool::invalid(sprintf(_("partition %s size"),$key)); break; case 1: - if (!tests::is_id(is_id($tmp[0])) &&(!empty($tmp[1]))){ - $message[]= sprintf(_("Please enter a valid partition size for partition %s."),($key)); + if (!tests::is_id($tmp[0]) &&(!empty($tmp[1]))){ + $message[]= msgPool::invalid(sprintf(_("partition %s size"),$key)); } break; case 2: if((!tests::is_id($tmp[0]))&&(!tests::is_id($tmp[1])) &&(!empty($tmp[1]))){ - $message[]=sprintf(_("Please enter a valid range for partition %s."),($key)); + $message[]= msgPool::invalid(sprintf(_("partition %s size"),$key)); }elseif($tmp[0]>=$tmp[1]){ - $message[]=sprintf(_("Please enter a valid range for partition %s."),($key)); + $message[]= msgPool::invalid(sprintf(_("partition %s size"),$key)); } break; default: - $message[]=sprintf(_("Please enter a range for partition size for partition %s."),($key)); + $message[]= msgPool::invalid(sprintf(_("partition %s size"),$key)); } foreach($this->UsedAttrs as $attrs){ diff --git a/gosa-plugins/fai/admin/fai/class_faiProfile.inc b/gosa-plugins/fai/admin/fai/class_faiProfile.inc index 7f337fd80..4eec15fa0 100644 --- a/gosa-plugins/fai/admin/fai/class_faiProfile.inc +++ b/gosa-plugins/fai/admin/fai/class_faiProfile.inc @@ -295,7 +295,7 @@ class faiProfile extends plugin $objTypes['FAItemplate'] = ""; $objTypes['FAIscript'] = ""; $objTypes['FAIvariable'] = ""; - $objTypes['FAIpackageList'] = ""; + $objTypes['FAIpackageList'] = ""; $objTypes['FAIpartitionTable'] = ""; /* Delete button */ @@ -395,7 +395,7 @@ class faiProfile extends plugin } if(empty($this->cn)){ - $message[]=_("'Name' is not valid!"); + $message[]= msgPool::invalid(_("Name")); } $ldap = $this->config->get_ldap_link(); @@ -414,7 +414,7 @@ class faiProfile extends plugin } if($ldap->count() || isset($this->FAIAllclasses[$this->cn])){ - $message[]=_("Name is already in use!"); + $message[]= msgPool::duplicated(_("Name")); } return ($message); diff --git a/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc b/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc index 21d7bc0f0..92ba68d20 100644 --- a/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc @@ -95,15 +95,15 @@ class faiVariableEntry extends plugin $message= plugin::check(); if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){ - $message[] =_("There is already a variable with the given name."); + $message[] = msgPool::duplicate(_("Name")); } if(empty($this->FAIvariableContent)) { - $message[]=_("Please specify a value for the attribute 'content'."); + $message[]= msgPool::required(_("Content")); } if(empty($this->cn)){ - $message[] = _("Please enter a name."); + $message[] = msgPool::required(_("Name")); } return ($message);