Browse Source

Initial commit

8.x-1.x
Alexander O'Neill 6 years ago
parent
commit
ef4fc53e16
  1. 7
      lmmi.info.yml
  2. 24
      lmmi.module
  3. 33
      src/Plugin/Block/TocWrapperBlock.php

7
lmmi.info.yml

@ -0,0 +1,7 @@
name: 'lmmi'
type: module
description: 'Custom extensions for the LMMI Journal site'
core: 8.x
package: 'LMMI'
dependencies:
- toc_api

24
lmmi.module

@ -0,0 +1,24 @@
<?php
/**
* @file
* Contains lmmi.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function lmmi_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the lmmi module.
case 'help.page.lmmi':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Custom extensions for the LMMI Journal site') . '</p>';
return $output;
default:
}
}

33
src/Plugin/Block/TocWrapperBlock.php

@ -0,0 +1,33 @@
<?php
namespace Drupal\lmmi\Plugin\Block;
use Drupal\Core\Block\BlockBase;
use Drupal\toc_api\Plugin\Block\TocBlockBase;
/**
* Provides a 'TocWrapperBlock' block.
*
* @Block(
* id = "toc_wrapper_block",
* admin_label = @Translation("ToC Wrapper Block"),
* )
*/
class TocWrapperBlock extends TocBlockBase {
/**
* {@inheritdoc}
*/
public function build() {
if ($this->getCurrentToc()) {
return parent::build();
}
return [];
}
/**
* @inheritdoc
*/
protected function getCurrentTocId() {
return 'toc_filter';
}
}
Loading…
Cancel
Save