scheduler_extras.module in Scheduler 8
Same filename and directory in other branches
Hook implementations for the Scheduler Extras test module.
File
tests/modules/scheduler_extras/scheduler_extras.moduleView source
<?php
/**
* @file
* Hook implementations for the Scheduler Extras test module.
*/
use Drupal\Core\Form\FormStateInterface;
/**
* Implements hook_form_FORM_ID_alter() for node_form().
*/
function scheduler_extras_form_node_form_alter(&$form, FormStateInterface $form_state) {
// This is used in SchedulerDefaultTimeTest to check that the default time is
// set correctly even when the time elememt of the datetime input is hidden.
$type = $form_state
->getFormObject()
->getEntity()->type->entity
->get('type');
if ($type == 'hidden_time') {
if (isset($form['publish_on'])) {
$form['publish_on']['widget'][0]['value']['#date_time_element'] = 'none';
}
if (isset($form['unpublish_on'])) {
$form['unpublish_on']['widget'][0]['value']['#date_time_element'] = 'none';
}
}
}
Functions
Name | Description |
---|---|
scheduler_extras_form_node_form_alter | Implements hook_form_FORM_ID_alter() for node_form(). |