14 class Form extends \Magento\Backend\Block\Widget\Form\Generic
31 \
Magento\Framework\Data\FormFactory $formFactory,
32 \
Magento\Widget\Model\WidgetFactory $widgetFactory,
35 $this->_widgetFactory = $widgetFactory;
47 $form = $this->_formFactory->create();
50 $fieldset = $form->addFieldset(
'base_fieldset', [
'legend' =>
'<div data-role="messages"></div>',
51 'comment' =>
__(
'Inserting a widget does not create a widget instance.')]);
57 'label' =>
__(
'Widget Type'),
58 'title' =>
__(
'Widget Type'),
59 'name' =>
'widget_type',
61 'onchange' =>
"wWidget.validateField()",
67 $form->setUseContainer(
true);
68 $form->setId(
'widget_options_form');
69 $form->setMethod(
'post');
70 $form->setAction($this->
getUrl(
'adminhtml/*/buildWidget'));
94 $html =
'<p class="nm"><small></small></p>';
97 $html .= sprintf(
'<div id="widget-description-%s" class="no-display">%s</div>',
$i,
$data[
'description']);
111 if (!$this->
hasData(
'available_widgets')) {
113 $allWidgets = $this->_widgetFactory->create()->getWidgetsArray();
115 foreach ($allWidgets as $widget) {
116 if (is_array($skipped) && in_array($widget[
'type'], $skipped)) {
121 if ($withEmptyElement) {
122 array_unshift(
$result, [
'type' =>
'',
'name' =>
__(
'-- Please Select --'),
'description' =>
'']);
127 return $this->
_getData(
'available_widgets');
137 return $this->_coreRegistry->registry(
'skip_widgets');
getUrl($route='', $params=[])
setData($key, $value=null)