From fcbce09fc4dc85a47a78ce01abe801225beb9a94 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 6 Oct 2009 21:50:41 -0700 Subject: 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. --- modules/gallery/helpers/gallery.php | 11 +++++++++-- modules/gallery/views/permissions_form.html.php | 24 ++++++++++++------------ 2 files changed, 21 insertions(+), 14 deletions(-) (limited to 'modules') 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 diff --git a/modules/gallery/views/permissions_form.html.php b/modules/gallery/views/permissions_form.html.php index f66f3144..f1714119 100644 --- a/modules/gallery/views/permissions_form.html.php +++ b/modules/gallery/views/permissions_form.html.php @@ -20,11 +20,11 @@ - " + " title="for_html_attr() ?>" alt="for_html_attr() ?>" /> - " alt="for_html_attr() ?>" /> + " alt="for_html_attr() ?>" /> @@ -32,22 +32,22 @@ - " alt="for_html_attr() ?>" /> + " alt="for_html_attr() ?>" /> - " alt="for_html_attr() ?>" /> + " alt="for_html_attr() ?>" /> - " alt="for_html_attr() ?>" /> + " alt="for_html_attr() ?>" /> - " alt="for_html_attr() ?>" /> + " alt="for_html_attr() ?>" /> @@ -56,30 +56,30 @@ - " alt="for_html_attr() ?>" /> + " alt="for_html_attr() ?>" /> id == 1): ?> - " alt="for_html_attr() ?>" title="for_html_attr() ?>"/> + " alt="for_html_attr() ?>" title="for_html_attr() ?>"/> - " alt="for_html_attr() ?>" /> + " alt="for_html_attr() ?>" /> id == 1): ?> - " title="for_html_attr() ?>" alt="for_html_attr() ?>" /> + " title="for_html_attr() ?>" alt="for_html_attr() ?>" /> - " alt="for_html_attr() ?>" /> + " alt="for_html_attr() ?>" /> - " alt="for_html_attr() ?>" /> + " alt="for_html_attr() ?>" /> -- cgit v1.2.3 From 13fb033235a057445d58f5c2663951d1e0738423 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 6 Oct 2009 23:05:35 -0700 Subject: Remove debugging lines (thanks talmdal!) --- modules/gallery/helpers/gallery.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index b7c68ef8..50e2c43b 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -94,14 +94,11 @@ class gallery_Core { $file_name = Kohana::find_file($directory, $file_name, $required, substr($ext, 1)); 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 -- cgit v1.2.3