2011-06-24 18:29:55 +02:00
|
|
|
<?php
|
2012-08-08 21:29:09 +02:00
|
|
|
$items = $this->contents;
|
2017-11-22 03:22:06 +01:00
|
|
|
$isSmartBlock = ($this->obj instanceof Application_Model_Block);
|
2015-08-28 19:22:08 +02:00
|
|
|
$isPlaylist = ($this->obj instanceof Application_Model_Playlist);
|
2018-12-12 23:31:27 +01:00
|
|
|
if ($isSmartBlock && $this->showPoolCount) { ?>
|
2018-12-01 15:21:52 +01:00
|
|
|
<div class='sp_text_font sp_text_font_bold'>
|
2018-12-01 15:42:02 +01:00
|
|
|
<span id='sp_pool_count' class='sp_text_font sp_text_font_bold'>
|
2018-12-01 15:21:52 +01:00
|
|
|
<?php
|
|
|
|
echo $this->poolCount;
|
2018-12-10 21:24:18 +01:00
|
|
|
echo ngettext(" track matches your search criteria.", " tracks match your search criteria.", $this->poolCount);
|
2018-12-01 15:42:02 +01:00
|
|
|
?>
|
2018-12-03 22:48:16 +01:00
|
|
|
</span>
|
|
|
|
<?php if ($this->poolCount > 0) { ?>
|
|
|
|
<span class='checked-icon sp-checked-icon' id='sp_pool_count_icon'></span>
|
|
|
|
<?php }
|
|
|
|
else { ?>
|
2018-12-01 15:21:52 +01:00
|
|
|
<span class='sp-warning-icon' id='sp_pool_count_icon'></span>
|
2018-12-03 22:48:16 +01:00
|
|
|
<?php } ?>
|
2018-12-01 15:21:52 +01:00
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
2017-11-22 03:22:06 +01:00
|
|
|
if (count($items) && ($isSmartBlock || $isPlaylist)) : ?>
|
2011-06-24 23:00:59 +02:00
|
|
|
<?php $i = 0; ?>
|
2018-01-19 19:59:25 +01:00
|
|
|
<?php if ($isSmartBlock && !($this->obj->isStatic())) {
|
2017-11-22 03:22:06 +01:00
|
|
|
echo _("</br>This is only a preview of possible content generated by the smart block based upon the above criteria.");}
|
|
|
|
?>
|
2012-07-30 23:18:33 +02:00
|
|
|
<?php foreach($items as $item) :
|
|
|
|
$staticBlock = null;
|
2013-05-13 18:23:05 +02:00
|
|
|
$nextFileUrl = null;
|
2012-07-30 23:18:33 +02:00
|
|
|
if ($item['type'] == 2) {
|
|
|
|
$bl= new Application_Model_Block($item['item_id']);
|
|
|
|
$staticBlock = $bl->isStatic();
|
2013-08-13 22:36:04 +02:00
|
|
|
$fileUrl = null;
|
2012-07-30 23:18:33 +02:00
|
|
|
}
|
2013-08-28 01:30:17 +02:00
|
|
|
else if ($item['type'] == 1) {
|
|
|
|
$fileUrl = null;
|
|
|
|
}
|
2015-08-07 22:49:05 +02:00
|
|
|
else if ($item['type'] == 0) {
|
|
|
|
$audiofile = Application_Model_StoredFile::RecallById($item['item_id']);
|
|
|
|
$fileUrl = $audiofile->getFileUrl();
|
2013-04-16 20:37:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (($i < count($items) -1) && ($items[$i+1]['type'] == 0)) {
|
2015-08-07 22:49:05 +02:00
|
|
|
$nextAudiofile = Application_Model_StoredFile::RecallById($items[$i+1]['item_id']);
|
2013-08-28 01:30:17 +02:00
|
|
|
$nextFileUrl = $nextAudiofile->getFileUrl();
|
2013-04-16 20:37:08 +02:00
|
|
|
}
|
2012-07-30 23:18:33 +02:00
|
|
|
?>
|
2012-07-22 22:12:34 +02:00
|
|
|
<li class="ui-state-default" id="spl_<?php echo $item["id"] ?>" unqid="<?php echo $item["id"]; ?>">
|
2012-08-08 18:23:07 +02:00
|
|
|
<div class="list-item-container">
|
2013-08-28 01:30:17 +02:00
|
|
|
|
2012-07-30 23:18:33 +02:00
|
|
|
<?php if ($item['type'] == 0 && $item['exists']):?>
|
2012-09-12 21:43:50 +02:00
|
|
|
<div class="big_play" audioFile="<?php echo $item["id"]; ?>" data-mime-type="<?php echo $item["mime"]; ?>">
|
2012-03-06 00:59:31 +01:00
|
|
|
<span class="ui-icon ui-icon-play"></span>
|
|
|
|
</div>
|
2012-08-10 18:52:36 +02:00
|
|
|
<?php elseif ($item['type'] == 1 && $item['exists']): ?>
|
2012-09-14 22:38:26 +02:00
|
|
|
<div class="big_play" data-mime-type="<?php echo $item["mime"]; ?>">
|
2012-08-10 18:52:36 +02:00
|
|
|
<span class="ui-icon ui-icon-play"></span>
|
|
|
|
</div>
|
2012-07-30 23:18:33 +02:00
|
|
|
<?php elseif ($item['type'] == 2 && $item['exists']): ?>
|
2012-10-16 20:09:34 +02:00
|
|
|
<div class="big_play" blockId="<?php echo $item["item_id"]; ?>" blocktype="<?php echo $staticBlock?"static":"dynamic"?>">
|
2012-09-14 22:38:26 +02:00
|
|
|
<span class="ui-icon ui-icon-play"></span>
|
2012-07-30 23:18:33 +02:00
|
|
|
</div>
|
2012-08-23 17:32:37 +02:00
|
|
|
<?php else:?>
|
|
|
|
<div class="big_play ui-state-hover">
|
|
|
|
<span class="ui-icon ui-icon-alert"></span>
|
|
|
|
</div>
|
2012-07-30 23:18:33 +02:00
|
|
|
<?php endif; ?>
|
2011-02-08 00:44:42 +01:00
|
|
|
<div class="text-row top">
|
2012-07-21 04:49:34 +02:00
|
|
|
<span class="spl_playlength"><?php echo $item["length"] ?></span>
|
2012-07-30 23:18:33 +02:00
|
|
|
<?php if ($item['type'] == 0) {?>
|
2015-08-28 20:27:18 +02:00
|
|
|
<!-- <span class="spl_cue ui-state-default"></span> -->
|
2012-07-30 23:18:33 +02:00
|
|
|
<?php } else if ($item['type'] == 2) {
|
|
|
|
if ($staticBlock) {?>
|
2012-09-17 21:41:22 +02:00
|
|
|
<span class="spl_block_expand close" blockId="<?php echo $item["item_id"]; ?>" id="expand_block_<?php echo $item["id"]?>">
|
|
|
|
<span class="ui-icon ui-icon-triangle-2-n-s"></span>
|
2012-11-15 16:59:06 +01:00
|
|
|
<?php echo _("Expand Static Block")?>
|
2012-09-17 21:41:22 +02:00
|
|
|
</span>
|
2012-07-30 23:18:33 +02:00
|
|
|
<?php } else { ?>
|
2012-09-17 21:41:22 +02:00
|
|
|
<span class="spl_block_expand close" blockId="<?php echo $item["item_id"]; ?>" id="expand_block_<?php echo $item["id"]?>">
|
|
|
|
<span class="ui-icon ui-icon-triangle-2-n-s"></span>
|
2012-11-15 16:59:06 +01:00
|
|
|
<?php echo _("Expand Dynamic Block")?>
|
2012-09-17 21:41:22 +02:00
|
|
|
</span>
|
2012-07-30 23:18:33 +02:00
|
|
|
<?php }
|
|
|
|
} ?>
|
2012-07-20 23:38:11 +02:00
|
|
|
<span class="spl_title"><?php echo $item['track_title'] ?></span>
|
2011-02-08 00:44:42 +01:00
|
|
|
</div>
|
|
|
|
<div class="text-row">
|
2012-08-08 18:23:07 +02:00
|
|
|
<span class="spl_artist"><?php echo $item['creator'] ?></span>
|
2011-05-31 22:49:01 +02:00
|
|
|
<span class="spl_offset"><?php echo $item["offset"]?></span>
|
2011-02-08 00:44:42 +01:00
|
|
|
</div>
|
2011-11-29 15:30:05 +01:00
|
|
|
<?php //create the crossfade icon.
|
2012-08-08 18:23:07 +02:00
|
|
|
if (($i < count($items) -1) && !($items[$i]['type'] == 2 && $items[$i+1]['type'])):
|
2011-11-29 15:30:05 +01:00
|
|
|
?>
|
2015-08-28 20:27:18 +02:00
|
|
|
<!-- <div id="fade_<?php echo $i ?>" class="spl_fade_control ui-state-default"></div> -->
|
2011-02-08 00:44:42 +01:00
|
|
|
<?php endif; ?>
|
2012-02-04 15:52:31 +01:00
|
|
|
<span id="remove_<?php echo $item["id"] ?>" class="ui-icon ui-icon-closethick"></span>
|
2011-02-08 00:44:42 +01:00
|
|
|
</div>
|
2012-07-30 23:18:33 +02:00
|
|
|
<?php if ($item['type'] == 0) {?>
|
2011-11-29 15:30:05 +01:00
|
|
|
<div id="cues_<?php echo $i ?>" class="cue-edit clearfix" style="display: none">
|
|
|
|
<?php echo $this->partial('playlist/set-cue.phtml', array(
|
2012-02-04 19:27:26 +01:00
|
|
|
'id' => $item["id"],
|
2011-11-29 15:30:05 +01:00
|
|
|
'cueIn' => $item['cuein'],
|
|
|
|
'cueOut' => $item['cueout'],
|
2015-08-07 22:49:05 +02:00
|
|
|
'cueInSec' => $item['cueInSec'],
|
2013-05-07 18:46:44 +02:00
|
|
|
'cueOutSec' => $item['cueOutSec'],
|
2013-04-16 20:37:08 +02:00
|
|
|
'uri' => $fileUrl,
|
2012-08-21 20:08:30 +02:00
|
|
|
'origLength' => $item['orig_length'])); ?>
|
2011-11-29 15:30:05 +01:00
|
|
|
</div>
|
2012-07-30 23:18:33 +02:00
|
|
|
<?php }?>
|
2011-11-29 15:30:05 +01:00
|
|
|
|
2011-02-08 00:44:42 +01:00
|
|
|
|
2011-11-29 15:30:05 +01:00
|
|
|
<?php //create a fade editor box
|
|
|
|
//(fadeout of current position + fade in of next position)
|
2012-08-08 18:23:07 +02:00
|
|
|
if(($i < count($items) -1) && !($items[$i]['type'] == 2 && $items[$i+1]['type'])):
|
2011-11-29 15:30:05 +01:00
|
|
|
?>
|
|
|
|
<div id="crossfade_<?php echo $i ?>-<?php echo $i+1 ?>" class="crossfade clearfix" style="display: none">
|
2013-08-28 01:30:17 +02:00
|
|
|
<?php
|
|
|
|
|
2013-05-13 18:23:05 +02:00
|
|
|
$vars = array(
|
2012-02-05 23:38:12 +01:00
|
|
|
'item1' => $items[$i]['id'],
|
2013-05-13 18:23:05 +02:00
|
|
|
'fadeOut' => $items[$i]['fadeout'],
|
|
|
|
'fadeIn' => $items[$i+1]['fadein'],
|
2012-07-30 23:18:33 +02:00
|
|
|
'item1Type' => $items[$i]['type'],
|
2015-08-07 22:49:05 +02:00
|
|
|
'cueIn1' => $items[$i]['cueInSec'],
|
2013-04-24 20:15:07 +02:00
|
|
|
'cueOut1' => $items[$i]['cueOutSec'],
|
2013-05-13 18:23:05 +02:00
|
|
|
'item1Url' => $fileUrl
|
|
|
|
);
|
2013-08-28 01:30:17 +02:00
|
|
|
|
2015-08-07 22:49:05 +02:00
|
|
|
$item2 = array(
|
2013-05-13 18:23:05 +02:00
|
|
|
'item2Url' => $nextFileUrl,
|
2015-08-07 22:49:05 +02:00
|
|
|
'item2' => $items[$i+1]['id'],
|
|
|
|
'item2Type' => $items[$i+1]['type'],
|
|
|
|
'offset' => $items[$i]['trackSec'] - $items[$i+1]['trackoffset'],
|
|
|
|
'cueIn2' => $items[$i+1]['cueInSec'],
|
|
|
|
'cueOut2' => $items[$i+1]['cueOutSec']
|
2013-05-13 18:23:05 +02:00
|
|
|
);
|
2013-08-28 01:30:17 +02:00
|
|
|
|
2013-05-13 18:23:05 +02:00
|
|
|
if (isset($nextFileUrl)) {
|
|
|
|
$vars = $vars + $item2;
|
|
|
|
}
|
2013-08-28 01:30:17 +02:00
|
|
|
|
|
|
|
echo $this->partial('playlist/set-fade.phtml', $vars);
|
2017-11-26 20:48:41 +01:00
|
|
|
|
2013-05-13 18:23:05 +02:00
|
|
|
?>
|
2011-11-29 15:30:05 +01:00
|
|
|
</div>
|
2011-02-08 00:44:42 +01:00
|
|
|
<?php endif; ?>
|
2012-07-30 23:18:33 +02:00
|
|
|
<?php if ($item['type'] == 2) {?>
|
2012-09-17 21:57:41 +02:00
|
|
|
<ul style='display:none' id="block_<?php echo $item["id"]?>_info" class="smart-block-info expand-block-separate"></ul>
|
2012-07-30 23:18:33 +02:00
|
|
|
<?php } ?>
|
2011-02-08 00:44:42 +01:00
|
|
|
</li>
|
|
|
|
<?php $i = $i+1; ?>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
2011-01-16 22:00:44 +01:00
|
|
|
<?php else : ?>
|
2015-08-07 22:49:05 +02:00
|
|
|
<div class="spl_empty">
|
2012-10-29 16:57:20 +01:00
|
|
|
<?php
|
2015-08-28 01:00:23 +02:00
|
|
|
if ($this->obj instanceof Application_Model_Block) {
|
|
|
|
if ($this->obj->isStatic()) {
|
|
|
|
echo _("Choose some search criteria above and click Generate to create this playlist.");
|
|
|
|
} else {
|
|
|
|
echo _("A track list will be generated when you schedule this smart block into a show.");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
echo _("Drag tracks here from your library to add them to the playlist");
|
|
|
|
}
|
2012-10-29 16:57:20 +01:00
|
|
|
?>
|
2015-08-07 22:49:05 +02:00
|
|
|
</div>
|
2018-12-03 22:48:16 +01:00
|
|
|
<?php endif; ?>
|