From: brong Date: Tue, 5 Mar 2002 03:04:07 +0000 (+0000) Subject: Added WIDTH and HEIGHT options to the logo image. Also added ALT tag X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=b6e0c3b65189c26e594d19cbceaed0bfa9d0def6 Added WIDTH and HEIGHT options to the logo image. Also added ALT tag on the image, requires new i18n string sprintf(_("%s Logo"), $org_name) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2542 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/config/conf.pl b/config/conf.pl index 223a0bb4..108b263a 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -345,12 +345,13 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) { print "\n"; } elsif ( $menu == 1 ) { print $WHT. "Organization Preferences\n" . $NRM; - print "1. Organization Name : $WHT$org_name$NRM\n"; - print "2. Organization Logo : $WHT$org_logo$NRM\n"; - print "3. Organization Title : $WHT$org_title$NRM\n"; - print "4. Signout Page : $WHT$signout_page$NRM\n"; - print "5. Default Language : $WHT$squirrelmail_default_language$NRM\n"; - print "6. Top Frame : $WHT$frame_top$NRM\n"; + print "1. Organization Name : $WHT$org_name$NRM\n"; + print "2. Organization Logo : $WHT$org_logo$NRM\n"; + print "3. Org. Logo Width/Height : $WHT($org_logo_width/$org_logo_height)$NRM\n"; + print "4. Organization Title : $WHT$org_title$NRM\n"; + print "5. Signout Page : $WHT$signout_page$NRM\n"; + print "6. Default Language : $WHT$squirrelmail_default_language$NRM\n"; + print "7. Top Frame : $WHT$frame_top$NRM\n"; print "\n"; print "R Return to Main Menu\n"; } elsif ( $menu == 2 ) { @@ -545,10 +546,11 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) { } elsif ( $menu == 1 ) { if ( $command == 1 ) { $org_name = command1(); } elsif ( $command == 2 ) { $org_logo = command2(); } - elsif ( $command == 3 ) { $org_title = command3(); } - elsif ( $command == 4 ) { $signout_page = command4(); } - elsif ( $command == 5 ) { $squirrelmail_default_language = command5(); } - elsif ( $command == 6 ) { $frame_top = command6(); } + elsif ( $command == 3 ) { ($org_logo_width,$org_logo_height) = command2a(); } + elsif ( $command == 4 ) { $org_title = command3(); } + elsif ( $command == 5 ) { $signout_page = command4(); } + elsif ( $command == 6 ) { $squirrelmail_default_language = command5(); } + elsif ( $command == 7 ) { $frame_top = command6(); } } elsif ( $menu == 2 ) { if ( $command == 1 ) { $domain = command11(); } elsif ( $command == 2 ) { $imapServerAddress = command12(); } @@ -649,6 +651,27 @@ sub command2 { return $new_org_logo; } +# org_logo_width +sub command2a { + print "Your organization's logo is an image that will be displayed at\n"; + print "different times throughout SquirrelMail. Width\n"; + print "and Height of your logo image. Use '0' to disable.\n"; + print "\n"; + print "Width: [$WHT$org_logo_width$NRM]: $WHT"; + $new_org_logo_width = ; + $new_org_logo_width =~ tr/0-9//cd; # only want digits! + if ( $new_org_logo_width eq '' ) { + $new_org_logo_width = $org_logo_width; + } + print "Height: [$WHT$org_logo_height$NRM]: $WHT"; + $new_org_logo_height = ; + $new_org_logo_height =~ tr/0-9//cd; # only want digits! + unless ( $new_org_logo_height > 0 ) { + $new_org_logo_height = $org_logo_height; + } + return ($new_org_logo_width, $new_org_logo_height); +} + # org_title sub command3 { print "A title is what is displayed at the top of the browser window in\n"; @@ -2094,6 +2117,11 @@ sub save_data { print CF "\$org_name = \"$org_name\";\n"; print CF "\$org_logo = '$org_logo';\n"; + $org_logo_width |= 0; + $org_logo_height |= 0; + print CF "\$org_logo_width = $org_logo_width;\n"; + print CF "\$org_logo_height = $org_logo_height;\n"; + print CF "\$org_logo = '$org_logo';\n"; print CF "\$org_title = \"$org_title\";\n"; print CF "\$signout_page = '$signout_page';\n"; print CF "\$frame_top = '$frame_top';\n"; diff --git a/config/config_default.php b/config/config_default.php index 1d341d2e..20020383 100644 --- a/config/config_default.php +++ b/config/config_default.php @@ -16,6 +16,13 @@ $config_version = '1.2.0'; global $org_logo; $org_logo = '../images/sm_logo.png'; +/* The width of the logo (0 for default) */ +$org_logo_width = 0; + +/* The height of the logo (0 for default) */ +$org_logo_height = 1; + + /* Organization's name */ global $org_name; $org_name = 'SquirrelMail'; diff --git a/src/login.php b/src/login.php index 62ae3238..2ca0a49c 100644 --- a/src/login.php +++ b/src/login.php @@ -106,8 +106,18 @@ do_hook('login_top'); $loginname_value = (isset($loginname) ? htmlspecialchars($loginname) : ''); +/* Display width and height like good little people */ +$width_and_height = ""; +if (isset($org_logo_width) && is_int($org_logo_width) && $org_logo_width>0) { + $width_and_height = " WIDTH=\"$org_logo_width\""; +} +if (isset($org_logo_height) && is_int($org_logo_height) && $org_logo_height>0) { + $width_and_height .= " HEIGHT=\"$org_logo_height\""; +} + echo "
". - "
\n". + " \""
\n". ( $hide_sm_attributions ? '' : '' . sprintf (_("SquirrelMail version %s"), $version) . "
\n". ' ' . _("By the SquirrelMail Development Team") . "
\n" ) .