summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/controllers/albums.php6
-rw-r--r--modules/gallery/js/l10n_client.js6
-rw-r--r--modules/gallery/libraries/Theme_View.php4
3 files changed, 15 insertions, 1 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index e14fe347..d545b415 100644
--- a/modules/gallery/controllers/albums.php
+++ b/modules/gallery/controllers/albums.php
@@ -93,10 +93,16 @@ class Albums_Controller extends Items_Controller {
"previous_item" => $previous_item,
"next_item" => $next_item,
"sibling_count" => $item->parent()->viewable()->children_count($where),
+ "siblings_callback" => array("Albums_Controller::get_siblings", array($item)),
"parents" => $item->parents()->as_array(),
"breadcrumbs" => Breadcrumb::array_from_item_parents($item));
}
+ static function get_siblings($item) {
+ // @todo consider creating Item_Model::siblings() if we use this more broadly.
+ return $item->parent()->viewable()->children();
+ }
+
public function create($parent_id) {
access::verify_csrf();
$album = ORM::factory("item", $parent_id);
diff --git a/modules/gallery/js/l10n_client.js b/modules/gallery/js/l10n_client.js
index a1b970e7..6d919c29 100644
--- a/modules/gallery/js/l10n_client.js
+++ b/modules/gallery/js/l10n_client.js
@@ -140,7 +140,11 @@ jQuery.extend(Gallery, {
} else {
if(search.length > 0) {
$('#l10n-client-string-select li').hide();
- $('#l10n-client-string-select li:contains('+search+')').show();
+ $('#l10n-client-string-select li').each(function() {
+ if ($(this).val().indexOf(search) != -1) {
+ $(this).show();
+ }
+ });
$('#l10n-client #g-l10n-search').val(search);
}
}
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index 8d69f23b..cf384109 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -86,6 +86,10 @@ class Theme_View_Core extends Gallery_View {
return $this->item;
}
+ public function siblings() {
+ return call_user_func_array($this->siblings_callback[0], $this->siblings_callback[1]);
+ }
+
public function tag() {
return $this->tag;
}