X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Faddressbook.php;h=ee38cf7f8b87d57077c67ce8fea3b8acf661b251;hb=864b1c33f86d957b310bca899e198140a0a3ed9b;hp=4b730e5e15a0ed906f6500d85e845c48f78aacda;hpb=ffd8224ce14be1e6eb40c4ace15f46c21d6f4b9b;p=squirrelmail.git
diff --git a/src/addressbook.php b/src/addressbook.php
index 4b730e5e..ee38cf7f 100644
--- a/src/addressbook.php
+++ b/src/addressbook.php
@@ -1,105 +1,109 @@
$b['backend'])
- return 1;
- else if($a['backend'] < $b['backend'])
+/**
+ * addressbook.php
+ *
+ * Copyright (c) 1999-2001 The Squirrelmail Development Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * Manage personal address book.
+ *
+ * $Id$
+ */
+
+/*****************************************************************/
+/*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!! ***/
+/*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION. ***/
+/*** + Base level indent should begin at left margin, as ***/
+/*** the require_once below looks. ***/
+/*** + All identation should consist of four space blocks ***/
+/*** + Tab characters are evil. ***/
+/*** + all comments should use "slash-star ... star-slash" ***/
+/*** style -- no pound characters, no slash-slash style ***/
+/*** + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD ***/
+/*** ALWAYS USE { AND } CHARACTERS!!! ***/
+/*** + Please use ' instead of ", when possible. Note " ***/
+/*** should always be used in _( ) function calls. ***/
+/*** Thank you for your help making the SM code more readable. ***/
+/*****************************************************************/
+
+require_once('../src/validate.php');
+require_once('../functions/array.php');
+require_once('../functions/display_messages.php');
+require_once('../functions/addressbook.php');
+
+/* Sort array by the key "name" */
+function alistcmp($a,$b) {
+ if($a['backend'] > $b['backend']) {
+ return 1;
+ } else {
+ if($a['backend'] < $b['backend']) {
return -1;
-
- return (strtolower($a['name']) > strtolower($b['name'])) ? 1 : -1;
+ }
}
-
- // Output form to add and modify address data
- function address_form($name, $submittext, $values = array()) {
- global $color;
- echo "
\n";
+ return (strtolower($a['name']) > strtolower($b['name'])) ? 1 : -1;
+}
+
+/* Make an input field */
+function adressbook_inp_field($label, $field, $name, $size, $values, $add) {
+ global $color;
+ echo '
' .
+ $label . ':
' .
+ '
' .
+ '' . $add . '
' . "\n";
+}
+/* Output form to add and modify address data */
+function address_form($name, $submittext, $values = array()) {
+ global $color;
- // Open addressbook, with error messages on but without LDAP (the
- // second "true"). Don't need LDAP here anyway
- $abook = addressbook_init(true, true);
- if($abook->localbackend == 0) {
- plain_error_message(_("No personal address book is defined. Contact administrator."), $color);
- exit();
- }
+ echo '
\n";
- // Display the "new address" form again
- printf("';
-
- $abortform = true;
+ if($delfailed) {
+ $showaddrlist = true;
+ $defselected = $orig_sel;
}
- }
-
- // Should not get here...
- else {
- plain_error_message(_("Unknown error"), $color);
- $abortform = true;
- }
- } // End of edit address
-
-
- // Some times we end output before forms are printed
- if($abortform) {
- print "