summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2013-10-13 17:27:17 (GMT)
committerAlex Pott2013-10-13 17:27:17 (GMT)
commit69a833416872f8cc427b28f969e6334b2c619882 (patch)
tree0a4313842be618f4b94c1948a7fd03aad041ce16
parentde0a575dec07fde4c3c4faa37beaa57346dbe4c2 (diff)
Issue #2028113 by RoSk0: Make forum module css a library.
-rw-r--r--core/modules/forum/forum.module17
-rw-r--r--core/modules/forum/lib/Drupal/forum/Controller/ForumController.php4
2 files changed, 19 insertions, 2 deletions
diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module
index be58c58..00a310a 100644
--- a/core/modules/forum/forum.module
+++ b/core/modules/forum/forum.module
@@ -885,3 +885,20 @@ function template_preprocess_forum_submitted(&$variables) {
function theme_forum_form(array $variables) {
return drupal_render_children($variables['form']);
}
+
+/**
+ * Implements hook_library_info().
+ *
+ * Forum specific libraries.
+ */
+function forum_library_info() {
+ $libraries['forum.index'] = array(
+ 'title' => 'Forum index',
+ 'version' => \Drupal::VERSION,
+ 'css' => array(
+ drupal_get_path('module', 'forum') . '/css/forum.module.css' => array(),
+ ),
+ );
+
+ return $libraries;
+}
diff --git a/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php b/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php
index 131c1fe..95b2923 100644
--- a/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php
+++ b/core/modules/forum/lib/Drupal/forum/Controller/ForumController.php
@@ -177,8 +177,8 @@ class ForumController implements ContainerInjectionInterface {
'#sortby' => $this->config->get('topics.order'),
'#forums_per_page' => $this->config->get('topics.page_limit'),
);
- // @todo Make this a library - see https://drupal.org/node/2028113.
- $build['#attached']['css'][] = drupal_get_path('module', 'forum') . '/css/forum.module.css';
+ $build['#attached']['library'][] = array('forum', 'forum.index');
+
return $build;
}