getAlbums does not list unpublished albums

How do I get around this so it shows unpublished albums also?

function getAlbumList( $args )
{
if ( is_object( $login_state = authorize( $args ) ) )
return $login_state;
$args = decode64( $args );
debugLog( 'after decode: ' . var_export( $args, true ) );
logger( 'getAlbumList', ( $args[ 'loglevel' ] ) );
$gallery = new Gallery();
$albums = $gallery->getAlbums();
//
// gather all names of the albums, including sub-albums
//
$allalbums = array();
if ( is_array( $albums ) )
foreach ( $albums as $album ) {
$allalbums[] = $album;
foreach ( getSubAlbums( $gallery, $album ) as $sub )
$allalbums[] = $sub;
} //$albums as $album
//
// create album objects and get needed values
//
foreach ( $allalbums as $albumfolder ) {
$album = new Album( $gallery, $albumfolder );
//
// ignore dynamic albums
//
if ( $album->isDynamic() || !$album->getID() )
continue;
if ( $args[ 'simplelist' ] )
$list[] = entitysave( array(
'name' => $album->getTitle(),
'id' => $album->getFolder()
) );
//debuglog ('simplelist');
//debuglog (var_export($list, true));
else
$list[] = entitysave( array(
'id' => $album->getID(),
'name' => $album->getTitle(),
'folder' => getFolderNode( $album->name ),
'url' => WEBPATH . 'index.php?album=' . urlencode( $album->name ) . '/',
'parentFolder' => $album->getParent()->name,
'description' => $album->getDesc(),
'location' => $album->getLocation(),
//'albumpassword' => $album->getPassword(),
'show' => $album->getShow(),
'commentson' => $album->getCommentsAllowed()
) );
} //$allalbums as $albumfolder
return $list;
}

Comments

  • acrylian Administrator, Developer
    The gallery/album class methods `getAlbums` has a parameter for that called "care" if I remember correctly offhand.
  • let me look.
Sign In or Register to comment.