Class humhub\modules\file\widgets\FilePreview

Inheritancehumhub\modules\file\widgets\FilePreview » humhub\widgets\JsWidget » humhub\components\Widget » yii\base\Widget
Available since version1.2

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$attribute string Model attribute used in combination with $model humhub\modules\file\widgets\FilePreview
$container string Html container element. humhub\widgets\JsWidget
$content string Html content. humhub\widgets\JsWidget
$edit boolean Weather or not the file previe is editable humhub\modules\file\widgets\FilePreview
$events [] humhub\widgets\JsWidget
$fadeIn boolean|string|integer humhub\widgets\JsWidget
$hideImageFileInfo boolean Weather or not to hide image files humhub\modules\file\widgets\FilePreview
$id string humhub\widgets\JsWidget
$init mixed humhub\widgets\JsWidget
$items humhub\modules\file\models\File[]|string[] File items to display if no $model is given or $model is a new record. humhub\modules\file\widgets\FilePreview
$jsWidget string humhub\modules\file\widgets\FilePreview
$model \yii\base\Model Model object used to fetch default items if $items is not set humhub\modules\file\widgets\FilePreview
$options humhub\widgets\JsWidget
$popoverPosition string Popover position humhub\modules\file\widgets\FilePreview
$preventPopover boolean Weather or not to prevent popover previews for images humhub\modules\file\widgets\FilePreview
$render boolean If set to false this widget won't be rendered humhub\components\Widget
$showInStream boolean Defines if only files with show_in_stream falg should be viewed in case $model is used to load the files humhub\modules\file\widgets\FilePreview
$visible boolean humhub\modules\file\widgets\FilePreview

Public Methods

Hide inherited methods

MethodDescriptionDefined By
getData() humhub\modules\file\widgets\FilePreview
getId() Returns the html id of this widget, if no id is set this function will generate an id if $autoGenerate is set to true (default). humhub\widgets\JsWidget
process() Process is a wrapper for the run method humhub\components\Widget
run() Draws the Upload Button output. humhub\modules\file\widgets\FilePreview
setDefaultOptions() Sets some default data options required by all widgets as the widget implementation and the widget evetns and initialization trigger. humhub\widgets\JsWidget
widget() Creates a widget instance and runs it. humhub\components\Widget

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getAttributes() Returns all html attributes for used by this widget and will normally inserted in the widgets root html element. humhub\widgets\JsWidget
getFileData() humhub\modules\file\widgets\FilePreview
getFiles() humhub\modules\file\widgets\FilePreview
getOptions() Assembles all widget attributes and data settings of this widget. humhub\widgets\JsWidget
isHighlighed() Checks whether the file should be highlighed in the results or not. humhub\modules\file\widgets\FilePreview

Events

Hide inherited events

EventTypeDescriptionDefined By
EVENT_CREATE humhub\libs\WidgetCreateEvent An event raised before creating a widget. humhub\components\Widget

Property Details

$attribute public property

Model attribute used in combination with $model

public string $attribute null
$edit public property

Weather or not the file previe is editable

public boolean $edit false
$hideImageFileInfo public property

Weather or not to hide image files

public boolean $hideImageFileInfo false
$items public property

File items to display if no $model is given or $model is a new record.

$jsWidget public property
public string $jsWidget "file.Preview"
$model public property

Model object used to fetch default items if $items is not set

public \yii\base\Model $model null
$popoverPosition public property

Popover position

public string $popoverPosition 'right'
$preventPopover public property

Weather or not to prevent popover previews for images

public boolean $preventPopover false
$showInStream public property (available since version 1.2.2)

Defines if only files with show_in_stream falg should be viewed in case $model is used to load the files

public boolean $showInStream null
$visible public property
public boolean $visible false

Method Details

getData() public method

public void getData ( )
getFileData() protected method

protected void getFileData ( )
getFiles() protected method

protected void getFiles ( )
isHighlighed() protected method

Checks whether the file should be highlighed in the results or not.

protected boolean isHighlighed ( humhub\modules\file\models\File $file )
$file humhub\modules\file\models\File
return boolean

Is highlighed

run() public method

Draws the Upload Button output.

public void run ( )