--- loncom/interface/loncommon.pm 2009/04/22 11:21:13 1.791 +++ loncom/interface/loncommon.pm 2009/04/24 05:14:09 1.792 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.791 2009/04/22 11:21:13 tempelho Exp $ +# $Id: loncommon.pm,v 1.792 2009/04/24 05:14:09 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -715,6 +715,21 @@ sub select_datelocale { return $output; } +sub select_language { + my ($name,$selected,$includeempty) = @_; + my %langchoices; + if ($includeempty) { + %langchoices = ('' => 'No language preference'); + } + foreach my $id (&languageids()) { + my $code = &supportedlanguagecode($id); + if ($code) { + $langchoices{$code} = &plainlanguagedescription($id); + } + } + return &select_form($selected,$name,%langchoices); +} + =pod =item * &linked_select_forms(...)