Class humhub\modules\content\widgets\ContentTagPicker

Inheritancehumhub\modules\content\widgets\ContentTagPicker » humhub\modules\ui\form\widgets\BasePicker » humhub\modules\ui\form\widgets\JsInputWidget » humhub\widgets\JsWidget » humhub\components\Widget » yii\base\Widget
Subclasseshumhub\modules\topic\widgets\TopicPicker

This InputWidget provides a generic ContentTag Dropdown

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$addOptions boolean|null humhub\modules\ui\form\widgets\BasePicker
$attribute string humhub\modules\ui\form\widgets\BasePicker
$container string Html container element. humhub\widgets\JsWidget
$content string Html content. humhub\widgets\JsWidget
$contentContainer humhub\modules\content\components\ContentContainerActiveRecord Container can be used to create urls etc humhub\modules\content\widgets\ContentTagPicker
$defaultResults array Array of item instances used as long the minInput is not exceed. humhub\modules\ui\form\widgets\BasePicker
$defaultRoute string humhub\modules\ui\form\widgets\BasePicker
$disabledItems Disabled items humhub\modules\ui\form\widgets\BasePicker
$events [] humhub\widgets\JsWidget
$fadeIn boolean|string|integer humhub\widgets\JsWidget
$focus boolean humhub\modules\ui\form\widgets\BasePicker
$form \yii\widgets\ActiveForm humhub\modules\ui\form\widgets\BasePicker
$formName humhub\modules\ui\form\widgets\BasePicker
$id string humhub\widgets\JsWidget
$init boolean humhub\modules\ui\form\widgets\BasePicker
$itemClass string TagClass humhub\modules\content\widgets\ContentTagPicker
$itemKey string humhub\modules\ui\form\widgets\BasePicker
$jsWidget string humhub\modules\ui\form\widgets\BasePicker
$limit string TagClass humhub\modules\content\widgets\ContentTagPicker
$maxInput integer humhub\modules\ui\form\widgets\BasePicker
$maxSelection integer humhub\modules\ui\form\widgets\BasePicker
$minInput integer humhub\modules\ui\form\widgets\BasePicker
$model \yii\db\ActiveRecord humhub\modules\ui\form\widgets\BasePicker
$name string The input name. humhub\modules\ui\form\widgets\JsInputWidget
$options humhub\widgets\JsWidget
$placeholder string humhub\modules\ui\form\widgets\BasePicker
$placeholderMore string humhub\modules\ui\form\widgets\BasePicker
$render boolean If set to false this widget won't be rendered humhub\components\Widget
$selection array humhub\modules\ui\form\widgets\BasePicker
$showDefaults humhub\modules\content\widgets\ContentTagPicker
$url string humhub\modules\ui\form\widgets\BasePicker
$value string The input value. humhub\modules\ui\form\widgets\JsInputWidget
$visible boolean humhub\widgets\JsWidget

Public Methods

Hide inherited methods

MethodDescriptionDefined By
beforeRun() humhub\modules\ui\form\widgets\BasePicker
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
init() humhub\modules\content\widgets\ContentTagPicker
jsonResult() humhub\modules\content\widgets\ContentTagPicker
loadItems() Loads all items of the given $selection array. humhub\modules\ui\form\widgets\BasePicker
process() Process is a wrapper for the run method humhub\components\Widget
run() humhub\modules\ui\form\widgets\BasePicker
search() humhub\modules\content\widgets\ContentTagPicker
searchByContainer() humhub\modules\content\widgets\ContentTagPicker
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
buildItemOption() Responsible for building the option data for an item. humhub\modules\ui\form\widgets\BasePicker
findDefaults() humhub\modules\content\widgets\ContentTagPicker
getAttributes() humhub\modules\ui\form\widgets\BasePicker
getData() Returns an array of data attributes for this picker isntance. humhub\modules\ui\form\widgets\BasePicker
getDefaultResultData() humhub\modules\ui\form\widgets\BasePicker
getItemImage() Used to retrieve the option image url of a given $item. humhub\modules\content\widgets\ContentTagPicker
getItemKey() Returns the item key which is used as option value. By default we use the $itemKey attribibute of $item. humhub\modules\ui\form\widgets\BasePicker
getItemText() Used to retrieve the option text of a given $item. humhub\modules\content\widgets\ContentTagPicker
getOptions() Assembles all widget attributes and data settings of this widget. humhub\widgets\JsWidget
getSelectedOptions() Prepares the selected options either by using the $selection array or by loading the items by means of the model attribute value. humhub\modules\ui\form\widgets\BasePicker
getUrl() Returns the url for this picker instance. If no $url is set we use the $defaultRoute for creating the url. humhub\modules\ui\form\widgets\BasePicker
getValue() humhub\modules\ui\form\widgets\JsInputWidget
hasModel() humhub\modules\ui\form\widgets\JsInputWidget

Events

Hide inherited events

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

Property Details

$contentContainer public property

Container can be used to create urls etc

$itemClass public property

TagClass

public string $itemClass = \humhub\modules\content\models\ContentTag::class
$limit public property

TagClass

public string $limit 50
$showDefaults public property
public $showDefaults false

Method Details

findDefaults() protected method

protected void findDefaults ( )
getItemImage() protected method

Used to retrieve the option image url of a given $item.

protected string|null getItemImage ( $item )
$item \yii\db\ActiveRecord

Selected item

return string|null

Image url or null if no selection image required.

getItemText() protected method

Used to retrieve the option text of a given $item.

protected string getItemText ( $item )
$item \yii\db\ActiveRecord

Selected item

return string

Item option text

init() public method

public void init ( )
jsonResult() public static method

public static void jsonResult ( $tags )
$tags
search() public static method

public static void search ( $term, $contentContainer null, $includeGlobal false )
$term
$contentContainer
$includeGlobal
searchByContainer() public static method

public static void searchByContainer ( $term, $contentContainer, $includeGlobal true )
$term
$contentContainer
$includeGlobal