From b97327caa07546659cc3baeb12c36dc1b8f9c23d Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 4 Jan 2008 16:56:55 +0000 Subject: [PATCH] Replaced a bunch of print_red's git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8228 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_log.inc | 14 +++++++------- gosa-core/include/class_plugin.inc | 12 ++++++------ gosa-core/include/class_pluglist.inc | 2 +- gosa-core/include/class_ppdManager.inc | 8 ++++---- gosa-core/include/functions_FAI.inc | 2 +- gosa-core/include/functions_dns.inc | 6 +++--- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/gosa-core/include/class_log.inc b/gosa-core/include/class_log.inc index 66db8d001..859b1c0f8 100644 --- a/gosa-core/include/class_log.inc +++ b/gosa-core/include/class_log.inc @@ -84,7 +84,7 @@ class log { if(count($msgs)){ foreach($msgs as $msg){ trigger_error("Logging failed, reason was: ".$msg); - print_red("Logging failed, reason was: ".$msg); + msg_dialog::display(_("Internal error"), sprintf(_("Logging failed: %s"), $msg), ERROR_DIALOG); } }else{ @@ -116,11 +116,11 @@ class log { $msgs = array(); if(!isset($entry['action']) || !in_array($entry['action'],array("modify","create","remove","copy","snapshot","view","security","debug"))){ - $msgs[] = "Invalid option specified '".$entry['action']."'"; + $msgs[] = sprintf(_("Invalid option '%s' specified."), $entry['action']); } if(!isset($entry['objecttype']) || empty($entry['objecttype'])){ - $msgs[] = "Specified objectType is empty or invalid."; + $msgs[] = _("Specified objectType is empty or invalid"); } return($msgs); @@ -141,7 +141,7 @@ class log { if(isset($this->config->data['SERVERS']['LOGGING'])){ $servers = $this->config->data['SERVERS']['LOGGING']; }else{ - print_red(_("You have enabled the logging into mysql databse, but there are no logging servers available.")); + msg_dialog::display(_("Error"), _("You have enabled the logging into mysql databse, but there are no logging servers available."), ERROR_DIALOG); return(FALSE); } @@ -149,12 +149,12 @@ class log { $con = @mysql_pconnect($server_name,$server['USER'],$server['PWD']); if(!$con){ - print_red(sprintf(_("Could not connect to logging server %s."),$server_name)); + msg_dialog::display(_("Error"), sprintf(_("Cannot connect to logging server '%s'."),$server_name), ERROR_DIALOG); return(FALSE); }else{ $db = mysql_select_db($server['DB'],$con); if(!$db){ - print_red(sprintf(_("Could not select database %s on server %s. Server says :%s"),$server['DB'],$server['SERVER'],mysql_error($con))); + msg_dialog::display(_("Error"), sprintf(_("Cannot select database '%s' on server '%s': %s"),$server['DB'],$server['SERVER'], mysql_error($con)), ERROR_DIALOG); return(FALSE); }else{ @@ -174,7 +174,7 @@ class log { "; $res = mysql_query($query,$con); if(!$res){ - print_red(sprintf(_("Could not query database %s on server %s. Server says :%s"),$server['DB'],$server['SERVER'],mysql_error($con))); + msg_dialog::display(_("Error"), sprintf(_("Cannot query database '%s' on server '%s': %s"),$server['DB'],$server['SERVER'], mysql_error($con)), ERROR_DIALOG); return(FALSE); } } diff --git a/gosa-core/include/class_plugin.inc b/gosa-core/include/class_plugin.inc index 15c44975d..9e5d706d3 100644 --- a/gosa-core/include/class_plugin.inc +++ b/gosa-core/include/class_plugin.inc @@ -623,7 +623,7 @@ class plugin exec($command); } else { $message= sprintf(_("Command '%s', specified as POSTCREATE for plugin '%s' doesn't seem to exist."), $command, get_class($this)); - print_red ($message); + msg_dialog::display(_("Error"), $message, ERROR_DIALOG); } } } @@ -655,7 +655,7 @@ class plugin exec($command); } else { $message= sprintf(_("Command '%s', specified as POSTMODIFY for plugin '%s' doesn't seem to exist."), $command, get_class($this)); - print_red ($message); + msg_dialog::display(_("Error"), $message, ERROR_DIALOG); } } } @@ -691,7 +691,7 @@ class plugin exec($command); } else { $message= sprintf(_("Command '%s', specified as POSTREMOVE for plugin '%s' doesn't seem to exist."), $command, get_class($this)); - print_red ($message); + msg_dialog::display(_("Error"), $message, ERROR_DIALOG); } } } @@ -1212,7 +1212,7 @@ class plugin /* Check if the snapshot_base is defined */ if(!isset($tmp['SNAPSHOT_BASE'])){ - print_red(sprintf(_("The snapshot functionality is enabled, but the required variable '%s' is not configured in your gosa.conf."),"SNAPSHOT_BASE")); + msg_dialog::display(_("Configuration error"), sprintf(_("The snapshot functionality is enabled, but the required variable '%s' is not set."),"SNAPSHOT_BASE"), ERROR_DIALOG); return(FALSE); } @@ -1224,7 +1224,7 @@ class plugin foreach(array("SNAPSHOT_SERVER","SNAPSHOT_USER","SNAPSHOT_PASSWORD","SNAPSHOT_BASE") as $var){ if(!isset($tmp[$var])){ $missing .= $var." "; - print_red(sprintf(_("The snapshot functionality is enabled, but the required variable(s) '%s' is not configured in your gosa.conf."),$missing)); + msg_dialog::display(_("Configuration error"), sprintf(_("The snapshot functionality is enabled, but the required variable '%s' is not set."), $missing), ERROR_DIALOG); return(FALSE); } } @@ -1449,7 +1449,7 @@ class plugin $msgs = $this->snapDialog->check(); if(count($msgs)){ foreach($msgs as $msg){ - print_red($msg); + msg_dialog::display(_("Error"), $msg, ERROR_DIALOG); } }else{ $this->dn = $this->snapDialog->dn; diff --git a/gosa-core/include/class_pluglist.inc b/gosa-core/include/class_pluglist.inc index 4871a710d..1bce72412 100644 --- a/gosa-core/include/class_pluglist.inc +++ b/gosa-core/include/class_pluglist.inc @@ -147,7 +147,7 @@ class pluglist { /* Read information from class variable */ if (!isset($info['CLASS'])){ - print_red(_("Your gosa.conf format has changed. Please re-run setup!")); + msg_dialog::display(_("Configuration error"), _("The configuration format has changed. Please re-run setup!"), ERROR_DIALOG); display_error_page(); } $vars= get_class_vars($info['CLASS']); diff --git a/gosa-core/include/class_ppdManager.inc b/gosa-core/include/class_ppdManager.inc index a9dfd1a7f..06996b18e 100644 --- a/gosa-core/include/class_ppdManager.inc +++ b/gosa-core/include/class_ppdManager.inc @@ -9,9 +9,9 @@ class ppdManager function ppdManager($path) { if(is_dir($path)){ - $this->path= $path; + $this->path= $path; }else{ - print_red(sprintf(_("PPD manager : The specified path '%s' doesn't exists."),$path)); + msg_dialog::display(_("PPD manager error"), sprintf(_("The specified path '%s' does not exist."),$path), ERROR_DIALOG); return (false); } } @@ -142,9 +142,9 @@ class ppdManager function saveProperties($ppdFile, $properties) { if(!is_readable($ppdFile)){ - print_red(sprintf(_("Specified ppd file '%s' can't be opened for reading."),$ppdFile)); + msg_dialog::display(_("PPD manager error"), sprintf(_("Specified PPD file '%s' cannot be opened for reading."),$ppdFile), ERROR_DIALOG); }elseif(!is_writeable(preg_replace("#(^.*/).*$#","\\1",$ppdFile.".tmp"))){ - print_red(sprintf(_("The required tmp file file '%s' can't be opened for writing."),$ppdFile.".tmp")); + msg_dialog::display(_("PPD manager error"), sprintf(_("The temporary file '%s' cannot be opened for writing."),$ppdFile.".tmp"), ERROR_DIALOG); }else{ foreach ($properties as $name => $section){ foreach ($section as $attribute => $value){ diff --git a/gosa-core/include/functions_FAI.inc b/gosa-core/include/functions_FAI.inc index ee72dd9ca..7b2b6170f 100644 --- a/gosa-core/include/functions_FAI.inc +++ b/gosa-core/include/functions_FAI.inc @@ -376,7 +376,7 @@ function save_release_changes_now() save_FAI_object($parent_obj,$objectAttrs); if(($parent_obj != $Current_DN)){ - print_red(sprintf(_("Error, following objects should be equal '%s' and '%s'"),$parent_obj,$Current_DN)); + msg_dialog::display(_("Error"), sprintf(_("Error, following objects should be equal '%s' and '%s'"),$parent_obj,$Current_DN), ERROR_DIALOG); } } } diff --git a/gosa-core/include/functions_dns.inc b/gosa-core/include/functions_dns.inc index 7ce7c33ef..f758f9a40 100644 --- a/gosa-core/include/functions_dns.inc +++ b/gosa-core/include/functions_dns.inc @@ -163,12 +163,12 @@ function getDNSZoneEntries($config,$HostDn,$silent = false) if($ldap->count() == 0){ if(!$silent){ - print_red(sprintf(_("Can't find reverse zone for dns zone '%s'. Aborting parsing this zone."),$zoneName)); + msg_dialog::display(_("Error"), sprintf(_("Cannot find reverse zone for DNS zone '%s'. Parsing zone aborted."),$zoneName), ERROR_DIALOG); } unset($Zones[$zoneName]); }elseif($ldap->count()>1){ if(!$silent){ - print_red(sprintf(_("Found more than one reverse zone for dns zone '%s'. Aborting parsing this zone."),$zoneName)); + msg_dialog::display(_("Error"), sprintf(_("Found more than one reverse zone for '%s'. Parsing zone aborted."),$zoneName), ERROR_DIALOG); } unset($Zones[$zoneName]); }else{ @@ -612,7 +612,7 @@ function getDNSZoneDN($config,$zoneNameMix) { $ret = ""; if(!strstr($zoneNameMix, '/')) { - print_red(sprintf(_("Undefined zone name '%s'. Zone name must look like this 'server/zone.com'."),$zoneNameMix)); + msg_dialog::display(_("Error"), sprintf(_("Undefined zone name '%s'!"),$zoneNameMix), ERROR_DIALOG); return($ret); } -- 2.30.2