浏览代码

added a bunch more hooks

Luke Ehresman 25 年之前
父节点
当前提交
6d65e62b87
共有 6 个文件被更改,包括 25 次插入2 次删除
  1. 13 2
      doc/plugin.txt
  2. 3 0
      src/help.php
  3. 1 0
      src/login.php
  4. 2 0
      src/read_body.php
  5. 3 0
      src/right_main.php
  6. 3 0
      src/search.php

+ 13 - 2
doc/plugin.txt

@@ -89,8 +89,19 @@ List of hooks
   loading_prefs                  src/load_prefs.php
   mailbox_index_before           functions/mailbox_display.php
   mailbox_index_after            functions/mailbox_display.php
-
-
+  right_main_after_header        src/right_main.php
+  right_main_bottom              src/right_main.php
+  login_top                      src/login.php
+  login_bottom                   src/login.php
+  read_body_top                  src/read_body.php
+  read_body_bottom               src/read_body.php
+  search_before_form             src/search.php
+  search_after_form              src/search.php
+  search_bottom                  src/search.php
+  help_top                       src/help.php
+  help_bottom                    src/help.php
+  help_chapter                   src/help.php
+   
 Options
 -------
 

+ 3 - 0
src/help.php

@@ -91,6 +91,7 @@
    <center><b><?php echo _("Help") ?></b></center>
 </td></tr></table>
 
+<? do_hook("help_top") ?>
 
 <table width=90% cellpadding=0 cellspacing=10 border=0 align=center><tr><td>
 <?php
@@ -145,6 +146,7 @@
       if (!$chapter) {
          echo "<table cellpadding=0 cellspacing=0 border=0 align=center><tr><td>\n";
          echo "<b><center>" . _("Table of Contents") . "</center></b><br>";
+         do_hook("help_chapter");
          echo "<ol>\n";
          for ($i=0; $i < count($helpdir); $i++) {
             $doc = file("../help/$user_language/$helpdir[$i]");
@@ -186,6 +188,7 @@
          echo "<br><center><a href=\"#pagetop\">" . _("Top") . "</a></center>";
       }
    }
+   do_hook("help_bottom"); 
 ?>
 <tr><td bgcolor="<?php echo $color[0] ?>">&nbsp;</td></tr></table>
 <td></tr></table>

+ 1 - 0
src/login.php

@@ -100,6 +100,7 @@
    echo "</TABLE>\n";
    echo "<input type=hidden name=just_logged_in value=1>\n";
    echo "</FORM>\n";
+   do_hook("login_bottom");
 ?>
 </BODY>
 </HTML>

+ 2 - 0
src/read_body.php

@@ -217,6 +217,7 @@
    $from_name = decodeHeader(htmlspecialchars($message->header->from));
    $subject = decodeHeader(htmlspecialchars(stripslashes($message->header->subject)));
 
+   do_hook("read_body_top");
    echo "<BR>";
    echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=100% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";
    echo "   <TR><TD BGCOLOR=\"$color[9]\" WIDTH=100%>";
@@ -341,5 +342,6 @@
    echo "   <TR><TD BGCOLOR=\"$color[9]\">&nbsp;</TD></TR>";
    echo "</TABLE>\n";
 
+   do_hook("read_body_bottom");
    sqimap_logout($imapConnection);
 ?>

+ 3 - 0
src/right_main.php

@@ -74,6 +74,8 @@
    sqimap_mailbox_select($imapConnection, $mailbox);
    displayPageHeader($color, $mailbox);
 
+   do_hook("right_main_after_header");
+   
    if ($just_logged_in == 1 && strlen(trim($motd)) > 0) {
       echo "<center><br>";
       echo "<table width=70% cellpadding=0 cellspacing=0 border=0><tr><td bgcolor=\"$color[9]\">";
@@ -113,6 +115,7 @@
       session_register("numMessages");
    }
 
+   do_hook("right_main_bottom");
    // close the connection
    sqimap_logout ($imapConnection);
 ?>

+ 3 - 0
src/search.php

@@ -28,6 +28,7 @@
    displayPageHeader($color, $mailbox);
    $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
 
+   do_hook("search_before_form");
    echo "<br>
       <table width=95% align=center cellpadding=2 cellspacing=0 border=0>
       <tr><td bgcolor=\"$color[0]\">
@@ -91,10 +92,12 @@
    echo "   </TABLE>\n"; 
    echo "</FORM>";
    echo "</td></tr></table>";
+   do_hook("search_after_form");
    if ($where && $what) {   
       sqimap_mailbox_select($imapConnection, $mailbox);
       sqimap_search($imapConnection, $where, $what, $mailbox, $color);
    }
+   do_hook("search_bottom");
    sqimap_logout ($imapConnection);
 ?>
 </body></html>