content_synchronizer.module in Content Synchronizer 8
Same filename and directory in other branches
Hooks definitions for content_synchronizer module.
File
content_synchronizer.moduleView source
<?php
/**
* @file
* Hooks definitions for content_synchronizer module.
*/
use Drupal\content_synchronizer\Service\EntityExportFormBuilder;
use Drupal\Core\Form\FormStateInterface;
use Drupal\content_synchronizer\Service\ExportManager;
use Drupal\content_synchronizer\Service\GlobalReferenceManager;
use Drupal\Core\Entity\EntityInterface;
use Drupal\content_synchronizer\Service\ArchiveDownloader;
/**
* Implements hook_theme().
*/
function content_synchronizer_theme($existing, $type, $theme, $path) {
$items = [
'entities_list_table' => [
'variables' => [
'entities' => NULL,
'title' => NULL,
'checkbox_name' => NULL,
'status_or_bundle' => NULL,
],
],
];
return $items;
}
/**
* Implements hook_form_alter().
*/
function content_synchronizer_form_alter(&$form, FormStateInterface $form_state, $form_id) {
\Drupal::service(EntityExportFormBuilder::SERVICE_NAME)
->addExportFields($form, $form_state);
}
/**
* Implements hook_entity_delete().
*/
function content_synchronizer_entity_delete(EntityInterface $entity) {
\Drupal::service(GlobalReferenceManager::SERVICE_NAME)
->onEntityDelete($entity);
\Drupal::service(ExportManager::SERVICE_NAME)
->onEntityDelete($entity);
}
/**
* Implements hook_preprocess().
*/
function content_synchronizer_preprocess_page(&$vars) {
\Drupal::service(ArchiveDownloader::SERVICE_NAME)
->donwloadArchive($vars);
}
Functions
Name | Description |
---|---|
content_synchronizer_entity_delete | Implements hook_entity_delete(). |
content_synchronizer_form_alter | Implements hook_form_alter(). |
content_synchronizer_preprocess_page | Implements hook_preprocess(). |
content_synchronizer_theme | Implements hook_theme(). |