UI option to show hostname in page title
authorJamie Cameron <jcameron@webmin.com>
Tue, 8 Dec 2009 21:47:02 +0000 (13:47 -0800)
committerJamie Cameron <jcameron@webmin.com>
Tue, 8 Dec 2009 21:47:02 +0000 (13:47 -0800)
lang/en
web-lib-funcs.pl
webmin/CHANGELOG
webmin/change_ui.cgi
webmin/edit_ui.cgi
webmin/lang/en

diff --git a/lang/en b/lang/en
index 088ff02..5aa66e8 100644 (file)
--- a/lang/en
+++ b/lang/en
@@ -5,6 +5,7 @@ main_logout=Logout
 main_version=Version $1 on $2 ($3)
 main_title=Webmin $1 on $2 ($3)
 main_title2=Webmin
+main_title3=Webmin $1 ($2)
 main_none=You do not have access to any Webmin modules.
 main_skill=Skill level
 main_readonly=(Read-only mode)
index e935ee5..fab8c33 100755 (executable)
@@ -923,14 +923,15 @@ my ($msg) = @_;
 my $title;
 my $os_type = $gconfig{'real_os_type'} || $gconfig{'os_type'};
 my $os_version = $gconfig{'real_os_version'} || $gconfig{'os_version'};
+my $host = &get_display_hostname();
 if ($gconfig{'sysinfo'} == 1 && $remote_user) {
        $title = sprintf "%s : %s on %s (%s %s)\n",
-               $msg, $remote_user, &get_display_hostname(),
+               $msg, $remote_user, $host,
                $os_type, $os_version;
        }
 elsif ($gconfig{'sysinfo'} == 4 && $remote_user) {
        $title = sprintf "%s on %s (%s %s)\n",
-               $remote_user, &get_display_hostname(),
+               $remote_user, $host,
                $os_type, $os_version;
        }
 else {
@@ -939,6 +940,9 @@ else {
 if ($gconfig{'showlogin'} && $remote_user) {
        $title = $remote_user." : ".$title;
        }
+if ($gconfig{'showhost'}) {
+       $title = $host." : ".$title;
+       }
 return $title;
 }
 
@@ -968,11 +972,16 @@ else {
                $ostr = "$os_type $os_version";
                }
        my $host = &get_display_hostname();
+       my $ver = &get_webmin_version();
        $title = $gconfig{'nohostname'} ? $text{'main_title2'} :
-               &text('main_title', &get_webmin_version(), $host, $ostr);
+                $gconfig{'showhost'} ? &text('main_title3', $ver, $ostr) :
+                                       &text('main_title', $ver, $host, $ostr);
        if ($gconfig{'showlogin'}) {
                $title = $remote_user." : ".$title;
                }
+       if ($gconfig{'showhost'}) {
+               $title = $host." : ".$title;
+               }
        }
 return $title;
 }
index f2b14e1..a00fb66 100644 (file)
@@ -97,3 +97,5 @@ Removed the option to select an OSDN mirror, as Sourceforge now does sensible lo
 Added an option on the Logging page to record logins and logouts from Webmin, for display in the Webmin Actions Log module.
 ---- Changes since 1.490 ----
 Added a field to the Debugging Log File page to select modules to debug for.
+---- Changes since 1.500 ----
+Added an option to the User Interface page to always put the hostname before the page title.
index e6ed8db..ace075a 100755 (executable)
@@ -19,6 +19,7 @@ for($i=0; $i<@cs_names; $i++) {
 $gconfig{'texttitles'} = $in{'texttitles'};
 $gconfig{'sysinfo'} = $in{'sysinfo'};
 $gconfig{'showlogin'} = $in{'showlogin'};
+$gconfig{'showhost'} = $in{'showhost'};
 $gconfig{'hostnamemode'} = $in{'hostnamemode'};
 $gconfig{'hostnamedisplay'} = $in{'hostnamedisplay'};
 $gconfig{'feedback_to'} = $in{'feedback_def'} ? undef : $in{'feedback'};
index bfddc18..f79a39f 100755 (executable)
@@ -8,7 +8,7 @@ require './webmin-lib.pl';
 print $text{'ui_desc'},"<p>\n";
 
 print &ui_form_start("change_ui.cgi", "post");
-print &ui_table_start($text{'ui_header'}, undef, 2, [ "width=30%" ]);
+print &ui_table_start($text{'ui_header'}, undef, 2);
 
 for($i=0; $i<@cs_names; $i++) {
        $cd = $cs_codes[$i];
@@ -32,6 +32,9 @@ print &ui_table_row($text{'ui_hostnamemode'},
 print &ui_table_row($text{'ui_showlogin'},
        &ui_yesno_radio("showlogin", int($gconfig{'showlogin'})));
 
+print &ui_table_row($text{'ui_showhost'},
+       &ui_yesno_radio("showhost", int($gconfig{'showhost'})));
+
 print &ui_table_row($text{'ui_feedback'},
        &ui_opt_textbox("feedback", $gconfig{'feedback_to'}, 20,
                        $webmin_feedback_address));
index 9ae384e..08382f1 100644 (file)
@@ -164,6 +164,7 @@ ui_sizemodules=Multiple modules chooser size
 ui_edbwidth=Missing or invalid chooser window width
 ui_edbheight=Missing or invalid chooser window height
 ui_showlogin=Prepend username to page titles?
+ui_showhost=Prepend hostname to page titles?
 ui_dateformat=Format for displayed dates
 ui_dateformat_dd/mon/yyyy=dd/mon/yyyy (ie. 16/Sep/2001)
 ui_dateformat_dd/mm/yyyy=dd/mm/yyyy (ie. 16/09/2001)