Handles most of the processing for files
This is the code documentation for the SproutCMS project
Search documentation |
class FileAdminControllerHandles most of the processing for files
Variables
Functions
public __constructvoid $FileAdminController->__construct ( ); Constructor protected _addPreRendervoid $FileAdminController->_addPreRender ( mixed $view ); Hook called by _getAddForm() just before the view is rendered public _addSaveunknown $FileAdminController->_addSave ( mixed &$item_id ); Not used. public _deleteSavebool $FileAdminController->_deleteSave ( int $item_id ); Deletes an item and logs the deleted data This method DOES NOT remove files from disk, in case the deleted DB record needs to be restored. They are removed later, when the deletion log is cleared; see ActionLogAdminController::cronCleanup. If lack of disk space is an issue, the log should be cleared more often, or alternate file backends should be used; see FilesBackend. public _editPreRendervoid $FileAdminController->_editPreRender ( mixed $view , mixed $item_id ); Pre-render hook public _editSaveunknown $FileAdminController->_editSave ( int $item_id ); Saves the provided POST data into this file in the database public _extraCleanupInvalidunknown $FileAdminController->_extraCleanupInvalid ( ); Provides a UI for doing a 'cleanup' - removes invalid files public _extraFindUsagearray $FileAdminController->_extraFindUsage ( int $file_id ); Find usage of a given file public _extraRedoSizesunknown $FileAdminController->_extraRedoSizes ( ); List of links to redo the sizes public _getContentsViewunknown $FileAdminController->_getContentsView ( Traversable $items , string $mode , StdClass $category ); Return HTML for a resultset of items The returned HTML will be sandwiched between the refinebar and the pagination bar. private _getContentsViewThumbunknown $FileAdminController->_getContentsViewThumb ( mixed $items , mixed $category ); Thumbnail view for files public _getEditSubActionsarray $FileAdminController->_getEditSubActions ( mixed $item_id ); Return the sub-actions for editing; for spec AdminController::renderSubActions public _getToolsunknown $FileAdminController->_getTools ( ); Return the list of sidebar tools public _getVisibilityFieldsarray $FileAdminController->_getVisibilityFields ( ); Return the fields to show in the sidebar when adding or editing a record. These fields are shown under a heading of "Visibility" Key is the field name, value is the field label public _isAddSavedbool $FileAdminController->_isAddSaved ( ); Is the "add" action saved? These may be false if the UI provides its own save mechanism (e.g. multi-add) public ajaxAuthorLookupvoid $FileAdminController->ajaxAuthorLookup ( ); Matches user input against a list of possible authors for files public ajaxDragdropCancelvoid $FileAdminController->ajaxDragdropCancel ( ); Cancel an upload - delete temporary files. May receive two different variations on the provided POST data: [result][tmp_file] Whole file was uploaded [partial_upload][code] Only some chunks of the file have been uploaded public ajaxDragdropChunkvoid $FileAdminController->ajaxDragdropChunk ( ); Save a single chunk of a multi-part file upload public ajaxDragdropDonevoid $FileAdminController->ajaxDragdropDone ( ); Stitch together uploaded chunks into an actual file Outputs a JSON response. The field "success" will be checked (= 1) to determine success. On error, the field "message" will be used as an error message. Other keys provided are passed to the ajaxDragdropForm method. public ajaxDragdropFormvoid $FileAdminController->ajaxDragdropForm ( ); Returns the form for updating a file which has been uploaded public ajaxDragdropSavevoid $FileAdminController->ajaxDragdropSave ( ); Handles the drag-and-drop upload form Output JSON should be: success 1 or 0 message Error message, if success is 0 html Confirmation HTML, if success is 1 private ajaxErrunknown $FileAdminController->ajaxErr ( mixed $message ); Used by some AJAX stuff to return a JSON error public cleanupInvalidActionvoid $FileAdminController->cleanupInvalidAction ( ); Does file cleanup - wrapper (admin) private cleanupInvalidActionInnervoid $FileAdminController->cleanupInvalidActionInner ( ); Remove invalid files, such as: - Files without a name - Files without a type - Files which don't actually exist public cronCleanupInvalidvoid $FileAdminController->cronCleanupInvalid ( ); Does file cleanup - wrapper (cron) private doUploadunknown $FileAdminController->doUpload ( int $category_id ); Used by the quick upload tool public downloadTempvoid $FileAdminController->downloadTemp ( mixed $filename ); Provide the contents of a temporarily uploaded file, for e.g. listening to uploaded audio public frontEndSearchstring $FileAdminController->frontEndSearch ( array $item_id , mixed $relevancy , mixed $keywords ); Process the results of a search. public previewFocalCropvoid $FileAdminController->previewFocalCrop ( string $size , string $filename , string $focal_point_data ); Renders a HTML subset containing a focal crop image public previewTransformvoid $FileAdminController->previewTransform ( mixed $transform , mixed $filename ); On the fly image resizing The size parameter is the new size. The first character is taken to be the resize type, accepts 'r' or 'c'. The width and height is specified width . 'x' . height (e.g. 200x100) public quickUploadvoid $FileAdminController->quickUpload ( ); Does a quick upload (from the fileselector) Returns JSON. public redoSizesActionvoid $FileAdminController->redoSizesAction ( ); Fixes files which don't have the sizes they should public reindexAllvoid $FileAdminController->reindexAll ( ); Does a complete re-index of all files private reindexItembool $FileAdminController->reindexItem ( int $item_id , string $name , string $plaintext [, bool $enabled ] ); Does a re-index for a file public selectorPopupvoid $FileAdminController->selectorPopup ( ); Outputs the file selector HTML public selectorPopupSearchvoid $FileAdminController->selectorPopupSearch ( ); Does the backend selector search private stitchChunksvoid $FileAdminController->stitchChunks ( string $dest_filename , string $code , string $num_chunks ); Stitch together the uploaded file from multiple chunks |
| Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Wednesday, 5th August, 2026 at 03:31 pm |
|