PHP Класс Prado\Web\UI\ActiveControls\TActiveFileUpload

TActiveFileUpload displays a file upload field on a page. Upon postback, the text entered into the field will be treated as the name of the file that will be uploaded to the server. The property {@link getHasFile HasFile} indicates whether the file upload is successful. If successful, the file may be obtained by calling {@link saveAs} to save it at a specified place. You can use {@link getFileName FileName}, {@link getFileType FileType}, {@link getFileSize FileSize} to get the original client-side file name, the file mime type, and the file size information. If the upload is not successful, {@link getErrorCode ErrorCode} contains the error code describing the cause of failure. TActiveFileUpload raises {@link onFileUpload OnFileUpload} event if a file is uploaded (whether it succeeds or not). TActiveFileUpload actually does a postback in a hidden IFrame, and then does a callback. This callback then raises the {@link onFileUpload OnFileUpload} event. After the postback a status icon is displayed; either a green checkmark if the upload is successful, or a red x if there was an error. TActiveFileUpload needs either an application level cache or a security manager to work securely.
Автор: Bradley Booms ([email protected])
Автор: Christophe Boulain ([email protected])
Наследование: extends Prado\Web\UI\WebControls\TFileUpload, implements Prado\Web\UI\ActiveControls\IActiveControl, implements Prado\Web\UI\ActiveControls\ICallbackEventHandler, implements Prado\Web\UI\INamingContainer
Показать файл Открыть проект

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

Метод Описание
__construct ( ) Creates a new callback control, sets the adapter to TActiveControlAdapter. If you override this class, be sure to set the adapter appropriately by, for example, by calling this constructor.
addAttributesToRender ( $writer ) Adds ID attribute, and renders the javascript for active component.
createChildControls ( )
getActiveControl ( ) : TBaseActiveCallbackControl
getAutoPostBack ( ) : boolean
getBusyImage ( ) : TImage
getCallbackJavascript ( ) : string
getClientSide ( ) : TCallbackClientSide
getErrorImage ( ) : TImage
getSuccessImage ( ) : TImage
getTempPath ( ) : string
onFileUpload ( $param ) This method is invoked when a file is uploaded.
onInit ( $sender )
onPreRender ( $param ) Publish the javascript
onUnload ( $param ) Removes localfile on ending of the callback.
raiseCallbackEvent ( $param ) Raises OnFileUpload event.
raisePostDataChangedEvent ( ) Raises postdata changed event.
saveAs ( $fileName, $deleteTempFile = true ) : boolean Saves the uploaded file.
setAutoPostBack ( $value )
setTempPath ( $value )

Защищенные методы

Метод Описание
getAssetUrl ( $file = '' ) : string
getClientClassName ( ) : string
getClientOptions ( ) : array Gets the client side options for this control.
popParamsByToken ( $token )
pushParamsAndGetToken ( TActiveFileUploadCallbackParams $params )

Описание методов

__construct() публичный Метод

Creates a new callback control, sets the adapter to TActiveControlAdapter. If you override this class, be sure to set the adapter appropriately by, for example, by calling this constructor.
public __construct ( )

addAttributesToRender() публичный Метод

Adds ID attribute, and renders the javascript for active component.
public addAttributesToRender ( $writer )

createChildControls() публичный Метод

public createChildControls ( )

getActiveControl() публичный Метод

public getActiveControl ( ) : TBaseActiveCallbackControl
Результат TBaseActiveCallbackControl standard callback control options.

getAssetUrl() защищенный Метод

protected getAssetUrl ( $file = '' ) : string
Результат string asset file url.

getAutoPostBack() публичный Метод

public getAutoPostBack ( ) : boolean
Результат boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true. Note: When set to false, you will need to trigger the callback yourself.

getBusyImage() публичный Метод

public getBusyImage ( ) : TImage
Результат Prado\Web\UI\WebControls\TImage the image displayed when an upload is in progress.

getCallbackJavascript() публичный Метод

public getCallbackJavascript ( ) : string
Результат string A chuck of javascript that will need to be called if {{@link getAutoPostBack AutoPostBack} is set to false}

getClientClassName() защищенный Метод

protected getClientClassName ( ) : string
Результат string corresponding javascript class name for this control.

getClientOptions() защищенный Метод

Gets the client side options for this control.
protected getClientOptions ( ) : array
Результат array ( inputID => input client ID, flagID => flag client ID, targetName => target unique ID, formID => form client ID, indicatorID => upload indicator client ID, completeID => complete client ID, errorID => error client ID)

getClientSide() публичный Метод

public getClientSide ( ) : TCallbackClientSide
Результат TCallbackClientSide client side request options.

getErrorImage() публичный Метод

public getErrorImage ( ) : TImage
Результат Prado\Web\UI\WebControls\TImage the image displayed when an upload does not complete successfully.

getSuccessImage() публичный Метод

public getSuccessImage ( ) : TImage
Результат Prado\Web\UI\WebControls\TImage the image displayed when an upload completes successfully.

getTempPath() публичный Метод

public getTempPath ( ) : string
Результат string the path where the uploaded file will be stored temporarily, in namespace format default "Application.runtime.*"

onFileUpload() публичный Метод

If you override this method, be sure to call the parent implementation to ensure the invocation of the attached event handlers.
public onFileUpload ( $param )

onInit() публичный Метод

public onInit ( $sender )

onPreRender() публичный Метод

Publish the javascript
public onPreRender ( $param )

onUnload() публичный Метод

Removes localfile on ending of the callback.
public onUnload ( $param )

popParamsByToken() защищенный Метод

protected popParamsByToken ( $token )

pushParamsAndGetToken() защищенный Метод

protected pushParamsAndGetToken ( TActiveFileUploadCallbackParams $params )
$params TActiveFileUploadCallbackParams

raiseCallbackEvent() публичный Метод

This method is required by {@link ICallbackEventHandler} interface. This method is mainly used by framework and control developers.
public raiseCallbackEvent ( $param )

raisePostDataChangedEvent() публичный Метод

This method calls {@link onFileUpload} method This method is primarily used by framework developers.

saveAs() публичный Метод

Saves the uploaded file.
public saveAs ( $fileName, $deleteTempFile = true ) : boolean
Результат boolean true if the file saving is successful

setAutoPostBack() публичный Метод

public setAutoPostBack ( $value )

setTempPath() публичный Метод

public setTempPath ( $value )