Removing hooks from template one by one...
[squirrelmail.git] / templates / default / message_list.tpl
index a335c183da15c45a2d60df15f9644a4c987c94ca..73e6345ab93547a9b363d662ea1bcac46d39f468 100644 (file)
@@ -5,6 +5,61 @@
  *
  * Template for viewing a messages list
  *
+ * The following variables are available in this template:
+//FIXME: need to clean (and document) this list, it is just a dump of the array keys of $t
+ *    $sTemplateID
+ *    $icon_theme_path
+ *    $javascript_on
+ *    $delayed_errors
+ *    $frames
+ *    $lang
+ *    $page_title
+ *    $header_tags
+ *    $plugin_output
+ *    $header_sent
+ *    $body_tag_js
+ *    $shortBoxName
+ *    $sm_attribute_str
+ *    $frame_top
+ *    $urlMailbox
+ *    $startMessage
+ *    $hide_sm_attributions
+ *    $uri
+ *    $text
+ *    $onclick
+ *    $class
+ *    $id
+ *    $target
+ *    $color
+ *    $form_name
+ *    $form_id
+ *    $page_selector
+ *    $page_selector_max
+ *    $messagesPerPage
+ *    $showall
+ *    $end_msg
+ *    $align
+ *    $iNumberOfMessages
+ *    $aOrder
+ *    $aFormElements
+ *    $sort
+ *    $pageOffset
+ *    $baseurl
+ *    $aMessages
+ *    $trash_folder
+ *    $sent_folder
+ *    $draft_folder
+ *    $thread_link_str
+ *    $php_self
+ *    $mailbox
+ *    $enablesort
+ *    $icon_theme
+ *    $use_icons
+ *    $alt_index_colors
+ *    $fancy_index_highlite
+ *    $compact_paginator
+ *    $aErrors
+ *
  * @copyright © 1999-2006 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  */
 
 /** add required includes */
-include_once(SM_PATH . 'templates/util_global.php');
-include_once(SM_PATH . 'templates/util_message_list.php');
+include_once(SM_PATH . 'functions/template/message_list_util.php');
 
 /* retrieve the template vars */
 extract($t);
 
-do_hook('mailbox_index_before');
+if (!empty($plugin_output['mailbox_index_before'])) echo $plugin_output['mailbox_index_before'];
 
 /**
  * Calculate string "Viewing message x to y (z total)"
@@ -91,7 +145,7 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16];
 
 ?>
 <div id="message_list">
-<form id="<?php echo $form_id;?>" name="<?php echo $form_name;?>" method="post" action="<?php echo $php_self;?>">
+<form id="<?php echo $form_name;?>" name="<?php echo $form_name;?>" method="post" action="<?php echo $php_self;?>">
 <table class="table_empty" cellspacing="0">
   <tr>
    <td>
@@ -121,17 +175,17 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16];
     if (count($aFormElements)) {
 ?>
 <!-- start message list form control -->
-      <tr class="message_list_controls" cellspacing="0">
+      <tr class="message_list_controls">
         <td>
           <table class="table_empty" cellspacing="0">
             <tr>
-              <td class="message_control_buttons" cellspacing="0">
+              <td class="message_control_buttons">
 
 <?php
         foreach ($aFormElements as $key => $value) {
             switch ($value[1]) {
             case 'submit':
-                if ($key != 'moveButton' && $key != 'delete' && $key != 'undeleteButton') { // add move in a different table cell
+                if ($key != 'moveButton' && $key != 'copyButton' && $key != 'delete' && $key != 'undeleteButton') { // add move in a different table cell
 ?>
                   <input type="submit" name="<?php echo $key; ?>" value="<?php echo $value[0]; ?>" class="message_control_button" />&nbsp;
 <?php
@@ -140,7 +194,7 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16];
             case 'checkbox':
                 if ($key != 'bypass_trash') {
 ?>
-                  <input type="checkbox" name="<?php echo $key; ?>" /><?php echo $value[0]; ?>&nbsp;
+                  <input type="checkbox" name="<?php echo $key; ?>" id="<?php echo $key; ?>" /><label for="<?php echo $key; ?>"><?php echo $value[0]; ?></label>&nbsp;
 <?php
                 }
                 break;
@@ -162,7 +216,7 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16];
  <?php
             if (isset($aFormElements['bypass_trash'])) {
 ?>
-                  <input type="checkbox" name="bypass_trash" /><?php echo $aFormElements['bypass_trash'][0]; ?>&nbsp;
+                  <input type="checkbox" name="bypass_trash" id="bypass_trash" /><label for="bypass_trash"><?php echo $aFormElements['bypass_trash'][0]; ?></label>&nbsp;
 <?php
             }
             if (isset($aFormElements['undeleteButton'])) {
@@ -174,13 +228,18 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16];
               </td>
 <?php
         } // if (isset($aFormElements['delete']))
-        if (isset($aFormElements['moveButton'])) {
+        if (isset($aFormElements['moveButton']) || isset($aFormElements['copyButton'])) {
 ?>
               <td class="message_control_move">
                     <select name="targetMailbox">
                        <?php echo $aFormElements['targetMailbox'][0];?>
                     </select>
+<?php         if (isset($aFormElements['moveButton'])) { ?>
                   <input type="submit" name="moveButton" value="<?php echo $aFormElements['moveButton'][0]; ?>" class="message_control_button" />
+<?php         }
+              if (isset($aFormElements['copyButton'])) { ?>
+                  <input type="submit" name="copyButton" value="<?php echo $aFormElements['copyButton'][0]; ?>" class="message_control_button" />
+<?php         } ?>
               </td>
 
 <?php
@@ -196,7 +255,8 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16];
 ?>
     </table>
 <?php
-    do_hook('mailbox_form_before');
+    //FIXME: no hooks in templates!
+    do_hook('mailbox_form_before', $null);
 ?>
     </td>
   </tr>
@@ -225,7 +285,7 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16];
         switch ($iCol) {
           case SQM_COL_CHECK:
               if ($javascript_on) {
-                  echo '<input type="checkbox" name="toggleAll" title="'._("Toggle All").'" onclick="toggle_all(\''.$form_id."',".$fancy_index_highlite.')" />'."\n";
+                  echo '<input type="checkbox" name="toggleAll" title="'._("Toggle All").'" onclick="toggle_all(\''.$form_name."',".$fancy_index_highlite.')" />'."\n";
               } else {
                   $link = $baseurl . "&amp;startMessage=$pageOffset&amp;checkall=";
                   if (sqgetGlobalVar('checkall',$checkall,SQ_GET)) {
@@ -260,16 +320,19 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16];
             if ($sort == $aSortSupported[$iCol][0]) {
                 $newsort = $aSortSupported[$iCol][1];
                 $img = 'up_pointer.png';
+                $text_icon = '&#8679;';  // U+21E7 UPWARDS WHITE ARROW
             } else if ($sort == $aSortSupported[$iCol][1]) {
                 $newsort = 0;
                 $img = 'down_pointer.png';
+                $text_icon = '&#8681;'; // U+21E9 DOWNWARDS WHITE ARROW
             } else {
                 $newsort = $aSortSupported[$iCol][0];
                 $img = 'sort_none.png';
+                $text_icon = '&#9723;'; // U+25FB WHITE MEDIUM SQUARE
             }
             /* Now that we have everything figured out, show the actual button. */
-            echo " <a href=\"$baseurl&amp;startMessage=1&amp;srt=$newsort\">" .
-                 getIcon($icon_theme_path, $img, '&nbsp;', _("Click here to change the sorting of the message list")) . "\n" .
+            echo " <a href=\"$baseurl&amp;startMessage=1&amp;srt=$newsort\" style=\"text-decoration:none\">" .
+                 getIcon($icon_theme_path, $img, $text_icon, _("Click here to change the sorting of the message list")) . "\n" .
                  '</a>';
         }
 ?>
@@ -533,7 +596,7 @@ if ($class != 'even' && $class != 'odd')
       </tr>
       <tr>
         <td>
-        <?php do_hook('mailbox_index_after');?>
+        <?php /* FIXME: no hooks in templates!! */ do_hook('mailbox_index_after', $null); ?>
         </td>
       </tr>
     </table>