diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2009-08-28 14:27:37 -0700 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2009-08-28 14:27:37 -0700 |
| commit | cb2171d0825251d619b53f6f80d217326fb6bab5 (patch) | |
| tree | 3f4ebee66cdbe06a1aa2c61c9d4527e30d2c83b5 /modules/organize/controllers | |
| parent | 6dcfdb6432d556f43736d60de8f310f247868bfa (diff) | |
Display the sort order in the Organize dialog, and allow users to
change the sort order on the fly.
Diffstat (limited to 'modules/organize/controllers')
| -rw-r--r-- | modules/organize/controllers/organize.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/modules/organize/controllers/organize.php b/modules/organize/controllers/organize.php index f56ad006..10b109f6 100644 --- a/modules/organize/controllers/organize.php +++ b/modules/organize/controllers/organize.php @@ -25,7 +25,7 @@ class Organize_Controller extends Controller { access::required("edit", $item); $v = new View("organize_dialog.html"); - $v->title = $item->title; + $v->album = $item; $parents = array(); foreach ($item->parents() as $parent) { $parents[$parent->id] = 1; @@ -84,6 +84,25 @@ class Organize_Controller extends Controller { "url" => url::site("organize/run/$task->id?csrf=" . access::csrf_token()))); } + function resort($target_id, $col, $dir) { + access::verify_csrf(); + + $album = ORM::factory("item", $target_id); + access::required("view", $album); + access::required("edit", $album); + + $options = album::get_sort_order_options(); + if (!isset($options[$col])) { + return; + } + + $album->sort_column = $col; + $album->sort_order = $dir; + $album->save(); + + print self::_get_micro_thumb_grid($album, 0); + } + private static function _get_micro_thumb_grid($item, $offset) { $v = new View("organize_thumb_grid.html"); $v->item = $item; |
