Class humhub\widgets\JsWidget

Inheritancehumhub\widgets\JsWidget » humhub\components\Widget » yii\base\Widget
Subclasseshumhub\modules\activity\widgets\ActivityStreamViewer, humhub\modules\activity\widgets\Stream, humhub\modules\admin\widgets\AdminMenu, humhub\modules\admin\widgets\AdvancedSettingMenu, humhub\modules\admin\widgets\AuthenticationMenu, humhub\modules\admin\widgets\GroupManagerMenu, humhub\modules\admin\widgets\GroupMenu, humhub\modules\admin\widgets\InformationMenu, humhub\modules\admin\widgets\ModuleMenu, humhub\modules\admin\widgets\SettingsMenu, humhub\modules\admin\widgets\SpaceMenu, humhub\modules\admin\widgets\UserMenu, humhub\modules\admin\widgets\UserSettingMenu, humhub\modules\content\widgets\ContainerProfileHeader, humhub\modules\content\widgets\ContentTagDropDown, humhub\modules\content\widgets\ContentTagPicker, humhub\modules\content\widgets\ContentTypePicker, humhub\modules\content\widgets\WallEntryControls, humhub\modules\content\widgets\richtext\AbstractRichText, humhub\modules\content\widgets\richtext\AbstractRichTextEditor, humhub\modules\content\widgets\richtext\HumHubRichText, humhub\modules\content\widgets\richtext\HumHubRichTextEditor, humhub\modules\content\widgets\richtext\ProsemirrorRichText, humhub\modules\content\widgets\richtext\ProsemirrorRichTextEditor, humhub\modules\content\widgets\richtext\RichText, humhub\modules\content\widgets\richtext\RichTextField, humhub\modules\directory\widgets\Menu, humhub\modules\file\widgets\FilePreview, humhub\modules\file\widgets\UploadButton, humhub\modules\file\widgets\UploadInput, humhub\modules\file\widgets\UploadProgress, humhub\modules\friendship\widgets\ManageMenu, humhub\modules\notification\widgets\Overview, humhub\modules\notification\widgets\OverviewWidget, humhub\modules\space\modules\manage\widgets\DefaultMenu, humhub\modules\space\modules\manage\widgets\MemberMenu, humhub\modules\space\modules\manage\widgets\Menu, humhub\modules\space\modules\manage\widgets\SecurityTabMenu, humhub\modules\space\widgets\HeaderControlsMenu, humhub\modules\space\widgets\Menu, humhub\modules\space\widgets\SpacePickerField, humhub\modules\stream\widgets\StreamViewer, humhub\modules\stream\widgets\WallStreamFilterNavigation, humhub\modules\topic\widgets\TopicPicker, humhub\modules\ui\filter\widgets\FilterNavigation, humhub\modules\ui\form\widgets\BasePicker, humhub\modules\ui\form\widgets\ColorPicker, humhub\modules\ui\form\widgets\DurationPicker, humhub\modules\ui\form\widgets\JsInputWidget, humhub\modules\ui\form\widgets\Markdown, humhub\modules\ui\form\widgets\MultiSelect, humhub\modules\ui\menu\widgets\DropdownMenu, humhub\modules\ui\menu\widgets\LeftNavigation, humhub\modules\ui\menu\widgets\Menu, humhub\modules\ui\menu\widgets\SubTabMenu, humhub\modules\ui\menu\widgets\TabMenu, humhub\modules\user\widgets\AccountMenu, humhub\modules\user\widgets\AccountProfileMenu, humhub\modules\user\widgets\AccountSettingsMenu, humhub\modules\user\widgets\AccountTopMenu, humhub\modules\user\widgets\ProfileMenu, humhub\modules\user\widgets\StreamViewer, humhub\modules\user\widgets\UserPickerField, humhub\widgets\BaseMenu, humhub\widgets\BasePickerField, humhub\widgets\ColorPickerField, humhub\widgets\ContentTagDropDown, humhub\widgets\DurationPicker, humhub\widgets\FadeIn, humhub\widgets\FooterMenu, humhub\widgets\GlobalModal, humhub\widgets\InputWidget, humhub\widgets\JPlayerPlaylistWidget, humhub\widgets\MarkdownField, humhub\widgets\Modal, humhub\widgets\ModalDialog, humhub\widgets\MultiSelectField, humhub\widgets\RichText, humhub\widgets\RichtextField, humhub\widgets\TimeZoneDropdownAddition, humhub\widgets\TopMenu
Available since version1.2

Description of JsWidget

Public Methods

Hide inherited methods

MethodDescriptionDefined By
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
getLayoutViewParams() Returns an array of view parameter used if \humhub\components\layout is set. humhub\components\Widget
process() Process is a wrapper for the run method humhub\components\Widget
run() Default implementation of JsWidget. humhub\widgets\JsWidget
setDefaultOptions() Sets some default data options required by all widgets as the widget implementation and the widget events 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
getData() Returns an array of data-* attributes to configure your clientside js widget. humhub\widgets\JsWidget
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

Property Details

$container public property

Html container element.

public string $container 'div'
$content public property

Html content.

public string $content null
$events public property
public [] $events = []
$fadeIn public property (available since version 1.2.2)
public boolean|string|integer $fadeIn false
$id public property
public string $id null
$init public property
public mixed $init false
$jsWidget public property
public string $jsWidget null
$options public property
public $options = []
$visible public property
public boolean $visible true

Method Details

getAttributes() protected method

Returns all html attributes for used by this widget and will normally inserted in the widgets root html element.

protected [] getAttributes ( )
getData() protected method

Returns an array of data-* attributes to configure your clientside js widget.

Note that this function does not require to add the data- prefix. This will be done by Yii.

The data-* attributes should be inserted to the widgets root element.

protected [] getData ( )
getId() public method

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).

Note that the id is automatically included within the getOptions() function.

public string getId ( $autoGenerate true )
$autoGenerate boolean
getOptions() protected method

Assembles all widget attributes and data settings of this widget.

Those attributes/options are are normally transfered to the js client by ordinary html attributes or by using data-* attributes.

protected array getOptions ( )
run() public method

Default implementation of JsWidget.

This will render a widget html element specified by $container and $content and the given $options/$event attributes. This function should be overwritten for widgets with a more complex rendering.

public string run ( )
setDefaultOptions() public method

Sets some default data options required by all widgets as the widget implementation and the widget events and initialization trigger.

public void setDefaultOptions ( )