<?php $albums = $this->getAlbums() ?>
<?php $option = $this->getCurrentOption(); ?>

<?php foreach($albums as $album) : ?>
    <li class="<?php echo $album->getId() ?>_albums albums_of_<?php echo $option->getId(); ?> types blocks">
        <a href="<?php echo $this->getUrl('media/mobile_gallery_music/album', array('album_id' => $album->getId(), 'option_value_id' => $option->getId())); ?>" rel="album_<?php echo $album->getId(); ?>" class="block is_ajax" onclick="page.showSubpage({a: this}); return false;">
            <img src="<?php echo $album->getArtworkUrl() ?>" width="135px" height="135px" />
            <p class="playlist_infos">
                <span class="playlist_name"><?php echo $album->getFormatedName() ?></span>
                <?php $total_songs = $album->getTotalTracks() ?>
                <?php if($album->getType() == 'podcast') : ?>
                    <span class="playlist_songs"><?php echo $this->_('Podcast') ?></span>
                <?php else : ?>
                    <span class="playlist_songs"><?php echo $total_songs ?> <?php echo $total_songs == 1 ? $this->_('title') : $this->_('titles') ?> <?php echo $total_songs > 0 ? ' - '.$album->getTotalDuration()  : '' ?></span>
                <?php endif; ?>
            </p>
        </a>
    </li>
<?php endforeach; ?>


