File/plugins/newmail/functions.php

Description

NaSMail NewMail plugin

Functions

  • version: $Id: functions.php 1261 2008-04-08 09:06:11Z tokul $
  • copyright: (c) 2006-2008 The NaSMail Project
  • copyright: (c) 2001-2006 The SquirrelMail Project Team
  • todo: add midi support
  • license: GNU Public License
Includes
 include_once (SM_PATH.'plugins/newmail/config.php') (line 35)
 include_once (SM_PATH.'config/newmail_config.php') (line 33)

load config

 include_once (SM_PATH.'plugins/newmail/config_default.php') (line 28)

load default config

Constants
SM_NEWMAIL_FILETYPE_MP3 = 3 (line 21)
SM_NEWMAIL_FILETYPE_OGG = 4 (line 22)
SM_NEWMAIL_FILETYPE_SVG = 6 (line 24)
SM_NEWMAIL_FILETYPE_SWF = 5 (line 23)
SM_NEWMAIL_FILETYPE_WAV = 2 (line 20)

file type defines

Functions
CheckNewMailboxSound (line 286)

Checks if mailbox contains new messages.

Order of arguments was changed in 1.3 version.

  • return: true, if there are new messages
bool CheckNewMailboxSound (stream $imapConnection, string $real_box,  &$total_new, integer $total_new)
  • stream $imapConnection
  • string $real_box: unformated mailbox name
  • integer $total_new: number of new messages
  • &$total_new
newmail_create_media_tags (line 720)

Detects used media type and creates all need tags

  • return: html tags with media objects
string newmail_create_media_tags (string $newmail_media)
  • string $newmail_media
newmail_detect_filetype (line 320)

Function tries to detect if file contents match declared file type

Function returns default extension for detected mime type or 'false'

TODO: use $contents to check if file is in specified type

string newmail_detect_filetype (string $contents, string $type)
  • string $contents: file contents
  • string $type: file mime type
newmail_get_mediatype (line 354)

Function tries to detect uploaded file type

  • return: One of SM_NEWMAIL_FILETYPE_* defines or false.
integer newmail_get_mediatype (string $type, string $filename)
  • string $type
  • string $filename
newmail_get_mediatype_by_ext (line 388)

Function provides filetype detection for browsers, that upload files with application/octet-stream file type.

Ex. some version of Opera.

  • return: One of SM_NEWMAIL_FILETYPE_* defines or false.
integer newmail_get_mediatype_by_ext (string $filename)
  • string $filename
newmail_media_embed (line 576)

Creates embed tags of multimedia object

docs about embed Apple: http://www.apple.com/quicktime/authoring/embed.html

Warnings: * Returned string does not contain html closing tag. * embed tags will be created by newmail_media_objects() only when $newmail_mediacompat_mode option is enabled. Option is not enabled by default in order to comply to w3.org specs. * This is internal function, use newmail_media_objects() instead

  • return: embed html tags and attributes required by selected media type.
  • link: Info about embed tag
string newmail_media_embed (string $object, integer $type, string $path, [array $args = array()], [bool $addsuffix = true])
  • string $object: object name
  • integer $type: media object type
  • string $path: URL to media object
  • array $args: media object attributes
  • bool $addsuffix: controls addition of suffix to media object url
newmail_media_embed_close (line 683)

Adds closing tags for object

Warning: * This is internal function, use newmail_media_objects() instead

  • return: closing tag of media object
string newmail_media_embed_close (integer $type)
  • integer $type: media object type
newmail_media_object (line 460)

Creates object tags of multimedia object for browsers that comply to w3.org specifications.

Warnings:

  • Returned string does not contain html closing tag.
  • This is internal function, use newmail_media_objects() instead

  • return: object html tags and attributes required by selected media type.
  • link: W3.org specs
string newmail_media_object (string $object, integer $type, string $path, [array $args = array()], [bool $addsuffix = true])
  • string $object: object name
  • integer $type: media object type
  • string $path: URL to media object
  • array $args: media object attributes
  • bool $addsuffix: controls addition of suffix to media object url
newmail_media_objects (line 409)

Creates html object tags of multimedia object

Main function that creates multimedia object tags

  • return: object html tags and attributes required by selected media type.
string newmail_media_objects (string $object,  $types, string $path, [array $args = array()], [string $extra = ''], [bool $addsuffix = true], integer $type)
  • string $object: object name
  • integer $type: media object type
  • string $path: URL to media object
  • array $args: media object attributes
  • string $extra: tags that have to buried deep inside object tags
  • bool $addsuffix: controls addition of suffix to media object url
  • $types
newmail_media_object_close (line 660)

Adds closing tags for object

Warning: * This is internal function, use newmail_media_objects() instead

  • return: closing tag of media object
string newmail_media_object_close (integer $type)
  • integer $type: media object type
newmail_media_object_ie (line 518)

Creates multimedia object tags for Internet Explorer (Win32)

Warning: * Returned string does not contain html closing tag, because this multimedia object can include other media objects. * This is internal function, use newmail_media_objects() instead

  • return: object html tags and attributes required by selected media type.
  • todo: add ogg and svg support
string newmail_media_object_ie (string $object, integer $type, string $path, [array $args = array()], bool $addsuffix)
  • string $object: object name
  • integer $type: media object type
  • string $path: URL to media object
  • array $args: media object attributes
  • bool $addsuffix: controls addition of suffix to media object url
newmail_media_object_ie_close (line 637)

Adds closing tags for ie object

Warning: * This is internal function, use newmail_media_objects() instead

  • return: closing tag of media object
string newmail_media_object_ie_close (integer $type)
  • integer $type: media object type
newmail_media_prepare_args (line 707)

Converts media attributes to string

Warning: * attribute values are automatically sanitized by htmlspecialchars() * This is internal function, use newmail_media_objects() instead

  • return: string with object attributes
string newmail_media_prepare_args (array $args)
  • array $args: array with object attributes
newmail_optpage_register_block_function (line 43)

Register newmail option block

void newmail_optpage_register_block_function ()
newmail_plugin_function (line 181)

Insert needed data in left_main

void newmail_plugin_function ()
newmail_pref_function (line 139)

Load newmail plugin settings

void newmail_pref_function ()
newmail_sav_function (line 62)

Save newmail plugin settings

void newmail_sav_function ()
newmail_set_loadinfo_function (line 168)

Set loadinfo data

Used by option page when saving settings.

void newmail_set_loadinfo_function ()

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