diff options
author | Chad Kieffer <ckieffer@gmail.com> | 2009-10-07 00:21:47 -0600 |
---|---|---|
committer | Chad Kieffer <ckieffer@gmail.com> | 2009-10-07 00:21:47 -0600 |
commit | 617076e8970872ba0355caeadb70cbf6735f2a39 (patch) | |
tree | fa14e2946763449af57661882a95b752a54e05f3 | |
parent | 859f8dc558555cee4c106099c1a44aa6866aaa0f (diff) | |
parent | 13fb033235a057445d58f5c2663951d1e0738423 (diff) |
Merge branch 'master' of github.com:gallery/gallery3
-rw-r--r-- | modules/gallery/helpers/gallery.php | 8 | ||||
-rw-r--r-- | modules/gallery/views/permissions_form.html.php | 24 |
2 files changed, 18 insertions, 14 deletions
diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 37a08d08..50e2c43b 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -92,8 +92,12 @@ 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")) { + return "lib/$directory/$file"; + } else if (file_exists(DOCROOT . "lib/$file")) { + return "lib/$file"; + } } if (is_string($file_name)) { 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 @@ <? if ($lock): ?> <td class="g-denied"> - <img src="<?= url::file("lib/images/ico-denied.png") ?>" + <img src="<?= url::file(gallery::find_file("images", "ico-denied.png")) ?>" title="<?= t('denied and locked through parent album')->for_html_attr() ?>" alt="<?= t('denied icon')->for_html_attr() ?>" /> <a href="javascript:show(<?= $lock->id ?>)" title="<?= t('click to go to parent album')->for_html_attr() ?>"> - <img src="<?= url::file("lib/images/ico-lock.png") ?>" alt="<?= t('locked icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-lock.png")) ?>" alt="<?= t('locked icon')->for_html_attr() ?>" /> </a> </td> <? else: ?> @@ -32,22 +32,22 @@ <? if ($allowed): ?> <td class="g-allowed"> <a href="javascript:set('allow',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('allowed through parent album, click to allow explicitly')->for_html_attr() ?>"> - <img src="<?= url::file("lib/images/ico-success-passive.png") ?>" alt="<?= t('passive allowed icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-success-passive.png")) ?>" alt="<?= t('passive allowed icon')->for_html_attr() ?>" /> </a> <a href="javascript:set('deny',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('click to deny')->for_html_attr() ?>"> - <img src="<?= url::file("lib/images/ico-denied-inactive.png") ?>" alt="<?= t('inactive denied icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-denied-inactive.png")) ?>" alt="<?= t('inactive denied icon')->for_html_attr() ?>" /> </a> </td> <? else: ?> <td class="g-denied"> <a href="javascript:set('allow',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('click to allow')->for_html_attr() ?>"> - <img src="<?= url::file("lib/images/ico-success-inactive.png") ?>" alt="<?= t('inactive allowed icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-success-inactive.png")) ?>" alt="<?= t('inactive allowed icon')->for_html_attr() ?>" /> </a> <a href="javascript:set('deny',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('denied through parent album, click to deny explicitly')->for_html_attr() ?>"> - <img src="<?= url::file("lib/images/ico-denied-passive.png") ?>" alt="<?= t('passive denied icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-denied-passive.png")) ?>" alt="<?= t('passive denied icon')->for_html_attr() ?>" /> </a> </td> <? endif ?> @@ -56,30 +56,30 @@ <td class="g-denied"> <a href="javascript:set('allow',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('click to allow')->for_html_attr() ?>"> - <img src="<?= url::file("lib/images/ico-success-inactive.png") ?>" alt="<?= t('inactive allowed icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-success-inactive.png")) ?>" alt="<?= t('inactive allowed icon')->for_html_attr() ?>" /> </a> <? if ($item->id == 1): ?> - <img src="<?= url::file("lib/images/ico-denied.png") ?>" alt="<?= t('denied icon')->for_html_attr() ?>" title="<?= t('denied')->for_html_attr() ?>"/> + <img src="<?= url::file(gallery::find_file("images", "ico-denied.png")) ?>" alt="<?= t('denied icon')->for_html_attr() ?>" title="<?= t('denied')->for_html_attr() ?>"/> <? else: ?> <a href="javascript:set('reset',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('denied, click to reset')->for_html_attr() ?>"> - <img src="<?= url::file("lib/images/ico-denied.png") ?>" alt="<?= t('denied icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-denied.png")) ?>" alt="<?= t('denied icon')->for_html_attr() ?>" /> </a> <? endif ?> </td> <? elseif ($intent === access::ALLOW): ?> <td class="g-allowed"> <? if ($item->id == 1): ?> - <img src="<?= url::file("lib/images/ico-success.png") ?>" title="<?= t("allowed")->for_html_attr() ?>" alt="<?= t('allowed icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-success.png")) ?>" title="<?= t("allowed")->for_html_attr() ?>" alt="<?= t('allowed icon')->for_html_attr() ?>" /> <? else: ?> <a href="javascript:set('reset',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('allowed, click to reset')->for_html_attr() ?>"> - <img src="<?= url::file("lib/images/ico-success.png") ?>" alt="<?= t('allowed icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-success.png")) ?>" alt="<?= t('allowed icon')->for_html_attr() ?>" /> </a> <? endif ?> <a href="javascript:set('deny',<?= $group->id ?>,<?= $permission->id ?>,<?= $item->id ?>)" title="<?= t('click to deny')->for_html_attr() ?>"> - <img src="<?= url::file("lib/images/ico-denied-inactive.png") ?>" alt="<?= t('inactive denied icon')->for_html_attr() ?>" /> + <img src="<?= url::file(gallery::find_file("images", "ico-denied-inactive.png")) ?>" alt="<?= t('inactive denied icon')->for_html_attr() ?>" /> </a> </td> <? endif ?> |