Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 0866771b authored by escuriola's avatar escuriola
Browse files

OEL-1147: Add NeutralFooterBlock extending from FooterBlockBase.

parent b3fae0fd
No related branches found
No related tags found
1 merge request!81OEL-1147 - Footer
<?php
declare(strict_types = 1);
namespace Drupal\oe_whitelabel_helper\Plugin\Block;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Cache\CacheableMetadata;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\oe_corporate_blocks\Plugin\Block\FooterBlockBase;
/**
* Provides the corporate EU footer block.
*
* @Block(
* id = "oe_corporate_blocks_neutral_footer",
* admin_label = @Translation("Neutral Footer block"),
* category = @Translation("Corporate blocks"),
* )
*/
class NeutralFooterBlock extends FooterBlockBase implements ContainerFactoryPluginInterface {
/**
* {@inheritdoc}
*/
public function build() {
$cache = new CacheableMetadata();
$cache->addCacheContexts(['languages:language_interface']);
$config = $this->configFactory->get('oe_corporate_blocks.ec_data.footer');
$cache->addCacheableDependency($config);
$build['#theme'] = 'oe_corporate_blocks_neutral_footer';
NestedArray::setValue($build, ['#corporate_footer', 'content_owner_details'], $config->get('content_owner_details'));
$this->setSiteSpecificFooter($build, $cache);
$cache->applyTo($build);
return $build;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment