From 4ba02d29f8c97483a3160050f635a6a91f9d7aa1 Mon Sep 17 00:00:00 2001 From: Maurice W Date: Mon, 11 Apr 2011 03:20:35 -0400 Subject: [PATCH] enabling ability to properly work with themes in cakePHP 1.2+ --- views/helpers/asset.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/views/helpers/asset.php b/views/helpers/asset.php index 539f185..5f4b1a7 100644 --- a/views/helpers/asset.php +++ b/views/helpers/asset.php @@ -367,6 +367,18 @@ function __findFile(&$asset, $type) { $paths = array($this->__getPath($type)); $paths = array_merge($paths, $this->options['searchPaths']); + //checks if a theme is being used + if(!empty($this->theme)) + { + //cakePHP < 1.2 suggests putting themes in /webroot/theme/themeName, while cakePHP > 1.3 suggests putting it in /views/themed/themeName + //so I'm covering both cases here + $themePaths = array( WWW_ROOT . 'theme' . DS . $this->theme . DS, + VIEWS . 'themed' . DS . $this->theme . DS, + ); + + $paths = array_merge($paths, $themePaths); + } + if (!empty($asset['plugin']) > 0) { $pluginPaths = App::path('plugins');