From e8708f7d042edf4cb0775ebb264843cbcd28204f Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 13 Mar 2008 14:26:15 +0000 Subject: [PATCH] msgPool git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9747 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/goto/class_ArpNewDevice.inc | 2 +- .../admin/systems/goto/class_printGeneric.inc | 24 +++++++++---------- .../systems/goto/class_terminalGeneric.inc | 10 ++++---- .../admin/systems/goto/class_terminalInfo.inc | 4 ++-- .../systems/goto/class_terminalService.inc | 10 ++++---- .../systems/goto/class_terminalStartup.inc | 4 ++-- .../systems/goto/class_workstationGeneric.inc | 10 ++++---- .../systems/goto/class_workstationService.inc | 8 +++---- .../systems/goto/class_workstationStartup.inc | 4 ++-- 9 files changed, 37 insertions(+), 39 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/class_ArpNewDevice.inc b/gosa-plugins/goto/admin/systems/goto/class_ArpNewDevice.inc index 455406ae8..40251a966 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_ArpNewDevice.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_ArpNewDevice.inc @@ -43,7 +43,7 @@ class ArpNewDevice extends plugin $message= plugin::check(); $message= array_merge($message, $this->netConfigDNS->check()); if(empty($this->cn)){ - $message[] = _("Please specify a valid dns name."); + $message[] = msgPool::required(_("Name.")); } return($message); } diff --git a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc index 0b89ef20e..1c974684e 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc @@ -311,7 +311,7 @@ class printgeneric extends plugin /* Do we represent a valid printer? */ if (!$this->is_account && $this->parent === NULL){ $display= "\"\" ". - _("This 'dn' has no printer features.").""; + msgPool::noValidExtension(_("printer")).""; return($display); } @@ -319,7 +319,7 @@ class printgeneric extends plugin if(!preg_match("/^Printer$/i",$this->BelongsTo)){ if((empty($this->cn)) && ($this->dn != "new")){ $display= $this->show_enable_header(_("Add printer extension"), - _("This object has printer extension disabled. You can't enable it while 'cn' is not present in entry. Possibly you are currently creating a new terminal template"),TRUE,TRUE); + msgPool::featuresDisabled(_("printer"))._("You can't enable it while 'cn' is not present in entry. Possibly you are currently creating a new terminal template."),TRUE,TRUE); $this->is_account= false; return $display; } @@ -327,18 +327,18 @@ class printgeneric extends plugin if (($this->is_account)){ if(preg_match("/^Workstation$/i",$this->BelongsTo)){ $display= $this->show_disable_header(_("Remove printer extension"), - _("This workstation has printer extension enabled.You can disable it by clicking below.")); + msgPool::featuresEnabled(_("printer"))); }elseif(preg_match("/^Terminal$/i",$this->BelongsTo)){ $display= $this->show_disable_header(_("Remove printer extension"), - _("This terminal has printer extension enabled. You can disable it by clicking below.")); + msgPool::featuresDisabled(_("printer"))); } }else{ if(preg_match("/^Workstation$/i",$this->BelongsTo)){ $display= $this->show_disable_header(_("Add printer extension"), - _("This workstation has printer extension disabled. You can enable it by clicking below.")); + msgPool::featuresEnabled(_("printer"))); }elseif(preg_match("/^Terminal$/i",$this->BelongsTo)){ $display= $this->show_enable_header(_("Add printer extension"), - _("This terminal has printer extension disabled. You can enable it by clicking below.")); + msgPool::featuresDisabled(_("printer"))); } return ($display); } @@ -529,9 +529,9 @@ class printgeneric extends plugin if(!preg_match("/Printer/i",$this->BelongsTo)){ if(preg_match("/Terminal/i",$this->BelongsTo)){ - $smarty->assign("desc" ,sprintf(_("This printer belongs to terminal %s. You can't rename this printer."),"".$this->cn."")); + $smarty->assign("desc" ,sprintf(_("This printer belongs to %s. You can't rename this printer."),_("terminal"),"".$this->cn."")); }else{ - $smarty->assign("desc" ,sprintf(_("This printer belongs to workstation %s. You can't rename this printer."),"".$this->cn."")); + $smarty->assign("desc" ,sprintf(_("This printer belongs to %s. You can't rename this printer."),_("workstation"),"".$this->cn."")); } $smarty->assign("cnACL" , $this->getacl("cn",true)); }else{ @@ -665,17 +665,17 @@ class printgeneric extends plugin /* must: cn */ if(($this->BelongsTo == "Printer") && (empty($this->cn))){ - $message[]= _("The required field 'Printer name' is not set."); + $message[]= msgPool::required(_("Name")); } /* must: cn */ if(($this->BelongsTo == "Printer") && !tests::is_dns_name($this->cn)){ - $message[]= _("Invalid character in printer name."); + $message[]= msgPool::invalid(_("Name")); } /* must: labeledURI */ if(empty($this->labeledURI)){ - $message[]= "The required field 'Printer URL' is not set."; + $message[]= msgPool::required(_("Printer URL")); } /* Check if there is already an entry with this cn*/ @@ -689,7 +689,7 @@ class printgeneric extends plugin continue; } if ($attrs['dn'] != $this->orig_dn){ - $message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn); + $message[]= msgPool::duplicated(_("Name")); break; } } diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc index 7928972f7..dbdb6a10c 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc @@ -216,7 +216,7 @@ class termgeneric extends plugin /* Do we represent a valid terminal? */ if (!$this->is_account && $this->parent === NULL){ $display= "\"\" ". - _("This 'dn' has no terminal features.").""; + msgPool::noValidExtension(_("terminal")).""; return($display); } @@ -398,12 +398,12 @@ class termgeneric extends plugin $this->dn= "cn=".$this->cn.",".get_ou('terminalou').$this->base; if ($this->cn == ""){ - $message[]= _("The required field 'Terminal name' is not set."); + $message[]= msgPool::required(_("Name")); } /* Check if given name is a valid host/dns name */ if(!tests::is_dns_name($this->cn) ){ - $message[] = _("Please specify a valid name for this object."); + $message[] = msgPool::invalid(_("Name")); } if ($this->orig_dn == 'new'){ @@ -422,7 +422,7 @@ class termgeneric extends plugin continue; } else { if ($attrs['dn'] != $this->orig_dn){ - $message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn); + $message[]= msgPool::duplicated(_("Name")); break; } } @@ -432,7 +432,7 @@ class termgeneric extends plugin /* Check for valid ntpServer selection */ if((!$this->inheritTimeServer) && (!count($this->gotoNtpServer))){ - $message[]= _("There must be at least one NTP server selected, or the inherit mode activated."); + $message[]= msgPool::required(_("NTP server")); } return ($message); diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalInfo.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalInfo.inc index 7a3313397..64096c4f6 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalInfo.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalInfo.inc @@ -65,13 +65,13 @@ class terminfo extends plugin /* Do we represent a valid terminal? */ if (!$this->is_account && $this->parent === NULL){ return("\"\" ". - _("This 'dn' has no terminal features.").""); + msgPool::noValidExtension(_("terminal")).""); } $smarty= get_smarty(); $display= ""; if(!is_callable("snmpget")){ - print_red(_("There is no php snmp module installed, can't gather any informations.")); + print_red(msgPool::missingext("snmp")); $smarty->assign("load", progressbar(0,100,15,true)); $smarty->assign("mem", progressbar(0,100,15,true)); diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc index 63fe1fce1..9ba040b90 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc @@ -485,13 +485,12 @@ class termservice extends plugin /* Check vsync for correct usage */ $val= preg_replace ("/\s/", "", $this->gotoXVsync); if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val) && $this->acl_is_writeable("gotoXVsync")){ - - $message[]= _("Please specify a valid VSync range."); + $message[]= msgPool::invalid(_("VSync range")); } elseif ($this->acl_is_writeable("gotoXVsync")){ list($v1,$v2)= preg_split ("/[-+]/", $val); if ($v2 != ""){ if ($v1 > $v2){ - $message[]= _("Please specify a valid VSync range."); + $message[]= msgPool::invalid(_("VSync range")); } } } @@ -499,13 +498,12 @@ class termservice extends plugin /* Check hsync for correct usage */ $val= preg_replace ("/\s/", "", $this->gotoXHsync); if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val) && $this->acl_is_writeable("gotoXHsync")){ - - $message[]= _("Please specify a valid HSync range."); + $message[]= msgPool::invalid(_("HSync range")); } elseif ($this->acl_is_writeable("gotoXHsync")){ list($v1,$v2)= preg_split ("/[-+]/", $val); if ($v2 != ""){ if ($v1 > $v2){ - $message[]= _("Please specify a valid HSync range."); + $message[]= msgPool::invalid(_("HSync range")); } } } diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc index c0d4a5803..6f7d61a38 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalStartup.inc @@ -162,7 +162,7 @@ class termstartup extends plugin /* Do we represent a valid terminal? */ if (!$this->is_account && $this->parent === NULL){ $display= "\"\" ". - _("This 'dn' has no terminal features.").""; + msgPool::noValidExtension(_("terminal")).""; return ($display); } @@ -204,7 +204,7 @@ class termstartup extends plugin if(isset($_POST['gotoShareAdd']) && $this->acl_is_writeable("gotoShare")){ /* We assign a share to this user, if we don't know where to mount the share */ if((!isset($_POST['gotoShareMountPoint']))||(empty($_POST['gotoShareMountPoint']))||(preg_match("/[\|]/i",$_POST['gotoShareMountPoint']))){ - print_red(_("You must specify a valid mount point.")); + print_red(msgPool::invalid(_("Mount point"))); }else{ $a_share = $this->gotoAvailableShares[$_POST['gotoShareSelection']]; $s_mount = $_POST['gotoShareMountPoint']; diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc index a2469a6a6..d092278bf 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc @@ -210,7 +210,7 @@ class workgeneric extends plugin /* Do we represent a valid terminal? */ if (!$this->is_account && $this->parent === NULL){ $display= "\"\" ". - _("This 'dn' has no workstation features.").""; + msgPool::noValidExtension(_("workstation")).""; return($display); } @@ -419,12 +419,12 @@ class workgeneric extends plugin $this->dn= "cn=".$this->cn.",".get_ou('workstationou').$this->base; if ($this->cn == ""){ - $message[]= _("The required field 'Workstation name' is not set."); + $message[]= msgPool::required(_("Name")); } /* Check if given name is a valid host/dns name */ if(!tests::is_dns_name($this->cn)){ - $message[] = _("Please specify a valid name for this object."); + $message[] = msgPool::invalid(_("Name")); } if ($this->orig_dn != $this->dn){ @@ -442,7 +442,7 @@ class workgeneric extends plugin continue; } else { if ($attrs['dn'] != $this->orig_dn){ - $message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn); + $message[]= msgPool::duplicated(_("Name")); break; } } @@ -452,7 +452,7 @@ class workgeneric extends plugin /* Check for valid ntpServer selection */ if((!$this->inheritTimeServer) && (!count($this->gotoNtpServer))){ - $message[]= _("There must be at least one NTP server selected, or the inherit mode activated."); + $message[]= msgPool::required(_("NTP server")); } /* Warn the user, that this host is currently installing */ diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc index d10108a2a..438d0b680 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc @@ -385,12 +385,12 @@ class workservice extends plugin if($this->acl_is_writeable("gotoXVsync")){ if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val)){ - $message[]= _("Please specify a valid VSync range."); + $message[]= msgPool::invalid(_("VSync")); } else{ list($v1,$v2)= preg_split ("/[-+]/", $val); if ($v2 != ""){ if ($v1 > $v2){ - $message[]= _("Please specify a valid VSync range."); + $message[]= msgPool::invalid(_("VSync")); } } } @@ -400,12 +400,12 @@ class workservice extends plugin $val= preg_replace ("/\s/", "", $this->gotoXHsync); if($this->acl_is_writeable("gotoXHsync")){ if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val)){ - $message[]= _("Please specify a valid HSync range."); + $message[]= msgPool::invalid(_("HSync")); } else{ list($v1,$v2)= preg_split ("/[-+]/", $val); if ($v2 != ""){ if ($v1 > $v2){ - $message[]= _("Please specify a valid HSync range."); + $message[]= msgPool::invalid(_("HSync")); } } } diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc index 59582f76d..fc4487d3d 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc @@ -327,7 +327,7 @@ class workstartup extends plugin /* Do we represent a valid terminal? */ if (!$this->is_account && $this->parent === NULL){ $display= "\"\" ". - _("This 'dn' has no terminal features.").""; + msgPool::noValidExtension(_("workstation")).""; return ($display); } @@ -474,7 +474,7 @@ class workstartup extends plugin if((isset($_POST['gotoShareAdd'])) && ($this->acl_is_writeable("gotoShare"))) { /* We assign a share to this user, if we don't know where to mount the share */ if((!isset($_POST['gotoShareMountPoint']))||(empty($_POST['gotoShareMountPoint']))||(preg_match("/[\|]/i",$_POST['gotoShareMountPoint']))){ - print_red(_("You must specify a valid mount point.")); + print_red(msgPool::required(_("Mount point"))); }else{ if(count($this->gotoAvailableShares)){ $a_share = $this->gotoAvailableShares[$_POST['gotoShareSelection']]; -- 2.30.2