diff --git a/entity_tasks.module b/entity_tasks.module index f105842b92b82cd745e22c5fdb8e0f8b839a7365..0720291ca06aefe83d78de1803cb63c41931e7ea 100644 --- a/entity_tasks.module +++ b/entity_tasks.module @@ -2,21 +2,21 @@ /** * @file - * Autoload includes folder. + * Entity Tasks hooks. */ -$moduleName = basename(dirname(__FILE__)); +use Drupal\Component\Serialization\Yaml; -$current_module_path = \Drupal::service('extension.list.module')->getPath($moduleName); -$pathsToInclude = glob($current_module_path . '/hooks/*'); +/** + * Implements hook_toolbar(). + */ +function entity_tasks_toolbar_alter(&$items) { + \Drupal::service('entity_tasks.toolbar')->buildToolbarConfiguration($items); +} -if ($pathsToInclude) { - $module_handler = \Drupal::service('module_handler'); - foreach ($pathsToInclude as $path) { - $pathInfo = pathinfo($path); - $directory = str_replace($current_module_path, '', $pathInfo['dirname']); - if (isset($pathInfo['extension'])) { - $module_handler->loadInclude($moduleName, $pathInfo['extension'], $directory . '/' . $pathInfo['filename']); - } - } +/** + * Implements hook_theme(). + */ +function entity_tasks_theme($existing, $type, $theme, $path) { + return Yaml::decode(file_get_contents(DRUPAL_ROOT . '/' . $path . '/' . $theme . '.themes.yml')); } diff --git a/hooks/entity_tasks.theme.inc b/hooks/entity_tasks.theme.inc deleted file mode 100644 index 4ebd3642282607bb35b71657c44123144ac31cb1..0000000000000000000000000000000000000000 --- a/hooks/entity_tasks.theme.inc +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * @file - * Theme hook. - */ - -use Drupal\Component\Serialization\Yaml; - -/** - * Implements hook_theme(). - */ -function entity_tasks_theme($existing, $type, $theme, $path) { - return Yaml::decode(file_get_contents(DRUPAL_ROOT . '/' . $path . '/' . $theme . '.themes.yml')); -} diff --git a/hooks/entity_tasks.toolbar.inc b/hooks/entity_tasks.toolbar.inc deleted file mode 100644 index 02e2115fafd03ba6812d83f05b85b548172ae6b1..0000000000000000000000000000000000000000 --- a/hooks/entity_tasks.toolbar.inc +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -/** - * @file - * Toolbar hook. - */ - -/** - * Implements hook_toolbar(). - */ -function entity_tasks_toolbar_alter(&$items) { - \Drupal::service('entity_tasks.toolbar')->buildToolbarConfiguration($items); -}