Alexander O'Neill
6 years ago
3 changed files with 64 additions and 0 deletions
@ -0,0 +1,7 @@
|
||||
name: 'lmmi' |
||||
type: module |
||||
description: 'Custom extensions for the LMMI Journal site' |
||||
core: 8.x |
||||
package: 'LMMI' |
||||
dependencies: |
||||
- toc_api |
@ -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: |
||||
} |
||||
} |
@ -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…
Reference in new issue