summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/gallery.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-10-06 21:50:41 -0700
committerBharat Mediratta <bharat@menalto.com>2009-10-06 21:50:41 -0700
commitfcbce09fc4dc85a47a78ce01abe801225beb9a94 (patch)
treec32cfafdf1177c9961115b900e9ce1ea75b70b62 /modules/gallery/helpers/gallery.php
parent0c7e4581c9f89aa462d951fae46f137f5a3566c0 (diff)
Update gallery::find_file to look for subdirectories in lib, then fall
back to looking in just lib itself. This is not consistent behavior with the rest of our module structure, though so we should probably make it more consistent. Fix up the permission images to use gallery::find_file again.
Diffstat (limited to 'modules/gallery/helpers/gallery.php')
-rw-r--r--modules/gallery/helpers/gallery.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php
index 37a08d08..b7c68ef8 100644
--- a/modules/gallery/helpers/gallery.php
+++ b/modules/gallery/helpers/gallery.php
@@ -92,9 +92,16 @@ class gallery_Core {
static function find_file($directory, $file, $required=false) {
$file_name = substr($file, 0, -strlen($ext = strrchr($file, '.')));
$file_name = Kohana::find_file($directory, $file_name, $required, substr($ext, 1));
- if (!$file_name && file_exists(DOCROOT . "lib/$file")) {
- return "lib/$file";
+ if (!$file_name) {
+ if (file_exists(DOCROOT . "lib/$directory/$file")) {
+ Kohana::log("alert",print_r(print_r(array($directory, $file),1) . " ==> lib/$directory/$file",1));
+ return "lib/$directory/$file";
+ } else if (file_exists(DOCROOT . "lib/$file")) {
+ Kohana::log("alert",print_r(print_r(array($directory, $file),1) . " ==> lib/$file",1));
+ return "lib/$file";
+ }
}
+ Kohana::log("alert",print_r(print_r(array($directory, $file),1) . " ==> $file_name",1));
if (is_string($file_name)) {
// make relative to DOCROOT