
| Current Path : /var/www/html/rocksensor1/web/modules/contrib/config_delete/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/rocksensor1/web/modules/contrib/config_delete/config_delete.module |
<?php
/**
* @file
* This is the primary module file.
*/
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function config_delete_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.config_delete':
$output = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Delete configuration items from the UI.') . '</p>';
return $output;
}
}
/**
* Implements hook_form_alter().
*/
function config_delete_form_alter(&$form, FormStateInterface $form_state, $form_id) {
if ($form_id == 'config_delete_form') {
unset($form['export']);
$form['config_delete_notice'] = [
'#type' => 'markup',
'#markup' => t('Notice: Deleting configuration items can potentially break your site! Please use this form only if you know what are you doing.'),
'#prefix' => '<strong>',
'#suffix' => '</strong>',
'#weight' => -100,
];
$form['delete_dependencies'] = [
'#type' => 'checkbox',
'#title' => t('Delete config dependencies'),
];
$form['submit'] = [
'#type' => 'submit',
'#value' => t('Delete'),
];
}
}