IP.Board  3.3.0
class_attach Class Reference
Inheritance diagram for class_attach:
plugin_blogcblock plugin_blogentry plugin_ccs plugin_custom_pages plugin_event plugin_msg plugin_packages plugin_post plugin_support

Public Member Functions

 __construct (ipsRegistry $registry)
 bulkArchive ($archiveIds=array(), $idType='attach_rel_id')
 bulkRemoveAttachment ($remove_ids=array(), $id_type='attach_rel_id')
 bulkUnarchive ($archiveIds=array(), $idType='attach_rel_id')
 checkUploadDirectory ()
 getUploadFormSettings ()
 init ()
 loadAttachmentPlugin ()
 postProcessUpload ($args=array())
 processMultipleUploads ()
 processUpload ()
 removeAttachment ()
 renderAttachments ($htmlArray, $rel_ids=array(), $skin_name='topic')
 renderSingleAttachment ($attachment, $skin_name='topic', $use_wrapper=false)
 showAttachment ($attach_id)

Data Fields

 $attach_parent_id = 0
 $attach_post_key = ''
 $attach_rel_id = 0
 $attach_settings
 $attach_stats = array()
 $error = ""
 $extra_upload_form_url = ''
 $html
 $language
 $plugin = ''
 $type = ''
 $upload_dir = ''
 $upload_path = ''

Protected Member Functions

 _parseThumbnailInline ($matches)
 getAttachTypes ()

Protected Attributes

 $DB
 $lang
 $member
 $memberData
 $registry
 $request
 $settings

Constructor & Destructor Documentation

__construct ( ipsRegistry registry)

#@- CONSTRUCTOR

Parameters:
objectipsRegistry reference
Returns:
void

Reimplemented in plugin_post.


Member Function Documentation

_parseThumbnailInline ( matches) [protected]

Swaps the HTML for the nice attachments.

Parameters:
arrayArray of matches from preg_replace_callback
Returns:
string HTML
bulkArchive ( archiveIds = array(),
idType = 'attach_rel_id' 
)

Archive attachments Currently this just flags them as archived. It does not physically move the files as this seems a bit pointless as they have to stay in the file system anyway

Parameters:
array$archiveIds
string$idType
bulkRemoveAttachment ( remove_ids = array(),
id_type = 'attach_rel_id' 
)

Removes attachment(s)

Parameters:
array$remove_idsArray of attachment ids to remove
string$id_typeColumn to use when deleting, attach_rel_id by default
Returns:
bool
bulkUnarchive ( archiveIds = array(),
idType = 'attach_rel_id' 
)

Unarchive attachments Currently this just flags them as unarchived. It does not physically move the files as this seems a bit pointless as they have to stay in the file system anyway

Parameters:
array$archiveIds
string$idType

Checks the upload dir. See above. It's not rocket science

Returns:
bool
getAttachTypes ( ) [protected]

Retrieve attachment types from cache

Returns:
array

Gets stuff required for the upload form

Returns:
void
init ( )

Initiates class

Returns:
void

Loads child extends class.

Returns:
void
postProcessUpload ( args = array())

Converts post-key attachments into rel_id / rel_module attachments by adding in the correct ID, etc

Parameters:
array$args
Returns:
array

Uploads and saves file

Returns:
mixed void, or an array of new insert ids

Uploads and saves file

Returns:
mixed void, or the new insert id

Removes an attachment.

Returns:
void
renderAttachments ( htmlArray,
rel_ids = array(),
skin_name = 'topic' 
)

Swaps the HTML for the nice attachments.

Parameters:
arrayArray of HTML blocks to convert: [ rel_id => $html ]
arrayRelationship ids
stringSkin group to use
Returns:
array Array of converted HTML blocks and attach code: [ id => $html ]
renderSingleAttachment ( attachment,
skin_name = 'topic',
use_wrapper = false 
)

Retrieve the HTML for a single attachment

Parameters:
mixedArray of attachment data, or an attachment ID
stringSkin group to use
boolWhether to wrap with the attachment block wrapper or not
Returns:
string Attachment HTML
showAttachment ( attach_id)

Show the attachment (or force download)

Parameters:
intAttachment ID (The main attach id)
Returns:
void
See Also:
http://community.invisionpower.com/tracker/issue-22011-wrong-way-to-handle-attachments-transfer/

Field Documentation

$attach_settings
Initial value:
 array( 
                                                                        'siu_thumb'                 => 0,
                                                                        'siu_height'                => 0,
                                                                        'siu_width'                 => 0,
                                                                        'allow_monthly_upload_dirs' => 0,
                                                                        'upload_dir'                => '' 
                                                                )
$language
Initial value:
 array( 'unlimited'   => 'Unlimited',
                                                          'not_allowed' => 'Uploading is not allowed' )

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables