summaryrefslogtreecommitdiff
path: root/Pigeonholes.php
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2007-09-09 15:52:18 +0000
committerMax Kremmel <xing@synapse.plus.com>2007-09-09 15:52:18 +0000
commit999458e5c8e0a2cf208e6bbb4510a777dc32fad8 (patch)
tree4187f1ff3ab9684f05146cf344f68cd326f89e45 /Pigeonholes.php
parent7e0102672274b16d10fccad94c6727c7acd7dc57 (diff)
downloadpigeonholes-999458e5c8e0a2cf208e6bbb4510a777dc32fad8.tar.gz
pigeonholes-999458e5c8e0a2cf208e6bbb4510a777dc32fad8.tar.bz2
pigeonholes-999458e5c8e0a2cf208e6bbb4510a777dc32fad8.zip
fix pathlist sorting and allow override for forbid insertion hiding
Diffstat (limited to 'Pigeonholes.php')
-rw-r--r--Pigeonholes.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/Pigeonholes.php b/Pigeonholes.php
index 3836115..f06a19f 100644
--- a/Pigeonholes.php
+++ b/Pigeonholes.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.106 2007/08/25 11:10:16 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.107 2007/09/09 15:52:18 squareing Exp $
*
* +----------------------------------------------------------------------+
* | Copyright ( c ) 2004, bitweaver.org
@@ -17,7 +17,7 @@
* Pigeonholes class
*
* @author xing <xing@synapse.plus.com>
- * @version $Revision: 1.106 $
+ * @version $Revision: 1.107 $
* @package pigeonholes
*/
@@ -274,17 +274,16 @@ class Pigeonholes extends LibertyAttachable {
* @return TRUE on success, FALSE if there is no pigeonhole
* @TODO We need to sort the returned values that successive pigoenholes are grouped together.
*/
- function getPigeonholesPathList( $pContentId=NULL, $pTruncate = FALSE ) {
+ function getPigeonholesPathList( $pContentId=NULL, $pTruncate = FALSE, $pShowAll = FALSE ) {
global $gBitSystem;
$where = $join = '';
- if ($gBitSystem->isFeatureActive('pigeonholes_allow_forbid_insertion')) {
+ if( $gBitSystem->isFeatureActive( 'pigeonholes_allow_forbid_insertion' ) && !$pShowAll ) {
$where .= empty( $where ) ? ' WHERE ' : ' AND ';
$where .= ' lcp.`pref_value` IS NULL OR lcp.`pref_value` != \'on\' ';
$join .= ' LEFT JOIN `'.BIT_DB_PREFIX.'liberty_content_prefs` lcp ON (pig.`content_id` = lcp.`content_id` AND lcp.`pref_name` = \'no_insert\') ';
}
-
$query = "SELECT pig.`content_id`, pig.`structure_id`
FROM `".BIT_DB_PREFIX."pigeonholes` pig
INNER JOIN `".BIT_DB_PREFIX."liberty_structures` ls ON ( ls.`structure_id` = pig.`structure_id` )
@@ -948,9 +947,9 @@ function pigeonholes_alphabetiser( $a, $b ) {
function pigeonholes_pathlist_sorter( $aa, $ab ) {
foreach( $aa as $key => $a ) {
if( !empty( $ab[$key] ) ) {
- if( $a['structure_id'] < $ab[$key]['structure_id'] ) {
+ if( $a['pos'] < $ab[$key]['pos'] ) {
return -1;
- } elseif( $a['structure_id'] > $ab[$key]['structure_id'] ) {
+ } elseif( $a['pos'] > $ab[$key]['pos'] ) {
return 1;
}
} else {