ModuleMiscForm.php in Module Builder 8.3
File
src/Form/ModuleMiscForm.php
View source
<?php
namespace Drupal\module_builder\Form;
use Drupal\Core\Form\FormStateInterface;
use MutableTypedData\Data\DataItem;
class ModuleMiscForm extends ComponentSectionForm {
protected function getFormComponentProperties(DataItem $data) {
$component_entity_type_id = $this->entity
->getEntityTypeId();
$component_sections_handler = $this->entityTypeManager
->getHandler($component_entity_type_id, 'component_sections');
$used_component_properties = $component_sections_handler
->getUsedComponentProperties();
$used_component_properties[] = 'readable_name';
$used_component_properties[] = 'root_name';
$used_component_properties[] = 'module_hook_presets';
$component_data_property_names = $data
->getPropertyNames();
$component_properties_to_use = array_diff($component_data_property_names, $used_component_properties);
return $component_properties_to_use;
}
public function form(array $form, FormStateInterface $form_state) {
$form = parent::form($form, $form_state);
if (isset($form['data']['module_help_text'])) {
$form['data']['module_help_text']['#type'] = 'textarea';
}
return $form;
}
}