فهرست منبع

Drop the default top-right 'SquirrelMail' name and link, as discussed
on squirrelmail-devel. It's overkill anyway to name and link SquirrelMail
so prominently on every page. It also confused users who clicked straight
through to our site. It will now only display something if provider_name
and provider_uri have been set, i.o.w., it's completely optional.

Thijs Kinkhorst 18 سال پیش
والد
کامیت
46215ecd92

+ 7 - 7
config/conf.pl

@@ -385,7 +385,7 @@ $delete_folder = 'false'                if ( !$delete_folder );
 $noselect_fix_enable = 'false'          if ( !$noselect_fix_enable );
 $frame_top = "_top"                     if ( !$frame_top );
 $provider_uri = ''                      if ( !$provider_uri );
-$provider_name = ''                     if ( !$provider_name );
+$provider_name = ''                     if ( !$provider_name || $provider_name eq 'SquirrelMail');
 $no_list_for_subscribe = 'false'        if ( !$no_list_for_subscribe );
 $allow_charset_search = 'true'          if ( !$allow_charset_search );
 $allow_advanced_search = 0              if ( !$allow_advanced_search) ;
@@ -563,7 +563,7 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) && ( $command ne ":q" ) ) {
         print "5.  Signout Page           : $WHT$signout_page$NRM\n";
         print "6.  Top Frame              : $WHT$frame_top$NRM\n";
         print "7.  Provider link          : $WHT$provider_uri$NRM\n";
-        print "8.  Provider name          : $WHT$provider_name$NRM\n";
+        print "8.  Provider link text     : $WHT$provider_name$NRM\n";
 
         print "\n";
         print "R   Return to Main Menu\n";
@@ -1107,8 +1107,8 @@ sub command6 {
 
 # Default link to provider
 sub command7 {
-    print "Here you can set the link on the right of the page.\n";
-    print "If empty, it will link to the SquirrelMail About page.\n";
+    print "Here you can set the link on the top-right of the message list.\n";
+    print "If empty, it will not be displayed.\n";
     print "\n";
     print "[$WHT$provider_uri$NRM]: $WHT";
     $new_provider_uri = <STDIN>;
@@ -1122,13 +1122,13 @@ sub command7 {
 }
 
 sub command8 {
-    print "Here you can set the name of the link on the right of the page.\n";
-    print "The default is 'SquirrelMail'\n";
+    print "Here you can set the name of the link on the top-right of the message list.\n";
+    print "The default is empty (do not display anything).'\n";
     print "\n";
     print "[$WHT$provider_name$NRM]: $WHT";
     $new_provider_name = <STDIN>;
     if ( $new_provider_name eq "\n" ) {
-        $new_provider_name = 'SquirrelMail';
+        $new_provider_name = '';
     } else {
         $new_provider_name =~ s/[\r\n]//g;
         $new_provider_name =~ s/^\s+$//g;

+ 11 - 9
config/config_default.php

@@ -86,21 +86,23 @@ $frame_top = '_top';
 /**
  * Provider name
  *
- * Here you can set name of the link displayed on the right side of main page.
+ * Here you can set the text of the link displayed on the top-right
+ * of the message list.
+ *
+ * Defaults to empty (no link).
  *
- * Link will be displayed only if you have $hide_sm_attributions
- * option set to true.
  * @global string $provider_name
  */
-$provider_name = 'SquirrelMail';
+$provider_name = '';
 
 /**
  * Provider URI
  *
- * Here you can set URL of the link displayed on the right side of main page.
- * When empty, this refers to the SquirrelMail About page.
- * Link will be displayed only if you have $hide_sm_attributions
- * option set to true.
+ * Here you can set URL of the link displayed on the top-right of
+ * the message list.
+ *
+ * Defaults to empty (no link).
+ *
  * @global string $provider_uri
  */
 $provider_uri = '';
@@ -562,7 +564,7 @@ $default_use_priority = true;
  * SquirrelMail Attributions Control
  *
  * This option disables display of "created by SquirrelMail developers"
- * strings and provider link
+ * strings and links.
  * @global bool $hide_sm_attributions
  * @since 1.2.0
  */

+ 2 - 4
contrib/RPM/config.php.redhat

@@ -17,9 +17,8 @@ $org_title     = "SquirrelMail $version";
 $signout_page  = '';
 $frame_top     = '_top';
 
-$provider_uri     = 'http://www.squirrelmail.org/';
-
-$provider_name     = 'SquirrelMail';
+$provider_uri     = '';
+$provider_name     = '';
 
 $motd = "";
 
@@ -174,4 +173,3 @@ $session_name = 'SQMSESSID';
  * sent and regular output to begin, which will majorly screw
  * things up when we try to send more headers later.
  */
-?>

+ 4 - 9
functions/page_header.php

@@ -239,19 +239,14 @@ function displayPageHeader($color, $mailbox, $sHeaderJs='', $sBodyTagJs = '') {
         $shortBoxName = _("INBOX");
     }
 
-    $sm_attributes = '';
-    if (!$hide_sm_attributions) {
-        if (empty($provider_uri)) {
-            $sm_attributes .= create_hyperlink($base_uri . 'src/about.php', 'SquirrelMail');
-        } else {
-            if (empty($provider_name)) $provider_name = 'SquirrelMail';
-            $sm_attributes .= create_hyperlink($provider_uri, $provider_name, '_blank');
-        }
+    $provider_link = '';
+    if (!empty($provider_uri) && !empty($provider_name) && $provider_name != 'SquirrelMail') {
+        $provider_link = create_hyperlink($provider_uri, $provider_name, '_blank');
     }
 
     $oTemplate->assign('body_tag_js', $sBodyTagJs);
     $oTemplate->assign('shortBoxName', $shortBoxName);
-    $oTemplate->assign('sm_attribute_str', $sm_attributes);
+    $oTemplate->assign('provider_link', $provider_link);
     $oTemplate->assign('frame_top', $frame_top);
     $oTemplate->assign('urlMailbox', $urlMailbox);
     $oTemplate->assign('startMessage', $startMessage);

+ 3 - 3
templates/default/page_header.tpl

@@ -75,7 +75,7 @@ $help_link		= makeInternalLink ('src/help.php', $help_str);
   </td>
  </tr>
  <tr>
-  <td class="sqm_topNavigation"<?php echo ($hide_sm_attributions ? ' colspan="2"' : ''); ?>>
+  <td class="sqm_topNavigation"<?php echo (empty($provider_link) ? ' colspan="2"' : ''); ?>>
    <?php echo $compose_link; ?>&nbsp;&nbsp;
    <?php echo $address_link; ?>&nbsp;&nbsp;
    <?php echo $folders_link; ?>&nbsp;&nbsp;
@@ -84,9 +84,9 @@ $help_link		= makeInternalLink ('src/help.php', $help_str);
    <?php echo $help_link; ?>&nbsp;&nbsp;
    <?php /* FIXME: no hooks in templates!! */ global $null; do_hook('menuline', $null); ?>
   </td>
-  <?php if (!empty($sm_attribute_str))
+  <?php if (!empty($provider_link))
             echo '<td class="sqm_providerInfo">'
-               . $sm_attribute_str
+               . $provider_link
                . "</td>\n"; ?>
  </tr>
 </table>

+ 3 - 3
templates/default_advanced/page_header.tpl

@@ -95,7 +95,7 @@ $help_link		= makeInternalLink ('src/help.php', $help_str);
   </td>
  </tr>
  <tr>
-  <td class="sqm_topNavigation"<?php echo ($hide_sm_attributions ? ' colspan="2"' : ''); ?>>
+  <td class="sqm_topNavigation"<?php echo (empty($provider_link) ? ' colspan="2"' : ''); ?>>
    <?php echo $compose_link; ?>&nbsp;&nbsp;
    <?php echo $address_link; ?>&nbsp;&nbsp;
    <?php echo $folders_link; ?>&nbsp;&nbsp;
@@ -104,9 +104,9 @@ $help_link		= makeInternalLink ('src/help.php', $help_str);
    <?php echo $help_link; ?>&nbsp;&nbsp;
    <?php /* FIXME: no hooks in templates!! */ global $null; do_hook('menuline', $null); ?>
   </td>
-  <?php if (!empty($sm_attribute_str))
+  <?php if (!empty($provider_link))
             echo '<td class="sqm_providerInfo">'
-               . $sm_attribute_str
+               . $provider_link
                . "</td>\n"; ?>
  </tr>
 </table>