Added WIDTH and HEIGHT options to the logo image. Also added ALT tag
authorbrong <brong@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 5 Mar 2002 03:04:07 +0000 (03:04 +0000)
committerbrong <brong@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 5 Mar 2002 03:04:07 +0000 (03:04 +0000)
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

config/conf.pl
config/config_default.php
src/login.php

index 223a0bb44810db9c5a8c24f1beef4c13a60552d2..108b263a48f0c45afe3567efff095b459f5531fd 100755 (executable)
@@ -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 = <STDIN>;
+    $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 = <STDIN>;
+    $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";
index 1d341d2e4d0eb87ffc37b3abe1419cbecc77d7c9..2002038381666515a67d495df0fed1464525cb4a 100644 (file)
@@ -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';
index 62ae3238e8e20b51eb826de386b119a4ab4f8ddc..2ca0a49c820976d10eed417d1588143ef72111cb 100644 (file)
@@ -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 "<CENTER>".
-     "  <IMG SRC=\"$org_logo\"><BR>\n".
+     "  <IMG SRC=\"$org_logo\" ALT=\"" . sprintf(_("%s Logo"), $org_name) . 
+        "\"$width_and_height><BR>\n".
      ( $hide_sm_attributions ? '' :
        '<SMALL>' . sprintf (_("SquirrelMail version %s"), $version) . "<BR>\n".
        '  ' . _("By the SquirrelMail Development Team") . "<BR></SMALL>\n" ) .