From c163b5d75a7e7cc79d01877fd52abfcbd8060e7b Mon Sep 17 00:00:00 2001 From: psc Date: Mon, 19 Oct 2009 08:47:53 +0000 Subject: [PATCH] Handle a special case in debconf configuration Use a text field for select fields which don't have a proper list of choices, instead of a useless "Need some text..." choice and show a warning about the requirements of such a field. (Trac: #868) git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@14601 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../fai/admin/fai/class_debconfTemplate.inc | 48 ++++++++++--------- .../fai/locale/de/LC_MESSAGES/messages.po | 39 ++++++++++----- trunk/gosa-plugins/fai/locale/messages.po | 31 +++++++----- 3 files changed, 73 insertions(+), 45 deletions(-) diff --git a/trunk/gosa-plugins/fai/admin/fai/class_debconfTemplate.inc b/trunk/gosa-plugins/fai/admin/fai/class_debconfTemplate.inc index bbbbbadf2..2e9fca6b3 100644 --- a/trunk/gosa-plugins/fai/admin/fai/class_debconfTemplate.inc +++ b/trunk/gosa-plugins/fai/admin/fai/class_debconfTemplate.inc @@ -190,7 +190,10 @@ class debconf if ((isset($entry['Type']))&&(isset($types[$entry['Type']]))){ /* Produce type specific output */ - $fn= "render_".$entry['Type']; + $entry_type = $entry['Type']; + + $fn= sprintf("render_%s", $entry_type); + $str = $this->$fn($entry); if(!empty($str)){ $result.=$str."

 

"; @@ -241,6 +244,7 @@ class debconf { $post_name= $data['post_name']; if (preg_match('/\$\{/', $data['Choices'])){ + $data['Description'] .= '

' . _('This debconf question is dynamically generated during package installation and requires choosing between specific options which cannot be presented here. The entered text needs to be one of the valid choices in order to take effect.') . ''; $result= $this->render_string($data); } else { $choices= ""; @@ -301,37 +305,37 @@ class debconf $post_name= $data['post_name']; if (preg_match('/\$\{/', $data['Choices'])){ - $choices= array("Need to use some text..."); + $result = $this->render_multiselect($data); } else { $choices= ""; foreach (split(", ", $data['Choices']) as $choice){ $choices[]= $choice; } - } - $result=" - - - -

".$data['Topic']."

".$data['Description']." - - - "; + $result=" + + + +

".$data['Topic']."

".$data['Description']." + + + "; - foreach($choices as $value){ - if($data['Default'] == $value){ - $result.="\n".htmlentities($value)."
"; - }else{ - $result.="\n".htmlentities($value)."
"; + foreach($choices as $value){ + if($data['Default'] == $value){ + $result.="\n".htmlentities($value)."
"; + }else{ + $result.="\n".htmlentities($value)."
"; + } } - } - $result.= " - - - - "; + $result.= " + + + + "; + } return ($result); } diff --git a/trunk/gosa-plugins/fai/locale/de/LC_MESSAGES/messages.po b/trunk/gosa-plugins/fai/locale/de/LC_MESSAGES/messages.po index 3f7fa1d59..a6a8c1735 100644 --- a/trunk/gosa-plugins/fai/locale/de/LC_MESSAGES/messages.po +++ b/trunk/gosa-plugins/fai/locale/de/LC_MESSAGES/messages.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: messages\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-10-02 16:27+0200\n" +"POT-Creation-Date: 2009-10-16 17:38+0200\n" "PO-Revision-Date: 2008-12-04 11:27+0100\n" "Last-Translator: Cajus Pollmeier \n" "Language-Team: deutsch \n" @@ -23,8 +23,9 @@ msgstr "" "X-Generator: KBabel 1.11.4\n" #: admin/systems/services/repository/class_servRepository.inc:26 -#: admin/systems/services/repository/class_servRepository.inc:308 -#: admin/systems/services/repository/class_servRepository.inc:344 +#: admin/systems/services/repository/class_servRepository.inc:260 +#: admin/systems/services/repository/class_servRepository.inc:334 +#: admin/systems/services/repository/class_servRepository.inc:370 #: admin/systems/services/repository/class_servRepositorySetup.inc:204 msgid "Repository service" msgstr "Repositorien-Dienst" @@ -94,7 +95,7 @@ msgstr "FAI Release" msgid "Name" msgstr "Name" -#: admin/systems/services/repository/class_servRepository.inc:326 +#: admin/systems/services/repository/class_servRepository.inc:352 #: admin/fai/class_faiManagement.inc:788 #: admin/fai/class_faiPackageConfiguration.inc:35 admin/fai/class_FAI.inc:566 #: admin/fai/class_faiPackage.inc:478 admin/fai/class_faiPackageEntry.inc:53 @@ -102,33 +103,33 @@ msgstr "Name" msgid "Service infrastructure" msgstr "Dienst-Infrastruktur" -#: admin/systems/services/repository/class_servRepository.inc:343 +#: admin/systems/services/repository/class_servRepository.inc:369 #: admin/systems/services/repository/servRepositorySetup.tpl:1 #: admin/fai/faiPackage.tpl:33 msgid "Repository" msgstr "Repository" -#: admin/systems/services/repository/class_servRepository.inc:344 +#: admin/systems/services/repository/class_servRepository.inc:370 msgid "Services" msgstr "Dienste" -#: admin/systems/services/repository/class_servRepository.inc:357 +#: admin/systems/services/repository/class_servRepository.inc:383 #: admin/systems/services/repository/servRepositorySetup.tpl:8 msgid "Parent server" msgstr "Quell-Server" -#: admin/systems/services/repository/class_servRepository.inc:358 +#: admin/systems/services/repository/class_servRepository.inc:384 #: admin/fai/branch_selector.tpl:2 msgid "Releases" msgstr "Releases" -#: admin/systems/services/repository/class_servRepository.inc:359 +#: admin/systems/services/repository/class_servRepository.inc:385 #: admin/systems/services/repository/class_servRepositorySetup.inc:157 #: admin/systems/services/repository/servRepositorySetup.tpl:28 msgid "URL" msgstr "URL" -#: admin/systems/services/repository/class_servRepository.inc:360 +#: admin/systems/services/repository/class_servRepository.inc:386 #: admin/systems/services/repository/servRepositorySetup.tpl:39 #: admin/systems/services/repository/class_divListRepositories.inc:24 #: admin/systems/services/repository/class_divListRepositories.inc:64 @@ -653,7 +654,9 @@ msgstr "Vorlagen-Gruppe" #: admin/fai/class_askClassName.inc:175 #, php-format msgid "This FAI class name is already in use by the administrative unit '%s'." -msgstr "Dieser FAI-Klassen-Name wird bereits von der administrativen Einheit '%s' verwendet." +msgstr "" +"Dieser FAI-Klassen-Name wird bereits von der administrativen Einheit '%s' " +"verwendet." #: admin/fai/branch_selector.tpl:8 msgid "Current release" @@ -1073,10 +1076,22 @@ msgstr "Localboot-Produkte" msgid "List of scripts" msgstr "Liste der Skripte" -#: admin/fai/class_debconfTemplate.inc:207 +#: admin/fai/class_debconfTemplate.inc:210 msgid "This package has no debconf options." msgstr "Dieses Paket verfügt über keine debconf-Optionen." +#: admin/fai/class_debconfTemplate.inc:247 +msgid "" +"This debconf question is dynamically generated during package installation " +"and requires choosing between specific options which cannot be presented " +"here. The entered text needs to be one of the valid choices in order to take " +"effect." +msgstr "" +"Diese Debconf-Frage wird während der Paket-Installation automatisch " +"generiert und erfordert eine Auswahl aus Möglichkeiten, die hier nicht " +"dargestellt werden können. Der angegebene Wert muss einer der gültigen " +"Auswahlmöglichkeiten entsprechen." + #: admin/fai/faiTemplateEntry.tpl:10 admin/fai/class_faiTemplateEntry.inc:220 msgid "File name" msgstr "Dateiname" diff --git a/trunk/gosa-plugins/fai/locale/messages.po b/trunk/gosa-plugins/fai/locale/messages.po index 54df2671a..e4286cf39 100644 --- a/trunk/gosa-plugins/fai/locale/messages.po +++ b/trunk/gosa-plugins/fai/locale/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-10-02 16:27+0200\n" +"POT-Creation-Date: 2009-10-16 17:38+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,8 +17,9 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: admin/systems/services/repository/class_servRepository.inc:26 -#: admin/systems/services/repository/class_servRepository.inc:308 -#: admin/systems/services/repository/class_servRepository.inc:344 +#: admin/systems/services/repository/class_servRepository.inc:260 +#: admin/systems/services/repository/class_servRepository.inc:334 +#: admin/systems/services/repository/class_servRepository.inc:370 #: admin/systems/services/repository/class_servRepositorySetup.inc:204 msgid "Repository service" msgstr "" @@ -88,7 +89,7 @@ msgstr "" msgid "Name" msgstr "" -#: admin/systems/services/repository/class_servRepository.inc:326 +#: admin/systems/services/repository/class_servRepository.inc:352 #: admin/fai/class_faiManagement.inc:788 #: admin/fai/class_faiPackageConfiguration.inc:35 admin/fai/class_FAI.inc:566 #: admin/fai/class_faiPackage.inc:478 admin/fai/class_faiPackageEntry.inc:53 @@ -96,33 +97,33 @@ msgstr "" msgid "Service infrastructure" msgstr "" -#: admin/systems/services/repository/class_servRepository.inc:343 +#: admin/systems/services/repository/class_servRepository.inc:369 #: admin/systems/services/repository/servRepositorySetup.tpl:1 #: admin/fai/faiPackage.tpl:33 msgid "Repository" msgstr "" -#: admin/systems/services/repository/class_servRepository.inc:344 +#: admin/systems/services/repository/class_servRepository.inc:370 msgid "Services" msgstr "" -#: admin/systems/services/repository/class_servRepository.inc:357 +#: admin/systems/services/repository/class_servRepository.inc:383 #: admin/systems/services/repository/servRepositorySetup.tpl:8 msgid "Parent server" msgstr "" -#: admin/systems/services/repository/class_servRepository.inc:358 +#: admin/systems/services/repository/class_servRepository.inc:384 #: admin/fai/branch_selector.tpl:2 msgid "Releases" msgstr "" -#: admin/systems/services/repository/class_servRepository.inc:359 +#: admin/systems/services/repository/class_servRepository.inc:385 #: admin/systems/services/repository/class_servRepositorySetup.inc:157 #: admin/systems/services/repository/servRepositorySetup.tpl:28 msgid "URL" msgstr "" -#: admin/systems/services/repository/class_servRepository.inc:360 +#: admin/systems/services/repository/class_servRepository.inc:386 #: admin/systems/services/repository/servRepositorySetup.tpl:39 #: admin/systems/services/repository/class_divListRepositories.inc:24 #: admin/systems/services/repository/class_divListRepositories.inc:64 @@ -1018,10 +1019,18 @@ msgstr "" msgid "List of scripts" msgstr "" -#: admin/fai/class_debconfTemplate.inc:207 +#: admin/fai/class_debconfTemplate.inc:210 msgid "This package has no debconf options." msgstr "" +#: admin/fai/class_debconfTemplate.inc:247 +msgid "" +"This debconf question is dynamically generated during package installation " +"and requires choosing between specific options which cannot be presented " +"here. The entered text needs to be one of the valid choices in order to take " +"effect." +msgstr "" + #: admin/fai/faiTemplateEntry.tpl:10 admin/fai/class_faiTemplateEntry.inc:220 msgid "File name" msgstr "" -- 2.30.2