Removing hooks from template one by one...
[squirrelmail.git] / templates / default / message_list.tpl
index 2ea3c96f0d2ae597c5128c2f833a01d00ae877ce..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)"
@@ -131,7 +185,7 @@ $clickedColor = (empty($color[16])) ? $color[2] : $color[16];
         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>
@@ -536,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>