Added 4 hooks (internal_link, mailbox_display_buttons, move_messages_button_action...
authorcigamit <cigamit@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 18 Jul 2003 02:53:37 +0000 (02:53 +0000)
committercigamit <cigamit@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 18 Jul 2003 02:53:37 +0000 (02:53 +0000)
These are very useful for several plugins (Msg  Flags, Archive Mail, Link Buttons to name a few) and allow for a more pretty/graphical display

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5330 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mailbox_display.php
functions/page_header.php
src/left_main.php
src/move_messages.php

index 12480fb208c2478706b1ee2d5cb6b56d20e1c66e..546e0b6644859776225b94f0f54c7bb56f28c394 100644 (file)
@@ -295,8 +295,7 @@ function getServerMessages($imapConnection, $start_msg, $show_num, $num_msgs, $i
             $end_loop = $num_msgs - $start_msg + 1;
         } else {
             $end_loop = $show_num;
-        }
-        return fillMessageArray($imapConnection,$id,$end_loop,$show_num);
+        }        return fillMessageArray($imapConnection,$id,$end_loop,$show_num);
     } else {
         return false;
     }
@@ -346,8 +345,7 @@ function getSelfSortMessages($imapConnection, $start_msg, $show_num,
             } else {
                 $end_loop = $show_num;
             }
-        }
-        $msgs = fillMessageArray($imapConnection,$id,$end_loop, $show_num);
+        }        $msgs = fillMessageArray($imapConnection,$id,$end_loop, $show_num);
     }
     return $msgs;
 }
@@ -420,8 +418,7 @@ function showMessagesForMailbox($imapConnection, $mailbox, $num_msgs,
            sqgetGlobalVar('msort', $msort, SQ_SESSION);
        } else {
            sqsession_unregister('msort');
-           sqsession_unregister('msgs');
-       }
+           sqsession_unregister('msgs');       }
         switch ($mode) {
             case 'thread':
                 $id   = get_thread_sort($imapConnection);
@@ -720,7 +717,7 @@ function mail_message_listing_beginning ($imapConnection,
         echo getButton('SUBMIT', 'expungeButton',_("Expunge"))
              .'&nbsp;' . _("mailbox") . "\n";
     }
-
+    do_hook('mailbox_display_buttons');
     echo getButton('SUBMIT', 'markRead',_("Read"));
     echo getButton('SUBMIT', 'markUnread',_("Unread"));
     echo getButton('SUBMIT', 'delete',_("Delete")) ."&nbsp;\n";
index 53c5d003e4603a30a125b22c3c586989405495ef..8d567d8d13fc35c32e2d78377cef20ebd329b77a 100644 (file)
@@ -74,6 +74,9 @@ function makeInternalLink($path, $text, $target='') {
     if ($target != '') {
         $target = " target=\"$target\"";
     }
+    $hooktext = do_hook_function('internal_link',$text);
+    if ($hooktext != '')
+        $text = $hooktext;
     return '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>';
 }
 
index e716ecc82ec6ba32b9dcc8b0475679e4a55aa7c8..b986093ccaf4706aa89851fd8d79ee4e6ee56e8c 100644 (file)
@@ -178,6 +178,10 @@ function create_collapse_link($boxnum) {
     }
     $link .= '</a>';
 
+    $hooklink = do_hook_function('create_collapse_link',$link);
+    if ($hooklink != '')
+        $link = $hooklink;
+
     /* Return the finished product. */
     return ($link);
 }
index bc1cd4eb020e4593185e7a3ddd623a7e91e7def6..43b89e567a6cb3a624334407b2c2fa9ad10adb98 100644 (file)
@@ -69,7 +69,7 @@ function attachSelectedMessages($msg, $imapConnection) {
             $body_a = sqimap_run_command($imapConnection, "FETCH $id RFC822",true, $response, $readmessage, $uid_support);
             if ($response == 'OK') {
             $k = $i + $start_index;
-        $subject = $msgs[$k]['SUBJECT'];
+            $subject = $msgs[$k]['SUBJECT'];
 
             array_shift($body_a);
             $body = implode('', $body_a);
@@ -177,14 +177,17 @@ if(isset($expungeButton)) {
     if (count($id)) {
         $cnt = count($id);
         if (!isset($attache)) {
+            $button_action = concat_hook_function('move_messages_button_action');
             if (isset($markRead)) {
                 sqimap_toggle_flag($imapConnection, $id, '\\Seen',true,true);
             } else if (isset($markUnread)) {
                 sqimap_toggle_flag($imapConnection, $id, '\\Seen',false,true);
             } else  {
-                sqimap_msgs_list_delete($imapConnection, $mailbox, $id);
-                if ($auto_expunge) {
-                    $cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, true);
+                if (!$button_action) {
+                    sqimap_msgs_list_delete($imapConnection, $mailbox, $id);
+                    if ($auto_expunge) {
+                        $cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, true);
+                    }
                 }
             }
         }