PHP 클래스 FileUploadPlugin, addons

상속: extends Gdn_Plugin
파일 보기 프로젝트 열기: vanilla/addons 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_MediaCache array

공개 메소드들

메소드 설명
__construct ( ) Permission checks & property prep.
apcAvailable ( ) : boolean
assetModel_styleCss_handler ( AssetModel $sender ) Add our CSS.
base_transformDiscussionToComment_handler ( object $sender, array $args ) Update Gdn_Media when a discussion is transformed into a comment due to a merge.
commentModel_deleteComment_handler ( CommentModel $Sender )
controller_delete ( $Sender )
discussionController_afterCommentBody_handler ( DiscussionController $Sender, $Args ) : void
discussionController_afterDiscussionBody_handler ( DiscussionController $Sender )
discussionController_beforeFormButtons_handler ( DiscussionController $Sender )
discussionController_download_create ( DiscussionController $Sender )
discussionController_render_before ( DiscussionController $Sender ) Calls FileUploadPlugin::PrepareController
discussionModel_deleteDiscussion_handler ( DiscussionModel $Sender )
drawAttachFile ( mixed $Sender ) DrawAttachFile function.
findLocalMedia ( mixed $Media, $Absolute = false, $ReturnString = false ) : array
findLocalMediaFolder ( mixed $MediaID, mixed $UserID, $Absolute = false, $ReturnString = false ) : array
logModel_afterInsert_handler ( object $Sender, array $Args ) Attach files to a log entry; used when new content is sent to moderation queue.
logModel_afterRestore_handler ( LogModel $Sender, array $Args ) Attach files to record created by restoring a log entry.
mediaCache ( ) : array | null Get our cache.
mediaModel ( ) : MediaModel Get instance of MediaModel.
pluginController_fileUpload_create ( PluginController $Sender )
postController_afterBodyField_handler ( $sender ) Add "Attach a file" to edit comment form.
postController_afterCommentBody_handler ( PostController $Sender ) : void
postController_afterCommentSave_handler ( PostController $Sender, array $Args ) Attach files to a comment during save.
postController_afterDiscussionFormOptions_handler ( PostController $Sender ) Calls FileUploadPlugin::DrawAttachFile
postController_afterDiscussionSave_handler ( PostController $Sender, array $Args ) Attach files to a discussion during save.
postController_checkUpload_create ( object $Sender ) Controller method that allows an AJAX call to check the progress of a file upload that is currently in progress.
postController_render_before ( PostController $Sender ) Calls FileUploadPlugin::PrepareController
postController_upload_create ( object $Sender ) Allows plugin to handle ajax file uploads.
settingsController_addEditCategory_handler ( SettingsController $Sender )
setup ( ) Run once on enable.
structure ( ) Database update.
utilityController_thumbnail_create ( UtilityController $Sender, array $Args = [] ) Create and display a thumbnail of an uploaded file.

보호된 메소드들

메소드 설명
attachAllFiles ( mixed $AttachedFilesData, mixed $AllFilesData, mixed $ForeignID, mixed $ForeignTable ) : void AttachAllFiles function.
attachFile ( integer $FileID, integer $ForeignID, string $ForeignType ) : boolean Attach a file to a foreign table and ID.
attachUploadsToComment ( Gdn_Controller $Controller, string $Type = 'comment' ) : void
cacheAttachedMedia ( mixed $Sender ) : void CacheAttachedMedia function.
placeMedia ( &$Media, mixed $UserID ) : boolean
prepareController ( mixed $Controller ) Adds CSS and JS includes to the header of the discussion or post.
trashFile ( integer $MediaID ) Delete an uploaded file & its media record.

메소드 상세

__construct() 공개 메소드

Permission checks & property prep.
public __construct ( )

apcAvailable() 공개 정적인 메소드

public static apcAvailable ( ) : boolean
리턴 boolean

assetModel_styleCss_handler() 공개 메소드

Add our CSS.
public assetModel_styleCss_handler ( AssetModel $sender )
$sender AssetModel

attachAllFiles() 보호된 메소드

AttachAllFiles function.
protected attachAllFiles ( mixed $AttachedFilesData, mixed $AllFilesData, mixed $ForeignID, mixed $ForeignTable ) : void
$AttachedFilesData mixed
$AllFilesData mixed
$ForeignID mixed
$ForeignTable mixed
리턴 void

attachFile() 보호된 메소드

Attach a file to a foreign table and ID.
protected attachFile ( integer $FileID, integer $ForeignID, string $ForeignType ) : boolean
$FileID integer
$ForeignID integer
$ForeignType string Lowercase.
리턴 boolean Whether attach was successful.

attachUploadsToComment() 보호된 메소드

protected attachUploadsToComment ( Gdn_Controller $Controller, string $Type = 'comment' ) : void
$Controller Gdn_Controller
$Type string
리턴 void

base_transformDiscussionToComment_handler() 공개 메소드

Update Gdn_Media when a discussion is transformed into a comment due to a merge.
public base_transformDiscussionToComment_handler ( object $sender, array $args )
$sender object Sending controller instance
$args array Event's arguments

cacheAttachedMedia() 보호된 메소드

CacheAttachedMedia function.
protected cacheAttachedMedia ( mixed $Sender ) : void
$Sender mixed
리턴 void

commentModel_deleteComment_handler() 공개 메소드

public commentModel_deleteComment_handler ( CommentModel $Sender )
$Sender CommentModel

controller_delete() 공개 메소드

public controller_delete ( $Sender )
$Sender

discussionController_afterCommentBody_handler() 공개 메소드

public discussionController_afterCommentBody_handler ( DiscussionController $Sender, $Args ) : void
$Sender DiscussionController
리턴 void

discussionController_afterDiscussionBody_handler() 공개 메소드

public discussionController_afterDiscussionBody_handler ( DiscussionController $Sender )
$Sender DiscussionController

discussionController_beforeFormButtons_handler() 공개 메소드

public discussionController_beforeFormButtons_handler ( DiscussionController $Sender )
$Sender DiscussionController

discussionController_download_create() 공개 메소드

public discussionController_download_create ( DiscussionController $Sender )
$Sender DiscussionController

discussionController_render_before() 공개 메소드

Calls FileUploadPlugin::PrepareController
public discussionController_render_before ( DiscussionController $Sender )
$Sender DiscussionController The hooked controller

discussionModel_deleteDiscussion_handler() 공개 메소드

public discussionModel_deleteDiscussion_handler ( DiscussionModel $Sender )
$Sender DiscussionModel

drawAttachFile() 공개 메소드

Helper method that allows the plugin to insert the file uploader UI into the Post Discussion and Post Comment forms.
public drawAttachFile ( mixed $Sender )
$Sender mixed

findLocalMedia() 공개 정적인 메소드

public static findLocalMedia ( mixed $Media, $Absolute = false, $ReturnString = false ) : array
$Media mixed
리턴 array

findLocalMediaFolder() 공개 정적인 메소드

public static findLocalMediaFolder ( mixed $MediaID, mixed $UserID, $Absolute = false, $ReturnString = false ) : array
$MediaID mixed
$UserID mixed
리턴 array

logModel_afterInsert_handler() 공개 메소드

Attach files to a log entry; used when new content is sent to moderation queue.
public logModel_afterInsert_handler ( object $Sender, array $Args )
$Sender object
$Args array

logModel_afterRestore_handler() 공개 메소드

This happens when a discussion or comment is approved.
public logModel_afterRestore_handler ( LogModel $Sender, array $Args )
$Sender LogModel
$Args array

mediaCache() 공개 메소드

Get our cache.
public mediaCache ( ) : array | null
리턴 array | null

mediaModel() 공개 메소드

Get instance of MediaModel.
public mediaModel ( ) : MediaModel
리턴 MediaModel MediaModel

placeMedia() 보호된 메소드

protected placeMedia ( &$Media, mixed $UserID ) : boolean
$UserID mixed
리턴 boolean

pluginController_fileUpload_create() 공개 메소드

public pluginController_fileUpload_create ( PluginController $Sender )
$Sender PluginController

postController_afterBodyField_handler() 공개 메소드

Add "Attach a file" to edit comment form.
public postController_afterBodyField_handler ( $sender )
$sender

postController_afterCommentBody_handler() 공개 메소드

public postController_afterCommentBody_handler ( PostController $Sender ) : void
$Sender PostController
리턴 void

postController_afterCommentSave_handler() 공개 메소드

Attach files to a comment during save.
public postController_afterCommentSave_handler ( PostController $Sender, array $Args )
$Sender PostController
$Args array

postController_afterDiscussionFormOptions_handler() 공개 메소드

Calls FileUploadPlugin::DrawAttachFile
public postController_afterDiscussionFormOptions_handler ( PostController $Sender )
$Sender PostController

postController_afterDiscussionSave_handler() 공개 메소드

Attach files to a discussion during save.
public postController_afterDiscussionSave_handler ( PostController $Sender, array $Args )
$Sender PostController
$Args array

postController_checkUpload_create() 공개 메소드

Controller method that allows an AJAX call to check the progress of a file upload that is currently in progress.
public postController_checkUpload_create ( object $Sender )
$Sender object

postController_render_before() 공개 메소드

Calls FileUploadPlugin::PrepareController
public postController_render_before ( PostController $Sender )
$Sender PostController The hooked controller

postController_upload_create() 공개 메소드

Allows plugin to handle ajax file uploads.
public postController_upload_create ( object $Sender )
$Sender object

prepareController() 보호된 메소드

Adds CSS and JS includes to the header of the discussion or post.
protected prepareController ( mixed $Controller )
$Controller mixed The hooked controller

settingsController_addEditCategory_handler() 공개 메소드

public settingsController_addEditCategory_handler ( SettingsController $Sender )
$Sender SettingsController

setup() 공개 메소드

Run once on enable.
public setup ( )

structure() 공개 메소드

Database update.
public structure ( )

trashFile() 보호된 메소드

Delete an uploaded file & its media record.
protected trashFile ( integer $MediaID )
$MediaID integer Unique ID on Media table.

utilityController_thumbnail_create() 공개 메소드

Create and display a thumbnail of an uploaded file.
public utilityController_thumbnail_create ( UtilityController $Sender, array $Args = [] )
$Sender UtilityController
$Args array

프로퍼티 상세

$_MediaCache 보호되어 있는 프로퍼티

protected array $_MediaCache
리턴 array