Happy New Year
[squirrelmail.git] / templates / default / message_list.tpl
index 0e7f547335979286fee4a8615967b0d0ae8478e3..573922394d2de7d5d150fbdf4433c29d5545371d 100644 (file)
  *    $compact_paginator
  *    $aErrors
  *    $checkall
+ *    $preselected
+ *    $show_personal_names boolean When turned on, all email
+ *                                 address fields should display
+ *                                 the personal name and use the
+ *                                 email address as a tool tip;
+ *                                 When turned off, this logic
+ *                                 should be inverted
+ *    $accesskey_mailbox_toggle_selected The access key to use for the toggle all checkbox
+ *    $accesskey_mailbox_thread The access key to use for the Thread/Unthread links
  *
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright 1999-2018 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -109,6 +118,7 @@ if ($pageOffset < $end_msg) {
 ?>
 <div id="message_list">
 <form id="<?php echo $form_name;?>" name="<?php echo $form_name;?>" method="post" action="<?php echo $php_self;?>">
+<input type="hidden" name="smtoken" value="<?php echo sm_generate_security_token(); ?>" />
 <table class="table_empty" cellspacing="0">
   <tr>
    <td>
@@ -127,7 +137,12 @@ if ($pageOffset < $end_msg) {
                        */
                       $paginator_str = $this->fetch('paginator.tpl');
                       echo $paginator_str . '<small>[<a href="' . $thread_link_uri
-                                          . '">' . $thread_name . '</a>]</small>'; ?>
+                                          . ($accesskey_mailbox_thread != 'NONE'
+                                          ? '" accesskey="' . $accesskey_mailbox_thread . '">'
+                                          : '">')
+                                          . $thread_name . '</a>]</small>&nbsp;&nbsp;';
+                      if (!empty($plugin_output['mailbox_paginator_after'])) echo $plugin_output['mailbox_paginator_after'];
+                  ?>
 <!-- end paginator and thread link string -->
               </td>
 <!-- message count string -->
@@ -191,31 +206,40 @@ if ($pageOffset < $end_msg) {
           case SQM_COL_CHECK:
               if ($javascript_on) {
                   $checked = ($checkall ? ' checked="checked" ' : '');
-                  echo '<input type="checkbox" name="toggleAll" title="'._("Toggle All").'" onclick="toggle_all(\''.$form_name."',".$fancy_index_highlite.')" ' . $checked . '/>'."\n";
+                  $accesskey = ($accesskey_mailbox_toggle_selected == 'NONE' ? ''
+                                : ' accesskey="' . $accesskey_mailbox_toggle_selected . '" ');
+                  echo '<input type="checkbox" name="toggleAll" id="toggleAll" title="'
+                     . _("Toggle All") . '" onclick="toggle_all(\''
+                     . $form_name . '\', \'msg\', ' . $fancy_index_highlite
+                     . '); return false;" ' . $checked . $accesskey . '/>' . "\n";
               } else {
                   $link = $baseurl 
                         . "&amp;startMessage=$pageOffset&amp;checkall=" 
                         . ($checkall ? '0' : '1');
-                  echo "<a href=\"$link\">"._("All").'</a>';
+                  echo "<a href=\"$link\">" . _("All") . '</a>';
               }
               break;
-          case SQM_COL_FROM:       echo _("From")."\n";     break;
-          case SQM_COL_DATE:       echo _("Date")."\n";     break;
-          case SQM_COL_SUBJ:       echo _("Subject")."\n";  break;
+          case SQM_COL_FROM:       
+              echo '<label for="toggleAll">' . _("From") . "</label>\n";
+              break;
+          case SQM_COL_DATE:       echo _("Date") . "\n";     break;
+          case SQM_COL_SUBJ:       echo _("Subject") . "\n";  break;
           case SQM_COL_FLAGS:
                 echo getIcon($icon_theme_path, 'msg_new.png', '&nbsp;', _("Message Flags")) . "\n";
                 break;
-          case SQM_COL_SIZE:       echo  _("Size")."\n";    break;
+          case SQM_COL_SIZE:       echo  _("Size") . "\n";    break;
           case SQM_COL_PRIO:
                 echo getIcon($icon_theme_path, 'prio_high.png', '!', _("Priority")) . "\n";
                 break;
           case SQM_COL_ATTACHMENT:
                 echo getIcon($icon_theme_path, 'attach.png', '+', _("Attachment")) . "\n";
                 break;
-          case SQM_COL_INT_DATE:   echo _("Received")."\n"; break;
-          case SQM_COL_TO:         echo _("To")."\n";       break;
-          case SQM_COL_CC:         echo _("Cc")."\n";       break;
-          case SQM_COL_BCC:        echo _("Bcc")."\n";      break;
+          case SQM_COL_INT_DATE:   echo _("Received") . "\n"; break;
+          case SQM_COL_TO:
+              echo '<label for="toggleAll">' . _("To") . "</label>\n";
+              break;
+          case SQM_COL_CC:         echo _("Cc") . "\n";       break;
+          case SQM_COL_BCC:        echo _("Bcc") . "\n";      break;
           default: break;
         }
         // add the sort buttons
@@ -256,8 +280,13 @@ if ($pageOffset < $end_msg) {
 
             // this stuff does the auto row highlighting on mouseover
             //
+            if (!empty($plugin_output['checkbox_javascript_onclick'])) $checkbox_javascript_onclick = $plugin_output['checkbox_javascript_onclick'];
+            else $checkbox_javascript_onclick = '';
+
             if ($javascript_on && $fancy_index_highlite) {
-                $checkbox_javascript = ' onclick="this.checked = !this.checked;"';
+                $checkbox_javascript = ' onclick="this.checked = !this.checked; ' . $checkbox_javascript_onclick . '"';
+            } else if (!empty($checkbox_javascript_onclick)) {
+                $checkbox_javascript = ' onclick="' . $checkbox_javascript_onclick . '"';
             } else {
                 $checkbox_javascript = '';
             }
@@ -305,7 +334,7 @@ if ($pageOffset < $end_msg) {
         $aColumns[SQM_COL_ATTACHMENT]['value'] = $sValue;
     }
 
-    $class = ($checkall && $javascript_on && $fancy_index_highlite ? 'clicked_even' : 'even');
+    $class = (($checkall || in_array($iUid, $preselected)) && $javascript_on && $fancy_index_highlite ? 'clicked_even' : 'even');
     $non_clicked_class = 'even';
 
     /**
@@ -313,7 +342,7 @@ if ($pageOffset < $end_msg) {
      */
     if (isset($alt_index_colors) && $alt_index_colors) {
         if (!($i % 2)) {
-            $class = ($checkall && $javascript_on && $fancy_index_highlite ? 'clicked_odd' : 'odd');
+            $class = (($checkall || in_array($iUid, $preselected)) && $javascript_on && $fancy_index_highlite ? 'clicked_odd' : 'odd');
             $non_clicked_class = 'odd';
         }
 
@@ -324,7 +353,7 @@ if ($pageOffset < $end_msg) {
      */
     if (isset($aMsg['row']['color']))
     {
-       if ($checkall && $javascript_on && $fancy_index_highlite) {
+       if (($checkall || in_array($iUid, $preselected)) && $javascript_on && $fancy_index_highlite) {
 //FIXME: would be best not to use $color directly here; want to move this to be a CSS style-defined value only, but the problem is that this CSS class is being defined on the fly right here
            $bgcolor = $color[16];
            $class = 'clicked_misc'.$i;
@@ -352,9 +381,11 @@ if ($pageOffset < $end_msg) {
     // where on the row you click
     //
     $javascript_auto_click = '';
+    $row_click_extra = '';
+    if (!empty($plugin_output['row_click_extra'])) $row_click_extra = $plugin_output['row_click_extra'];
     if ($javascript_on && $fancy_index_highlite) {
         // include the form_id in order to show multiple messages lists. Otherwise id isn't unique
-        $javascript_auto_click = " onmousedown=\"row_click('$form_id"."_msg$i')\"";
+        $javascript_auto_click = " onmousedown=\"row_click('$form_id"."_msg$i', event, '$form_name', 'msg[' + $i + ']', '$row_click_extra')\"";
     }
 
 
@@ -425,6 +456,17 @@ if ($non_clicked_class != 'even' && $non_clicked_class != 'odd'
         $onclick    = (isset($aCol['onclick']))    ? $aCol['onclick']    : '';
         $value      = (isset($aCol['value']))      ? $aCol['value']      : '';
         $target     = (isset($aCol['target']))     ? $aCol['target']     : '';
+        if (!$show_personal_names
+         && !empty($title)
+         && ($iCol == SQM_COL_FROM
+          || $iCol == SQM_COL_TO
+          || $iCol == SQM_COL_CC
+          || $iCol == SQM_COL_BCC)) {
+            // swap title and value
+            $tmp = $title;
+            $title = $value;
+            $value = $tmp;
+        }
         if ($iCol !== SQM_COL_CHECK) {
             $value = $sLabelStart.$sPre.$value.$sEnd.$sLabelEnd;
         }
@@ -432,7 +474,7 @@ if ($non_clicked_class != 'even' && $non_clicked_class != 'odd'
 
         switch ($iCol) {
           case SQM_COL_CHECK:
-            $checked = ($checkall ? ' checked="checked" ' : '');
+            $checked = (($checkall || in_array($iUid, $preselected)) ? ' checked="checked" ' : '');
             if ($javascript_on) {
                 echo '<td class="col_check"'. $javascript_auto_click. '>' ?>
                 <input type="checkbox" name="<?php echo "msg[$i]";?>" id="<?php echo $form_id."_msg$i";?>" value="<?php echo $iUid;?>" <?php echo $checkbox_javascript . $checked;?> /></td>
@@ -454,7 +496,7 @@ if ($non_clicked_class != 'even' && $non_clicked_class != 'odd'
             if ($onclick)    { $sText .= " onclick=\"$onclick\""; }
             if ($link_extra) { $sText .= " $link_extra";          }
             if ($javascript_on && $fancy_index_highlite) {
-                  $sText .= " onmousedown=\"row_click('$form_id"."_msg$i'); setPointer(this." . (empty($bold) ? '' : 'parentNode.') .
+                  $sText .= " onmousedown=\"row_click('$form_id"."_msg$i', event, '$form_name', 'msg[' + $i + ']', '$row_click_extra'); setPointer(this." . (empty($bold) ? '' : 'parentNode.') .
                             'parentNode.parentNode, ' . $i . ', \'click\', \''. $non_clicked_class. '\', \'mouse_over\', \'clicked\');"';
             }
             $sText .= ">"
@@ -472,8 +514,9 @@ if ($non_clicked_class != 'even' && $non_clicked_class != 'odd'
             break;
           case SQM_COL_INT_DATE:
           case SQM_COL_DATE:
-            $sText = "    <td class=\"col_date\" $javascript_auto_click>"
-                   . $value. "</td>\n";
+            $sText = "    <td class=\"col_date\" $javascript_auto_click";
+            if ($title) {$sText .= " title=\"$title\"";}
+            $sText .= ">" . $value. "</td>\n";
             echo $sText;
             break;
           default:
@@ -527,6 +570,7 @@ if ($non_clicked_class != 'even' && $non_clicked_class != 'odd'
                        */
                       $paginator_str = $this->fetch('paginator.tpl');
                       echo $paginator_str; 
+                      if (!empty($plugin_output['mailbox_paginator_after'])) echo $plugin_output['mailbox_paginator_after'];
                     ?></td>
                     <td class="message_count"><?php echo $msg_cnt_str; ?></td>
                   </tr>
@@ -546,5 +590,5 @@ if ($non_clicked_class != 'even' && $non_clicked_class != 'odd'
 </div>
 
 <?php if (!$hide_sm_attributions): ?>
-<p class="sqm_squirrelcopyright">&copy; 1999-2007 The SquirrelMail Project Team - <a href="about.php">About SquirrelMail</a></p>
+<p class="sqm_squirrelcopyright">&copy; <?php echo SM_COPYRIGHT ?> The SquirrelMail Project Team - <a href="about.php">About SquirrelMail</a></p>
 <?php endif; ?>