diff -ruN e-smith-lib-2.4.0.old/root/usr/share/perl5/vendor_perl/esmith/console.pm e-smith-lib-2.4.0/root/usr/share/perl5/vendor_perl/esmith/console.pm --- e-smith-lib-2.4.0.old/root/usr/share/perl5/vendor_perl/esmith/console.pm 2008-08-20 14:23:20.000000000 -0700 +++ e-smith-lib-2.4.0/root/usr/share/perl5/vendor_perl/esmith/console.pm 2014-03-16 17:01:16.000000000 -0700 @@ -385,6 +385,29 @@ ); } + +=head2 textbox + +A text box lets you display the contents of a text file in a dialog box. +It is like a simple text file viewer. + +=cut + +sub textbox +{ + my $self = shift; + my %params = @_; + my $title = $params{title}; + my $file = $params{file}; + my $height = $params{height} || '20'; + my $width = $params{width} || SCREEN_COLUMNS; + $self->screen("--title", $title, + "--textbox", $file, + $height, + $width, + ); +} + =head2 menu_page This method displays a screen with a menu. diff -ruN e-smith-lib-2.4.0.old/root/usr/share/perl5/vendor_perl/esmith/util.pm e-smith-lib-2.4.0/root/usr/share/perl5/vendor_perl/esmith/util.pm --- e-smith-lib-2.4.0.old/root/usr/share/perl5/vendor_perl/esmith/util.pm 2013-01-25 08:09:11.000000000 -0800 +++ e-smith-lib-2.4.0/root/usr/share/perl5/vendor_perl/esmith/util.pm 2014-03-16 16:57:08.000000000 -0700 @@ -1170,6 +1170,58 @@ return wantarray ? @licenses : "@licenses"; } +=head2 getLicenseFile() + +Return the license filename. + +Optionally takes a language tag to be used for retrieving the license, +defaulting to the locale of the server. + +If more than one license file than return the first alphabetically. + +=cut + +sub getLicenseFile +{ + my ($locale) = @_; + + if ($locale) + { + $locale =~ s/-(\S\S)/_\U$1/; + } + else + { + my $db = esmith::ConfigDB->open(); + + my ( $lang, @rest ) = $db->getLocale(); + + $lang = $lang || "en_US"; + + $locale = $lang; + } + + my $base_dir = $ENV{ESMITH_LICENSE_DIR} || "/etc/e-smith/licenses"; + + $locale = "en_US" unless ( -d "${base_dir}/${locale}" ); + + my $dir = "${base_dir}/${locale}"; + + opendir( DIR, $dir ) || die "Couldn't open licenses directory\n"; + + my @licenses; + foreach my $license ( readdir(DIR) ) + { + my $file = "${dir}/${license}"; + next unless ( -f $file ); + push @licenses, $file; + } + + @licenses = sort @licenses; + + return shift @licenses; +} + + =item B Initialize all databases located at /etc/e-smith/db.