Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
57d45a4f84
15 changed files with 650 additions and 785 deletions
|
@ -36,7 +36,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'/css/media_library.css');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'/css/contextmenu.css');
|
||||
|
||||
|
||||
|
||||
$this->_helper->layout->setLayout('library');
|
||||
$this->_helper->viewRenderer->setResponseSegment('library');
|
||||
|
@ -90,7 +90,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
$url = $file->getRelativeFileUrl($baseUrl).'/download/true';
|
||||
$menu[] = array('action' => array('type' => 'gourl', 'url' => $url),
|
||||
'title' => 'Download');
|
||||
|
||||
|
||||
if (Application_Model_Preference::GetUploadToSoundcloudOption()) {
|
||||
$text = "Upload to SoundCloud";
|
||||
if(!is_null($file->getSoundCloudId())){
|
||||
|
@ -98,12 +98,12 @@ class LibraryController extends Zend_Controller_Action
|
|||
}
|
||||
$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Library/upload-file-soundcloud/id/#id#',
|
||||
'callback'=>"window['addProgressIcon']('$file_id')"),'title' => $text);
|
||||
|
||||
|
||||
$scid = $file->getSoundCloudId();
|
||||
|
||||
|
||||
if($scid > 0){
|
||||
$link_to_file = $file->getSoundCloudLinkToFile();
|
||||
$menu[] = array('action' => array('type' => 'fn',
|
||||
$menu[] = array('action' => array('type' => 'fn',
|
||||
'callback' => "window['openFileOnSoundCloud']('$link_to_file')"),
|
||||
'title' => 'View on SoundCloud');
|
||||
}
|
||||
|
@ -132,8 +132,6 @@ class LibraryController extends Zend_Controller_Action
|
|||
'title' => 'Close');
|
||||
}
|
||||
|
||||
//$menu[] = array('action' => array('type' => 'ajax', 'url' => '/Playlist/metadata/format/json/id/#id#', 'callback' => 'window["createPlaylistMetaForm"]'), 'title' => 'Edit Metadata');
|
||||
|
||||
$menu[] = array('action' => array('type' => 'fn',
|
||||
'callback' => "window['confirmDeletePlaylist']('$paramsPop')"),
|
||||
'title' => 'Delete');
|
||||
|
@ -210,7 +208,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
{
|
||||
$request = $this->getRequest();
|
||||
$form = new Application_Form_EditAudioMD();
|
||||
|
||||
|
||||
$file_id = $this->_getParam('id', null);
|
||||
$file = Application_Model_StoredFile::Recall($file_id);
|
||||
$form->populate($file->getDbColMetadata());
|
||||
|
@ -222,7 +220,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
$file->setDbColMetadata($formdata);
|
||||
|
||||
$data = $file->getMetadata();
|
||||
|
||||
|
||||
// set MDATA_KEY_FILEPATH
|
||||
$data['MDATA_KEY_FILEPATH'] = $file->getFilePath();
|
||||
Logging::log($data['MDATA_KEY_FILEPATH']);
|
||||
|
@ -254,14 +252,14 @@ class LibraryController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function uploadFileSoundcloudAction(){
|
||||
$id = $this->_getParam('id');
|
||||
$res = exec("/usr/lib/airtime/utils/soundcloud-uploader $id > /dev/null &");
|
||||
// we should die with ui info
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
public function getUploadToSoundcloudStatusAction(){
|
||||
$id = $this->_getParam('id');
|
||||
$type = $this->_getParam('type');
|
||||
|
@ -278,7 +276,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
$this->view->error_msg = $file->getSoundCloudErrorMsg();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Stores the number of entries user chose to show in the Library
|
||||
* to the pref db
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
class PlaylistController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
protected $pl_sess = null;
|
||||
|
||||
public function init()
|
||||
|
@ -15,7 +14,6 @@ class PlaylistController extends Zend_Controller_Action
|
|||
->addActionContext('move-item', 'json')
|
||||
->addActionContext('close', 'json')
|
||||
->addActionContext('new', 'json')
|
||||
->addActionContext('metadata', 'json')
|
||||
->addActionContext('edit', 'json')
|
||||
->addActionContext('delete-active', 'json')
|
||||
->addActionContext('delete', 'json')
|
||||
|
@ -102,58 +100,11 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$pl->setPLMetaData('dc:creator', $userInfo->login);
|
||||
|
||||
$this->changePlaylist($pl->getId());
|
||||
$form = new Application_Form_PlaylistMetadata();
|
||||
$this->view->fieldset = $form;
|
||||
$this->view->form = $this->view->render('playlist/new.phtml');
|
||||
}
|
||||
|
||||
public function metadataAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$form = new Application_Form_PlaylistMetadata();
|
||||
|
||||
$pl_id = $this->_getParam('id', null);
|
||||
//not a new playlist
|
||||
if(!is_null($pl_id)) {
|
||||
$this->changePlaylist($pl_id);
|
||||
|
||||
$pl = $this->getPlaylist();
|
||||
if($pl === false){
|
||||
$this->view->playlist_error = true;
|
||||
return false;
|
||||
}
|
||||
$title = $pl->getPLMetaData("dc:title");
|
||||
$desc = $pl->getPLMetaData("dc:description");
|
||||
|
||||
$data = array( 'title' => $title, 'description' => $desc);
|
||||
$form->populate($data);
|
||||
}
|
||||
|
||||
if ($request->isPost()) {
|
||||
$title = $this->_getParam('title', null);
|
||||
$description = $this->_getParam('description', null);
|
||||
|
||||
$pl = $this->getPlaylist();
|
||||
if($pl === false){
|
||||
$this->view->playlist_error = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if($title)
|
||||
$pl->setName($title);
|
||||
|
||||
if(isset($description)) {
|
||||
$pl->setPLMetaData("dc:description", $description);
|
||||
}
|
||||
|
||||
$this->view->pl = $pl;
|
||||
$this->view->html = $this->view->render('playlist/index.phtml');
|
||||
unset($this->view->pl);
|
||||
}
|
||||
|
||||
$this->view->pl_id = $pl_id;
|
||||
$this->view->fieldset = $form;
|
||||
$this->view->form = $this->view->render('playlist/new.phtml');
|
||||
$this->view->pl = $pl;
|
||||
$this->view->pl_id = $pl->getId();
|
||||
$this->view->html = $this->view->render('playlist/index.phtml');
|
||||
unset($this->view->pl);
|
||||
}
|
||||
|
||||
public function editAction()
|
||||
|
@ -256,42 +207,37 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$this->view->description = $pl->getDescription();
|
||||
|
||||
unset($this->view->pl);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public function setCueAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$pos = $this->_getParam('pos');
|
||||
$pl = $this->getPlaylist();
|
||||
if($pl === false){
|
||||
if ($pl === false){
|
||||
$this->view->playlist_error = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if($request->isPost()) {
|
||||
$cueIn = $this->_getParam('cueIn', null);
|
||||
$cueOut = $this->_getParam('cueOut', null);
|
||||
$cueIn = $this->_getParam('cueIn', null);
|
||||
$cueOut = $this->_getParam('cueOut', null);
|
||||
|
||||
$response = $pl->changeClipLength($pos, $cueIn, $cueOut);
|
||||
$response = $pl->changeClipLength($pos, $cueIn, $cueOut);
|
||||
|
||||
$this->view->response = $response;
|
||||
return;
|
||||
$this->view->response = $response;
|
||||
|
||||
if(!isset($response["error"])) {
|
||||
$this->view->pl = $pl;
|
||||
$this->view->html = $this->view->render('playlist/update.phtml');
|
||||
$this->view->name = $pl->getName();
|
||||
$this->view->length = $pl->getLength();
|
||||
$this->view->description = $pl->getDescription();
|
||||
|
||||
unset($this->view->pl);
|
||||
}
|
||||
|
||||
$cues = $pl->getCueInfo($pos);
|
||||
|
||||
$this->view->pos = $pos;
|
||||
$this->view->cueIn = $cues[0];
|
||||
$this->view->cueOut = $cues[1];
|
||||
$this->view->origLength = $cues[2];
|
||||
$this->view->html = $this->view->render('playlist/set-cue.phtml');
|
||||
}
|
||||
|
||||
public function setFadeAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$pos = $this->_getParam('pos');
|
||||
$pl = $this->getPlaylist();
|
||||
if($pl === false){
|
||||
|
@ -299,24 +245,22 @@ class PlaylistController extends Zend_Controller_Action
|
|||
return false;
|
||||
}
|
||||
|
||||
if($request->isPost()) {
|
||||
$fadeIn = $this->_getParam('fadeIn', null);
|
||||
$fadeOut = $this->_getParam('fadeOut', null);
|
||||
$fadeIn = $this->_getParam('fadeIn', null);
|
||||
$fadeOut = $this->_getParam('fadeOut', null);
|
||||
|
||||
$response = $pl->changeFadeInfo($pos, $fadeIn, $fadeOut);
|
||||
$response = $pl->changeFadeInfo($pos, $fadeIn, $fadeOut);
|
||||
|
||||
$this->view->response = $response;
|
||||
return;
|
||||
}
|
||||
$this->view->response = $response;
|
||||
|
||||
$this->view->pos = intval($pos);
|
||||
if(!isset($response["error"])) {
|
||||
$this->view->pl = $pl;
|
||||
$this->view->html = $this->view->render('playlist/update.phtml');
|
||||
$this->view->name = $pl->getName();
|
||||
$this->view->length = $pl->getLength();
|
||||
$this->view->description = $pl->getDescription();
|
||||
|
||||
$fades = $pl->getFadeInfo($pos+1);
|
||||
$this->view->fadeIn = $fades[0];
|
||||
|
||||
$fades = $pl->getFadeInfo($pos);
|
||||
$this->view->fadeOut = $fades[1];
|
||||
$this->view->html = $this->view->render('playlist/set-fade.phtml');
|
||||
unset($this->view->pl);
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteAction()
|
||||
|
@ -430,7 +374,5 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
$this->view->playlistDescription = $description;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
<?php
|
||||
|
||||
class Application_Form_PlaylistMetadata extends Zend_Form{
|
||||
|
||||
public function init()
|
||||
{
|
||||
// Add username element
|
||||
$this->addElement('text', 'title', array(
|
||||
'label' => 'Title:',
|
||||
'class' => 'input_text',
|
||||
'required' => false,
|
||||
'filters' => array('StringTrim'),
|
||||
'validators' => array(
|
||||
'NotEmpty',
|
||||
)
|
||||
));
|
||||
|
||||
// Add the comment element
|
||||
$this->addElement('textarea', 'description', array(
|
||||
'label' => 'Description:',
|
||||
'class' => 'input_text_area',
|
||||
'required' => false,
|
||||
));
|
||||
|
||||
// Add the comment element
|
||||
$this->addElement('button', 'new_playlist_submit', array(
|
||||
'label' => 'Save',
|
||||
'ignore' => true
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
<br /><br /><center>View script for controller <b>Playlist</b> and script/action name <b>addItem</b></center>
|
|
@ -1 +0,0 @@
|
|||
<br /><br /><center>View script for controller <b>Playlist</b> and script/action name <b>close</b></center>
|
|
@ -1 +0,0 @@
|
|||
<br /><br /><center>View script for controller <b>Playlist</b> and script/action name <b>deleteActive</b></center>
|
|
@ -1 +0,0 @@
|
|||
<br /><br /><center>View script for controller <b>Playlist</b> and script/action name <b>deleteItem</b></center>
|
|
@ -1 +0,0 @@
|
|||
<br /><br /><center>View script for controller <b>Playlist</b> and script/action name <b>delete</b></center>
|
|
@ -1,3 +0,0 @@
|
|||
<form method="post" action="" enctype="application/x-www-form-urlencoded">
|
||||
<?php echo $this->view->fieldset; ?>
|
||||
</form>
|
|
@ -1 +0,0 @@
|
|||
<br /><br /><center>View script for controller <b>Playlist</b> and script/action name <b>moveItem</b></center>
|
|
@ -1,6 +0,0 @@
|
|||
<h3 class="plain">Playlist Metadata</h3>
|
||||
<form method="post" action="" enctype="application/x-www-form-urlencoded">
|
||||
<fieldset>
|
||||
<?php echo $this->fieldset; ?>
|
||||
</fieldset>
|
||||
</form>
|
|
@ -1 +0,0 @@
|
|||
<br /><br /><center>View script for controller <b>Playlist</b> and script/action name <b>setPlaylistFades</b></center>
|
|
@ -4,10 +4,10 @@ if (count($items)) : ?>
|
|||
|
||||
<?php $i = 0; ?>
|
||||
<?php foreach($items as $item) : ?>
|
||||
<li class="ui-state-default" id="spl_<?php echo $i ?>">
|
||||
<li class="ui-state-default" id="spl_<?php echo $i ?>" unqid="<?php echo $item["CcFiles"]["gunid"]."_".$i; ?>">
|
||||
<div class="list-item-container">
|
||||
<a href="javascript:void(0);" class="big_play"
|
||||
onclick="audioPreview('<?php echo $item["CcFiles"]["gunid"].".".pathinfo($item["CcFiles"]["filepath"], PATHINFO_EXTENSION);?>',
|
||||
<a href="javascript:void(0);" class="big_play"
|
||||
onclick="audioPreview('<?php echo $item["CcFiles"]["gunid"].".".pathinfo($item["CcFiles"]["filepath"], PATHINFO_EXTENSION);?>',
|
||||
'spl_<?php echo $i ?>')"><span class="ui-icon ui-icon-play"></span></a>
|
||||
|
||||
<div class="text-row top">
|
||||
|
@ -19,16 +19,33 @@ if (count($items)) : ?>
|
|||
<span class="spl_artist"><?php echo $item["CcFiles"]['artist_name'] ?></span>
|
||||
<span class="spl_offset"><?php echo $item["offset"]?></span>
|
||||
</div>
|
||||
<?php if($i < count($items) -1): ?>
|
||||
<?php //create the crossfade icon.
|
||||
if ($i < count($items) -1):
|
||||
?>
|
||||
<div id="fade_<?php echo $i ?>" class="spl_fade_control ui-state-default"></div>
|
||||
<?php endif; ?>
|
||||
<span class="ui-icon ui-icon-closethick"></span>
|
||||
</div>
|
||||
|
||||
<div id="cues_<?php echo $i ?>" class="cue-edit clearfix" style="display: none"></div>
|
||||
<div id="cues_<?php echo $i ?>" class="cue-edit clearfix" style="display: none">
|
||||
<?php echo $this->partial('playlist/set-cue.phtml', array(
|
||||
'pos' => $i,
|
||||
'cueIn' => $item['cuein'],
|
||||
'cueOut' => $item['cueout'],
|
||||
'origLength' => $item["CcFiles"]['length'])); ?>
|
||||
</div>
|
||||
|
||||
<?php if($i < count($items) -1): ?>
|
||||
<div id="crossfade_<?php echo $i ?>-<?php echo $i+1 ?>" class="crossfade clearfix" style="display: none"></div>
|
||||
|
||||
<?php //create a fade editor box
|
||||
//(fadeout of current position + fade in of next position)
|
||||
if($i < count($items) -1):
|
||||
?>
|
||||
<div id="crossfade_<?php echo $i ?>-<?php echo $i+1 ?>" class="crossfade clearfix" style="display: none">
|
||||
<?php echo $this->partial('playlist/set-fade.phtml', array(
|
||||
'pos' => $i,
|
||||
'fadeOut' => $items[$i]['fadeout'],
|
||||
'fadeIn' => $items[$i+1]['fadein'])); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</li>
|
||||
|
@ -36,5 +53,5 @@ if (count($items)) : ?>
|
|||
<?php endforeach; ?>
|
||||
|
||||
<?php else : ?>
|
||||
<li class="spl_empty">Empty playlist</li>
|
||||
<li class="spl_empty">Empty playlist</li>
|
||||
<?php endif; ?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue