Moved files that meet criteria to top of track listing
This commit is contained in:
parent
a4fdb9bc62
commit
91906e5b5d
|
@ -57,18 +57,20 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createUpdateResponse($obj)
|
private function createUpdateResponse($obj, $formIsValid = false)
|
||||||
{
|
{
|
||||||
$formatter = new LengthFormatter($obj->getLength());
|
$formatter = new LengthFormatter($obj->getLength());
|
||||||
$this->view->length = $formatter->format();
|
$this->view->length = $formatter->format();
|
||||||
|
|
||||||
$this->view->obj = $obj;
|
$this->view->obj = $obj;
|
||||||
$this->view->contents = $obj->getContents();
|
$this->view->contents = $obj->getContents();
|
||||||
|
if ($formIsValid) {
|
||||||
|
$this->view->poolCount = $obj->getListofFilesMeetCriteria()['count'];
|
||||||
|
}
|
||||||
$this->view->html = $this->view->render('playlist/update.phtml');
|
$this->view->html = $this->view->render('playlist/update.phtml');
|
||||||
$this->view->name = $obj->getName();
|
$this->view->name = $obj->getName();
|
||||||
$this->view->description = $obj->getDescription();
|
$this->view->description = $obj->getDescription();
|
||||||
$this->view->modified = $obj->getLastModified("U");
|
$this->view->modified = $obj->getLastModified("U");
|
||||||
|
|
||||||
unset($this->view->obj);
|
unset($this->view->obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +101,6 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$form = new Application_Form_SmartBlockCriteria();
|
$form = new Application_Form_SmartBlockCriteria();
|
||||||
$form->removeDecorator('DtDdWrapper');
|
$form->removeDecorator('DtDdWrapper');
|
||||||
$form->startForm($obj->getId(), $formIsValid);
|
$form->startForm($obj->getId(), $formIsValid);
|
||||||
|
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
$this->view->obj = $obj;
|
$this->view->obj = $obj;
|
||||||
//$this->view->type = "sb";
|
//$this->view->type = "sb";
|
||||||
|
@ -555,8 +556,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
if ($form->isValid($params)) {
|
if ($form->isValid($params)) {
|
||||||
$this->setPlaylistNameDescAction();
|
$this->setPlaylistNameDescAction();
|
||||||
$bl->saveSmartBlockCriteria($params['data']);
|
$bl->saveSmartBlockCriteria($params['data']);
|
||||||
|
$this->createUpdateResponse($bl, true);
|
||||||
$this->createUpdateResponse($bl);
|
|
||||||
$this->view->result = 0;
|
$this->view->result = 0;
|
||||||
/*
|
/*
|
||||||
$result['html'] = $this->createFullResponse($bl, true, true);
|
$result['html'] = $this->createFullResponse($bl, true, true);
|
||||||
|
@ -599,7 +599,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
if ($form->isValid($params)) {
|
if ($form->isValid($params)) {
|
||||||
$result = $bl->generateSmartBlock($params['data']);
|
$result = $bl->generateSmartBlock($params['data']);
|
||||||
$this->view->result = $result['result'];
|
$this->view->result = $result['result'];
|
||||||
$this->createUpdateResponse($bl);
|
$this->createUpdateResponse($bl, true);
|
||||||
#$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true, true)));
|
#$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true, true)));
|
||||||
} else {
|
} else {
|
||||||
$this->view->obj = $bl;
|
$this->view->obj = $bl;
|
||||||
|
@ -624,7 +624,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$result = $bl->shuffleSmartBlock();
|
$result = $bl->shuffleSmartBlock();
|
||||||
|
|
||||||
$this->view->result = $result["result"];
|
$this->view->result = $result["result"];
|
||||||
$this->createUpdateResponse($bl);
|
$this->createUpdateResponse($bl,true);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if ($result['result'] == 0) {
|
if ($result['result'] == 0) {
|
||||||
|
@ -652,7 +652,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$result = $pl->shuffle();
|
$result = $pl->shuffle();
|
||||||
|
|
||||||
$this->view->result = $result["result"];
|
$this->view->result = $result["result"];
|
||||||
$this->createUpdateResponse($pl);
|
$this->createUpdateResponse($pl,true);
|
||||||
/*
|
/*
|
||||||
if ($result['result'] == 0) {
|
if ($result['result'] == 0) {
|
||||||
$this->_helper->json->sendJson(array(
|
$this->_helper->json->sendJson(array(
|
||||||
|
|
|
@ -120,7 +120,9 @@
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<?php if ($this->showPoolCount) { ?>
|
<?php
|
||||||
|
// this will never run due to refactoring of playlist controller. it is replaced with code in update.phtml
|
||||||
|
if ($this->showPoolCount) { ?>
|
||||||
<div class='sp_text_font sp_text_font_bold'>
|
<div class='sp_text_font sp_text_font_bold'>
|
||||||
<span id='sp_pool_count' class='sp_text_font sp_text_font_bold'>
|
<span id='sp_pool_count' class='sp_text_font sp_text_font_bold'>
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -2,6 +2,35 @@
|
||||||
$items = $this->contents;
|
$items = $this->contents;
|
||||||
$isStaticSmartBlock = ($this->obj instanceof Application_Model_Block && $this->obj->isStatic());
|
$isStaticSmartBlock = ($this->obj instanceof Application_Model_Block && $this->obj->isStatic());
|
||||||
$isPlaylist = ($this->obj instanceof Application_Model_Playlist);
|
$isPlaylist = ($this->obj instanceof Application_Model_Playlist);
|
||||||
|
if ($this->poolCount) { ?>
|
||||||
|
<div class='sp_text_font sp_text_font_bold'>
|
||||||
|
<span id='sp_pool_count' class='sp_text_font sp_text_font_bold'>
|
||||||
|
<?php
|
||||||
|
if ($this->poolCount > 1) {
|
||||||
|
echo $this->poolCount;
|
||||||
|
?>
|
||||||
|
<?php echo _("files meet the criteria")?>
|
||||||
|
</span>
|
||||||
|
<span class='checked-icon sp-checked-icon' id='sp_pool_count_icon'></span>
|
||||||
|
<?php
|
||||||
|
} else if ($this->poolCount == 1) {
|
||||||
|
echo $this->poolCount;
|
||||||
|
?>
|
||||||
|
<?php echo _("file meets the criteria")?>
|
||||||
|
</span>
|
||||||
|
<span class='checked-icon sp-checked-icon' id='sp_pool_count_icon'></span>
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>
|
||||||
|
0 <?php echo " "._("files meet the criteria")?>
|
||||||
|
</span>
|
||||||
|
<span class='sp-warning-icon' id='sp_pool_count_icon'></span>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<?php }
|
||||||
|
|
||||||
if (count($items) && ($isStaticSmartBlock || $isPlaylist)) : ?>
|
if (count($items) && ($isStaticSmartBlock || $isPlaylist)) : ?>
|
||||||
<?php $i = 0; ?>
|
<?php $i = 0; ?>
|
||||||
<?php foreach($items as $item) :
|
<?php foreach($items as $item) :
|
||||||
|
@ -120,6 +149,7 @@ if (($i < count($items) -1) && ($items[$i+1]['type'] == 0)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $this->partial('playlist/set-fade.phtml', $vars);
|
echo $this->partial('playlist/set-fade.phtml', $vars);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
Loading…
Reference in New Issue