Base
Table of Contents
Constants
- TRANSFORM_STATUS_NO_MODULE = 'no module'
- TRANSFORM_STATUS_NOT_ALLOWED = 'not allowed'
- TRANSFORM_STATUS_SUCCESS = 'success'
- TRANSFORM_STATUS_WAS_TRANSFORMED = 'was transformed'
Methods
- __construct() : mixed
- View constructor.
- className() : mixed
- getAlternativeExtensions() : array<string|int, mixed>
- Returns array of alternative extensions, that has the same mime type as main extension
- getData() : array<string|int, mixed>|null
- Returns file (@see CFile::getById()).
- getEditorTypeFile() : string
- Get type attribute for bb-code in html-editor
- getId() : int|null
- Return ID from b_file for the viewable file.
- getJsViewerAdditionalJsonParams() : array<string|int, mixed>
- Returns additional json array parameters for core_viewer.js
- getJsViewerFallbackHtmlAttributeName() : string|null
- Return html-attribute for iframe viewer.
- getJsViewerHeight() : int
- Returns height of popup window for core_viewer.js
- getJsViewerType() : string|null
- Return type of viewer from core_viewer.js
- getJsViewerWidth() : int
- Returns width of popup window for core_viewer.js
- getMaxSizeTransformation() : int
- Returns maximum allowed transformation file size.
- getMimeType() : mixed
- Mime-type of the view.
- getName() : string
- Return name of the view.
- getPreviewData() : array<string|int, mixed>|null
- Returns file (@see CFile::getById());
- getPreviewExtension() : string
- Extension of the preview.
- getPreviewMimeType() : mixed
- Mime-type of the preview.
- getPreviewName() : string
- Returns name of the preview.
- getTransformTime() : int
- Returns approximate time of transformation of the file.
- getViewableExtensions() : array<string|int, mixed>
- Returns array of extensions that can be viewed.
- getViewExtension() : string
- Extension of the view.
- isAlwaysTransformToViewFormat() : bool
- Returns true if file should be transformed into view regardless of origin extension.
- isHtmlAvailable() : bool
- Returns true if view can be rendered in some way.
- isJsViewerHideEditButton() : bool
- Returns true if edit button should be hidden in js viewer.
- isLastTransformationFailed() : array<string|int, mixed>|bool
- Returns true if there was an error in last transformation for this file.
- isNeededLimitRightsOnTransformTime() : bool
- Returns true if we should limit rights on attached object with this file while transform in progress.
- isSaveForVersion() : bool
- True if view should be saved in version as well.
- isShowTransformationInfo() : bool
- Returns true if we should display message about transformation status.
- isShowTransformationUpgradeMessage() : bool
- Returns true upgrade message should be shown.
- isTransformationAllowed() : bool
- Returns true if transformation is allowed for this file.
- isTransformationAllowedInOptions() : bool
- Is transformation allowed for this View.
- isTransformationAllowedOnOpen() : bool
- Returns true if this file should be transformed on open.
- render() : string
- Return html code to view file.
- renderTransformationInProcessMessage() : string
- Returns html of the dummy view.
- transformOnOpen() : array<string|int, mixed>
- Send command to transform file if necessary. Returns array for json response.
Constants
TRANSFORM_STATUS_NO_MODULE
public
mixed
TRANSFORM_STATUS_NO_MODULE
= 'no module'
TRANSFORM_STATUS_NOT_ALLOWED
public
mixed
TRANSFORM_STATUS_NOT_ALLOWED
= 'not allowed'
TRANSFORM_STATUS_SUCCESS
public
mixed
TRANSFORM_STATUS_SUCCESS
= 'success'
TRANSFORM_STATUS_WAS_TRANSFORMED
public
mixed
TRANSFORM_STATUS_WAS_TRANSFORMED
= 'was transformed'
Methods
__construct()
View constructor.
public
__construct(string $name, int $fileId[, int $viewId = null ][, int $previewId = null ][, bool $isTransformationEnabledInStorage = true ]) : mixed
Parameters
- $name : string
-
Name of the file.
- $fileId : int
-
ID from b_file of the file.
- $viewId : int = null
-
ID from b_file of the view.
- $previewId : int = null
-
ID from b_file of the preview.
- $isTransformationEnabledInStorage : bool = true
-
.
Tags
className()
public
static className() : mixed
getAlternativeExtensions()
Returns array of alternative extensions, that has the same mime type as main extension
public
static getAlternativeExtensions() : array<string|int, mixed>
Return values
array<string|int, mixed>getData()
Returns file (@see CFile::getById()).
public
getData() : array<string|int, mixed>|null
If there is no record - delete
Return values
array<string|int, mixed>|nullgetEditorTypeFile()
Get type attribute for bb-code in html-editor
public
getEditorTypeFile() : string
Return values
stringgetId()
Return ID from b_file for the viewable file.
public
getId() : int|null
Return values
int|nullgetJsViewerAdditionalJsonParams()
Returns additional json array parameters for core_viewer.js
public
getJsViewerAdditionalJsonParams() : array<string|int, mixed>
Return values
array<string|int, mixed>getJsViewerFallbackHtmlAttributeName()
Return html-attribute for iframe viewer.
public
getJsViewerFallbackHtmlAttributeName() : string|null
Return values
string|nullgetJsViewerHeight()
Returns height of popup window for core_viewer.js
public
getJsViewerHeight() : int
Return values
intgetJsViewerType()
Return type of viewer from core_viewer.js
public
getJsViewerType() : string|null
Return values
string|nullgetJsViewerWidth()
Returns width of popup window for core_viewer.js
public
getJsViewerWidth() : int
Return values
intgetMaxSizeTransformation()
Returns maximum allowed transformation file size.
public
getMaxSizeTransformation() : int
Return values
intgetMimeType()
Mime-type of the view.
public
static getMimeType() : mixed
getName()
Return name of the view.
public
getName() : string
Return values
stringgetPreviewData()
Returns file (@see CFile::getById());
public
getPreviewData() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetPreviewExtension()
Extension of the preview.
public
static getPreviewExtension() : string
Return values
stringgetPreviewMimeType()
Mime-type of the preview.
public
static getPreviewMimeType() : mixed
getPreviewName()
Returns name of the preview.
public
getPreviewName() : string
Return values
stringgetTransformTime()
Returns approximate time of transformation of the file.
public
getTransformTime() : int
Return values
intgetViewableExtensions()
Returns array of extensions that can be viewed.
public
static getViewableExtensions() : array<string|int, mixed>
Return values
array<string|int, mixed>getViewExtension()
Extension of the view.
public
static getViewExtension() : string
Return values
stringisAlwaysTransformToViewFormat()
Returns true if file should be transformed into view regardless of origin extension.
public
static isAlwaysTransformToViewFormat() : bool
Return values
boolisHtmlAvailable()
Returns true if view can be rendered in some way.
public
isHtmlAvailable() : bool
Return values
boolisJsViewerHideEditButton()
Returns true if edit button should be hidden in js viewer.
public
isJsViewerHideEditButton() : bool
Return values
boolisLastTransformationFailed()
Returns true if there was an error in last transformation for this file.
public
isLastTransformationFailed() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|boolisNeededLimitRightsOnTransformTime()
Returns true if we should limit rights on attached object with this file while transform in progress.
public
isNeededLimitRightsOnTransformTime() : bool
Return values
boolisSaveForVersion()
True if view should be saved in version as well.
public
isSaveForVersion() : bool
Return values
boolisShowTransformationInfo()
Returns true if we should display message about transformation status.
public
isShowTransformationInfo() : bool
Return values
boolisShowTransformationUpgradeMessage()
Returns true upgrade message should be shown.
public
isShowTransformationUpgradeMessage() : bool
Return values
boolisTransformationAllowed()
Returns true if transformation is allowed for this file.
public
isTransformationAllowed([int $size = 0 ]) : bool
Parameters
- $size : int = 0
-
Size of the file.
Return values
boolisTransformationAllowedInOptions()
Is transformation allowed for this View.
public
static isTransformationAllowedInOptions() : bool
Return values
boolisTransformationAllowedOnOpen()
Returns true if this file should be transformed on open.
public
isTransformationAllowedOnOpen([int $size = 0 ]) : bool
Parameters
- $size : int = 0
Return values
boolrender()
Return html code to view file.
public
render([array<string|int, mixed> $params = array() ]) : string
Parameters
- $params : array<string|int, mixed> = array()
Return values
stringrenderTransformationInProcessMessage()
Returns html of the dummy view.
public
renderTransformationInProcessMessage() : string
Return values
stringtransformOnOpen()
Send command to transform file if necessary. Returns array for json response.
public
transformOnOpen(File $file) : array<string|int, mixed>
Parameters
- $file : File