Class attachment

Description

Attachment class to perform the majority of uploading and attachment handling operations within ILance.

  • author: ILance
  • version: $Revision: 1.0.0 $

Located in /api/class.attachment.inc.php (line 23)


	
			
Variable Summary
Method Summary
void ConvertBMP2GD ( $src, [ $dest = false])
string get_file_size ()
string get_file_type ()
string get_max_size ()
void handle_attachtype_rebuild_settings ([ $attachtype = ''], [ $userid = 0], [ $projectid = 0], [ $filehash = ''], [ $ads_id = 0])
void handle_attachtype_upload_settings ([ $attachtype = ''])
void ImageCreateFromBmp ( $filename)
integer img_resizer (string $src, integer $w, integer $h, string $extension)
string print_innerhtml_js ([string $attachmentlist = 'attachmentlist'], [string $attachment_list_html = ''])
nothing remove_attachment ([integer $attachid = 0], [integer $userid = 0])
boolean save_attachment ()
mixed storagetype ([string $action = ''])
integer totalattachments ()
integer totaldiskspace ()
integer totaldownloads ()
bool validate_size ()
Variables
mixed $date_time = null (line 36)
mixed $ext_array = array() (line 33)
mixed $filedata = null (line 34)
mixed $filetype = null (line 35)
mixed $file_name = null (line 30)
mixed $max_file_size = null (line 32)
mixed $mimetypes = array(
'image/gif',
'image/jpeg',
'image/png',
'image/psd',
'image/bmp',
'image/tiff',
'image/jp2',
'image/iff',
'image/xbm',
'image/ief',
'image/vnd.wap.wbmp',
'image/vnd.microsoft.icon',
'image/vnd.djvu',
'image/x-cmu-raster',
'image/x-portable-anymap',
'image/x-portable-bitmap',
'image/x-portable-graymap',
'image/x-portable-pixmap',
'image/x-rgb',
'image/x-xbitmap',
'image/x-xpixmap',
'image/x-xwindowdump'
)
(line 41)

list of image only mime types

mixed $storagetype = null (line 28)
mixed $temp_file_name = null (line 29)
mixed $totalattachments = null (line 25)
mixed $totaldiskspace = null (line 26)
mixed $totaldownloads = null (line 27)
mixed $upload_dir = null (line 31)
Methods
ConvertBMP2GD (line 1480)
void ConvertBMP2GD ( $src, [ $dest = false])
  • $src
  • $dest
get_file_size (line 557)

Function to return the actual file size of a file being uploaded

  • return: file type
string get_file_size ()
get_file_type (line 542)

Function to return the actual file type of a file being uploaded

  • return: file type
string get_file_type ()
get_max_size (line 572)

Function to return the maximum size permitted for upload (should already be assigned)

  • return: maximum file size
string get_max_size ()
get_upload_directory (line 621)

Function to return the full upload directory (should already be assigned)

  • return: full folder path
string get_upload_directory ()
handle_attachtype_rebuild_settings (line 655)
void handle_attachtype_rebuild_settings ([ $attachtype = ''], [ $userid = 0], [ $projectid = 0], [ $filehash = ''], [ $ads_id = 0])
  • $attachtype
  • $userid
  • $projectid
  • $filehash
  • $ads_id
handle_attachtype_upload_settings (line 940)
void handle_attachtype_upload_settings ([ $attachtype = ''])
  • $attachtype
ImageCreateFromBmp (line 1606)
void ImageCreateFromBmp ( $filename)
  • $filename
img_resizer (line 1631)

Function to resize a file attachment

  • return: 0 if fail, ration otherwise
integer img_resizer (string $src, integer $w, integer $h, string $extension)
  • string $src: source file
  • integer $w: Max width
  • integer $h: Max height
  • string $extension: file extension of real image
print_innerhtml_js (line 74)

Function for printing the innerhtml javascript code in the templates

  • return: Returns javascript code
string print_innerhtml_js ([string $attachmentlist = 'attachmentlist'], [string $attachment_list_html = ''])
  • string $attachmentlist: attachment div id
  • string $attachment_list_html: attachment list html contents
remove_attachment (line 1375)

Function to remove a file attachment from the system for a specified user

nothing remove_attachment ([integer $attachid = 0], [integer $userid = 0])
  • integer $attachid: attachment id
  • integer $userid: user id (optional)
save_attachment (line 1115)

Function to save the uploaded file attachment to the filesystem or database

  • return: true or false based on successful attachment upload
boolean save_attachment ()
storagetype (line 180)

Function for returning the method of storage used by the attachment system

mixed storagetype ([string $action = ''])
  • string $action: action of function to return
totalattachments (line 107)

Function for returning the total amount of attachments in the system

  • return: total amount of attachments
integer totalattachments ()
totaldiskspace (line 131)

Function for returning the total amount of disk space used by attachments in the system

  • return: total amount of attachments
integer totaldiskspace ()
totaldownloads (line 155)

Function for returning the total downloads based on attachments in the system

  • return: total number of downloads
integer totaldownloads ()
validate_extension (line 239)

Function for validating the filename extention based on the file being uploaded

  • return: true or false if extension is valid
bool validate_extension ()
validate_size (line 277)

Function for validating the filesize based on the file being uploaded

  • return: true or false if filesize is valid
bool validate_size ()

Documentation generated on Mon, 08 Aug 2011 17:40:47 +0200 by phpDocumentor 1.4.1