Skip to content
Snippets Groups Projects

Added hook_help into .module file.

All threads resolved!
1 file
+ 19
27
Compare changes
  • Side-by-side
  • Inline
+ 19
27
@@ -5,36 +5,28 @@
@@ -5,36 +5,28 @@
* Contains alt_text_validation.module.
* Contains alt_text_validation.module.
*/
*/
/*
use Drupal\Component\Utility\Html;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Entity\FieldableEntityInterface;
use Drupal\markdown\Markdown;
use Drupal\Core\Form\FormStateInterface;
use Drupal\file\Plugin\Field\FieldType\FileFieldItemList;
*/
/**
/**
* Implements hook_form_FORM_ID_alter().
* Implements hook_help().
*
* Alter the image_style_warmer form to insert a third option.
*
* Should be removed as part of va.gov-cms#4425 .
*/
*/
/*function va_gov_media_form_image_style_warmer_settings_form_alter(array &$form, FormStateInterface $form_state) {
function alt_text_validation_help($route_name, RouteMatchInterface $route_match) {
$image_styles_config = \Drupal::configFactory()->get('image_style_warmer.settings');
switch ($route_name) {
$image_styles = $image_styles_config->get('vagov_image_styles');
case 'help.page.alt_text_validation':
$form['initial_image_styles']['#access'] = FALSE;
if (\Drupal::moduleHandler()->moduleExists('markdown')) {
$form['queue_image_styles']['#access'] = FALSE;
// Use the Markdown filter to render the README.
$form['vagov_image_styles'] = [
// @phpstan-ignore-next-line
'#type' => 'checkboxes',
return Markdown::create()->loadFile(__DIR__ . '/README.md');
'#title' => t('Late-generated image styles'),
}
'#description' => t('Select image styles which will be created after cropping.'),
else {
'#options' => image_style_options(FALSE),
$text = file_get_contents(__DIR__ . '/README.md');
'#default_value' => !empty($image_styles) ? $image_styles : [],
return '<pre>' . Html::escape($text) . '</pre>';
'#size' => 10,
}
];
}
}*/
return NULL;
}
/**
/**
* Implements hook_clientside_validation_validator_info_alter().
* Implements hook_clientside_validation_validator_info_alter().
Loading