integrated attachment_common into the core
[squirrelmail.git] / src / options_identities.php
index 5b900cfc708c0bda48b4f06a9da5619bb404f0b2..8c8b0e0f905f0d46445132153cbd7118d4d5c246 100644 (file)
@@ -5,10 +5,8 @@
     **  $Id$
     **/
 
-   include('../src/validate.php');
-   include('../functions/page_header.php');
-   include('../functions/display_messages.php');
-   include('../src/load_prefs.php');
+   require_once('../src/validate.php');
+   require_once('../functions/display_messages.php');
 
    if (isset($return)) {
       SaveUpdateFunction();
    
    displayPageHeader($color, 'None');
 
+   $Info = do_hook('options_identities_process', 0);
+   if ($Info[1])
+      SaveUpdateFunction();
+
    if (CheckAndDoDefault() || CheckAndDoPromote()) {
       SaveUpdateFunction();
    }
 ?>
 <br>
 <table width=95% align=center border=0 cellpadding=2 cellspacing=0>
-  <tr>
-    <th bgcolor="<?php echo $color[0] ?>" align=center>
-      <?php echo _("Options") . " - " . _("Advanced Identities"); ?>
-    </th>
-  </tr>
-</table>
+<tr><td bgcolor="<?php echo $color[0] ?>" align="center">
+
+      <b><?php echo _("Options") . ' - ' . _("Advanced Identities"); ?></b>
+
+    <table width="100%" border="0" cellpadding="1" cellspacing="1">
+    <tr><td bgcolor="<?php echo $color[4] ?>" align="center">
+
+<form name=f action="options_identities.php" method=post><br>
 
-<form name=f action="options_identities.php" method=post>
+<?PHP do_hook('options_identities_top'); ?>
 
-<center>
-<table width=80% cellpadding=0 cellspacing=0 border=0>
+<table width=80% cellpadding=2 cellspacing=0 border=0>
   <tr bgcolor="<?PHP echo $color[9] ?>">
     <th colspan=2 align=center><?PHP echo _("Default Identity") ?></th>
   </tr>
    ShowTableInfo('', '', '', $num);
 ?>
 </table>   
-</center>
 </form>
+
+    </td></tr>
+    </table>
+
+</td></tr>
+</table>
 </body></html>
+
 <?PHP
 
 function SaveUpdateFunction()
@@ -89,6 +98,7 @@ function SaveUpdateFunction()
       if (isset($$name)) {
          $fakeI --;
       } else {
+         do_hook('options_identities_renumber', $i, $fakeI);
          $filled = 0;
         
          $name = 'full_name' . $i;
@@ -146,6 +156,7 @@ function CheckAndDoDefault()
       $name = 'make_default_' . $i;
       global $$name;
       if (isset($$name)) {
+          do_hook('options_identities_renumber', $i, 'default');
           global $full_name, $email_address, $reply_to;
          
           $name = 'full_name' . $i;
@@ -210,6 +221,8 @@ function CheckAndDoPromote()
       $name = 'promote_' . $i;
       global $$name;
       if (isset($$name) && $i > 1) {
+          do_hook('options_identities_renumber', $i, $i - 1);
+         
          $nameA = 'full_name' . $i;
          $nameB = 'full_name' . ($i - 1);
          global $$nameA, $$nameB;
@@ -224,8 +237,8 @@ function CheckAndDoPromote()
          $$nameA = $$nameB;
          $$nameB = $temp;
          
-         $nameA = 'email_address' . $i;
-         $nameB = 'email_address' . ($i - 1);
+         $nameA = 'reply_to' . $i;
+         $nameB = 'reply_to' . ($i - 1);
          global $$nameA, $$nameB;
          $temp = $$nameA;
          $$nameA = $$nameB;
@@ -294,11 +307,12 @@ function ShowTableInfo($full_name, $email_address, $reply_to, $post)
       ?>" name="reply_to<?PHP echo $post ?>"> 
     </td>
   </tr>
+<?PHP do_hook('options_identities_table', $OtherBG, $isEmptySection, $post); ?>
   <tr<?PHP echo $OtherBG ?>>
     <td>&nbsp;</td><td>
       <input type=hidden name="form_for_<?PHP echo $post ?>" value="1">
-      <input type=submit name="update" value="<?PHP echo _("Save / Update") ?>">
-<?PHP 
+      <input type=submit name="update" value="<?PHP 
+   echo _("Save / Update") . '">';
    if (! $isEmptySection && $post != '') {
 ?>
       <input type=submit name="make_default_<?PHP echo $post ?>" value="<?PHP
@@ -312,6 +326,7 @@ function ShowTableInfo($full_name, $email_address, $reply_to, $post)
          echo _("Move Up") ?>">
 <?PHP
    }
+   do_hook('options_identities_buttons', $isEmptySection, $post);
 ?>
     </td>
   </tr>
@@ -320,3 +335,4 @@ function ShowTableInfo($full_name, $email_address, $reply_to, $post)
   </tr>
 <?PHP
 }
+?>
\ No newline at end of file