panopoly_magic.module in Panopoly 8.2
Same filename and directory in other branches
Hook implementations for panopoly_magic.
File
modules/panopoly/panopoly_magic/panopoly_magic.moduleView source
<?php
/**
* @file
* Hook implementations for panopoly_magic.
*/
use Drupal\Core\Form\FormStateInterface;
/**
* Implements hook_form_FORM_ID_alter().
*/
function panopoly_magic_form_layout_builder_add_block_alter(&$form, FormStateInterface $form_state, $form_id) {
\Drupal::service('panopoly_magic.alterations.reusable_blocks')
->alterForm($form, $form_state, $form_id);
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function panopoly_magic_form_layout_builder_update_block_alter(&$form, FormStateInterface $form_state, $form_id) {
\Drupal::service('panopoly_magic.alterations.reusable_blocks')
->alterForm($form, $form_state, $form_id);
}
/**
* Implements hook_theme().
*/
function panopoly_magic_theme() {
return [
'panopoly_magic_preview' => [
'render element' => 'preview',
],
];
}
/**
* Default preprocess hook for panopoly-magic-theme.html.twig template.
*/
function template_preprocess_panopoly_magic_preview(&$vars) {
$preview =& $vars['preview'];
$vars['title'] = $preview['#title'];
$vars['add_link'] = $preview['add_link'];
unset($preview['add_link']);
}
Functions
Name | Description |
---|---|
panopoly_magic_form_layout_builder_add_block_alter | Implements hook_form_FORM_ID_alter(). |
panopoly_magic_form_layout_builder_update_block_alter | Implements hook_form_FORM_ID_alter(). |
panopoly_magic_theme | Implements hook_theme(). |
template_preprocess_panopoly_magic_preview | Default preprocess hook for panopoly-magic-theme.html.twig template. |