Merge branch 'saas-dev' of github.com:sourcefabric/Airtime into saas-dev
This commit is contained in:
commit
6251fd62d5
|
@ -18,7 +18,7 @@ class Application_Common_Timezone
|
|||
'UTC' => DateTimeZone::UTC
|
||||
);
|
||||
|
||||
$tzlist = array();
|
||||
$tzlist = array(NULL => "Use station default");
|
||||
|
||||
foreach ($regions as $name => $mask) {
|
||||
$ids = DateTimeZone::listIdentifiers($mask);
|
||||
|
|
|
@ -24,95 +24,6 @@ class LibraryController extends Zend_Controller_Action
|
|||
public function indexAction()
|
||||
{
|
||||
$this->_redirect("showbuilder");
|
||||
// $CC_CONFIG = Config::getConfig();
|
||||
//
|
||||
// $request = $this->getRequest();
|
||||
// $baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
//
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.fnSetFilteringDelay.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.colReorder.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.FixedColumns.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.columnFilter.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
//
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_playlistbuilder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
//
|
||||
// $this->view->headLink()->appendStylesheet($baseUrl.'css/media_library.css?'.$CC_CONFIG['airtime_version']);
|
||||
// $this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
|
||||
// $this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']);
|
||||
// $this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/dataTables.colReorder.min.css?'.$CC_CONFIG['airtime_version']);
|
||||
// $this->view->headLink()->appendStylesheet($baseUrl.'css/waveform.css?'.$CC_CONFIG['airtime_version']);
|
||||
//
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/airtime/library/spl.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/airtime/playlist/smart_blockbuilder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
//
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/observer/observer.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/config.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/curves.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/fades.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/local_storage.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/controls.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/playout.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/track_render.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/track.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/time_scale.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
// $this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/playlist.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
//
|
||||
// //arbitrary attributes need to be allowed to set an id for the templates.
|
||||
// $this->view->headScript()->setAllowArbitraryAttributes(true);
|
||||
// //$this->view->headScript()->appendScript(file_get_contents(APPLICATION_PATH.'/../public/js/waveformplaylist/templates/bottombar.tpl'),
|
||||
// // 'text/template', array('id' => 'tpl_playlist_cues', 'noescape' => true));
|
||||
//
|
||||
// $this->view->headLink()->appendStylesheet($baseUrl.'css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
|
||||
//
|
||||
// try {
|
||||
//
|
||||
// $obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME);
|
||||
// if (isset($obj_sess->id)) {
|
||||
// $objInfo = Application_Model_Library::getObjInfo($obj_sess->type);
|
||||
// $obj = new $objInfo['className']($obj_sess->id);
|
||||
// $userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
// $user = new Application_Model_User($userInfo->id);
|
||||
// $isAdminOrPM = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
//
|
||||
// if ($isAdminOrPM || $obj->getCreatorId() == $userInfo->id) {
|
||||
// $this->view->obj = $obj;
|
||||
// if ($obj_sess->type == "block") {
|
||||
// $form = new Application_Form_SmartBlockCriteria();
|
||||
// $form->startForm($obj_sess->id);
|
||||
// $this->view->form = $form;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// $formatter = new LengthFormatter($obj->getLength());
|
||||
// $this->view->length = $formatter->format();
|
||||
// $this->view->type = $obj_sess->type;
|
||||
// }
|
||||
//
|
||||
// //get user settings and determine if we need to hide
|
||||
// // or show the playlist editor
|
||||
// $showPlaylist = false;
|
||||
// $data = Application_Model_Preference::getLibraryScreenSettings();
|
||||
// if (!is_null($data)) {
|
||||
// if ($data["playlist"] == "true") {
|
||||
// $showPlaylist = true;
|
||||
// }
|
||||
// }
|
||||
// $this->view->showPlaylist = $showPlaylist;
|
||||
// } catch (PlaylistNotFoundException $e) {
|
||||
// $this->playlistNotFound($obj_sess->type);
|
||||
// } catch (Exception $e) {
|
||||
// $this->playlistNotFound($obj_sess->type);
|
||||
// Logging::info($e->getMessage());
|
||||
// //$this->playlistUnknownError($e);
|
||||
// }
|
||||
}
|
||||
|
||||
protected function playlistNotFound($p_type)
|
||||
|
|
|
@ -51,8 +51,14 @@ class LocaleController extends Zend_Controller_Action
|
|||
//library/events/library_showbuilder.js
|
||||
//already in library/events/library_playlistbuilder.js
|
||||
"Please select a cursor position on timeline." => _("Please select a cursor position on timeline."),
|
||||
"You haven't added any " => _("You haven't added any "),
|
||||
"Learn about " => _("Learn about "),
|
||||
"You haven't added any tracks" => _("You haven't added any tracks"),
|
||||
"You haven't added any playlists" => _("You haven't added any playlists"),
|
||||
"You haven't added any smart blocks" => _("You haven't added any smart blocks"),
|
||||
"You haven't added any webstreams" => _("You haven't added any webstreams"),
|
||||
"Learn about tracks" => _("Learn about tracks"),
|
||||
"Learn about playlists" => _("Learn about playlists"),
|
||||
"Learn about smart blocks" => _("Learn about smart blocks"),
|
||||
"Learn about webstreams" => _("Learn about webstreams"),
|
||||
"Click 'New' to create one." => _("Click 'New' to create one."),
|
||||
//"Adding 1 Item" => _("Adding 1 Item"),
|
||||
//"Adding %s Items" => _("Adding %s Items"),
|
||||
|
|
|
@ -204,7 +204,11 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
|||
$resourceName,
|
||||
$request->getActionName())) {
|
||||
/** Redirect to access denied page */
|
||||
$this->denyAccess();
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(403)
|
||||
->appendBody("You don't have permission to access this resource.")
|
||||
->sendResponse();
|
||||
// $this->denyAccess(); /* This results in a 404! */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,11 +121,14 @@ class Application_Form_EditUser extends Zend_Form
|
|||
$locale->setValue(Application_Model_Preference::GetUserLocale($currentUserId));
|
||||
$locale->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($locale);
|
||||
|
||||
|
||||
$stationTz = Application_Model_Preference::GetTimezone($currentUserId);
|
||||
$userTz = Application_Model_Preference::GetUserTimezone($currentUserId);
|
||||
|
||||
$timezone = new Zend_Form_Element_Select("cu_timezone");
|
||||
$timezone->setLabel(_("Interface Timezone:"));
|
||||
$timezone->setMultiOptions(Application_Common_Timezone::getTimezones());
|
||||
$timezone->setValue(Application_Model_Preference::GetUserTimezone($currentUserId));
|
||||
$timezone->setValue($userTz == $stationTz ? null : $userTz);
|
||||
$timezone->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($timezone);
|
||||
|
||||
|
|
|
@ -37,19 +37,17 @@ class Application_Form_Login extends Zend_Form
|
|||
));
|
||||
|
||||
// Add username element
|
||||
$this->addElement('text', 'username', array(
|
||||
'label' => _('Username:'),
|
||||
'class' => 'input_text',
|
||||
'required' => true,
|
||||
'value' => (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1)?'admin':'',
|
||||
'filters' => array('StringTrim'),
|
||||
'validators' => array(
|
||||
'NotEmpty',
|
||||
),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
$username = new Zend_Form_Element_Text("username");
|
||||
$username->setLabel(_('Username:'))
|
||||
->setAttribs(array(
|
||||
'autofocus' => 'true',
|
||||
'class' => 'input_text',
|
||||
'required' => 'true'))
|
||||
->setValue((isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1)?'admin':'')
|
||||
->addFilter('StringTrim')
|
||||
->setDecorators(array('ViewHelper'))
|
||||
->setValidators(array('NotEmpty'));
|
||||
$this->addElement($username);
|
||||
|
||||
// Add password element
|
||||
$this->addElement('password', 'password', array(
|
||||
|
|
|
@ -480,10 +480,6 @@ class Application_Model_Preference
|
|||
|
||||
public static function SetUserTimezone($timezone = null)
|
||||
{
|
||||
// When a new user is created they will get the default timezone
|
||||
// setting which the admin sets on preferences page
|
||||
if (is_null($timezone))
|
||||
$timezone = self::GetDefaultTimezone();
|
||||
self::setValue("user_timezone", $timezone, true);
|
||||
}
|
||||
|
||||
|
@ -523,10 +519,10 @@ class Application_Model_Preference
|
|||
public static function GetUserLocale()
|
||||
{
|
||||
$locale = self::getValue("user_locale", true);
|
||||
if (!$locale) {
|
||||
// empty() checks for null and empty strings - more robust than !val
|
||||
if (empty($locale)) {
|
||||
return self::GetDefaultLocale();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return $locale;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ class Application_Service_CalendarService
|
|||
|
||||
$menu["schedule"] = array(
|
||||
// "name"=> _("Add / Remove Content"),
|
||||
"name" => _("Schedule Show"),
|
||||
"name" => _("Schedule Tracks"),
|
||||
"icon" => "add-remove-content",
|
||||
"url" => $baseUrl."showbuilder/builder-dialog/");
|
||||
}
|
||||
|
|
|
@ -68,10 +68,8 @@
|
|||
</form>
|
||||
</div>
|
||||
<H2><?php echo _("Recent Uploads")?></H2>
|
||||
<div class="dataTables_scrolling">
|
||||
<table id="recent_uploads_table" class="datatable lib-content ui-widget ui-widget-content block-shadow"
|
||||
cellpadding="0" cellspacing="0"></table>
|
||||
</div>
|
||||
</div>
|
||||
<div style="clear: both;"></div>
|
||||
</div>
|
|
@ -353,7 +353,9 @@ INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('zh_CN', '简体中文'
|
|||
-- added in 2.5.2
|
||||
|
||||
INSERT INTO cc_pref (keystr, valstr) VALUES ('timezone', 'UTC');
|
||||
INSERT INTO cc_pref (subjid, keystr, valstr) VALUES (1, 'user_timezone', 'UTC');
|
||||
-- We don't want to set the user timezone by default - it should instead use the station timezone
|
||||
-- until the user changes it manually.
|
||||
-- INSERT INTO cc_pref (subjid, keystr, valstr) VALUES (1, 'user_timezone', 'UTC');
|
||||
|
||||
INSERT INTO cc_pref (keystr, valstr) VALUES ('import_timestamp', '0');
|
||||
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"1": {
|
||||
"media": "tracks",
|
||||
"icon": "icon-music",
|
||||
"subtext": "Click 'Upload' to add some now.",
|
||||
"href": "http://sourcefabric.booktype.pro/airtime-pro-for-broadcasters/add-media/"
|
||||
},
|
||||
"2": {
|
||||
"media": "playlists",
|
||||
"icon": "icon-list",
|
||||
"subtext": "Click 'New' to create one now.",
|
||||
"href": "http://sourcefabric.booktype.pro/airtime-pro-for-broadcasters/library/"
|
||||
},
|
||||
"3": {
|
||||
"media": "smart blocks",
|
||||
"icon": "icon-time",
|
||||
"subtext": "Click 'New' to create one now.",
|
||||
"href": "http://sourcefabric.booktype.pro/airtime-pro-for-broadcasters/library/"
|
||||
|
||||
},
|
||||
"4": {
|
||||
"media": "webstreams",
|
||||
"icon": "icon-random",
|
||||
"subtext": "Click 'New' to create one now.",
|
||||
"href": "http://sourcefabric.booktype.pro/airtime-pro-for-broadcasters/library/"
|
||||
},
|
||||
"unauthorized": "You don't have permission to view the library."
|
||||
}
|
|
@ -1,9 +1,8 @@
|
|||
@CHARSET "UTF-8";
|
||||
|
||||
#recent_uploads > .dataTables_scrolling
|
||||
#recent_uploads .dataTables_scrolling
|
||||
{
|
||||
top: 41px;
|
||||
bottom: 8px;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
#recent_uploads_wrapper
|
||||
|
@ -25,9 +24,10 @@
|
|||
position: absolute;
|
||||
left: 8px;
|
||||
right: 8px;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
bottom: 8px;
|
||||
top: 41px;
|
||||
border: 1px solid #5b5b5b;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
#recent_uploads_table_wrapper > .fg-toolbar
|
||||
|
|
|
@ -610,6 +610,7 @@ div.ColVis_collectionBackground {
|
|||
|
||||
.ColVis.TableTools > button {
|
||||
padding: 3px 9px;
|
||||
margin: -1px -1px 5px 0;
|
||||
}
|
||||
|
||||
.ColVis_title {
|
||||
|
|
|
@ -3322,10 +3322,14 @@ dd .stream-status {
|
|||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.edit-user-global input, .edit-user-global select {
|
||||
.edit-user-global input {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.edit-user-global select {
|
||||
width: 212px;
|
||||
}
|
||||
|
||||
.edit-user-errors {
|
||||
margin-left: 33% !important;
|
||||
width: 208px;
|
||||
|
|
|
@ -79,47 +79,23 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
if (emptyRow.length > 0) {
|
||||
emptyRow.hide();
|
||||
var opts = {},
|
||||
mediaType = parseInt($('.media_type_selector.selected').attr('data-selection-id')),
|
||||
var mediaType = parseInt($('.media_type_selector.selected').attr('data-selection-id')),
|
||||
img = $('#library_empty_image');
|
||||
// TODO: once the new manual pages are added, change links!
|
||||
if (mediaType > 1) {
|
||||
opts.subtext = $.i18n._("Click 'New' to create one now.");
|
||||
opts.href = "http://sourcefabric.booktype.pro/airtime-pro-for-broadcasters/library/";
|
||||
} else {
|
||||
opts.subtext = $.i18n._("Click 'Upload' to add some now.");
|
||||
opts.href = "http://sourcefabric.booktype.pro/airtime-pro-for-broadcasters/add-media/";
|
||||
}
|
||||
|
||||
switch(mediaType) {
|
||||
case 1:
|
||||
opts.media = $.i18n._('tracks');
|
||||
opts.icon = 'icon-music';
|
||||
break;
|
||||
case 2:
|
||||
opts.media = $.i18n._('playlists');
|
||||
opts.icon = 'icon-list';
|
||||
break;
|
||||
case 3:
|
||||
opts.media = $.i18n._('smart blocks');
|
||||
opts.icon = 'icon-time';
|
||||
break;
|
||||
case 4:
|
||||
opts.media = $.i18n._('webstreams');
|
||||
opts.icon = 'icon-random';
|
||||
break;
|
||||
}
|
||||
|
||||
// Remove all classes for when we change between empty media types
|
||||
img.removeClass(function() {
|
||||
return $( this ).attr( "class" );
|
||||
});
|
||||
img.addClass("icon-white " + opts.icon);
|
||||
$('#library_empty_text').html(
|
||||
$.i18n._("You haven't added any ") + opts.media + "."
|
||||
+ "<br/>" + opts.subtext
|
||||
+ "<br/><a href='" + opts.href + "'>" + $.i18n._("Learn about ") + opts.media + "</a>"
|
||||
);
|
||||
// TODO: once the new manual pages are added, change links!
|
||||
$.getJSON( "ajax/library_placeholders.json", function( data ) {
|
||||
var opts = data[mediaType];
|
||||
img.addClass("icon-white " + opts.icon);
|
||||
$('#library_empty_text').html(
|
||||
$.i18n._("You haven't added any " + opts.media + ".")
|
||||
+ "<br/>" + $.i18n._(opts.subtext)
|
||||
+ "<br/><a href='" + opts.href + "'>" + $.i18n._("Learn about " + opts.media) + "</a>"
|
||||
);
|
||||
}) ;
|
||||
|
||||
$('#library_empty').show();
|
||||
} else {
|
||||
$('#library_empty').hide();
|
||||
|
@ -281,118 +257,119 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
mod.createToolbarButtons();
|
||||
mod.moveSearchBarToHeader();
|
||||
|
||||
$toolbar.append($menu);
|
||||
// add to timeline button
|
||||
$toolbar
|
||||
.find('#library-plus')
|
||||
.click(
|
||||
function() {
|
||||
|
||||
if (AIRTIME.button.isDisabled('btn-group #library-plus') === true) {
|
||||
return;
|
||||
}
|
||||
if (localStorage.getItem('user-type') != 'G') {
|
||||
$toolbar.append($menu);
|
||||
// add to timeline button
|
||||
$toolbar
|
||||
.find('#library-plus')
|
||||
.click(
|
||||
function () {
|
||||
|
||||
var selected = AIRTIME.library.getSelectedData(), data, i, length, temp, aMediaIds = [], aSchedIds = [], aData = [];
|
||||
if (AIRTIME.button.isDisabled('btn-group #library-plus') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($("#show_builder_table").is(":visible")) {
|
||||
for (i = 0, length = selected.length; i < length; i++) {
|
||||
data = selected[i];
|
||||
aMediaIds.push( {
|
||||
"id" : data.id,
|
||||
"type" : data.ftype
|
||||
});
|
||||
}
|
||||
var selected = AIRTIME.library.getSelectedData(), data, i, length, temp, aMediaIds = [], aSchedIds = [], aData = [];
|
||||
|
||||
// process selected files/playlists.
|
||||
$("#show_builder_table tr.sb-selected").each(function(i, el) {
|
||||
aData.push($(el).data("aData"));
|
||||
if ($("#show_builder_table").is(":visible")) {
|
||||
for (i = 0, length = selected.length; i < length; i++) {
|
||||
data = selected[i];
|
||||
aMediaIds.push({
|
||||
"id": data.id,
|
||||
"type": data.ftype
|
||||
});
|
||||
}
|
||||
|
||||
// process selected schedule rows to add media
|
||||
// after.
|
||||
for (i = 0, length = aData.length; i < length; i++) {
|
||||
temp = aData[i];
|
||||
aSchedIds.push( {
|
||||
"id" : temp.id,
|
||||
"instance" : temp.instance,
|
||||
"timestamp" : temp.timestamp
|
||||
});
|
||||
}
|
||||
// process selected files/playlists.
|
||||
$("#show_builder_table tr.sb-selected").each(function (i, el) {
|
||||
aData.push($(el).data("aData"));
|
||||
});
|
||||
|
||||
if (aSchedIds.length == 0) {
|
||||
if (!addToCurrentOrNext(aSchedIds)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// process selected schedule rows to add media
|
||||
// after.
|
||||
for (i = 0, length = aData.length; i < length; i++) {
|
||||
temp = aData[i];
|
||||
aSchedIds.push({
|
||||
"id": temp.id,
|
||||
"instance": temp.instance,
|
||||
"timestamp": temp.timestamp
|
||||
});
|
||||
}
|
||||
|
||||
AIRTIME.showbuilder.fnAdd(aMediaIds, aSchedIds);
|
||||
} else {
|
||||
for (i = 0, length = selected.length; i < length; i++) {
|
||||
data = selected[i];
|
||||
aMediaIds.push([data.id, data.ftype]);
|
||||
}
|
||||
|
||||
// check if a playlist/block is open before adding items
|
||||
if ($('.active-tab .obj_type').val() == 'playlist'
|
||||
|| $('.active-tab .obj_type').val() == 'block') {
|
||||
AIRTIME.playlist.fnAddItems(aMediaIds, undefined, 'after');
|
||||
if (aSchedIds.length == 0) {
|
||||
if (!addToCurrentOrNext(aSchedIds)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// delete from library.
|
||||
$toolbar.find('.icon-trash').parent().click(function() {
|
||||
AIRTIME.showbuilder.fnAdd(aMediaIds, aSchedIds);
|
||||
} else {
|
||||
for (i = 0, length = selected.length; i < length; i++) {
|
||||
data = selected[i];
|
||||
aMediaIds.push([data.id, data.ftype]);
|
||||
}
|
||||
|
||||
if (AIRTIME.button.isDisabled('icon-trash') === true) {
|
||||
return;
|
||||
}
|
||||
// check if a playlist/block is open before adding items
|
||||
if ($('.active-tab .obj_type').val() == 'playlist'
|
||||
|| $('.active-tab .obj_type').val() == 'block') {
|
||||
AIRTIME.playlist.fnAddItems(aMediaIds, undefined, 'after');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
AIRTIME.library.fnDeleteSelectedItems();
|
||||
});
|
||||
// delete from library.
|
||||
$toolbar.find('.icon-trash').parent().click(function () {
|
||||
if (AIRTIME.button.isDisabled('icon-trash') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
$toolbar.find('#sb-new').click(function() {
|
||||
if (AIRTIME.button.isDisabled('btn-group #sb-new') === true) {
|
||||
return;
|
||||
}
|
||||
AIRTIME.library.fnDeleteSelectedItems();
|
||||
});
|
||||
|
||||
var selection = $(".media_type_selector.selected").attr("data-selection-id");
|
||||
$toolbar.find('#sb-new').click(function () {
|
||||
if (AIRTIME.button.isDisabled('btn-group #sb-new') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (selection == 2) {
|
||||
AIRTIME.playlist.fnNew();
|
||||
} else if (selection == 3) {
|
||||
AIRTIME.playlist.fnNewBlock();
|
||||
} else if (selection == 4) {
|
||||
AIRTIME.playlist.fnWsNew();
|
||||
}
|
||||
});
|
||||
var selection = $(".media_type_selector.selected").attr("data-selection-id");
|
||||
|
||||
|
||||
$toolbar.find('#sb-edit').click(function() {
|
||||
if (AIRTIME.button.isDisabled('btn-group #sb-edit') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
var selected = $(".lib-selected");
|
||||
|
||||
selected.each(function(i, el) {
|
||||
var data = $(el).data("aData");
|
||||
|
||||
if (data.ftype === "audioclip") {
|
||||
$.get(baseUrl + "library/edit-file-md/id/" + data.id, {format: "json"}, function(json){
|
||||
AIRTIME.playlist.fileMdEdit(json);
|
||||
//buildEditMetadataDialog(json);
|
||||
});
|
||||
} else if (data.ftype === "playlist" || data.ftype === "block") {
|
||||
AIRTIME.playlist.fnEdit(data.id, data.ftype, baseUrl+'playlist/edit');
|
||||
AIRTIME.playlist.validatePlaylistElements();
|
||||
} else if (data.ftype === "stream") {
|
||||
AIRTIME.playlist.fnEdit(data.id, data.ftype, baseUrl + 'webstream/edit');
|
||||
if (selection == 2) {
|
||||
AIRTIME.playlist.fnNew();
|
||||
} else if (selection == 3) {
|
||||
AIRTIME.playlist.fnNewBlock();
|
||||
} else if (selection == 4) {
|
||||
AIRTIME.playlist.fnWsNew();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
mod.createToolbarDropDown();
|
||||
|
||||
$toolbar.find('#sb-edit').click(function () {
|
||||
if (AIRTIME.button.isDisabled('btn-group #sb-edit') === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
var selected = $(".lib-selected");
|
||||
|
||||
selected.each(function (i, el) {
|
||||
var data = $(el).data("aData");
|
||||
|
||||
if (data.ftype === "audioclip") {
|
||||
$.get(baseUrl + "library/edit-file-md/id/" + data.id, {format: "json"}, function (json) {
|
||||
AIRTIME.playlist.fileMdEdit(json);
|
||||
//buildEditMetadataDialog(json);
|
||||
});
|
||||
} else if (data.ftype === "playlist" || data.ftype === "block") {
|
||||
AIRTIME.playlist.fnEdit(data.id, data.ftype, baseUrl + 'playlist/edit');
|
||||
AIRTIME.playlist.validatePlaylistElements();
|
||||
} else if (data.ftype === "stream") {
|
||||
AIRTIME.playlist.fnEdit(data.id, data.ftype, baseUrl + 'webstream/edit');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
mod.createToolbarDropDown();
|
||||
}
|
||||
};
|
||||
|
||||
return AIRTIME;
|
||||
|
|
|
@ -558,6 +558,19 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
}
|
||||
|
||||
function handleAjaxError(r) {
|
||||
// If the request was denied due to permissioning
|
||||
if (r.status === 403) {
|
||||
// Hide the processing div
|
||||
$("#library_display_wrapper").find(".dt-process-rel").hide();
|
||||
$.getJSON( "ajax/library_placeholders.json", function( data ) {
|
||||
$('#library_empty_text').text($.i18n._(data.unauthorized));
|
||||
}) ;
|
||||
|
||||
$('#library_empty').show();
|
||||
}
|
||||
}
|
||||
|
||||
oTable = $libTable.dataTable( {
|
||||
|
||||
// put hidden columns at the top to insure they can never be visible
|
||||
|
@ -689,13 +702,14 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
getUsabilityHint();
|
||||
|
||||
$.ajax( {
|
||||
$.ajax({
|
||||
"dataType": 'json',
|
||||
"type": "POST",
|
||||
"url": sSource,
|
||||
"data": aoData,
|
||||
"success": fnCallback
|
||||
} );
|
||||
"success": fnCallback,
|
||||
"error": handleAjaxError
|
||||
});
|
||||
},
|
||||
"fnRowCallback": AIRTIME.library.fnRowCallback,
|
||||
"fnCreatedRow": function( nRow, aData, iDataIndex ) {
|
||||
|
|
|
@ -185,7 +185,7 @@ $(document).ready(function () {
|
|||
"bFilter": false,
|
||||
"bSort": false,
|
||||
//"sDom": '<"H">frtip<"F"l>',
|
||||
"sDom": 'frt<"F"lip>',
|
||||
"sDom": '<"dataTables_scrolling"frt><"F"lip>',
|
||||
"bPaginate": true,
|
||||
"sPaginationType": "full_numbers",
|
||||
"oLanguage": getDatatablesStrings({
|
||||
|
|
Loading…
Reference in New Issue