You are here

library.module in Library 8

Same filename and directory in other branches
  1. 5.2 library.module
  2. 6.2 library.module
  3. 6 library.module
  4. 7 library.module

Contains library.module.

File

library.module
View 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

Namesort descending Description
library_cron Implements hook_cron().
library_form_node_form_alter Implements hook_form_node_form_alter().
library_help Implements hook_help().