summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspiderr <spider@viovio.com>2011-02-18 01:57:43 -0500
committerspiderr <spider@viovio.com>2011-02-18 01:57:43 -0500
commit2caa32ac1b980cf2a80dd439674b27b7c08e0059 (patch)
treed6aea9025e34b6c29ebdfa0da5d7f8611af3dc08
parent963a00f26894bb0623919c70577195e40285ccc5 (diff)
downloadfisheye-2caa32ac1b980cf2a80dd439674b27b7c08e0059.tar.gz
fisheye-2caa32ac1b980cf2a80dd439674b27b7c08e0059.tar.bz2
fisheye-2caa32ac1b980cf2a80dd439674b27b7c08e0059.zip
generateMenu always returns something now, init ret in ::getTree
-rw-r--r--FisheyeGallery.php23
1 files changed, 12 insertions, 11 deletions
diff --git a/FisheyeGallery.php b/FisheyeGallery.php
index b4fcdfc..eba6562 100644
--- a/FisheyeGallery.php
+++ b/FisheyeGallery.php
@@ -651,6 +651,8 @@ class FisheyeGallery extends FisheyeBase {
function getTree( $pListHash ) {
global $gBitDb;
+ $ret = array();
+
if( $this->mDb->isAdvancedPostgresEnabled() ) {
$bindVars = array();
$containVars = array();
@@ -680,7 +682,6 @@ class FisheyeGallery extends FisheyeBase {
ORDER BY lc.title";
$rootContent = $gBitDb->GetAssoc( $query, $bindVars );
- $ret = array();
foreach( array_keys( $rootContent ) as $conId ) {
$splitVars = array();
$query = "SELECT branch AS hash_key, * $selectSql
@@ -755,6 +756,7 @@ class FisheyeGallery extends FisheyeBase {
}
} else {
// this needs replacing with a more suitable list query ...
+ $pListHash['show_empty'] = TRUE;
$galList = $this->getList( $pListHash );
// index by content_id
foreach( $galList as $galId => $gal ) {
@@ -855,19 +857,18 @@ class FisheyeGallery extends FisheyeBase {
// Generate a select drop menu of listed galleries
function generateMenu( $pListHash, $pOptions, $pLocate=NULL ) {
- $ret = '';
- if( $hash = FisheyeGallery::getTree( $pListHash ) ) {
- $ret = "<select ";
- foreach( array( 'class', 'name', 'id', 'onchange' ) as $key ) {
- if( !empty( $pOptions[$key] ) ) {
- $ret .= " $key=\"$pOptions[$key]\" ";
- }
+ $ret = "<select ";
+ foreach( array( 'class', 'name', 'id', 'onchange' ) as $key ) {
+ if( !empty( $pOptions[$key] ) ) {
+ $ret .= " $key=\"$pOptions[$key]\" ";
}
- $ret .= ">";
- $ret .= !empty( $pOptions['first_option'] ) ? $pOptions['first_option'] : '';
+ }
+ $ret .= ">";
+ $ret .= !empty( $pOptions['first_option'] ) ? $pOptions['first_option'] : '';
+ if( $hash = FisheyeGallery::getTree( $pListHash ) ) {
$ret .= FisheyeGallery::generateMenuOptions( $hash, $pOptions, $pLocate );
- $ret .= "</select>";
}
+ $ret .= "</select>";
return $ret;
}