Modifications made to give options for how "Reply Citation" is done. This is the...
authorthomppj <thomppj@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 21 Sep 2001 03:36:38 +0000 (03:36 +0000)
committerthomppj <thomppj@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 21 Sep 2001 03:36:38 +0000 (03:36 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1507 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php
src/load_prefs.php
src/options.php
src/options_display.php

index 8f6e46937703351c425eaec0db585a2ca88df6f4..8a348b70359ca40cf0594171c30b42b00db9dd31 100644 (file)
              $orig_from = trim(substr($orig_from,0,strpos($orig_from,'<')));
              $orig_from = str_replace('"','',$orig_from);
              $orig_from = str_replace("'",'',$orig_from);
-            $body = $orig_from . ' ' . _('said') . ":\n" . $body;
+            $body = getReplyCitation($orig_from) . $body;
          }
          
          return;
       sqimap_logout($imapConnection);
    }
    
-   
-   
-   
    function ClearAttachments() {
        global $attachments, $attachment_dir;
        
        
        $attachments = array();
    }
-   
+
+   function getReplyCitation($orig_from) {
+      global $reply_citation_style, $reply_citation_start, $reply_citation_end;
+
+      /* First, return an empty string when no citation style selected. */
+      if (($reply_citation_style == '') || ($reply_citation_style == 'none')) {
+         return ('');
+      }
+
+      /* Otherwise, try to select the desired citation style. */
+      switch ($reply_citation_style) {
+         case 'author_said':
+            $start = '';
+            $end   = ' ' . _("said") . ':';
+            break;
+         case 'quote_who':
+            $start = '<' . _("quote") . ' ' . _("who") . '="';
+            $end   = '">';
+            break;
+         case 'user-defined':
+            $start = $reply_citation_start;
+            $end   = $reply_citation_end;
+            break;
+         default: return ('');
+      }
+
+      /* Build and return the citation string. */
+      return ($start . $orig_from . $end . "\n");
+   }   
 ?>
index 161c49f41253bf1022bed9d9cf472516a7da228b..aed52bd33cf9f008a1b8d6042eb208b90d3b1bf2 100644 (file)
 
    global $folder_prefix;
    $folder_prefix = getPref($data_dir, $username, "folder_prefix");
-   if ($folder_prefix == "")
+   if ($folder_prefix == "") {
       $folder_prefix = $default_folder_prefix;
+   }
 
+   /** Load special folders **/
+   global $trash_folder, $sent_folder;
+   $new_trash_folder = getPref($data_dir, $username, "trash_folder");
+   if (($new_trash_folder == "") && ($move_to_trash == true)) {
+      $trash_folder = $folder_prefix . $trash_folder;
+   } else {
+      $trash_folder = $new_trash_folder;
+   }
 
-       /** Load special folders **/
-       global $trash_folder, $sent_folder;
-       $new_trash_folder = getPref($data_dir, $username, "trash_folder");
-       if (($new_trash_folder == "") && ($move_to_trash == true))
-               $trash_folder = $folder_prefix . $trash_folder;
-       else
-               $trash_folder = $new_trash_folder;
-
-       /** Load special folders **/
-       $new_sent_folder = getPref($data_dir, $username, "sent_folder");
-       if (($new_sent_folder == "") && ($move_to_sent == true))
-               $sent_folder = $folder_prefix . $sent_folder;
-       else
-               $sent_folder = $new_sent_folder;
-
+   /** Load special folders **/
+   $new_sent_folder = getPref($data_dir, $username, "sent_folder");
+   if (($new_sent_folder == "") && ($move_to_sent == true)) {
+      $sent_folder = $folder_prefix . $sent_folder;
+   } else {
+      $sent_folder = $new_sent_folder;
+   }
 
    global $show_num, $wrap_at, $left_size;
    $show_num = getPref($data_dir, $username, "show_num");
-   if ($show_num == "")
+   if ($show_num == "") {
       $show_num = 25;
+   }
    
    $wrap_at = getPref($data_dir, $username, "wrap_at");
-   if ($wrap_at == "")
+   if ($wrap_at == "") {
       $wrap_at = 86;
-   if ($wrap_at < 15)
+   } else if ($wrap_at < 15) {
       $wrap_at = 15;
+   }
 
    $left_size = getPref($data_dir, $username, "left_size");
    if ($left_size == "") {
-      if (isset($default_left_size))
+      if (isset($default_left_size)) {
          $left_size = $default_left_size;
-      else  
+      } else {
          $left_size = 200;
-   }      
-
+      }
+   }
 
    global $editor_size, $use_signature, $prefix_sig;
    $editor_size = getPref($data_dir, $username, "editor_size");
-   if ($editor_size == "")
+   if ($editor_size == "") {
       $editor_size = 76;
+   }
+
 
    $use_signature = getPref($data_dir, $username, "use_signature");
-   if ($use_signature == "")
+   if ($use_signature == "") {
       $use_signature = false;
+   }
 
    $prefix_sig = getPref($data_dir, $username, "prefix_sig");
-   if ($prefix_sig == "")
+   if ($prefix_sig == "") {
       $prefix_sig = true;
+   }
+
+   /* Load preferences for reply citation style. */
+   global $reply_citation_style, $reply_citation_start, $reply_citation_end;
+
+   $reply_citation_style = getPref($data_dir, $username, 'reply_citation_style');
+   if ($reply_citation_style == '') {
+      $reply_citation_style = 'none';
+   }
+   $reply_citation_start = getPref($data_dir, $username, 'reply_citation_start');
+   $reply_citation_end = getPref($data_dir, $username, 'reply_citation_end');
 
 
    global $left_refresh, $sort;
    $left_refresh = getPref($data_dir, $username, "left_refresh");
-   if ($left_refresh == "")
+   if ($left_refresh == "") {
       $left_refresh = false;
+   }
 
    $sort = getPref($data_dir, $username, "sort");
-   if ($sort == "")
+   if ($sort == "") {
       $sort = 6;
-   
+   }
    
    /** Load up the Signature file **/
    global $signature_abs;
    } else {
       $alt_index_colors = true;
    }
-   
-   
+      
    global $location_of_bar, $location_of_buttons;
    $location_of_bar = getPref($data_dir, $username, 'location_of_bar');
    if ($location_of_bar == '')
        $location_of_bar = 'left';
        
    $location_of_buttons = getPref($data_dir, $username, 'location_of_buttons');
-   if ($location_of_buttons == '')
+   if ($location_of_buttons == '') {
        $location_of_buttons = 'between';
-       
-       
+   }
+    
    global $collapse_folders, $show_html_default;
    $collapse_folders = getPref($data_dir, $username, 'collapse_folders');
   
index 4ead9c949bd7801d3cf65a590665081bf6629690..7516d1bb98193966cc3004cf7ff52add3b60f41e 100644 (file)
    
       # Save display preferences
       setPref($data_dir, $username, 'chosen_theme', $chosentheme);
+      setPref($data_dir, $username, 'language', $language);
+      setPref($data_dir, $username, 'use_javascript_addr_book', $javascript_abook);
       setPref($data_dir, $username, 'show_num', $shownum);
       setPref($data_dir, $username, 'wrap_at', $wrapat);
       setPref($data_dir, $username, 'editor_size', $editorsize);
+      setPref($data_dir, $username, 'reply_citation_style', $new_reply_citation_style);
+      setPref($data_dir, $username, 'reply_citation_start', $new_reply_citation_start);
+      setPref($data_dir, $username, 'reply_citation_end', $new_reply_citation_end);
       setPref($data_dir, $username, 'left_refresh', $leftrefresh);
-      setPref($data_dir, $username, 'language', $language);
       setPref($data_dir, $username, 'location_of_bar', $folder_new_location);
       setPref($data_dir, $username, 'location_of_buttons', $button_new_location);
       setPref($data_dir, $username, 'left_size', $leftsize);
-      setPref($data_dir, $username, 'use_javascript_addr_book', $javascript_abook);
-      if (isset($altIndexColors) && $altIndexColors == 1)
+
+      if (isset($altIndexColors) && $altIndexColors == 1) {
          setPref($data_dir, $username, 'alt_index_colors', 1);
-      else
+      } else {
          setPref($data_dir, $username, 'alt_index_colors', 0);
-      if (isset($showhtmldefault))
+      }
+
+      if (isset($showhtmldefault)) {
          setPref($data_dir, $username, 'show_html_default', 1);
-      else
+      } else {
          removePref($data_dir, $username, 'show_html_default');
-      if (isset($includeselfreplyall))
+      }
+
+      if (isset($includeselfreplyall)) {
          setPref($data_dir, $username, 'include_self_reply_all', 1);
-      else
+      } else {
          removePref($data_dir, $username, 'include_self_reply_all');
+      }
     
       do_hook('options_display_save');
 
index 0882b7ef16b9c0cac7627ac1973d21cf5050ddba..5c862157a3717c1386f196bf604e0cd03d2ecc84 100644 (file)
 <table width="95%" align="center" border="0" cellpadding="2" cellspacing="0">
 <tr><td bgcolor="<?php echo $color[0] ?>" align="center">
 
-      <b><?php echo _("Options") . ' - ' . _("Display Preferences"); ?></b><br>
+   <b><?php echo _("Options") . ' - ' . _("Display Preferences"); ?></b><br>
 
-    <table width="100%" border="0" cellpadding="1" cellspacing="1">
-    <tr><td bgcolor="<?php echo $color[4] ?>" align="center">
+   <table width="100%" border="0" cellpadding="1" cellspacing="1">
+   <tr><td bgcolor="<?php echo $color[4] ?>" align="center">
 
    <form name="f" action="options.php" method="post"><br>
       <table width="100%" cellpadding="2" cellspacing="0" border="0">
             </td>
          </tr>
          <tr>
-            <td align="right" nowrap><?PHP echo _("Location of folder list") ?>:</td>
-            <td><select name="folder_new_location">
-                <option value="left"<?PHP
-                    if ($location_of_bar != 'right') echo ' SELECTED';
-                    ?>><?PHP echo _("Left"); ?></option>
-                <option value="right"<?PHP
-                    if ($location_of_bar == 'right') echo ' SELECTED';
-                    ?>><?PHP echo _("Right"); ?></option>
+            <td align="right" nowrap><?PHP echo _("Reply Citation Style") ?>:</td>
+            <td><select name="new_reply_citation_style">
+                <option value="none"<?PHP
+                    if ($reply_citation_style == 'none') echo ' SELECTED';
+                    ?>>- <?PHP echo _("Not Used"); ?> -</option>
+                <option value="author_said"<?PHP
+                    if ($reply_citation_style == 'author_said') echo ' SELECTED';
+                    ?>><?PHP echo _("AUTHOR Said"); ?></option>
+                <option value="quote_who"<?PHP
+                    if ($reply_citation_style == 'quote_who') echo ' SELECTED';
+                    ?>><?PHP echo _("Quote Who XML"); ?></option>
+                <option value="user-defined"<?PHP
+                    if ($reply_citation_style == 'user-defined') echo ' SELECTED';
+                    ?>><?PHP echo _("User-Defined"); ?></option>
                 </select>
             </td>
          </tr>
+         <tr>
+            <td align="right" nowrap><?php echo _("User-Defined Reply Citation"); ?>:</td>
+            <td>
+               <tt><input type="text" size="15" name="new_reply_citation_start" value="<?php
+                  echo $reply_citation_start;
+               ?>"></tt> &lt;<?PHP echo _("Author's Name"); ?>&gt;
+               <tt><input type="text" size="15" name="new_reply_citation_end" value="<?php
+                  echo $reply_citation_end;
+               ?>"></tt>
+            </td>
+         </tr>
          <tr>
             <td align="right" nowrap><?PHP echo _("Location of buttons when composing") ?>:</td>
             <td><select name="button_new_location">
                 </select>
             </td>
          </tr>
+         <tr>
+            <td align="right" nowrap><?PHP echo _("Location of folder list") ?>:</td>
+            <td><select name="folder_new_location">
+                <option value="left"<?PHP
+                    if ($location_of_bar != 'right') echo ' SELECTED';
+                    ?>><?PHP echo _("Left"); ?></option>
+                <option value="right"<?PHP
+                    if ($location_of_bar == 'right') echo ' SELECTED';
+                    ?>><?PHP echo _("Right"); ?></option>
+                </select>
+            </td>
+         </tr>
          <tr>
             <td align=right nowrap><?php echo _("Width of folder list"); ?>:
             </td><td>