\KickAssets
API for the KickAssets UI. Although this is a subclass of LeftAndMain, there is no LeftAndMain template for it. Rather, it is just a backend, and LeftAndMain is inherited to provide consistentcy, i.e. with permissions
Synopsis
class KickAssets
extends LeftAndMain
{
- // constants
- const ICON_SIZE = 64;
- const IMAGE_WIDTH = 198;
- const IMAGE_HEIGHT = 132;
- const FOLDER_EXTENSION = ' ';
- // members
- private static string $menu_title = 'Browse files...';
- private static string $url_segment = 'kickassets';
- private static array $url_handlers = ;
- private static array $allowed_actions = ;
- private static string $menu_icon = 'kickassets/images/icon.png';
- // methods
- public static string remove_assets_dir()
- public bool canView()
- public void init()
- public HTMLText|SS_HTTPResponse handleIndex()
- public SS_HTTPResponse handleFolderContents()
- public SS_HTTPResponse handleRecentItems()
- public SS_HTTPResponse handleCreateFolder()
- public KickAssetsFileRequest|SS_HTTPResponse handleFile()
- public SS_HTTPResponse handleFolders()
- public SS_HTTPResponse handleUpload()
- public SS_HTTPResponse handleDelete()
- public SS_HTTPResponse handleSearch()
- public string jsonConfig()
- public SS_HTTPResponse handleMove()
- public array createFolderJson()
- public array createFileJson()
- protected array createBreadcrumbJson()
- protected string getSortClause()
Hierarchy
Extends
- LeftAndMain
Constants
Name | Value |
---|---|
ICON_SIZE | 64 |
IMAGE_WIDTH | 198 |
IMAGE_HEIGHT | 132 |
FOLDER_EXTENSION | ' ' |
Members
private
- $allowed_actions
—
array
Allowed actions for endpoints - $url_handlers
—
array
URL handlers for various endpoints - $url_segment
—
string
The URLSegment that resolves to KickAssets admin
Methods
protected
- createBreadcrumbJson() — Creates an array of breadcrumbs for a given Folder, ready to be transformed to JSON
- getSortClause() — Given a sort field, generate a string of SQL to apply the sort
public
- canView() — Defines the canView permission
- createFileJson() — Given a File object, create an array of its properties and values ready to be transformed to JSON
- createFolderJson() — Given a Folder object, create an array of its properties and values ready to be transformed to JSON
- handleCreateFolder() — Creates a folder, ensures uniqueness
- handleDelete() — Deletes a list of files
- handleFile() — Handles a specific file request
- handleFolderContents() — Gets the contents of a folder, and applies a sort. Splits the response into folder metadata and folder children
- handleFolders() — Gets a list of all the folders in the system
- handleIndex() — Index action, renders the main template
- 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.
- handleRecentItems() — Gets recently updated items
- handleSearch() — Searches for files by PartialMatch
- handleUpload() — The endpoint for file uploads. Hands off to Dropzone module
- init() — Bootstraps the module, adds JavaScript
- jsonConfig() — Creates a JSON string of all the variables that can be set in the Config
- remove_assets_dir() — Strips the assets directory from the beginning of a folder name