mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 18:29:39 +02:00
https://github.com/WWBN/AVideo/issues/4237
This commit is contained in:
parent
31295962d7
commit
05852f7045
7 changed files with 1627 additions and 177 deletions
|
@ -3,12 +3,13 @@ $defaultSwitch = false;
|
||||||
$youtubeSwitch = Plugin::isEnabledByName('YouTube');
|
$youtubeSwitch = Plugin::isEnabledByName('YouTube');
|
||||||
$gallerySwitch = Plugin::isEnabledByName('Gallery');
|
$gallerySwitch = Plugin::isEnabledByName('Gallery');
|
||||||
$netflixSwitch = Plugin::isEnabledByName('YouPHPFlix2');
|
$netflixSwitch = Plugin::isEnabledByName('YouPHPFlix2');
|
||||||
if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch)) {
|
$channelListSwitch = Plugin::isEnabledByName('FirstPageChannelList');
|
||||||
|
if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch) && empty($channelListSwitch)) {
|
||||||
$defaultSwitch = true;
|
$defaultSwitch = true;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-3">
|
<div class="col-sm-6 col-md-3 col-lg-3">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
Default
|
Default
|
||||||
|
@ -22,7 +23,7 @@ if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch)) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-3">
|
<div class="col-sm-6 col-md-3 col-lg-3">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
Netflix
|
Netflix
|
||||||
|
@ -36,7 +37,22 @@ if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch)) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-3">
|
<div class="clearfix hidden-md hidden-lg"></div>
|
||||||
|
<div class="col-sm-6 col-md-3 col-lg-3">
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
Channel
|
||||||
|
<div class="material-switch pull-right">
|
||||||
|
<input class="" data-toggle="toggle" type="checkbox" id="channelListSwitch" <?php echo $channelListSwitch ? "checked" : ""; ?>>
|
||||||
|
<label for="channelListSwitch" class="label-primary"></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<img src="<?php echo $global['webSiteRootURL']; ?>admin/img/channel.png" class="img-responsive img-radio">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6 col-md-3 col-lg-3">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
Gallery
|
Gallery
|
||||||
|
@ -50,7 +66,8 @@ if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch)) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-3">
|
<div class="clearfix"></div>
|
||||||
|
<div class="col-sm-6 col-md-3 col-lg-3">
|
||||||
<div class="panel panel-danger">
|
<div class="panel panel-danger">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
YouTube <span class="label label-danger" data-toggle="tooltip" title="This layout will be removed in future releases, use the Gallery instead"> Deprecated </span>
|
YouTube <span class="label label-danger" data-toggle="tooltip" title="This layout will be removed in future releases, use the Gallery instead"> Deprecated </span>
|
||||||
|
@ -71,10 +88,12 @@ if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch)) {
|
||||||
var netflixSwitch = $('#netflixSwitch').is(":checked");
|
var netflixSwitch = $('#netflixSwitch').is(":checked");
|
||||||
var gallerySwitch = $('#gallerySwitch').is(":checked");
|
var gallerySwitch = $('#gallerySwitch').is(":checked");
|
||||||
var youtubeSwitch = $('#youtubeSwitch').is(":checked");
|
var youtubeSwitch = $('#youtubeSwitch').is(":checked");
|
||||||
if (!defaultSwitch && !netflixSwitch && !gallerySwitch && !youtubeSwitch) {
|
var channelListSwitch = $('#channelListSwitch').is(":checked");
|
||||||
|
if (!defaultSwitch && !netflixSwitch && !gallerySwitch && !youtubeSwitch && !channelListSwitch) {
|
||||||
$('#netflixSwitch').prop('checked', false);
|
$('#netflixSwitch').prop('checked', false);
|
||||||
$('#gallerySwitch').prop('checked', false);
|
$('#gallerySwitch').prop('checked', false);
|
||||||
$('#youtubeSwitch').prop('checked', false);
|
$('#youtubeSwitch').prop('checked', false);
|
||||||
|
$('#channelListSwitch').prop('checked', false);
|
||||||
$('#defaultSwitch').prop('checked', true);
|
$('#defaultSwitch').prop('checked', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,6 +103,197 @@ if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch)) {
|
||||||
$('#netflixSwitch').prop('checked', false);
|
$('#netflixSwitch').prop('checked', false);
|
||||||
$('#gallerySwitch').prop('checked', false);
|
$('#gallerySwitch').prop('checked', false);
|
||||||
$('#youtubeSwitch').prop('checked', false);
|
$('#youtubeSwitch').prop('checked', false);
|
||||||
|
$('#channelListSwitch').prop('checked', false);
|
||||||
|
}
|
||||||
|
checkSwitch();
|
||||||
|
|
||||||
|
modal.showPleaseWait();
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": false},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": false},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
|
||||||
|
data: {"theme": 'default'},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
modal.hidePleaseWait();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$('#netflixSwitch').change(function (e) {
|
||||||
|
if ($(this).is(":checked")) {
|
||||||
|
$('#gallerySwitch').prop('checked', false);
|
||||||
|
$('#defaultSwitch').prop('checked', false);
|
||||||
|
$('#youtubeSwitch').prop('checked', false);
|
||||||
|
$('#channelListSwitch').prop('checked', false);
|
||||||
|
}
|
||||||
|
checkSwitch();
|
||||||
|
|
||||||
|
modal.showPleaseWait();
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": false},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": true},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": false},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
|
||||||
|
data: {"theme": 'netflix'},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
modal.hidePleaseWait();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$('#gallerySwitch').change(function (e) {
|
||||||
|
if ($(this).is(":checked")) {
|
||||||
|
$('#netflixSwitch').prop('checked', false);
|
||||||
|
$('#defaultSwitch').prop('checked', false);
|
||||||
|
$('#youtubeSwitch').prop('checked', false);
|
||||||
|
$('#channelListSwitch').prop('checked', false);
|
||||||
|
}
|
||||||
|
checkSwitch();
|
||||||
|
|
||||||
|
modal.showPleaseWait();
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": true},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": false},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
|
||||||
|
data: {"theme": 'default'},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
modal.hidePleaseWait();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$('#youtubeSwitch').change(function (e) {
|
||||||
|
if ($(this).is(":checked")) {
|
||||||
|
$('#gallerySwitch').prop('checked', false);
|
||||||
|
$('#defaultSwitch').prop('checked', false);
|
||||||
|
$('#netflixSwitch').prop('checked', false);
|
||||||
|
$('#channelListSwitch').prop('checked', false);
|
||||||
|
}
|
||||||
|
checkSwitch();
|
||||||
|
|
||||||
|
modal.showPleaseWait();
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": false},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": true},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
|
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": false},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
|
||||||
|
data: {"theme": 'default'},
|
||||||
|
type: 'post',
|
||||||
|
success: function (response) {
|
||||||
|
modal.hidePleaseWait();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#channelListSwitch').change(function (e) {
|
||||||
|
if ($(this).is(":checked")) {
|
||||||
|
$('#gallerySwitch').prop('checked', false);
|
||||||
|
$('#defaultSwitch').prop('checked', false);
|
||||||
|
$('#netflixSwitch').prop('checked', false);
|
||||||
|
$('#youtubeSwitch').prop('checked', false);
|
||||||
}
|
}
|
||||||
checkSwitch();
|
checkSwitch();
|
||||||
|
|
||||||
|
@ -104,128 +314,18 @@ if (empty($netflixSwitch) && empty($gallerySwitch) && empty($youtubeSwitch)) {
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
|
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
||||||
data: {"theme": 'default'},
|
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": true},
|
||||||
type: 'post',
|
type: 'post',
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
modal.hidePleaseWait();
|
$.ajax({
|
||||||
}
|
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
|
||||||
});
|
data: {"theme": 'default'},
|
||||||
}
|
type: 'post',
|
||||||
});
|
success: function (response) {
|
||||||
}
|
modal.hidePleaseWait();
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
});
|
|
||||||
$('#netflixSwitch').change(function (e) {
|
|
||||||
if ($(this).is(":checked")) {
|
|
||||||
$('#gallerySwitch').prop('checked', false);
|
|
||||||
$('#defaultSwitch').prop('checked', false);
|
|
||||||
$('#youtubeSwitch').prop('checked', false);
|
|
||||||
}
|
|
||||||
checkSwitch();
|
|
||||||
|
|
||||||
modal.showPleaseWait();
|
|
||||||
$.ajax({
|
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
|
||||||
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": false},
|
|
||||||
type: 'post',
|
|
||||||
success: function (response) {
|
|
||||||
$.ajax({
|
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
|
||||||
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
|
|
||||||
type: 'post',
|
|
||||||
success: function (response) {
|
|
||||||
$.ajax({
|
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
|
||||||
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": true},
|
|
||||||
type: 'post',
|
|
||||||
success: function (response) {
|
|
||||||
$.ajax({
|
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
|
|
||||||
data: {"theme": 'netflix'},
|
|
||||||
type: 'post',
|
|
||||||
success: function (response) {
|
|
||||||
modal.hidePleaseWait();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
$('#gallerySwitch').change(function (e) {
|
|
||||||
if ($(this).is(":checked")) {
|
|
||||||
$('#netflixSwitch').prop('checked', false);
|
|
||||||
$('#defaultSwitch').prop('checked', false);
|
|
||||||
$('#youtubeSwitch').prop('checked', false);
|
|
||||||
}
|
|
||||||
checkSwitch();
|
|
||||||
|
|
||||||
modal.showPleaseWait();
|
|
||||||
$.ajax({
|
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
|
||||||
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": true},
|
|
||||||
type: 'post',
|
|
||||||
success: function (response) {
|
|
||||||
$.ajax({
|
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
|
||||||
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": false},
|
|
||||||
type: 'post',
|
|
||||||
success: function (response) {
|
|
||||||
$.ajax({
|
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
|
||||||
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
|
|
||||||
type: 'post',
|
|
||||||
success: function (response) {
|
|
||||||
$.ajax({
|
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
|
|
||||||
data: {"theme": 'default'},
|
|
||||||
type: 'post',
|
|
||||||
success: function (response) {
|
|
||||||
modal.hidePleaseWait();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
$('#youtubeSwitch').change(function (e) {
|
|
||||||
if ($(this).is(":checked")) {
|
|
||||||
$('#gallerySwitch').prop('checked', false);
|
|
||||||
$('#defaultSwitch').prop('checked', false);
|
|
||||||
$('#netflixSwitch').prop('checked', false);
|
|
||||||
}
|
|
||||||
checkSwitch();
|
|
||||||
|
|
||||||
modal.showPleaseWait();
|
|
||||||
$.ajax({
|
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
|
||||||
data: {"uuid": "a06505bf-3570-4b1f-977a-fd0e5cab205d", "name": "Gallery", "dir": "Gallery", "enable": false},
|
|
||||||
type: 'post',
|
|
||||||
success: function (response) {
|
|
||||||
$.ajax({
|
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
|
||||||
data: {"uuid": "e3a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "YouPHPFlix2", "dir": "YouPHPFlix2", "enable": false},
|
|
||||||
type: 'post',
|
|
||||||
success: function (response) {
|
|
||||||
$.ajax({
|
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
|
|
||||||
data: {"uuid": "youu05bf-3570-4b1f-977a-fd0e5cabtube", "name": "YouTube", "dir": "YouTube", "enable": true},
|
|
||||||
type: 'post',
|
|
||||||
success: function (response) {
|
|
||||||
$.ajax({
|
|
||||||
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
|
|
||||||
data: {"theme": 'default'},
|
|
||||||
type: 'post',
|
|
||||||
success: function (response) {
|
|
||||||
modal.hidePleaseWait();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
BIN
admin/img/channel.png
Normal file
BIN
admin/img/channel.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 540 KiB |
39
plugin/FirstPageChannelList/FirstPageChannelList.php
Normal file
39
plugin/FirstPageChannelList/FirstPageChannelList.php
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once $global['systemRootPath'] . 'plugin/Plugin.abstract.php';
|
||||||
|
require_once $global['systemRootPath'] . 'plugin/AVideoPlugin.php';
|
||||||
|
class FirstPageChannelList extends PluginAbstract {
|
||||||
|
|
||||||
|
public function getTags() {
|
||||||
|
return array(
|
||||||
|
PluginTags::$RECOMMENDED,
|
||||||
|
PluginTags::$FREE,
|
||||||
|
PluginTags::$GALLERY,
|
||||||
|
PluginTags::$LAYOUT,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
public function getDescription() {
|
||||||
|
return "Make the first page a Channel list";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getName() {
|
||||||
|
return "FirstPageChannelList";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getUUID() {
|
||||||
|
return "channel-first-page-977a-fd0e5cab205d";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPluginVersion() {
|
||||||
|
return "1.0";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFirstPage(){
|
||||||
|
global $global;
|
||||||
|
if(!AVideoPlugin::isEnabledByName("YouPHPFlix2") && !AVideoPlugin::isEnabledByName("CombineSites")){
|
||||||
|
return $global['systemRootPath'].'view/channels.php';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
1156
sitemap.xml
1156
sitemap.xml
File diff suppressed because one or more lines are too long
135
view/downloadChecker.php
Normal file
135
view/downloadChecker.php
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
<?php
|
||||||
|
global $global, $config;
|
||||||
|
if (!isset($global['systemRootPath'])) {
|
||||||
|
require_once '../videos/configuration.php';
|
||||||
|
}
|
||||||
|
$metaDescription = "Download checker";
|
||||||
|
|
||||||
|
function getChecked($text, $isChecked, $help = array()) {
|
||||||
|
$helpTXT = "";
|
||||||
|
if (!empty($help)) {
|
||||||
|
$helpTXT = '<ul class="list-group">';
|
||||||
|
foreach ($help as $value) {
|
||||||
|
$helpTXT .= '<li class="list-group-item" style="font-size: 0.7em;">' . $value . '</li>';
|
||||||
|
}
|
||||||
|
$helpTXT .= '</ul>';
|
||||||
|
}
|
||||||
|
if ($isChecked) {
|
||||||
|
return '<li class="list-group-item list-group-item-success"><i class="far fa-check-square"></i> ' . $text . $helpTXT . '</li>';
|
||||||
|
} else {
|
||||||
|
return '<li class="list-group-item list-group-item-danger"><i class="far fa-square"></i> ' . $text . $helpTXT . '</li>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
Site Download Configuration
|
||||||
|
</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<ul class="list-group">
|
||||||
|
<?php
|
||||||
|
$globallyDownload = CustomizeUser::canDownloadVideos();
|
||||||
|
$obj = AVideoPlugin::getObjectDataIfEnabled("CustomizeUser");
|
||||||
|
if (User::isAdmin()) {
|
||||||
|
$help = array();
|
||||||
|
$help[] = "Site Configurations menu / Advanced Configuration / Allow download video";
|
||||||
|
}
|
||||||
|
if (!$globallyDownload) {
|
||||||
|
if (empty($config->getAllow_download())) {
|
||||||
|
echo getChecked(__("Your Site Configurations is set to NOT Allow Download"), false, $help);
|
||||||
|
} else {
|
||||||
|
echo getChecked(__("Your Site Configurations is set to Allow Download"), true, $help);
|
||||||
|
}
|
||||||
|
if (User::isAdmin()) {
|
||||||
|
$help = array();
|
||||||
|
$help[] = "Plugins menu / CustomizeUser / nonAdminCannotDownload";
|
||||||
|
}
|
||||||
|
if ($obj->nonAdminCannotDownload) {
|
||||||
|
echo getChecked(__("Non admin users can download videos"), true, $help);
|
||||||
|
} else {
|
||||||
|
echo getChecked(__("Non admin users can NOT download videos"), false, $help);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
echo getChecked(__("This site configuration allow download"), true, $help);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
if (!empty($_REQUEST['videos_id'])) {
|
||||||
|
$video = new Video('', '', $_REQUEST['videos_id']);
|
||||||
|
$users_id = $video->getUsers_id();
|
||||||
|
$user = new User($users_id);
|
||||||
|
?>
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
User Download Configuration (<?php echo User::getNameIdentificationById($users_id); ?>)
|
||||||
|
</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<ul class="list-group">
|
||||||
|
<?php
|
||||||
|
if (User::isAdmin()) {
|
||||||
|
$help = array();
|
||||||
|
$help[] = "Plugins menu / CustomizeUser / userCanAllowFilesDownload";
|
||||||
|
}else{
|
||||||
|
$help = array();
|
||||||
|
}
|
||||||
|
if (!empty($obj->userCanAllowFilesDownload)) {
|
||||||
|
$help[] = "My Videos menu / Allow Download My Videos";
|
||||||
|
if (!empty($user->getExternalOption('userCanAllowFilesDownload'))) {
|
||||||
|
if (!empty($obj->userCanAllowFilesDownloadSelectPerVideo)) {
|
||||||
|
echo getChecked(__("This user do allow download selected videos"), true, $help);
|
||||||
|
} else {
|
||||||
|
echo getChecked(__("This user do allow download all his files"), true, $help);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo getChecked(__("This user do NOT allow download his files"), false, $help);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo getChecked(__("The download is controlled by the system, there is nothing to check on the user"), true, $help);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
Video Download Configuration (<?php echo $video->getTitle(); ?>)
|
||||||
|
</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<ul class="list-group">
|
||||||
|
<?php
|
||||||
|
$canDownloadVideoFromVideo = CustomizeUser::canDownloadVideosFromVideo($video->getId());
|
||||||
|
if ($canDownloadVideoFromVideo) {
|
||||||
|
echo getChecked(__("This video can be downloaded"), true);
|
||||||
|
} else {
|
||||||
|
$category = new Category($video->getCategories_id());
|
||||||
|
$help = array();
|
||||||
|
$help[] = "Categories menu / Edit a category / Meta Data / Allow Download";
|
||||||
|
if (is_object($category) && !$category->getAllow_download()) {
|
||||||
|
echo getChecked(__("This category do not allow download"), false, $help);
|
||||||
|
} else {
|
||||||
|
echo getChecked(__("This category allow download"), true, $help);
|
||||||
|
}
|
||||||
|
if (!empty($obj->userCanAllowFilesDownloadSelectPerVideo)) {
|
||||||
|
$help = array();
|
||||||
|
$help[] = "My Videos menu / Edit a video / Allow Download This media";
|
||||||
|
if (empty($video->getCan_download())) {
|
||||||
|
echo getChecked(__("User must allow each video individually, but this video is not marked for download"), false, $help);
|
||||||
|
} else {
|
||||||
|
echo getChecked(__("This video checked for download"), true, $help);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo getChecked(__("The download permission is site wide, so there is nothing to check on the video"), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
|
@ -865,22 +865,37 @@ function avideoToast(msg) {
|
||||||
$.toast(msg);
|
$.toast(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function avideoAlertAJAXHTML(url) {
|
||||||
|
modal.showPleaseWait();
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
success: function (response) {
|
||||||
|
avideoAlertText(response);
|
||||||
|
modal.hidePleaseWait();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function avideoAlertHTMLText(title, msg, type) {
|
function avideoAlertHTMLText(title, msg, type) {
|
||||||
var span = document.createElement("span");
|
var span = document.createElement("span");
|
||||||
span.innerHTML = msg;
|
span.innerHTML = msg;
|
||||||
swal({
|
swal({
|
||||||
title: title,
|
title: title,
|
||||||
content: span,
|
content: span,
|
||||||
type: type,
|
|
||||||
icon: type,
|
icon: type,
|
||||||
html: true,
|
closeModal: true,
|
||||||
closeModal: true
|
buttons: type?true:false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function avideoAlertText(msg) {
|
||||||
|
avideoAlert("", msg, '');
|
||||||
|
}
|
||||||
|
|
||||||
function avideoAlertInfo(msg) {
|
function avideoAlertInfo(msg) {
|
||||||
avideoAlert("Info", msg, 'info');
|
avideoAlert("Info", msg, 'info');
|
||||||
}
|
}
|
||||||
|
|
||||||
function avideoAlertError(msg) {
|
function avideoAlertError(msg) {
|
||||||
avideoAlert("Error", msg, 'error');
|
avideoAlert("Error", msg, 'error');
|
||||||
}
|
}
|
||||||
|
|
|
@ -534,7 +534,7 @@
|
||||||
<input type="number" step="1" id="views_count" class="form-control externalOptions" >
|
<input type="number" step="1" id="views_count" class="form-control externalOptions" >
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}else{
|
} else {
|
||||||
?><input type="hidden" id="views_count" value="-1"><?php
|
?><input type="hidden" id="views_count" value="-1"><?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -679,21 +679,21 @@
|
||||||
<h2><?php echo __("How to setup the Youtube-Upload feature"); ?>:</h2>
|
<h2><?php echo __("How to setup the Youtube-Upload feature"); ?>:</h2>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
<?php echo __("You need to enable"); ?>
|
<?php echo __("You need to enable"); ?>
|
||||||
<a href="<?php echo $global['webSiteRootURL']; ?>siteConfigurations" class="btn btn-info btn-xs"><?php echo __("Google Login"); ?></a> <?php echo __("and get the following information") . ": <strong>" . __("Google ID and Key") . "</strong>"; ?>
|
<a href="<?php echo $global['webSiteRootURL']; ?>siteConfigurations" class="btn btn-info btn-xs"><?php echo __("Google Login"); ?></a> <?php echo __("and get the following information") . ": <strong>" . __("Google ID and Key") . "</strong>"; ?>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<?php echo __("Go to your"); ?>
|
<?php echo __("Go to your"); ?>
|
||||||
<a href="https://console.developers.google.com/apis/dashboard" class="btn btn-info btn-xs" target="_blank" rel="noopener noreferrer"><?php echo __("Google Console API Dashboard"); ?></a>
|
<a href="https://console.developers.google.com/apis/dashboard" class="btn btn-info btn-xs" target="_blank" rel="noopener noreferrer"><?php echo __("Google Console API Dashboard"); ?></a>
|
||||||
<?php echo __("and enable the following API") . ": <strong>" . __("YouTube Data API") . " v3</strong>"; ?>
|
<?php echo __("and enable the following API") . ": <strong>" . __("YouTube Data API") . " v3</strong>"; ?>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<?php echo __("In authorized credentials allow the following URIs redirection"); ?>:
|
<?php echo __("In authorized credentials allow the following URIs redirection"); ?>:
|
||||||
<code><?php echo $global['webSiteRootURL']; ?>objects/youtubeUpload.json.php</code>
|
<code><?php echo $global['webSiteRootURL']; ?>objects/youtubeUpload.json.php</code>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<?php echo __("You can find more help on the following documentation"); ?>:
|
<?php echo __("You can find more help on the following documentation"); ?>:
|
||||||
<a href="https://developers.google.com/youtube/v3/getting-started" class="btn btn-info btn-xs" target="_blank" rel="noopener noreferrer"><?php echo __("YouTube Data API Overview"); ?></a>
|
<a href="https://developers.google.com/youtube/v3/getting-started" class="btn btn-info btn-xs" target="_blank" rel="noopener noreferrer"><?php echo __("YouTube Data API Overview"); ?></a>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
|
@ -718,47 +718,47 @@ if (empty($advancedCustom->disableHTMLDescription)) {
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript" src="<?php echo $global['webSiteRootURL']; ?>view/js/tinymce/tinymce.min.js"></script>
|
<script type="text/javascript" src="<?php echo $global['webSiteRootURL']; ?>view/js/tinymce/tinymce.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
tinymce.init({
|
tinymce.init({
|
||||||
language: "<?php echo $_SESSION['language']; ?>",
|
language: "<?php echo $_SESSION['language']; ?>",
|
||||||
selector: '#inputDescription', // change this value according to your HTML
|
selector: '#inputDescription', // change this value according to your HTML
|
||||||
plugins: 'code print preview fullpage searchreplace autolink directionality visualblocks visualchars fullscreen image link media codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern help ',
|
plugins: 'code print preview fullpage searchreplace autolink directionality visualblocks visualchars fullscreen image link media codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern help ',
|
||||||
//toolbar: 'fullscreen | formatselect | bold italic strikethrough forecolor backcolor permanentpen formatpainter | link image media pageembed | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | addcomment',
|
//toolbar: 'fullscreen | formatselect | bold italic strikethrough forecolor backcolor permanentpen formatpainter | link image media pageembed | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | addcomment',
|
||||||
toolbar: 'fullscreen | formatselect | bold italic strikethrough | link image media pageembed | numlist bullist | removeformat | addcomment',
|
toolbar: 'fullscreen | formatselect | bold italic strikethrough | link image media pageembed | numlist bullist | removeformat | addcomment',
|
||||||
menubar: 'edit insert view format table tools help', // remove 'file' menu as it's useless in our context
|
menubar: 'edit insert view format table tools help', // remove 'file' menu as it's useless in our context
|
||||||
height: 400,
|
height: 400,
|
||||||
convert_urls: false,
|
convert_urls: false,
|
||||||
images_upload_handler: function (blobInfo, success, failure) {
|
images_upload_handler: function (blobInfo, success, failure) {
|
||||||
var xhr, formData;
|
var xhr, formData;
|
||||||
if (!videos_id) {
|
if (!videos_id) {
|
||||||
$('#inputTitle').val("Article automatically booked");
|
$('#inputTitle').val("Article automatically booked");
|
||||||
saveVideo(false);
|
saveVideo(false);
|
||||||
|
}
|
||||||
|
xhr = new XMLHttpRequest();
|
||||||
|
xhr.withCredentials = false;
|
||||||
|
xhr.open('POST', '<?php echo $global['webSiteRootURL']; ?>objects/uploadArticleImage.php?video_id=' + videos_id);
|
||||||
|
xhr.onload = function () {
|
||||||
|
var json;
|
||||||
|
if (xhr.status != 200) {
|
||||||
|
failure('HTTP Error: ' + xhr.status);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
json = xhr.responseText;
|
||||||
|
json = JSON.parse(json);
|
||||||
|
if (json.error === false && json.url) {
|
||||||
|
success(json.url);
|
||||||
|
} else if (json.msg) {
|
||||||
|
avideoAlert("<?php echo __("Sorry!"); ?>", json.msg, "error");
|
||||||
|
} else {
|
||||||
|
avideoAlert("<?php echo __("Error!"); ?>", "<?php echo __("Unknown Error!"); ?>", "error");
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
formData = new FormData();
|
||||||
|
formData.append('file_data', blobInfo.blob(), blobInfo.filename());
|
||||||
|
xhr.send(formData);
|
||||||
}
|
}
|
||||||
xhr = new XMLHttpRequest();
|
});
|
||||||
xhr.withCredentials = false;
|
|
||||||
xhr.open('POST', '<?php echo $global['webSiteRootURL']; ?>objects/uploadArticleImage.php?video_id=' + videos_id);
|
|
||||||
xhr.onload = function () {
|
|
||||||
var json;
|
|
||||||
if (xhr.status != 200) {
|
|
||||||
failure('HTTP Error: ' + xhr.status);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
json = xhr.responseText;
|
|
||||||
json = JSON.parse(json);
|
|
||||||
if (json.error === false && json.url) {
|
|
||||||
success(json.url);
|
|
||||||
} else if (json.msg) {
|
|
||||||
avideoAlert("<?php echo __("Sorry!"); ?>", json.msg, "error");
|
|
||||||
} else {
|
|
||||||
avideoAlert("<?php echo __("Error!"); ?>", "<?php echo __("Unknown Error!"); ?>", "error");
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
formData = new FormData();
|
|
||||||
formData.append('file_data', blobInfo.blob(), blobInfo.filename());
|
|
||||||
xhr.send(formData);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
@ -1791,7 +1791,7 @@ if (CustomizeUser::canDownloadVideos()) {
|
||||||
var downloadURL = addGetParam(url, 'download', 1);
|
var downloadURL = addGetParam(url, 'download', 1);
|
||||||
var pattern = /^m3u8/i;
|
var pattern = /^m3u8/i;
|
||||||
if (pattern.test(k) === true) {
|
if (pattern.test(k) === true) {
|
||||||
downloadURL = addGetParam(downloadURL, 'title', row.clean_title+'_'+k+'.mp4');
|
downloadURL = addGetParam(downloadURL, 'title', row.clean_title + '_' + k + '.mp4');
|
||||||
download += '<div class="btn-group btn-group-justified">';
|
download += '<div class="btn-group btn-group-justified">';
|
||||||
download += '<a class="btn btn-default btn-xs" onclick="copyToClipboard(\'' + url + '\');" ><span class="fa fa-copy " aria-hidden="true"></span> ' + k + '</a>';
|
download += '<a class="btn btn-default btn-xs" onclick="copyToClipboard(\'' + url + '\');" ><span class="fa fa-copy " aria-hidden="true"></span> ' + k + '</a>';
|
||||||
download += '<a href="' + downloadURL + '" class="btn btn-default btn-xs" target="_blank" ><span class="fa fa-download " aria-hidden="true"></span> MP4</a>';
|
download += '<a href="' + downloadURL + '" class="btn btn-default btn-xs" target="_blank" ><span class="fa fa-download " aria-hidden="true"></span> MP4</a>';
|
||||||
|
@ -1802,6 +1802,10 @@ if (CustomizeUser::canDownloadVideos()) {
|
||||||
|
|
||||||
}
|
}
|
||||||
<?php
|
<?php
|
||||||
|
} else if(!empty ($config->getAllow_download()) || User::isAdmin()){
|
||||||
|
?>
|
||||||
|
download = '<button type="button" class="btn btn-default btn-xs btn-block" onclick="whyICannotDownload(' + row.id + ');" data-toggle="tooltip" title="<?php echo str_replace("'", "\\'", __("Why I cannot download?")); ?>"><span class="fa-stack" style="font-size: 0.8em;"><i class="fa fa-download fa-stack-1x"></i><i class="fas fa-ban fa-stack-2x" style="color:Tomato"></i></span></button>';
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -2205,4 +2209,7 @@ if (!empty($_GET['link'])) {
|
||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function whyICannotDownload(videos_id) {
|
||||||
|
avideoAlertAJAXHTML(webSiteRootURL + "view/downloadChecker.php?videos_id=" + videos_id);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue