From 7eb36d5455f2f0e7125d17bb6443b2c59049b14b Mon Sep 17 00:00:00 2001 From: lhm-gosa Date: Tue, 31 Aug 2010 08:29:44 +0000 Subject: [PATCH] Correctly display and save PPDs when an option is not translated. (TRAC #5063) git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@19498 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/admin/systems/ppd/class_ppdManager.inc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/trunk/gosa-plugins/goto/admin/systems/ppd/class_ppdManager.inc b/trunk/gosa-plugins/goto/admin/systems/ppd/class_ppdManager.inc index 64d23e3fd..4a6d16556 100644 --- a/trunk/gosa-plugins/goto/admin/systems/ppd/class_ppdManager.inc +++ b/trunk/gosa-plugins/goto/admin/systems/ppd/class_ppdManager.inc @@ -279,8 +279,16 @@ class ppdManager /* Possible value? */ if (preg_match("@^\*$eoption\s+@", $line)){ #*PageSize Letter/US Letter: "<>setpagedevice" - $c= preg_replace("@^\*$eoption\s+([^/]+).*$@", "$1", $line); + /* Options can have one of 2 forms: + *OptionName OptionValue/TranslationOfValue: ... + *OptionName OptionValue: ... + i.e. there may be a translation or not. + */ + $c= preg_replace("@^\*$eoption\s+([^/:]+).*$@", "$1", $line); $d= preg_replace("@^\*$eoption\s+[^/]+/([^:]+).*$@", "$1", $line); + if ($d == $line) { /* if there is no translation, use untranslated value*/ + $d = "$c"; + } if(empty($group)){ $properties["NO_SECTION"][$option][trim($c)]= trim($d); }else{ -- 2.30.2