summaryrefslogtreecommitdiff
path: root/Pigeonholes.php
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2005-10-22 18:02:12 +0000
committerMax Kremmel <xing@synapse.plus.com>2005-10-22 18:02:12 +0000
commit65c016d8eb08fcd0b07f0a91d06ff58feb7a7253 (patch)
treefe24479480c87c28a92e7d87f951fc310aec1ef4 /Pigeonholes.php
parenta7fa9632ace29c8dc5aa3a05f91b9b0999786364 (diff)
downloadpigeonholes-65c016d8eb08fcd0b07f0a91d06ff58feb7a7253.tar.gz
pigeonholes-65c016d8eb08fcd0b07f0a91d06ff58feb7a7253.tar.bz2
pigeonholes-65c016d8eb08fcd0b07f0a91d06ff58feb7a7253.zip
apply some default sort mode
Diffstat (limited to 'Pigeonholes.php')
-rw-r--r--Pigeonholes.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/Pigeonholes.php b/Pigeonholes.php
index 1ae8dc4..6dc4a1d 100644
--- a/Pigeonholes.php
+++ b/Pigeonholes.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.6 2005/10/19 20:25:34 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.7 2005/10/22 18:02:12 squareing Exp $
*
* +----------------------------------------------------------------------+
* | Copyright ( c ) 2004, bitweaver.org
@@ -17,7 +17,7 @@
* Pigeonholes class
*
* @author xing <xing@synapse.plus.com>
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
* @package pigeonholes
*/
@@ -230,12 +230,12 @@ class Pigeonholes extends LibertyAttachable {
* @param $pContentId content id of pigeonhole.
* @return path in form of an array on success, FALSE ( boolean ) if content is in no pigeonhole
* @access public
- * @TODO sort the array somehow to make sure that the path is always incrementing and looks nice...
**/
function getPigeonholesPathList( $pContentId=NULL ) {
$query = "SELECT bp.`content_id`, bp.`structure_id`
FROM `".BIT_DB_PREFIX."bit_pigeonholes` bp
- ORDER BY bp.`content_id` ASC";
+ JOIN `".BIT_DB_PREFIX."tiki_structures` ts ON ( ts.`structure_id` = bp.`structure_id` )
+ ORDER BY ts.`root_structure_id`, ts.`structure_id` ASC";
$result = $this->mDb->query( $query );
$pigeonholes = $result->getRows();
foreach( $pigeonholes as $pigeonhole ) {
@@ -338,6 +338,9 @@ class Pigeonholes extends LibertyAttachable {
if( !empty( $pListHash['sort_mode'] ) ) {
$where .= " ORDER BY ".$this->mDb->convert_sortmode( $pListHash['sort_mode'] )." ";
+ } else {
+ // default sort mode makes list look nice
+ $where .= " ORDER BY ts.`root_structure_id`, ts.`structure_id` ASC";
}
$query = "SELECT bp.*, ts.`root_structure_id`, ts.`parent_id`, tc.`title`, tc.`data`, tc.`content_type_guid`,