library.module in Library 8
Same filename and directory in other branches
Contains library.module.
File
library.moduleView source
<?php
/**
* @file
* Contains library.module.
*/
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\library\WidgetSubmit;
/**
* Implements hook_help().
*/
function library_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the library module.
case 'help.page.library':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Provides library stock management') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_form_node_form_alter().
*/
function library_form_node_form_alter(&$form, FormStateInterface $form_state) {
WidgetSubmit::attach($form, $form_state);
}
/**
* Implements hook_cron().
*/
function library_cron() {
\Drupal::service('library.anonmyize_records')
->anonymize();
}
Functions
Name | Description |
---|---|
library_cron | Implements hook_cron(). |
library_form_node_form_alter | Implements hook_form_node_form_alter(). |
library_help | Implements hook_help(). |