PHP 클래스 KickAssets

상속: extends LeftAndMain
파일 보기 프로젝트 열기: unclecheese/silverstripe-kickassets 1 사용 예제들

공개 메소드들

메소드 설명
JSONConfig ( ) : string Creates a JSON string of all the variables that can be set in the Config
canView ( Member $member = null ) : boolean Defines the canView permission
createFileJSON ( File $file, Folder $folder = null ) : array Given a File object, create an array of its properties and values ready to be transformed to JSON
createFolderJSON ( Folder $folder ) : array Given a Folder object, create an array of its properties and values ready to be transformed to JSON
handleCreateFolder ( SS_HTTPRequest $r ) : SS_HTTPResponse Creates a folder, ensures uniqueness
handleDelete ( SS_HTTPRequest $r ) : SS_HTTPResponse Deletes a list of files
handleFile ( SS_HTTPRequest $r ) : KickAssets_FileRequest Handles a specific file request
handleFolderContents ( SS_HTTPRequest $r ) : SS_HTTPResponse Gets the contents of a folder, and applies a sort. Splits the response into folder metadata and folder children
handleFolders ( SS_HTTPRequest $r ) : SS_HTTPResponse Gets a list of all the folders in the system
handleIndex ( $r ) : SSViewer Index action, renders the main template
handleMove ( SS_HTTPRequest $r ) : SS_HTTPResponse Moves a list of files ('ids') to a new folder ('newFolder' named file path or ID) If newFolder is a string, the folder will be created if it doesn't exist.
handleRecentItems ( SS_HTTPRequest $r ) : SS_HTTPResponse Gets recently updated items
handleSearch ( SS_HTTPRequest $r ) : SS_HTTPResponse Searches for files by PartialMatch
handleUpload ( SS_HTTPRequest $r ) : SS_HTTPResponse The endpoint for file uploads. Hands off to Dropzone module
init ( ) Bootstraps the module, adds JavaScript
remove_assets_dir ( string $filename ) : string Strips the assets directory from the beginning of a folder name

보호된 메소드들

메소드 설명
createBreadcrumbJSON ( Folder $folder ) : array Creates an array of breadcrumbs for a given Folder, ready to be transformed to JSON
getSortClause ( string $sort ) : string Given a sort field, generate a string of SQL to apply the sort

메소드 상세

JSONConfig() 공개 메소드

Creates a JSON string of all the variables that can be set in the Config
public JSONConfig ( ) : string
리턴 string

canView() 공개 메소드

Defines the canView permission
public canView ( Member $member = null ) : boolean
$member Member
리턴 boolean

createBreadcrumbJSON() 보호된 메소드

Creates an array of breadcrumbs for a given Folder, ready to be transformed to JSON
protected createBreadcrumbJSON ( Folder $folder ) : array
$folder Folder
리턴 array

createFileJSON() 공개 메소드

Given a File object, create an array of its properties and values ready to be transformed to JSON
public createFileJSON ( File $file, Folder $folder = null ) : array
$file File
$folder Folder
리턴 array

createFolderJSON() 공개 메소드

Given a Folder object, create an array of its properties and values ready to be transformed to JSON
public createFolderJSON ( Folder $folder ) : array
$folder Folder
리턴 array

getSortClause() 보호된 메소드

Given a sort field, generate a string of SQL to apply the sort
protected getSortClause ( string $sort ) : string
$sort string
리턴 string

handleCreateFolder() 공개 메소드

Creates a folder, ensures uniqueness
public handleCreateFolder ( SS_HTTPRequest $r ) : SS_HTTPResponse
$r SS_HTTPRequest
리턴 SS_HTTPResponse

handleDelete() 공개 메소드

Deletes a list of files
public handleDelete ( SS_HTTPRequest $r ) : SS_HTTPResponse
$r SS_HTTPRequest
리턴 SS_HTTPResponse

handleFile() 공개 메소드

Handles a specific file request
public handleFile ( SS_HTTPRequest $r ) : KickAssets_FileRequest
$r SS_HTTPRequest
리턴 KickAssets_FileRequest

handleFolderContents() 공개 메소드

Gets the contents of a folder, and applies a sort. Splits the response into folder metadata and folder children
public handleFolderContents ( SS_HTTPRequest $r ) : SS_HTTPResponse
$r SS_HTTPRequest
리턴 SS_HTTPResponse

handleFolders() 공개 메소드

Gets a list of all the folders in the system
public handleFolders ( SS_HTTPRequest $r ) : SS_HTTPResponse
$r SS_HTTPRequest
리턴 SS_HTTPResponse

handleIndex() 공개 메소드

Index action, renders the main template
public handleIndex ( $r ) : SSViewer
리턴 SSViewer

handleMove() 공개 메소드

Moves a list of files ('ids') to a new folder ('newFolder' named file path or ID) If newFolder is a string, the folder will be created if it doesn't exist.
public handleMove ( SS_HTTPRequest $r ) : SS_HTTPResponse
$r SS_HTTPRequest
리턴 SS_HTTPResponse

handleRecentItems() 공개 메소드

Gets recently updated items
public handleRecentItems ( SS_HTTPRequest $r ) : SS_HTTPResponse
$r SS_HTTPRequest
리턴 SS_HTTPResponse

handleSearch() 공개 메소드

Searches for files by PartialMatch
public handleSearch ( SS_HTTPRequest $r ) : SS_HTTPResponse
$r SS_HTTPRequest
리턴 SS_HTTPResponse

handleUpload() 공개 메소드

The endpoint for file uploads. Hands off to Dropzone module
public handleUpload ( SS_HTTPRequest $r ) : SS_HTTPResponse
$r SS_HTTPRequest
리턴 SS_HTTPResponse

init() 공개 메소드

Bootstraps the module, adds JavaScript
public init ( )

remove_assets_dir() 공개 정적인 메소드

Strips the assets directory from the beginning of a folder name
public static remove_assets_dir ( string $filename ) : string
$filename string
리턴 string