File/plugins/abook_import_export/functions.php

Description

functions.php - Addressbook Import-Export functions

Copyright (c) 1999-2006 The SquirrelMail Project Team Copyright (c) 2007,2009 The NaSMail Project Licensed under the GNU GPL. For full terms see the file COPYING.

Uses standard plugin format to create a couple of forms to enable import/export of CSV files to/from the address book.

  • version: $Id: functions.php 1460 2009-11-03 08:20:33Z tokul $
Includes
 include_once (SM_PATH.'plugins/abook_import_export/config.php') (line 75)
 include_once (SM_PATH.'functions/forms.php') (line 22)

load form functions

 include_once (SM_PATH.'config/abook_import_export_config.php') (line 73)

site configuration

 include_once (SM_PATH.'plugins/abook_import_export/config_default.php') (line 29)

load default configuration

 include_once (SM_PATH.'functions/display_messages.php') (line 20)

load sqm_baseuri() function

Functions
aie_create_form (line 86)

Add import/export form

(internal function)

void aie_create_form ()
aie_create_Select (line 249)

Prints selection boxes in imported data table headers

Send the field numbers entered in the text boxes by the user back to this script for more processing email is handled differently, not being an array

void aie_create_Select (integer $csvmax, integer $column)
  • integer $csvmax: max number of columns
  • integer $column: column number
aie_CSVProcess (line 285)
  • return: if string is returned - it contains fatal processing error. if array - processed csv data. Array keys should be counted. If count = 1, possible processing error.
mixed aie_CSVProcess (string $row, string $text_delimiter,  &$csvorder, array $csvorder)
  • string $row
  • string $text_delimiter: (since 1.0) gets POST parameter to fix escaped text delimiters. Works only in PHP 4.3.0+
  • array $csvorder: (since 1.0) controls order imported address book fields
  • &$csvorder
aie_display_size (line 224)

returns size integer formated in bytes, Kbytes or Mbytes

  • return: formated size string
string aie_display_size (integer $size)
  • integer $size: size in bytes
aie_error_box (line 486)

Own error message function

Function provides better controls than internal NaSMail error_box() function.

  • since: 1.0
void aie_error_box (string $error_msg, [string $error_title = ''], [boolean $close_html = false])
  • string $error_msg
  • string $error_title
  • boolean $close_html
aie_fgetcsv (line 359)

fgetcsv wrapper to solve differences between 4.3.0+ and older

  • since: 1.0
void aie_fgetcsv (resource $handle, integer $length, string $delimiter, string $enclosure)
  • resource $handle
  • integer $length
  • string $delimiter
  • string $enclosure
aie_select_backend (line 406)

Creates address book selection options

Tags use 'backend' input field.

Backend ($v-bname, $v->listing and $v-writeable) specifics:

local_file - writeable parameter is available. listing parameter is available since 1.5.1. Older listing behavior defaults to true

global_file - backend is merged with local_file in 1.4.4 and 1.5.1. writeable parameter is available. listing parameter is not available and defaults to true.

database - writeable parameter is available. listing parameter is available since 1.4.4 and 1.5.1. Older listing behavior defaults to true.

ldap_server - writeable parameter is not available and backend is read only. listing parameter is available since 1.5.1. Older listing behavior defaults to false. number of returned results can be limited by backend options. backend can be uninitialized in some cases.

Listing is evaluated by list_addr() function behavior. In some cases backends might allow listing with wide search in search() method, but such backend behavior is treated as unsupported and might be removed in some SquirrelMail version.

  • return: html form tags (select or hidden input)
  • since: 1.0
string aie_select_backend (string $listing_type,  &$backend_count, integer $backend_count)
  • string $listing_type: all, write or list
  • integer $backend_count: returns number of available backends. It allows to detect which forms tags are used. 0 = empty string,
    1. = hidden input, 2 or more = select box
    abook_import_export gettext domain must be initialized before calling this function, but code can use any domain
  • &$backend_count

Documentation generated on Sun, 22 Nov 2009 17:36:34 +0200 by phpDocumentor 1.4.3