PHP Класс KickAssets

Наследование: extends LeftAndMain
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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