From: <tna...@us...> - 2009-03-09 13:52:09
|
Revision: 20325 http://gallery.svn.sourceforge.net/gallery/?rev=20325&view=rev Author: tnalmdal Date: 2009-03-09 13:43:13 +0000 (Mon, 09 Mar 2009) Log Message: ----------- Change Item_Model::get_position to respect the sort order. This also forced the next/prev buttons in album navication to respect the sort order as well. Modified Paths: -------------- gallery3/trunk/core/models/item.php Modified: gallery3/trunk/core/models/item.php =================================================================== --- gallery3/trunk/core/models/item.php 2009-03-09 13:30:22 UTC (rev 20324) +++ gallery3/trunk/core/models/item.php 2009-03-09 13:43:13 UTC (rev 20325) @@ -299,11 +299,10 @@ * the first child in the album is at position 1. */ public function get_position($child_id) { - // Right now we only sort by id ascending, so bake that assumption in here. - // @todo fix this when we introduce sort orders. return ORM::factory("item") ->where("parent_id", $this->id) ->where("id <=", $child_id) + ->orderby(array($this->sort_column => $this->sort_order)) ->count_all(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |