summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/album.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-08-28 14:27:37 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-28 14:27:37 -0700
commitcb2171d0825251d619b53f6f80d217326fb6bab5 (patch)
tree3f4ebee66cdbe06a1aa2c61c9d4527e30d2c83b5 /modules/gallery/helpers/album.php
parent6dcfdb6432d556f43736d60de8f310f247868bfa (diff)
Display the sort order in the Organize dialog, and allow users to
change the sort order on the fly.
Diffstat (limited to 'modules/gallery/helpers/album.php')
-rw-r--r--modules/gallery/helpers/album.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/modules/gallery/helpers/album.php b/modules/gallery/helpers/album.php
index 1b6b875d..d46f21ac 100644
--- a/modules/gallery/helpers/album.php
+++ b/modules/gallery/helpers/album.php
@@ -116,13 +116,7 @@ class album_Core {
$sort_order->dropdown("column", array("id" => "gAlbumSortColumn"))
->label(t("Sort by"))
- ->options(array("weight" => t("Manual"),
- "captured" => t("Date captured"),
- "created" => t("Date uploaded"),
- "title" => t("Title"),
- "updated" => t("Date modified"),
- "view_count" => t("Number of views"),
- "rand_key" => t("Random")))
+ ->options(album::get_sort_order_options())
->selected($parent->sort_column);
$sort_order->dropdown("direction", array("id" => "gAlbumSortDirection"))
->label(t("Order"))
@@ -137,4 +131,17 @@ class album_Core {
$form->add_rules_from(ORM::factory("item"));
return $form;
}
+
+ /**
+ * Return a structured set of all the possible sort orders.
+ */
+ static function get_sort_order_options() {
+ return array("weight" => t("Manual"),
+ "captured" => t("Date captured"),
+ "created" => t("Date uploaded"),
+ "title" => t("Title"),
+ "updated" => t("Date modified"),
+ "view_count" => t("Number of views"),
+ "rand_key" => t("Random"));
+ }
}