diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-03-20 14:59:55 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-03-20 14:59:55 +0000 |
commit | 48c022e8cbcc027cec20aa0b6657a2c784df5ad8 (patch) | |
tree | bc061c16abe10d96f387394af44804857dbe8ed6 /core/libraries/Admin_View.php | |
parent | acfb81d940a50ec018613946e30f63c623b8c5db (diff) |
Rather than moving the themeroller and all of its associated files
into each theme. I chose to create methods Theme_View::file($path)
and Admin_View::file($path). These methods check for a theme override
file in the theme and return a link to it if it exists. So to
override the themeroller files. just create a lib/themeroller in the
theme and the files will be picked up.
Diffstat (limited to 'core/libraries/Admin_View.php')
-rw-r--r-- | core/libraries/Admin_View.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/libraries/Admin_View.php b/core/libraries/Admin_View.php index 9ca585d2..e88b01ee 100644 --- a/core/libraries/Admin_View.php +++ b/core/libraries/Admin_View.php @@ -45,6 +45,11 @@ class Admin_View_Core extends View { return $absolute_url ? url::abs_file($arg) : url::file($arg); } + public function file($path) { + $theme_path = "themes/{$this->theme_name}/$path"; + return url::file(file_exists($theme_path) ? $theme_path : $path); + } + public function display($page_name, $view_class="View") { return new $view_class($page_name); } |