CC-84: Smart Playlists

- add qtip for smart playlists
- modified qtip content for regular playlists that contain smart playlists
This commit is contained in:
denise 2012-08-01 12:04:48 -04:00
parent e1f962baa9
commit c9afac239a
5 changed files with 159 additions and 14 deletions

View file

@ -21,21 +21,93 @@
<?php endif; ?>
<?php if($this->type == "playlist") : ?>
<?php if($this->type == "playlist" || $this->type == "block") : ?>
<div><span>Name:</span><span><?php echo ($this->md["dc:title"]);?></span></div>
<div><span>Creator:</span><span><?php echo ($this->md["dc:creator"]);?></span></div>
<?php if ($this->type == "block" && $this->blType == "Dynamic") { ?>
<?php if ($this->contents["limit"]["modifier"] == "items") { ?>
<?php $len = $this->contents["limit"]["value"]." tracks"; ?>
<?php } elseif ($this->contents["limit"]["modifier"] == "minutes") { ?>
<?php
$mins = $this->contents["limit"]["value"];
if ($mins > 59) {
$hours = intval($mins / 60);
$minutes = $mins % 60;
$len = $hours.":".str_pad($minutes, 2, "0", STR_PAD_LEFT).":00.0";
} else {
$len = $this->contents["limit"]["value"].":00.0";
}
?>
<?php } else {?>
<?php $len = $this->contents["limit"]["value"].":00:00.0"; ?>
<?php } ?>
<div><span>Length:</span><span><?php echo $len;?></span></div>
<?php } else { ?>
<div><span>Length:</span><span><?php echo ($this->md["dcterms:extent"]);?></span></div>
<?php } ?>
<div><span>Description:</span><span><?php echo ($this->md["dc:description"]);?></span></div>
<div><span>Contents: </span>
<?php foreach($this->contents as $row) : ?>
<div>
<span><?php echo $row["track_title"] ?></span>
<span><?php echo $row["creator"] ?></span>
<span><?php echo $row["album_title"] ?></span>
<span><?php echo $row["length"] ?></span>
</div>
<?php endforeach; ?>
</div>
<?php if ($this->type == "playlist" || ($this->type == "block" && $this->blType == "Static")) {?>
<?php if ($this->type == "playlist") { ?>
<div><span>Playlist Contents: </span></div>
<?php } else { ?>
<div><span>Static Playlist Contents: </span></div>
<?php } ?>
<table class='library-get-file-md'>
<?php foreach($this->contents as $row) : ?>
<?php
$maxStrLen = 35;
if (strlen($row["track_title"]) > $maxStrLen) {
$row["track_title"] = substr($row["track_title"], 0, 34)."...";
}
?>
<?php if ($row["type"] == 2) {
$bl = new Application_Model_Block($row["item_id"]);
$isStatic = $bl->isStatic(); ?>
<tr class='file-md-qtip-playlist <?php if ($isStatic) echo 'static'; else echo 'dynamic';?>'>
<td colspan="3"><?php if ($isStatic) echo 'Static Playlist'; else echo 'Dynamic Playlist';?></td>
</tr>
<tr class='file-md-qtip-playlist <?php if ($isStatic) echo 'static'; else echo 'dynamic';?>'>
<td class='file-md-qtip-row-width-title'><?php echo $row["track_title"] ?></td>
<td class='file-md-qtip-row-width-artist'><?php echo $row["creator"] ?></td>
<?php if (!$isStatic) { ?>
<?php $criteria = $bl->getCriteria();?>
<?php $len = $bl->getLength();?>
<td class='file-md-qtip-row-width-small'><?php echo $len ?></td>
<?php } else { ?>
<td class='file-md-qtip-row-width-small'><?php echo $row["length"] ?></td>
<?php } ?>
</tr>
<?php } else { ?>
<tr>
<td class='file-md-qtip-row-width-title'><?php echo $row["track_title"] ?></td>
<td class='file-md-qtip-row-width-artist'><?php echo $row["creator"] ?></td>
<td class='file-md-qtip-row-width-small'><?php echo $row["length"] ?></td>
</tr>
<?php } ?>
<?php endforeach; ?>
</table>
<?php } elseif ($this->blType == "Dynamic") { ?>
<div><span>Dynamic Playlist Criteria: </span></div>
<table class='library-get-file-md table-small'>
<?php foreach ($this->contents["crit"] as $criterias) : ?>
<?php foreach ($criterias as $crit ) : ?>
<tr>
<td class='file-md-qtip-criteria-width-small'><?php echo $crit["display_name"] ?></td>
<td class='file-md-qtip-criteria-width-small'><?php echo $crit["modifier"] ?></td>
<td class='file-md-qtip-criteria-width'><?php echo $crit["value"] ?>
<?php if (isset($crit["extra"])) { ?>
to <?php echo $crit["extra"] ?></td>
<?php } ?>
</tr>
<?php endforeach; ?>
<tr>
<td>Limit to </td>
<td><?php echo $this->contents["limit"]["value"] ?> <?php echo $this->contents["limit"]["modifier"] ?></td>
</tr>
<?php endforeach; ?>
</table>
<?php } ?>
<?php endif; ?>
<?php if ($this->type == "stream") : ?>