Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Martin Konecny 2012-07-26 14:41:22 -04:00
commit ed54e882a3
4 changed files with 15 additions and 8 deletions

View File

@ -57,7 +57,11 @@ class LibraryController extends Zend_Controller_Action
$obj = new Application_Model_Block($this->obj_sess->id); $obj = new Application_Model_Block($this->obj_sess->id);
} }
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
$menu["pl_add"] = array("name"=> "Add to ".ucfirst($this->obj_sess->type), "icon" => "add-playlist", "icon" => "copy"); if ($this->obj_sess->type === "playlist") {
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy");
} else {
$menu["pl_add"] = array("name"=> "Add to Smart Playlist", "icon" => "add-playlist", "icon" => "copy");
}
} }
} }
if ($isAdminOrPM) { if ($isAdminOrPM) {
@ -72,6 +76,13 @@ class LibraryController extends Zend_Controller_Action
$obj = new Application_Model_Playlist($id); $obj = new Application_Model_Playlist($id);
} else { } else {
$obj = new Application_Model_Block($id); $obj = new Application_Model_Block($id);
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
if ($this->obj_sess->type === "playlist") {
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy");
} else {
$menu["pl_add"] = array("name"=> "Add to Smart Playlist", "icon" => "add-playlist", "icon" => "copy");
}
}
} }
if ($this->obj_sess->id !== $id && $screen == "playlist") { if ($this->obj_sess->id !== $id && $screen == "playlist") {

View File

@ -219,7 +219,7 @@ class PlaylistController extends Zend_Controller_Action
$name = 'Untitled Playlist'; $name = 'Untitled Playlist';
if ($type == 'block') { if ($type == 'block') {
$name = 'Untitled Smart Block'; $name = 'Untitled Smart Playlist';
} }
$obj = new $objInfo['className'](); $obj = new $objInfo['className']();

View File

@ -614,11 +614,7 @@ var AIRTIME = (function(AIRTIME) {
} }
else { else {
callback = function() { callback = function() {
if (data.ftype === "playlist") { AIRTIME.playlist.fnEdit(data.id, data.ftype);
AIRTIME.playlist.fnEdit(data.id, 'playlist');
} else {
AIRTIME.playlist.fnEdit(data.id, 'block');
}
}; };
} }
oItems.edit.callback = callback; oItems.edit.callback = callback;

View File

@ -759,7 +759,7 @@ var AIRTIME = (function(AIRTIME){
ignoreRightClick: true, ignoreRightClick: true,
items: { items: {
"sp": {name: "New Playlist", callback: AIRTIME.playlist.fnNew}, "sp": {name: "New Playlist", callback: AIRTIME.playlist.fnNew},
"sb": {name: "New Smart Block", callback: AIRTIME.playlist.fnNewBlock} "sb": {name: "New Smart Playlist", callback: AIRTIME.playlist.fnNewBlock}
} }
}); });
/* /*