summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/Extension/ThemeHandler.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/lib/Drupal/Core/Extension/ThemeHandler.php')
-rw-r--r--core/lib/Drupal/Core/Extension/ThemeHandler.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/core/lib/Drupal/Core/Extension/ThemeHandler.php b/core/lib/Drupal/Core/Extension/ThemeHandler.php
index c529bad..d9ef77e 100644
--- a/core/lib/Drupal/Core/Extension/ThemeHandler.php
+++ b/core/lib/Drupal/Core/Extension/ThemeHandler.php
@@ -682,4 +682,34 @@ class ThemeHandler implements ThemeHandlerInterface {
return system_list('theme');
}
+ /**
+ * {@inheritdoc}
+ */
+ public function getThemeDirectories() {
+ $dirs = array();
+ foreach ($this->listInfo() as $name => $theme) {
+ $dirs[$name] = DRUPAL_ROOT . '/' . $theme->getPath();
+ }
+ return $dirs;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function themeExists($theme) {
+ $themes = $this->listInfo();
+ return isset($themes[$theme]);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getTheme($name) {
+ $themes = $this->listInfo();
+ if (isset($themes[$name])) {
+ return $themes[$name];
+ }
+ throw new \InvalidArgumentException(sprintf('The theme %s does not exist.', $name));
+ }
+
}