浏览代码

Added Length of Subject as Display Option (default 50, as before).

alex-brainstorm 22 年之前
父节点
当前提交
d42fee728b
共有 2 个文件被更改,包括 10 次插入3 次删除
  1. 2 3
      functions/mailbox_display.php
  2. 8 0
      include/options/display.php

+ 2 - 3
functions/mailbox_display.php

@@ -21,10 +21,8 @@ require_once(SM_PATH . 'functions/mime.php');
 
 
 /* Constants:
 /* Constants:
  *   PG_SEL_MAX:   default value for page_selector_max
  *   PG_SEL_MAX:   default value for page_selector_max
- *   SUBJ_TRIM_AT: the length at which we trim off subjects
  */
  */
 define('PG_SEL_MAX', 10);
 define('PG_SEL_MAX', 10);
-define('SUBJ_TRIM_AT', 50);
 
 
 function elapsed($start)
 function elapsed($start)
 {
 {
@@ -1260,7 +1258,8 @@ function processSubject($subject, $threadlevel = 0) {
         return _("(no subject)");
         return _("(no subject)");
     }
     }
 
 
-    $trim_at = SUBJ_TRIM_AT;
+    global $truncate_subject;     /* number of characters for Subject field (<= 0 for unchanged) */
+    $trim_at = $truncate_subject;
 
 
     /* if this is threaded, subtract two chars per indentlevel */
     /* if this is threaded, subtract two chars per indentlevel */
     if (($threadlevel > 0) && ($threadlevel <= 10))
     if (($threadlevel > 0) && ($threadlevel <= 10))

+ 8 - 0
include/options/display.php

@@ -159,6 +159,14 @@ function load_optpage_data_display() {
         'size'    => SMOPT_SIZE_TINY
         'size'    => SMOPT_SIZE_TINY
     );
     );
 
 
+    $optvals[SMOPT_GRP_MAILBOX][] = array(
+        'name'    => 'truncate_subject',
+        'caption' => _("Length of Subject Field (0 for full)"),
+        'type'    => SMOPT_TYPE_INTEGER,
+        'refresh' => SMOPT_REFRESH_NONE,
+        'size'    => SMOPT_SIZE_TINY
+    );
+
 
 
     /*** Load the General Options into the array ***/
     /*** Load the General Options into the array ***/
     $optgrps[SMOPT_GRP_MESSAGE] = _("Message Display and Composition");
     $optgrps[SMOPT_GRP_MESSAGE] = _("Message Display and Composition");