<?php $playlists = $this->getPlaylists() ?>
<?php $option = $this->getCurrentOption(); ?>

<?php foreach($playlists as $playlist) : ?>
    <li class="<?php echo $option->getId() ?>_playlists playlists_of_<?php echo $option->getId(); ?> types blocks">
        <a href="<?php echo $this->getUrl('media/mobile_gallery_music/playlist', array('playlist_id' => $playlist->getId(), 'option_value_id' => $option->getId())); ?>" rel="playlist_<?php echo $playlist->getId(); ?>" class="relative block is_ajax" onclick="page.showSubpage({a: this}); return false;">
            <?php $artwork_urls = $playlist->getMosaicArtworkUrl(); ?>
            <?php if(count($artwork_urls) == 1) : ?>
                <img src="<?php echo $artwork_urls[0] ?>" width="135px" height="135px" />
            <?php else : ?>
                <?php foreach($artwork_urls as $index => $artwork_url) : ?>
                <?php $class = $index < 2 ? 'top' : 'bottom'; ?>
                <?php $class .= $index%2 ? ' right' : ' left'; ?>
                <img src="<?php echo $artwork_url ?>" width="67px" height="67px" class="<?php echo $class; ?>" />
                <?php endforeach; ?>
            <?php endif; ?>
            <p class="playlist_infos">
                <span class="playlist_name"><?php echo $playlist->getName() ?></span>
                <?php $total_songs = $playlist->getTotalTracks() ?>
                <span class="playlist_songs"><?php echo $total_songs ?> <?php echo $total_songs == 1 ? $this->_('title') : $this->_('titles') ?> <?php echo $total_songs > 0 ? ' - '.$playlist->getTotalDuration()  : '' ?></span>
            </p>
        </a>
    </li>
<?php endforeach; ?>