CC-3819 : Add View on Soundcloud context menu option on calendar page
This commit is contained in:
parent
f8900d4b05
commit
803c44611a
4 changed files with 36 additions and 13 deletions
|
@ -82,6 +82,11 @@ class LibraryController extends Zend_Controller_Action
|
|||
|
||||
$scid = $file->getSoundCloudId();
|
||||
|
||||
if ($scid > 0){
|
||||
$url = $file->getSoundCloudLinkToFile();
|
||||
$menu["soundcloud"]["items"]["view"] = array("name" => "View on Soundcloud", "icon" => "soundcloud", "url" => $url);
|
||||
}
|
||||
|
||||
if (!is_null($scid)){
|
||||
$text = "Re-upload to SoundCloud";
|
||||
}
|
||||
|
@ -90,11 +95,6 @@ class LibraryController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
$menu["soundcloud"]["items"]["upload"] = array("name" => $text, "icon" => "soundcloud", "url" => "/library/upload-file-soundcloud/id/{$id}");
|
||||
|
||||
if ($scid > 0){
|
||||
$url = $file->getSoundCloudLinkToFile();
|
||||
$menu["soundcloud"]["items"]["view"] = array("name" => "View on Soundcloud", "icon" => "soundcloud", "url" => $url);
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->items = $menu;
|
||||
|
|
|
@ -258,8 +258,17 @@ class ScheduleController extends Zend_Controller_Action
|
|||
&& $instance->isRecorded()
|
||||
&& Application_Model_Preference::GetUploadToSoundcloudOption()) {
|
||||
|
||||
$text = is_null($instance->getSoundCloudFileId()) ? 'Upload to SoundCloud' : 'Re-upload to SoundCloud';
|
||||
$menu["soundcloud"] = array("name"=> $text, "icon" => "soundcloud");
|
||||
$file = $instance->getRecordedFile();
|
||||
$fileId = $file->getId();
|
||||
$scid = $instance->getSoundCloudFileId();
|
||||
|
||||
if ($scid > 0){
|
||||
$url = $file->getSoundCloudLinkToFile();
|
||||
$menu["soundcloud_view"] = array("name" => "View on Soundcloud", "icon" => "soundcloud", "url" => $url);
|
||||
}
|
||||
|
||||
$text = is_null($scid) ? 'Upload to SoundCloud' : 'Re-upload to SoundCloud';
|
||||
$menu["soundcloud_upload"] = array("name"=> $text, "icon" => "soundcloud");
|
||||
}
|
||||
|
||||
if ($showStartLocalDT->getTimestamp() <= $epochNow &&
|
||||
|
|
|
@ -35,17 +35,22 @@
|
|||
font-size: 11px;
|
||||
}
|
||||
|
||||
.context-menu-item.icon {
|
||||
padding: 2px 2px 2px 28px;
|
||||
.context-menu-item {
|
||||
padding: 2px 5px;
|
||||
background-color: #f0f0f0;
|
||||
position: relative;
|
||||
min-height: 18px;
|
||||
-moz-user-select: -moz-none;
|
||||
}
|
||||
|
||||
.context-menu-item.icon {
|
||||
padding: 2px 2px 2px 28px;
|
||||
}
|
||||
|
||||
.context-menu-separator {
|
||||
padding-bottom:0;
|
||||
border-bottom: 1px solid #DDD;
|
||||
min-height: 2px;
|
||||
}
|
||||
|
||||
.context-menu-item > label {
|
||||
|
|
|
@ -336,13 +336,22 @@ $(document).ready(function() {
|
|||
oItems.content.callback = callback;
|
||||
}
|
||||
|
||||
//define a soundcloud callback.
|
||||
if (oItems.soundcloud !== undefined) {
|
||||
//define a soundcloud upload callback.
|
||||
if (oItems.soundcloud_upload !== undefined) {
|
||||
|
||||
callback = function() {
|
||||
uploadToSoundCloud(data.id);
|
||||
};
|
||||
oItems.soundcloud.callback = callback;
|
||||
oItems.soundcloud_upload.callback = callback;
|
||||
}
|
||||
|
||||
//define a view on soundcloud callback.
|
||||
if (oItems.soundcloud_view !== undefined) {
|
||||
|
||||
callback = function() {
|
||||
window.open(oItems.soundcloud_view.url);
|
||||
};
|
||||
oItems.soundcloud_view.callback = callback;
|
||||
}
|
||||
|
||||
//define a cancel recorded show callback.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue