Class humhub\modules\file\widgets\UploadButton

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

UploadButtonWidget renders an upload button with integrated file input.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$attach boolean Defines if the file should be attached to the given §model right after upload, note this only works for already existing models humhub\modules\file\widgets\UploadInput
$attribute string humhub\modules\file\widgets\UploadInput
$buttonOptions array humhub\modules\file\widgets\UploadButton
$container string Html container element. humhub\widgets\JsWidget
$content string Html content. humhub\widgets\JsWidget
$cssButtonClass \humhub\modules\file\widgets\type humhub\modules\file\widgets\UploadButton
$dropZone \humhub\modules\file\widgets\type humhub\modules\file\widgets\UploadInput
$events [] humhub\widgets\JsWidget
$fadeIn boolean|string|integer humhub\widgets\JsWidget
$form \humhub\modules\file\widgets\type humhub\modules\file\widgets\UploadInput
$hideInStream boolean Defines if uploaded files should set the show_in_stream flag, this has only effect if the underlying action does support the showInStream request parameter humhub\modules\file\widgets\UploadInput
$id string humhub\widgets\JsWidget
$init \humhub\modules\file\widgets\type humhub\modules\file\widgets\UploadInput
$jsWidget \humhub\modules\file\widgets\type humhub\modules\file\widgets\UploadInput
$label \humhub\modules\file\widgets\type humhub\modules\file\widgets\UploadButton
$max \humhub\modules\file\widgets\type humhub\modules\file\widgets\UploadInput
$model \yii\db\ActiveRecord humhub\modules\file\widgets\UploadInput
$multiple boolean humhub\modules\file\widgets\UploadInput
$name string humhub\modules\file\widgets\UploadInput
$options humhub\widgets\JsWidget
$postState boolean humhub\modules\file\widgets\UploadInput
$preview \humhub\modules\file\widgets\type humhub\modules\file\widgets\UploadInput
$progress \humhub\modules\file\widgets\type humhub\modules\file\widgets\UploadInput
$render boolean If set to false this widget won't be rendered humhub\components\Widget
$single boolean humhub\modules\file\widgets\UploadInput
$submitName string humhub\modules\file\widgets\UploadInput
$tooltip boolean humhub\modules\file\widgets\UploadButton
$tooltipPosition string humhub\modules\file\widgets\UploadButton
$url \humhub\modules\file\widgets\type humhub\modules\file\widgets\UploadInput
$visible \humhub\modules\file\widgets\type humhub\modules\file\widgets\UploadInput

Public Methods

Hide inherited methods

MethodDescriptionDefined By
getAttributes() humhub\modules\file\widgets\UploadInput
getData() humhub\modules\file\widgets\UploadInput
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
getSubmittedFiles() Returns submitted files for the given settings, either bei fetching them directly from the request in case of form-name based uploads or from the model in case of model based uploads. humhub\modules\file\widgets\UploadInput
init() humhub\modules\file\widgets\UploadInput
process() Process is a wrapper for the run method humhub\components\Widget
run() Draws the Upload Button output. humhub\modules\file\widgets\UploadButton
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
getOptions() Assembles all widget attributes and data settings of this widget. humhub\widgets\JsWidget

Events

Hide inherited events

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

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
DEFAULT_FORM_NAME 'fileList' humhub\modules\file\widgets\UploadInput

Property Details

$buttonOptions public property
public array $buttonOptions = []
$cssButtonClass public property
public \humhub\modules\file\widgets\type $cssButtonClass 'btn-default'
$label public property
public \humhub\modules\file\widgets\type $label false
$tooltip public property
public boolean $tooltip true
$tooltipPosition public property
public string $tooltipPosition 'bottom'

Method Details

run() public method

Draws the Upload Button output.

public void run ( )