1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00

Update page builder

This commit is contained in:
Daniel Neto 2024-04-02 13:44:59 -03:00
parent 7ec296ff28
commit b565543ec0
166 changed files with 6185 additions and 7400 deletions

View file

@ -107,7 +107,7 @@
logoImgBase64 = resp;
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/customize_settings_nativeUpdate.json.php',
url: webSiteRootURL+'admin/customize_settings_nativeUpdate.json.php',
data: {
"logoImgBase64": logoImgBase64,
"webSiteTitle": $('#inputWebSiteTitle').val(),

View file

@ -95,27 +95,27 @@ $delay = 0.5;
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
url: 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',
url: 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',
url: 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',
url: 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',
url: webSiteRootURL+'admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {
@ -142,27 +142,27 @@ $delay = 0.5;
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
url: 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',
url: 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',
url: 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',
url: 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',
url: webSiteRootURL+'admin/themeUpdate.json.php',
data: {"theme": 'netflix'},
type: 'post',
success: function (response) {
@ -189,27 +189,27 @@ $delay = 0.5;
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
url: 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',
url: 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',
url: 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',
url: 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',
url: webSiteRootURL+'admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {
@ -236,27 +236,27 @@ $delay = 0.5;
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
url: 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',
url: 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',
url: 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',
url: 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',
url: webSiteRootURL+'admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {
@ -285,27 +285,27 @@ $delay = 0.5;
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
url: 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',
url: 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',
url: 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',
url: webSiteRootURL+'objects/pluginSwitch.json.php',
data: {"uuid": "channel-first-page-977a-fd0e5cab205d", "name": "FirstPageChannelList", "dir": "FirstPageChannelList", "enable": true},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
url: webSiteRootURL+'admin/themeUpdate.json.php',
data: {"theme": 'default'},
type: 'post',
success: function (response) {

View file

@ -53,12 +53,12 @@ $delay = 0.2;
$('.playerSwitch').not(this).prop('checked', false);
var skin = $(this).val();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
url: webSiteRootURL+'objects/pluginSwitch.json.php',
data: {"uuid": "e9a568e6-ef61-4dcc-aad0-0109e9be8e36", "name": "PlayerSkins", "dir": "PlayerSkins", "enable": true},
type: 'post',
success: function (response) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/playerUpdate.json.php',
url: webSiteRootURL+'admin/playerUpdate.json.php',
data: {"skin": skin},
type: 'post',
success: function (response) {

View file

@ -41,7 +41,7 @@
modal.showPleaseWait();
$('.themeSwitch').not(this).prop('checked', false);
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
url: webSiteRootURL+'admin/themeUpdate.json.php',
data: {"theme": $(this).val()},
type: 'post',
success: function (response) {

View file

@ -358,7 +358,7 @@ switch ($_GET['page']) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/save.json.php',
url: webSiteRootURL+'admin/save.json.php',
data: $(this).serialize(),
type: 'post',
success: function (response) {
@ -369,7 +369,7 @@ switch ($_GET['page']) {
$('.pluginSwitch').change(function (e) {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
url: webSiteRootURL+'objects/pluginSwitch.json.php',
data: {"uuid": $(this).attr('uuid'), "name": $(this).attr('name'), "dir": $(this).attr('name'), "enable": $(this).is(":checked")},
type: 'post',
success: function (response) {

View file

@ -50,7 +50,7 @@
modal.showPleaseWait();
$("#emailMessage").val(tinymce.get('emailMessage').getContent());
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/emailAllUsers.json.php',
url: webSiteRootURL+'objects/emailAllUsers.json.php',
method: 'POST',
data: {
'message': $('#emailMessage').val(),

View file

@ -8,17 +8,17 @@ if (isset($_GET['getLanguage'])) {
require_once($lngFile);
foreach ($t as $key => $value) {
if(empty($value)){
if (empty($value)) {
$t[$key] = $key;
}
}
if(!empty($_REQUEST['print'])){
if (!empty($_REQUEST['print'])) {
header('Content-Type: text/plain');
foreach ($t as $key => $value) {
echo $value.PHP_EOL;
echo $value . PHP_EOL;
}
}else{
} else {
header('Content-Type: application/json');
echo json_encode($t);
}
@ -34,178 +34,162 @@ if (!User::isAdmin() || !empty($global['disableAdvancedConfigurations'])) {
}
$vars = listAllWordsToTranslate();
$_page = new Page(array('Translate AVideo'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<?php
echo getHTMLTitle(__("Translate AVideo"));
?>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<style type="text/css">
textarea.form-control {
height: 100% !important;
}
</style>
</head>
<style type="text/css">
textarea.form-control {
height: 100% !important;
}
</style>
<div class="container-fluid">
<br>
<div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="col-sm-8">
<button class="btn btn-success btn-block " id="btnSaveFile" disabled><i class="fas fa-save"></i> <?php echo __("Save File"); ?></button>
</div>
<div class="col-sm-4">
<div class="navbar-lang-btn">
<?php
if ($lang == 'en') {
$lang = 'en_US';
}
echo Layout::getLangsSelect('selectFlag', $lang, 'selectFlag', 'btn-block', true);
//var_dump($lang);exit;
?>
</div>
<script>
$(function() {
$("#div_selectFlag a").click(function(event) {
event.preventDefault();
var value = $(this).attr('value');
var tb1 = $('#originalWords');
var tb2 = $('#translatedCode');
var tb3 = $('#arrayCode');
console.log('Changed language');
console.log(value);
$.ajax({
url: 'index.php?getLanguage=' + value,
dataType: 'json'
}).done(function(data) {
console.log("Found existing translation!");
var arrayOfLines = $('#originalWords').val().split('\n');
$('#translatedCode').empty();
$.each(arrayOfLines, function(index, item) {
if (data.hasOwnProperty(item)) {
$('#translatedCode').append(data[item] + '\n');
} else {
$('#translatedCode').append('\n');
}
});
$('#translatedCode').trigger('keyup');
tb1.scroll(function() {
tb2.scrollTop(tb1.scrollTop());
});
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<br>
<div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="col-sm-8">
<button class="btn btn-success btn-block " id="btnSaveFile" disabled><i class="fas fa-save"></i> <?php echo __("Save File"); ?></button>
</div>
<div class="col-sm-4">
<div class="navbar-lang-btn">
<?php
if ($lang == 'en') {
$lang = 'en_US';
}
echo Layout::getLangsSelect('selectFlag', $lang, 'selectFlag', 'btn-block', true);
//var_dump($lang);exit;
?>
</div>
<script>
$(function () {
$("#div_selectFlag a").click(function (event) {
event.preventDefault();
var value = $(this).attr('value');
var tb1 = $('#originalWords');
var tb2 = $('#translatedCode');
var tb3 = $('#arrayCode');
console.log('Changed language');
console.log(value);
$.ajax({
url: 'index.php?getLanguage=' + value,
dataType: 'json'
}).done(function (data) {
console.log("Found existing translation!");
var arrayOfLines = $('#originalWords').val().split('\n');
$('#translatedCode').empty();
$.each(arrayOfLines, function (index, item) {
if (data.hasOwnProperty(item)) {
$('#translatedCode').append(data[item] + '\n');
} else {
$('#translatedCode').append('\n');
}
});
$('#translatedCode').trigger('keyup');
tb1.scroll(function () {
tb2.scrollTop(tb1.scrollTop());
});
tb2.scroll(function() {
tb3.scrollTop(tb2.scrollTop());
});
}).fail(function() {
console.log("New translation");
tb1.scroll(function() {
tb2.scroll(function () {
tb3.scrollTop(tb2.scrollTop());
});
}).fail(function () {
console.log("New translation");
tb1.scroll(function () {
});
});
});
});
</script>
</div>
</div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-4 col-md-12">
<h3><?php echo __("Original words found"); ?></h3>
<textarea placeholder="<?php echo __("Original words found"); ?>" class="form-control" rows="20" readonly="readonly" id="originalWords" wrap="off"><?php
foreach ($vars as $value) {
echo $value, "\n";
}
?></textarea>
</div>
<div class="col-lg-4 col-md-12">
<h3><?php echo __("Word Translations"); ?></h3>
<textarea placeholder="<?php echo __("Paste here the translated words, one each line"); ?>" class="form-control" id="translatedCode" rows="20" wrap="off"></textarea>
</div>
<div class="col-lg-4 col-md-12">
<h3><?php echo __("Translated Array"); ?></h3>
<textarea placeholder="<?php echo __("Translated Array"); ?>" class="form-control" id="arrayCode" rows="20" readonly="readonly"
style="white-space: pre;overflow-wrap: normal;overflow-x: scroll;"
></textarea>
</div>
</div>
<?php
$dir = "{$global['systemRootPath']}locale";
if (!is_writable($dir)) {
?>
<div class="alert alert-info">
<?php echo __("You need to make your locale folder writable"); ?>
<pre><code>chown www-data:www-data <?php echo $global['systemRootPath']; ?>locale && sudo chmod -R 755 <?php echo $global['systemRootPath']; ?>locale</code></pre>
</div>
<?php
}
?>
<div class="alert alert-info">
<?php echo count($vars) . ' words found'; ?>
</div>
});
});
</script>
</div>
</div>
</div><!--/.container-->
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
var arrayLocale = <?php echo json_encode(array_values($vars)); ?>;
$(document).ready(function () {
$('#translatedCode').keyup(function () {
var lines = $(this).val().split('\n');
console.log(lines);
if (lines.length > 0 && !(lines.length == 1 && lines[0] === "")) {
var str = "";
for (var i = 0; i < lines.length; i++) {
if (typeof arrayLocale[i] == "undefined") {
break;
}
var key = arrayLocale[i].replace(/'/g, "\\'");
str += "$t['" + key + "'] = \"" + lines[i] + "\";\n";
}
$('#arrayCode').val(str);
$('button').prop('disabled', false);
</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-4 col-md-12">
<h3><?php echo __("Original words found"); ?></h3>
<textarea placeholder="<?php echo __("Original words found"); ?>" class="form-control" rows="20" readonly="readonly" id="originalWords" wrap="off"><?php
foreach ($vars as $value) {
echo $value, "\n";
}
?></textarea>
</div>
<div class="col-lg-4 col-md-12">
<h3><?php echo __("Word Translations"); ?></h3>
<textarea placeholder="<?php echo __("Paste here the translated words, one each line"); ?>" class="form-control" id="translatedCode" rows="20" wrap="off"></textarea>
</div>
<div class="col-lg-4 col-md-12">
<h3><?php echo __("Translated Array"); ?></h3>
<textarea placeholder="<?php echo __("Translated Array"); ?>" class="form-control" id="arrayCode" rows="20" readonly="readonly" style="white-space: pre;overflow-wrap: normal;overflow-x: scroll;"></textarea>
</div>
</div>
<?php
$dir = "{$global['systemRootPath']}locale";
if (!is_writable($dir)) {
?>
<div class="alert alert-info">
<?php echo __("You need to make your locale folder writable"); ?>
<pre><code>chown www-data:www-data <?php echo $global['systemRootPath']; ?>locale && sudo chmod -R 755 <?php echo $global['systemRootPath']; ?>locale</code></pre>
</div>
<?php
}
?>
<div class="alert alert-info">
<?php echo count($vars) . ' words found'; ?>
</div>
</div>
</div>
</div>
<script>
var arrayLocale = <?php echo json_encode(array_values($vars)); ?>;
$(document).ready(function() {
$('#translatedCode').keyup(function() {
var lines = $(this).val().split('\n');
console.log(lines);
if (lines.length > 0 && !(lines.length == 1 && lines[0] === "")) {
var str = "";
for (var i = 0; i < lines.length; i++) {
if (typeof arrayLocale[i] == "undefined") {
break;
}
var key = arrayLocale[i].replace(/'/g, "\\'");
str += "$t['" + key + "'] = \"" + lines[i] + "\";\n";
}
$('#arrayCode').val(str);
$('button').prop('disabled', false);
} else {
$('#arrayCode').val("");
$('button').prop('disabled', true);
}
});
$('#btnSaveFile').click(function() {
if ($('#btnSaveFile').is(":disabled")) {
return false;
}
modal.showPleaseWait();
$.ajax({
url: 'save.php',
data: {
"flag": $("#selectFlag").val(),
"code": $('#arrayCode').val()
},
type: 'post',
success: function(response) {
if (response.status === "1") {
avideoAlert("<?php echo __("Congratulations!"); ?>", "<?php echo __("Your language has been saved!"); ?>", "success");
} else {
$('#arrayCode').val("");
$('button').prop('disabled', true);
avideoAlert("<?php echo __("Sorry!"); ?>", response.error, "error");
}
});
$('#btnSaveFile').click(function () {
if ($('#btnSaveFile').is(":disabled")) {
return false;
}
modal.showPleaseWait();
$.ajax({
url: 'save.php',
data: {"flag": $("#selectFlag").val(), "code": $('#arrayCode').val()},
type: 'post',
success: function (response) {
if (response.status === "1") {
avideoAlert("<?php echo __("Congratulations!"); ?>", "<?php echo __("Your language has been saved!"); ?>", "success");
} else {
avideoAlert("<?php echo __("Sorry!"); ?>", response.error, "error");
}
modal.hidePleaseWait();
}
});
});
modal.hidePleaseWait();
}
});
</script>
</body>
</html>
});
});
</script>
<?php
$_page->print();
?>

View file

@ -1,6 +1,7 @@
<?php
class Page {
class Page
{
private $title;
private $bodyClass = '';
@ -11,78 +12,117 @@ class Page {
private $bodyContent = '';
private $includeNavbar = true;
private $includeFooter = true;
private $includeBGAnimation = false;
private $includeInHead = array();
private $includeInFooter = array();
public function __construct($title, $bodyClass='') {
public function __construct($title, $bodyClass = '', $loadBasicCSSAndJS = false)
{
$this->title = $title;
$this->bodyClass = $bodyClass;
_ob_start();
if ($loadBasicCSSAndJS) {
$this->loadBasicCSSAndJS();
}
}
public function setTitle(string $title) {
public function loadBasicCSSAndJS()
{
$this->setExtraScripts(
array(
'view/css/DataTables/datatables.min.js',
'view/js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'
)
);
$this->setExtraStyles(
array(
'view/css/DataTables/datatables.min.css',
'view/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css'
)
);
}
public function setTitle(string $title)
{
$this->title = $title;
}
public function setBodyClass(string $bodyClass) {
public function setBodyClass(string $bodyClass)
{
$this->bodyClass = $bodyClass;
}
public function setExtraScripts(array $extraScripts) {
public function setExtraScripts(array $extraScripts)
{
$this->extraScripts = $extraScripts;
}
public function setExtraStyles(array $extraStyles) {
public function setExtraStyles(array $extraStyles)
{
$this->extraStyles = $extraStyles;
}
public function setInlineStyles(string $inlineStyles) {
public function setInlineStyles(string $inlineStyles)
{
$this->inlineStyles = $inlineStyles;
}
public function setInlineScripts(string $inlineScripts) {
public function setInlineScripts(string $inlineScripts)
{
$this->inlineScripts = $inlineScripts;
}
public function setBodyContent(string $bodyContent) {
public function setBodyContent(string $bodyContent)
{
$this->bodyContent = $bodyContent;
}
public function setIncludeNavbar(bool $includeNavbar) {
public function setIncludeNavbar(bool $includeNavbar)
{
$this->includeNavbar = $includeNavbar;
}
public function setIncludeFooter(bool $includeFooter) {
public function setIncludeFooter(bool $includeFooter)
{
$this->includeFooter = $includeFooter;
}
public function setIncludeInHead(array $includeInHead) {
public function setIncludeInHead(array $includeInHead)
{
$this->includeInHead = $includeInHead;
}
public function setIncludeInFooter(array $includeInFooter) {
public function setIncludeInFooter(array $includeInFooter)
{
$this->includeInFooter = $includeInFooter;
}
public function getHead() {
public function setIncludeBGAnimation(bool $includeBGAnimation)
{
$this->includeBGAnimation = $includeBGAnimation;
}
public function getHead()
{
global $config, $global;
if(!is_array($this->title)){
if (!is_array($this->title)) {
$this->title = array($this->title);
}
foreach ($this->title as $key => $value) {
$this->title[$key] = __($value);
}
echo "<head>";
echo "<title>" . implode($config->getPageTitleSeparator(), $this->title) . getSEOComplement() . $config->getPageTitleSeparator() . $config->getWebSiteTitle() . "</title>";
echo getHTMLTitle($this->title);
//echo "<title>" . implode($config->getPageTitleSeparator(), $this->title) . getSEOComplement() . $config->getPageTitleSeparator() . $config->getWebSiteTitle() . "</title>";
include $global['systemRootPath'] . 'view/include/head.php';
if(!empty($this->includeInHead)){
if (!empty($this->includeInHead)) {
foreach ($this->includeInHead as $value) {
include $global['systemRootPath'] . $value;
}
}
if(!empty($this->extraStyles)){
if (!empty($this->extraStyles)) {
foreach ($this->extraStyles as $style) {
echo "<link href=\"" . $global['webSiteRootURL'].$style . "\" rel=\"stylesheet\" type=\"text/css\" />";
echo "<link href=\"" . $global['webSiteRootURL'] . $style . "\" rel=\"stylesheet\" type=\"text/css\" />";
}
}
@ -92,28 +132,37 @@ class Page {
echo "</head>";
}
public function getNavBar() {
public function getNavBar()
{
global $global;
if($this->includeBGAnimation){
CustomizeUser::autoIncludeBGAnimationFile();
}
$redirectUri = getRedirectUri();
if (stripos($redirectUri, "embed/") !== false) {
$this->includeNavbar = false;
}
if ($this->includeNavbar) {
// Your navbar HTML
include $global['systemRootPath'] . 'view/include/navbar.php';
}
}
public function getFooter() {
public function getFooter()
{
global $config, $global;
if ($this->includeFooter) {
// Your footer HTML
include $global['systemRootPath'] . 'view/include/footer.php';
}
if(!empty($this->includeInFooter)){
if (!empty($this->includeInFooter)) {
foreach ($this->includeInFooter as $value) {
include $global['systemRootPath'] . $value;
}
}
if(!empty($this->extraScripts)){
if (!empty($this->extraScripts)) {
foreach ($this->extraScripts as $script) {
echo "<script src=\"" . $global['webSiteRootURL'].$script . "\" type=\"text/javascript\"></script>";
echo "<script src=\"" . $global['webSiteRootURL'] . $script . "\" type=\"text/javascript\"></script>";
}
}
if (!empty($this->inlineScripts)) {
@ -121,7 +170,8 @@ class Page {
}
}
public function getContent() {
public function getContent()
{
global $global;
$rtl = '';
if (isRTL()) {
@ -131,29 +181,30 @@ class Page {
$this->getNavBar();
//echo '<div id="_avideoPageContentLoading" class="progress"><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"><span class="sr-only">Loading...</span></div></div>';
//echo '<div id="_avideoPageContent">';
echo $this->bodyContent;
echo $this->bodyContent;
//echo '</div>';
$this->getFooter();
echo "</body>";
}
public function getPage() {
public function getPage()
{
echo "<!DOCTYPE html>";
echo "<html lang=\"" . getLanguage() . "\">";
$this->getHead();
$this->getContent();
echo "</html>";
}
public function print($include_end = true){
public function print($include_end = true)
{
global $config, $global;
$html = _ob_get_clean();
_ob_start();
$this->bodyContent = $html;
$this->getPage();
if($include_end){
include $global['systemRootPath'].'objects/include_end.php';
if ($include_end) {
include $global['systemRootPath'] . 'objects/include_end.php';
}
}
}

View file

@ -8,7 +8,7 @@ if (!isset($global['systemRootPath'])) {
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}

View file

@ -5488,9 +5488,16 @@ function getHTMLTitle($titleArray)
if (!is_array($titleArray)) {
$titleArray = [];
}
$titleArray[] = getSEOComplement();
$titleArray[] = $config->getWebSiteTitle();
$title = implode($config->getPageTitleSeparator(), $titleArray);
$cleanTitleArray = array();
foreach ($titleArray as $value) {
if(!empty($value) && !in_array($value, $cleanTitleArray)){
$cleanTitleArray[] = $value;
}
}
$title = implode($config->getPageTitleSeparator(), $cleanTitleArray);
$global['pageTitle'] = $title;
return "<title>{$title}</title>";
}

View file

@ -133,7 +133,7 @@ if (!(!empty($_REQUEST['user']) && !empty($_REQUEST['recoverpass']))) {
evt.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/userRecoverPassSave.json.php',
url: webSiteRootURL+'objects/userRecoverPassSave.json.php',
data: $('#recoverPassForm').serializeArray(),
type: 'post',
success: function(response) {

View file

@ -34,7 +34,7 @@
ad_overlay_users_id = users_id;
$('#adsFormModal').modal();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/AD_Overlay/getCode.json.php?users_id=' + users_id,
url: webSiteRootURL+'plugin/AD_Overlay/getCode.json.php?users_id=' + users_id,
success: function (response) {
$( "#addOverlayCode" ).text(response.msg);
if(response.status == 'a'){

View file

@ -10,7 +10,7 @@ $ad->loadFromUser(User::getId());
AD Code
</div>
<div class="panel-body">
<textarea class="form-control" rows="10" id="addOverlayCode"><?php echo $ad->getCode(); ?></textarea>
<textarea class="form-control" rows="10" id="addOverlayCode"><?php echo htmlentities($ad->getCode()); ?></textarea>
<button class="btn btn-success btn-block" type="button" onclick="saveCode()"><?php echo __("Save Ad Code") ?></button>
</div>
</div>

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
@ -287,7 +287,7 @@ if (!User::isAdmin()) {
$(".pluginSwitch").on("change", function (e) {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>objects/pluginSwitch.json.php',
url: webSiteRootURL+'objects/pluginSwitch.json.php',
data: {"uuid": "3f2a707f-3c06-4b78-90f9-a22f2fda92ef", "name": "AD_Server", "dir": "AD_Server", "enable": $('#enable1').is(":checked")},
type: 'post',
success: function (response) {
@ -300,7 +300,7 @@ if (!User::isAdmin()) {
minLength: 0,
source: function (req, res) {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>videos.json',
url: webSiteRootURL+'videos.json',
type: "POST",
data: {
searchPhrase: req.term,
@ -481,7 +481,7 @@ if (!User::isAdmin()) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/AD_Server/view/addCampaign.php',
url: webSiteRootURL+'plugin/AD_Server/view/addCampaign.php',
data: $('#panelForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -51,7 +51,7 @@ $countries = IP2Location::getCountries();
$("#country").on("change", function (e) {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/User_Location/regions.json.php?country=' + $('#country').val(),
url: webSiteRootURL+'plugin/User_Location/regions.json.php?country=' + $('#country').val(),
success: function (response) {
$('#region').empty();
$('#region').append($("<option></option>").text('All'));
@ -68,7 +68,7 @@ $countries = IP2Location::getCountries();
$("#region").on("change", function (e) {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/User_Location/cities.json.php?country=' + $('#country').val() + '&region=' + $('#region').val(),
url: webSiteRootURL+'plugin/User_Location/cities.json.php?country=' + $('#country').val() + '&region=' + $('#region').val(),
success: function (response) {
$('#city').empty();
$('#city').append($("<option></option>").text('All'));

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
@ -170,7 +170,7 @@ $('#Ai_metatags_responsesai_responses_id').val('');
$(document).ready(function () {
$('#addAi_metatags_responsesBtn').click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/AI/View/addAi_metatags_responsesVideo.php',
url: webSiteRootURL+'plugin/AI/View/addAi_metatags_responsesVideo.php',
data: $('#panelAi_metatags_responsesForm').serialize(),
type: 'post',
success: function (response) {
@ -220,7 +220,7 @@ $('#Ai_metatags_responsesai_responses_id').val('');
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/AI/View/Ai_metatags_responses/add.json.php',
url: webSiteRootURL+'plugin/AI/View/Ai_metatags_responses/add.json.php',
data: $('#panelAi_metatags_responsesForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
@ -94,7 +94,7 @@ $('#Ai_responsesvideos_id').val('');
$('#addAi_responsesBtn').click(function () {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/AI/View/addAi_responsesVideo.php',
url: webSiteRootURL+'plugin/AI/View/addAi_responsesVideo.php',
data: $('#panelAi_responsesForm').serialize(),
type: 'post',
success: function (response) {
@ -133,7 +133,7 @@ $('#Ai_responsesvideos_id').val('');
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/AI/View/Ai_responses/add.json.php',
url: webSiteRootURL+'plugin/AI/View/Ai_responses/add.json.php',
data: $('#panelAi_responsesForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
@ -138,7 +138,7 @@ $('#Ai_transcribe_responsesai_responses_id').val('');
$(document).ready(function () {
$('#addAi_transcribe_responsesBtn').click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/AI/View/addAi_transcribe_responsesVideo.php',
url: webSiteRootURL+'plugin/AI/View/addAi_transcribe_responsesVideo.php',
data: $('#panelAi_transcribe_responsesForm').serialize(),
type: 'post',
success: function (response) {
@ -183,7 +183,7 @@ $('#Ai_transcribe_responsesai_responses_id').val('');
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/AI/View/Ai_transcribe_responses/add.json.php',
url: webSiteRootURL+'plugin/AI/View/Ai_transcribe_responses/add.json.php',
data: $('#panelAi_transcribe_responsesForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -13,134 +13,109 @@ if (empty($plugin)) {
forbiddenPage('API Plugin disabled');
}
$obj = AVideoPlugin::getObjectData("API");
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<?php
echo getHTMLTitle(__("API"));
?>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<style>
pre a{
color: #333;
font-weight: bolder;
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
$methodsList = array();
$reflector = new ReflectionClass('API');
$class_methods = get_class_methods('API');
$methodsList = array();
$reflector = new ReflectionClass('API');
$class_methods = get_class_methods('API');
foreach ($class_methods as $key => $method[0]) {
if (preg_match("/(get|set)_api_(.*)/", $method[0], $matches)) {
$methodsList[] = array($method[0], $reflector, $matches[1], $matches[2], '');
}
}
$plugins = Plugin::getAllEnabled();
foreach ($plugins as $value) {
$p = AVideoPlugin::loadPlugin($value['dirName']);
if (class_exists($value['dirName'])) {
$class_methods = get_class_methods($value['dirName']);
$reflector = new ReflectionClass($value['dirName']);
foreach ($class_methods as $key => $method[0]) {
if (preg_match("/(get|set)_api_(.*)/", $method[0], $matches)) {
$methodsList[] = array($method[0], $reflector, $matches[1], $matches[2], '');
if (preg_match("/API_(get|set)_(.*)/", $method[0], $matches)) {
$methodsList[] = array($method[0], $reflector, $matches[1], $matches[2], $value['dirName']);
}
}
}
}
$plugins = Plugin::getAllEnabled();
foreach ($plugins as $value) {
$p = AVideoPlugin::loadPlugin($value['dirName']);
if(class_exists($value['dirName'])){
$class_methods = get_class_methods($value['dirName']);
$reflector = new ReflectionClass($value['dirName']);
foreach ($class_methods as $key => $method[0]) {
if (preg_match("/API_(get|set)_(.*)/", $method[0], $matches)) {
$methodsList[] = array($method[0], $reflector, $matches[1], $matches[2], $value['dirName']);
}
}
}
}
$_page = new Page(array('API'));
/*
usort($class_methods, function ($a, $b) {
if (!preg_match("/(get|set)_api_(.*)/", $a, $matchesA)) {
return 0;
}
if (!preg_match("/(get|set)_api_(.*)/", $b, $matchesB)) {
return 0;
}
return strcasecmp($matchesA[2], $matchesB[2]);
});
*
*/
?>
<div class="container-fluid">
<ul class="list-group">
<li class="list-group-item">
<details>
<summary style="cursor: pointer;"><i class="fas fa-file-upload"></i> Upload a Video</summary>
<br>
For more detailed instructions please <a href="https://github.com/WWBN/AVideo/wiki/Upload-videos-from-third-party-applications" target="_blank" rel="noopener noreferrer" >read this</a>
<br>
Your HTML Form should looks like this. The user and the pass values on the action URL will be the video owner
<pre><?php
$frm = '<form enctype="multipart/form-data" method="post" action="' . $global['webSiteRootURL'] . 'plugin/MobileManager/upload.php?user=' . urlencode(User::getUserName()) . '&pass=' . User::getUserPass() . '">
?>
<style>
pre a {
color: #333;
font-weight: bolder;
}
</style>
<div class="container-fluid">
<ul class="list-group">
<li class="list-group-item">
<details>
<summary style="cursor: pointer;"><i class="fas fa-file-upload"></i> Upload a Video</summary>
<br>
For more detailed instructions please <a href="https://github.com/WWBN/AVideo/wiki/Upload-videos-from-third-party-applications" target="_blank" rel="noopener noreferrer">read this</a>
<br>
Your HTML Form should looks like this. The user and the pass values on the action URL will be the video owner
<pre><?php
$frm = '<form enctype="multipart/form-data" method="post" action="' . $global['webSiteRootURL'] . 'plugin/MobileManager/upload.php?user=' . urlencode(User::getUserName()) . '&pass=' . User::getUserPass() . '">
<input name="title" type="text" /><br>
<textarea name="description"></textarea><br>
<input name="categories_id" type="hidden" value="1" />
<input name="upl" type="file" accept="video/mp4" /><br>
<input type="submit" value="submit" id="submit"/>
</form>';
echo htmlentities($frm);
?>
echo htmlentities($frm);
?>
</pre>
You can Click to get notified for the new video uploads with the Webhook in the Notification plugin, Check <a href="https://github.com/WWBN/AVideo/wiki/Notifications-Plugin#webhooks" target="_blank" rel="noopener noreferrer">here</a> for more details
You can Click to get notified for the new video uploads with the Webhook in the Notification plugin, Check <a href="https://github.com/WWBN/AVideo/wiki/Notifications-Plugin#webhooks" target="_blank" rel="noopener noreferrer">here</a> for more details
</details>
</li>
<?php
foreach ($methodsList as $method) {
if (!preg_match("/(get|set)_api_(.*)/", $method[0], $matches)) {
if (!preg_match("/API_(get|set)_(.*)/", $method[0], $matches)) {
continue;
}
}
$reflector = $method[1];
$icon = 'fa-solid fa-pen-to-square';
if(strtolower($method[2]) === "get"){
$icon = 'fas fa-sign-out-alt';
}
?>
<li class="list-group-item">
<details>
<summary style="cursor: pointer;">
<i class="<?php echo $icon; ?>"></i>
<?php echo strtoupper($method[2]); ?>
<?php echo $method[3]; ?>
<?php
if(!empty($method[4])){
echo " ({$method[4]} plugin)";
}
?>
</summary>
<br>
<pre><?php
$comment = $reflector->getMethod($method[0])->getDocComment();
$comment = str_replace(['{webSiteRootURL}', '{getOrSet}', '{APIPlugin}', '{APIName}', '{APISecret}'], [$global['webSiteRootURL'], $method[2], $method[4], $method[3], $obj->APISecret], $comment);
preg_match_all('#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#', $comment, $match2);
//var_dump($match2[0]);
$link = "<a target='_blank' href='{$match2[0][0]}'>" . htmlentities($match2[0][0]) . "</a>";
$comment = str_replace([$match2[0][0], " *"], [$link, "*"], $comment);
echo($comment);
?>
</pre>
</details>
</li>
<?php
}
?>
</ul>
</div>
</details>
</li>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
foreach ($methodsList as $method) {
if (!preg_match("/(get|set)_api_(.*)/", $method[0], $matches)) {
if (!preg_match("/API_(get|set)_(.*)/", $method[0], $matches)) {
continue;
}
}
$reflector = $method[1];
$icon = 'fa-solid fa-pen-to-square';
if (strtolower($method[2]) === "get") {
$icon = 'fas fa-sign-out-alt';
}
?>
</body>
</html>
<li class="list-group-item">
<details>
<summary style="cursor: pointer;">
<i class="<?php echo $icon; ?>"></i>
<?php echo strtoupper($method[2]); ?>
<?php echo $method[3]; ?>
<?php
if (!empty($method[4])) {
echo " ({$method[4]} plugin)";
}
?>
</summary>
<br>
<pre><?php
$comment = $reflector->getMethod($method[0])->getDocComment();
$comment = str_replace(['{webSiteRootURL}', '{getOrSet}', '{APIPlugin}', '{APIName}', '{APISecret}'], [$global['webSiteRootURL'], $method[2], $method[4], $method[3], $obj->APISecret], $comment);
preg_match_all('#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#', $comment, $match2);
//var_dump($match2[0]);
$link = "<a target='_blank' href='{$match2[0][0]}'>" . htmlentities($match2[0][0]) . "</a>";
$comment = str_replace([$match2[0][0], " *"], [$link, "*"], $comment);
echo ($comment);
?>
</pre>
</details>
</li>
<?php
}
?>
</ul>
</div>
<?php
$_page->print();
?>

View file

@ -2,86 +2,84 @@
require_once '../../../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not manager plugin Audit"));
forbiddenPage("You can not manager plugin Audit");
exit;
}
$_page = new Page(array('Audit'));
$_page->loadBasicCSSAndJS();
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<?php
echo getHTMLTitle( __("Audit"));
?>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.css"/>
<style>
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-body">
<table id="auditTable" class="table table-striped">
<thead>
<tr>
<th>Class</th>
<th>Method</th>
<th>Statement</th>
<th>Format</th>
<th>Values</th>
<th>Created</th>
<th>User</th>
<th>IP</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Class</th>
<th>Method</th>
<th>Statement</th>
<th>Format</th>
<th>Values</th>
<th>Created</th>
<th>User</th>
<th>IP</th>
</tr>
</tfoot>
</table>
</div>
</div>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-body">
<table id="auditTable" class="table table-striped">
<thead>
<tr>
<th>Class</th>
<th>Method</th>
<th>Statement</th>
<th>Format</th>
<th>Values</th>
<th>Created</th>
<th>User</th>
<th>IP</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Class</th>
<th>Method</th>
<th>Statement</th>
<th>Format</th>
<th>Values</th>
<th>Created</th>
<th>User</th>
<th>IP</th>
</tr>
</tfoot>
</table>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script type="text/javascript" src="<?php echo getURL('view/css/DataTables/datatables.min.js'); ?>"></script>
<script>
$(document).ready(function () {
var auditTable = $('#auditTable').DataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": "<?php echo $global['webSiteRootURL']; ?>plugin/Audit/page/audits.json.php",
},
"columns": [
{"data": "class"},
{"data": "method"},
{"data": "statement"},
{"data": "formats"},
{"data": "values"},
{"data": "created"},
{"data": "user"},
{"data": "ip"},
],
select: true,
"order": [[5, "desc"]]
});
});
</script>
</body>
</html>
</div>
</div>
<script>
$(document).ready(function() {
var auditTable = $('#auditTable').DataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": "<?php echo $global['webSiteRootURL']; ?>plugin/Audit/page/audits.json.php",
},
"columns": [{
"data": "class"
},
{
"data": "method"
},
{
"data": "statement"
},
{
"data": "formats"
},
{
"data": "values"
},
{
"data": "created"
},
{
"data": "user"
},
{
"data": "ip"
},
],
select: true,
"order": [
[5, "desc"]
]
});
});
</script>
<?php
$_page->print();
?>

View file

@ -1,145 +1,134 @@
<?php
require_once '../../../videos/configuration.php';
AVideoPlugin::loadPlugin("AutoPostOnSocialMedia");
$_page = new Page(array('AutoPostOnSocialMedia'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo $config->getWebSiteTitle(); ?> :: AutoPostOnSocialMedia</title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="col-sm-2">
<input type="checkbox" onclick="$('.scheduleTwitterPost input:checkbox').prop('checked', this.checked);" id="AutoPostOnSocialMediaCheckbox">
<label for="AutoPostOnSocialMediaCheckbox">
<?php echo __('AutoPostOnSocialMedia') ?>
</label>
</div>
<div class="col-sm-8">
<button class="btn btn-success btn-block" onclick="saveScheduleTwitter();">
<i class="fas fa-save"></i>
<?php echo __('Save') ?>
</button>
</div>
<div class="col-sm-2">
<div class="pull-right">
<?php echo AVideoPlugin::getSwitchButton("AutoPostOnSocialMedia"); ?>
</div>
</div>
</div>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading">
<div class="row">
<div class="col-sm-2">
<input type="checkbox" onclick="$('.scheduleTwitterPost input:checkbox').prop('checked', this.checked);" id="AutoPostOnSocialMediaCheckbox">
<label for="AutoPostOnSocialMediaCheckbox">
<?php echo __('AutoPostOnSocialMedia') ?>
</label>
</div>
<div class="panel-body scheduleTwitterPost">
<?php
$rows = Scheduler_commands::getAllFromType(AutoPostOnSocialMedia::$scheduleType);
$savedValues = array();
foreach ($rows as $value) {
if(!isset($savedValues[$value['repeat_day_of_week']])){
$savedValues[$value['repeat_day_of_week']] = array();
}
$savedValues[$value['repeat_day_of_week']][] = $value['repeat_hour'];
}
//var_dump($savedValues);
$weekdays = array(
__('Sunday'),
__('Monday'),
__('Tuesday'),
__('Wednsday'),
__('Thursday'),
__('Friday'),
__('Saturday')
);
$columns = 3;
foreach ($weekdays as $weekday => $value) {
?>
<div class="col-lg-3 col-md-4 col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">
<input type="checkbox" onclick="$('.scheduleTwitterPost input.form-check-input-<?php echo $value; ?>:checkbox').prop('checked', this.checked);" id="AutoPostOnSocialMediaCheckbox-<?php echo $value; ?>">
<label for="AutoPostOnSocialMediaCheckbox-<?php echo $value; ?>">
<?php echo $value; ?>
</label>
</div>
<div class="panel-body">
<?php
$i = 0;
for ($c = 1; $c <= $columns; $c++) {
$val = 12 / $columns;
$class = 'col-xs-' . $val;
$time = 24 / $columns;
?>
<div class="<?php echo $class; ?>">
<?php
for (; $i < $time * $c; $i++) {
$checked = '';
if(!empty($savedValues[$weekday]) && in_array($i, $savedValues[$weekday])){
$checked = 'checked="checked"';
}
?>
<div class="form-check">
<input class="form-check-input form-check-input-<?php echo $value; ?>" type="checkbox" <?php echo $checked; ?>
value="<?php echo $weekday; ?>_<?php echo $i; ?>" id="flexCheckDefault<?php echo $value . $i; ?>">
<label class="form-check-label" for="flexCheckDefault<?php echo $value . $i; ?>">
<?php printf("%02d", $i); ?>H
</label>
</div>
<?php
}
?>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php
}
?>
<div class="col-sm-8">
<button class="btn btn-success btn-block" onclick="saveScheduleTwitter();">
<i class="fas fa-save"></i>
<?php echo __('Save') ?>
</button>
</div>
<div class="col-sm-2">
<div class="pull-right">
<?php echo AVideoPlugin::getSwitchButton("AutoPostOnSocialMedia"); ?>
</div>
</div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
$(function () {
<div class="panel-body scheduleTwitterPost">
<?php
});
function saveScheduleTwitter() {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/AutoPostOnSocialMedia/saveSchedule.json.php',
method: 'POST',
data: {
'checkedItems': getCheckedItems()
},
success: function (response) {
avideoResponse(response);
modal.hidePleaseWait();
}
});
$rows = Scheduler_commands::getAllFromType(AutoPostOnSocialMedia::$scheduleType);
$savedValues = array();
foreach ($rows as $value) {
if (!isset($savedValues[$value['repeat_day_of_week']])) {
$savedValues[$value['repeat_day_of_week']] = array();
}
$savedValues[$value['repeat_day_of_week']][] = $value['repeat_hour'];
}
function getCheckedItems() {
var selected = new Array();
$("input.form-check-input:checkbox:checked").each(function () {
selected.push($(this).val());
});
console.log('selected', selected);
return selected;
//var_dump($savedValues);
$weekdays = array(
__('Sunday'),
__('Monday'),
__('Tuesday'),
__('Wednsday'),
__('Thursday'),
__('Friday'),
__('Saturday')
);
$columns = 3;
foreach ($weekdays as $weekday => $value) {
?>
<div class="col-lg-3 col-md-4 col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">
<input type="checkbox" onclick="$('.scheduleTwitterPost input.form-check-input-<?php echo $value; ?>:checkbox').prop('checked', this.checked);" id="AutoPostOnSocialMediaCheckbox-<?php echo $value; ?>">
<label for="AutoPostOnSocialMediaCheckbox-<?php echo $value; ?>">
<?php echo $value; ?>
</label>
</div>
<div class="panel-body">
<?php
$i = 0;
for ($c = 1; $c <= $columns; $c++) {
$val = 12 / $columns;
$class = 'col-xs-' . $val;
$time = 24 / $columns;
?>
<div class="<?php echo $class; ?>">
<?php
for (; $i < $time * $c; $i++) {
$checked = '';
if (!empty($savedValues[$weekday]) && in_array($i, $savedValues[$weekday])) {
$checked = 'checked="checked"';
}
?>
<div class="form-check">
<input class="form-check-input form-check-input-<?php echo $value; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo $weekday; ?>_<?php echo $i; ?>" id="flexCheckDefault<?php echo $value . $i; ?>">
<label class="form-check-label" for="flexCheckDefault<?php echo $value . $i; ?>">
<?php printf("%02d", $i); ?>H
</label>
</div>
<?php
}
?>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php
}
</script>
</body>
</html>
?>
</div>
</div>
</div>
<script>
$(function() {
});
function saveScheduleTwitter() {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/AutoPostOnSocialMedia/saveSchedule.json.php',
method: 'POST',
data: {
'checkedItems': getCheckedItems()
},
success: function(response) {
avideoResponse(response);
modal.hidePleaseWait();
}
});
}
function getCheckedItems() {
var selected = new Array();
$("input.form-check-input:checkbox:checked").each(function() {
selected.push($(this).val());
});
console.log('selected', selected);
return selected;
}
</script>
<?php
$_page->print();
?>

View file

@ -2,7 +2,7 @@
require_once '../../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isLogged()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
@ -10,127 +10,111 @@ $plugin = AVideoPlugin::loadPluginIfEnabled("BlockonomicsYPT");
$obj = AVideoPlugin::getObjectData("BlockonomicsYPT");
$order_id = $plugin->setUpPayment($_GET['value']);
$order = new BlockonomicsOrder($order_id);
$_page = new Page(array('Invoice'));
$_page->setExtraScripts(array('plugin/BlockonomicsYPT/jquery.qrcode.min.js'))
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<?php
echo getHTMLTitle( __("Invoice"));
?>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<style>
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container">
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">
<h1>
Order#: <?php echo sprintf('%08d', $order->getId()); ?>
</h1>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-6">
<h2>Bitcoin Address</h2>
<a href="bitcoin:<?php echo $order->getAddr(); ?>?amount=<?php echo $order->getFormatedBits(); ?>">
<div id="qrcode" class="text-center"></div>
</a>
<br/>
<div class="field">
<div class="control">
<input type="text" class="input form-control" value="<?php echo $order->getAddr(); ?>" readonly="readonly">
</div>
</div>
</div>
<div class="col-md-6">
<h2>To pay, send exact amount of BTC to the given address</h2>
<h3>Amount</h3>
<p><strong><?php echo $order->getFormatedBits(); ?></strong> BTC ⇌ <strong><?php echo $order->getTotal_value(); ?></strong> <?php echo $order->getCurrency(); ?></p>
<br/>
<h2>Payment Details: </h2>
<h4 style="display: none;" class="bstatus label label-danger" id="status-3"> Payment Expired</h4>
<h4 style="display: none;" class="bstatus label label-danger" id="status-2"> Payment Error</h4>
<h4 style="display: none;" class="bstatus label label-warning" id="status0"> Unconfirmed</h4>
<h4 style="display: none;" class="bstatus label label-warning" id="status1"> Partially Confirmed</h4>
<h4 style="display: none;" class="bstatus label label-success" id="status2" >Confirmed</h4>
<div>
Received : <strong id="received"><?php echo $order->getFormatedBits_payed(); ?></strong>
<small>BTC</small>
</div>
<div style="margin-bottom:10px;" >
Transaction : <span id="transaction"></span>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h1>
Order#: <?php echo sprintf('%08d', $order->getId()); ?>
</h1>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-6">
<h2>Bitcoin Address</h2>
<a href="bitcoin:<?php echo $order->getAddr(); ?>?amount=<?php echo $order->getFormatedBits(); ?>">
<div id="qrcode" class="text-center"></div>
</a>
<br />
<div class="field">
<div class="control">
<input type="text" class="input form-control" value="<?php echo $order->getAddr(); ?>" readonly="readonly">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="progress">
<div class="progress-bar progress-bar-striped active" role="progressbar"
aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:100%" id="timeleft">
100%
</div>
</div>
<div class="col-md-6">
<h2>To pay, send exact amount of BTC to the given address</h2>
<h3>Amount</h3>
<p><strong><?php echo $order->getFormatedBits(); ?></strong> BTC ⇌ <strong><?php echo $order->getTotal_value(); ?></strong> <?php echo $order->getCurrency(); ?></p>
<br />
<h2>Payment Details: </h2>
<h4 style="display: none;" class="bstatus label label-danger" id="status-3"> Payment Expired</h4>
<h4 style="display: none;" class="bstatus label label-danger" id="status-2"> Payment Error</h4>
<h4 style="display: none;" class="bstatus label label-warning" id="status0"> Unconfirmed</h4>
<h4 style="display: none;" class="bstatus label label-warning" id="status1"> Partially Confirmed</h4>
<h4 style="display: none;" class="bstatus label label-success" id="status2">Confirmed</h4>
<div>
Received : <strong id="received"><?php echo $order->getFormatedBits_payed(); ?></strong>
<small>BTC</small>
</div>
<div style="margin-bottom:10px;">
Transaction : <span id="transaction"></span>
</div>
</div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script src="<?php echo getCDN(); ?>plugin/BlockonomicsYPT/jquery.qrcode.min.js" type="text/javascript"></script>
<script>
var totalSeconds = <?php echo $obj->ExpireInSeconds; ?>;
var totalSecondsPassed = <?php echo time() - strtotime($order->getCreated()); ?>;
var totalSecondsleft = totalSeconds - totalSecondsPassed;
$(document).ready(function () {
$('#qrcode').qrcode({width: 220, height: 220, text: "bitcoin:<?php echo $order->getAddr(); ?>?amount=<?php echo $order->getFormatedBits(); ?>"});
<div class="row">
<div class="col-md-12">
<div class="progress">
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:100%" id="timeleft">
100%
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var totalSeconds = <?php echo $obj->ExpireInSeconds; ?>;
var totalSecondsPassed = <?php echo time() - strtotime($order->getCreated()); ?>;
var totalSecondsleft = totalSeconds - totalSecondsPassed;
$(document).ready(function() {
$('#qrcode').qrcode({
width: 220,
height: 220,
text: "bitcoin:<?php echo $order->getAddr(); ?>?amount=<?php echo $order->getFormatedBits(); ?>"
});
setInterval(function () {
totalSecondsleft--;
if (totalSecondsleft < 1) {
totalSecondsleft = 0;
}
var percent = (totalSecondsleft / totalSeconds) * 100;
setInterval(function() {
totalSecondsleft--;
if (totalSecondsleft < 1) {
totalSecondsleft = 0;
}
var percent = (totalSecondsleft / totalSeconds) * 100;
$("#timeleft").css('width', percent + "%").html(totalSecondsleft + " <?php echo __("Seconds Left"); ?>");
}, 1000);
check();
});
$("#timeleft").css('width', percent + "%").html(totalSecondsleft + " <?php echo __("Seconds Left"); ?>");
}, 1000);
check();
});
function check() {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/BlockonomicsYPT/check.php?addr=<?php echo $order->getAddr(); ?>',
success: function (response) {
console.log(response);
if (response.status < 2) {
$("#transaction").html('<a target="_blank" href="http://www.blockonomics.co/api/tx?txid=' + response.txid + '&addr={{<?php echo $order->getAddr(); ?>}}">' + response.txid + '</a>');
$("#received").html((response.bits_payed / 1.0e8));
setTimeout(function () {
check();
}, 3000);
}else{
response.status = 2;
}
$(".bstatus").not("#status"+response.status).hide();
$("#status"+response.status).fadeIn();
}
});
}
</script>
</body>
</html>
function check() {
$.ajax({
url: webSiteRootURL + 'plugin/BlockonomicsYPT/check.php?addr=<?php echo $order->getAddr(); ?>',
success: function(response) {
console.log(response);
if (response.status < 2) {
$("#transaction").html('<a target="_blank" href="http://www.blockonomics.co/api/tx?txid=' + response.txid + '&addr={{<?php echo $order->getAddr(); ?>}}">' + response.txid + '</a>');
$("#received").html((response.bits_payed / 1.0e8));
setTimeout(function() {
check();
}, 3000);
} else {
response.status = 2;
}
$(".bstatus").not("#status" + response.status).hide();
$("#status" + response.status).fadeIn();
}
});
}
</script>
<?php
$_page->print();
?>

View file

@ -99,7 +99,7 @@ $_page->setExtraScripts(
function addBookmark() {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Bookmark/page/bookmarkSave.json.php',
url: webSiteRootURL+'plugin/Bookmark/page/bookmarkSave.json.php',
data: {
"videos_id": <?php echo $_GET['videos_id'] ?>,
"timeInSeconds": timeToSeconds($('#currentTime').val()),
@ -146,7 +146,7 @@ $_page->setExtraScripts(
var index = $(li).attr('index');
var id = $(li).attr('bookmarkId');
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Bookmark/page/bookmarkDelete.json.php',
url: webSiteRootURL+'plugin/Bookmark/page/bookmarkDelete.json.php',
data: {
"id": id
},
@ -164,7 +164,7 @@ $_page->setExtraScripts(
function loadBookmark() {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Bookmark/getBookmarks.json.php?videos_id=<?php echo $_GET['videos_id'] ?>',
url: webSiteRootURL+'plugin/Bookmark/getBookmarks.json.php?videos_id=<?php echo $_GET['videos_id'] ?>',
success: function(response) {
allBookmarksArray = response;
bookmarksArray = (allBookmarksArray.rows);

View file

@ -2,48 +2,30 @@
require_once '../../../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You are not admin"));
forbiddenPage("You are not admin");
exit;
}
$_page = new Page(array('Bookmarks'));
$_page->loadBasicCSSAndJS();
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<?php
echo getHTMLTitle( __("Bookmarks"));
?>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.css"/>
<style>
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container">
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<div class="col-md-6">
<?php
include './editorForm.php';
?>
</div>
<div class="col-md-6">
<?php
include './editorTable.php';
?>
</div>
</div>
<div class="container">
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<div class="col-md-6">
<?php
include './editorForm.php';
?>
</div>
<div class="col-md-6">
<?php
include './editorTable.php';
?>
</div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script type="text/javascript" src="<?php echo getURL('view/css/DataTables/datatables.min.js'); ?>"></script>
</body>
</html>
</div>
</div>
<?php
$_page->print();
?>

View file

@ -34,7 +34,7 @@
evt.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Bookmark/page/bookmarkSave.json.php',
url: webSiteRootURL+'plugin/Bookmark/page/bookmarkSave.json.php',
data: $('#bookmarkForm').serializeArray(),
type: 'post',
success: function (response) {

View file

@ -45,7 +45,7 @@
console.log(data);
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Bookmark/page/bookmarkDelete.json.php',
url: webSiteRootURL+'plugin/Bookmark/page/bookmarkDelete.json.php',
data: {'id': data.id},
type: 'post',
success: function (response) {

View file

@ -1,293 +1,336 @@
<?php
require_once '../../videos/configuration.php';
if (!User::isLogged()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
$obj = AVideoPlugin::getObjectData("BulkEmbed");
$_page = new Page(array('Search'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<?php
echo getHTMLTitle( __("Search"));
?>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<style>
#custom-search-input{
padding: 3px;
border: solid 1px #E4E4E4;
border-radius: 6px;
background-color: #fff;
}
<style>
#custom-search-input {
padding: 3px;
border: solid 1px #E4E4E4;
border-radius: 6px;
background-color: #fff;
}
#custom-search-input input{
border: 0;
box-shadow: none;
}
#custom-search-input input {
border: 0;
box-shadow: none;
}
#custom-search-input button{
margin: 2px 0 0 0;
background: none;
box-shadow: none;
border: 0;
color: #666666;
padding: 0 8px 0 10px;
border-left: solid 1px #ccc;
}
#custom-search-input button {
margin: 2px 0 0 0;
background: none;
box-shadow: none;
border: 0;
color: #666666;
padding: 0 8px 0 10px;
border-left: solid 1px #ccc;
}
#custom-search-input button:hover{
border: 0;
box-shadow: none;
border-left: solid 1px #ccc;
}
#custom-search-input button:hover {
border: 0;
box-shadow: none;
border-left: solid 1px #ccc;
}
#custom-search-input .glyphicon-search{
font-size: 23px;
}
#results li {
padding: 10px 0;
border-bottom: 1px dotted #ccc;
list-style: none;
overflow: auto;
}
.list-left {
float: left;
width: 20%;
}
.list-left img {
width: 100%;
padding: 3px;
border: 1px solid #ccc;
}
.list-right {
float: right;
width: 78%;
}
.list-right h3 {
margin: 0;
}
.list-right p {
margin: 0;
}
#custom-search-input .glyphicon-search {
font-size: 23px;
}
.cTitle {
color: #dd2826;
}
#results li {
padding: 10px 0;
border-bottom: 1px dotted #ccc;
list-style: none;
overflow: auto;
}
.button-container {
margin-top: 25px;
.list-left {
float: left;
width: 20%;
}
}
.list-left img {
width: 100%;
padding: 3px;
border: 1px solid #ccc;
}
.paging-button {
background: #f4f4f4;
padding: 0 13px;
border: #ccc 1px solid;
border-radius: 5px;
color: #333;
margin: 10px;
cursor: pointer;
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container">
.list-right {
float: right;
width: 78%;
}
<div class="panel panel-default">
<div class="panel-heading">
<form id="search-form" name="search-form" onsubmit="return search()">
<div id="custom-search-input">
<div class="input-group col-md-12">
<input type="search" id="query" class="form-control input-lg" placeholder="Search YouTube / PlayList URL" />
<span class="input-group-btn">
<button class="btn btn-info btn-lg" type="submit">
<i class="glyphicon glyphicon-search"></i>
</button>
</span>
</div>
</div>
</form>
<br>
<div class="row">
<div class="col-sm-6">
<button class="btn btn-info btn-block" id="getAll"><?php echo __('Embed All'); ?></button>
</div>
<div class="col-sm-6">
<button class="btn btn-success btn-block" id="getSelected"><?php echo __('Embed Selected'); ?></button>
</div>
.list-right h3 {
margin: 0;
}
.list-right p {
margin: 0;
}
.cTitle {
color: #dd2826;
}
.button-container {
margin-top: 25px;
}
.paging-button {
background: #f4f4f4;
padding: 0 13px;
border: #ccc 1px solid;
border-radius: 5px;
color: #333;
margin: 10px;
cursor: pointer;
}
</style>
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">
<form id="search-form" name="search-form" onsubmit="return search()">
<div id="custom-search-input">
<div class="input-group col-md-12">
<input type="search" id="query" class="form-control input-lg" placeholder="Search YouTube / PlayList URL" />
<span class="input-group-btn">
<button class="btn btn-info btn-lg" type="submit">
<i class="glyphicon glyphicon-search"></i>
</button>
</span>
</div>
</div>
<div class="panel-body">
<ul id="results"></ul>
<div id="buttons"></div>
</form>
<br>
<div class="row">
<div class="col-sm-6">
<button class="btn btn-info btn-block" id="getAll"><?php echo __('Embed All'); ?></button>
</div>
<div class="col-sm-6">
<button class="btn btn-success btn-block" id="getSelected"><?php echo __('Embed Selected'); ?></button>
</div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
<div class="panel-body">
<ul id="results"></ul>
<div id="buttons"></div>
</div>
</div>
</div>
<script>
var gapikey = '<?php echo $obj->API_KEY; ?>';
var playListName = '';
var gapikey = '<?php echo $obj->API_KEY; ?>';
var playListName = '';
$(function() {
$('#search-form').submit(function(e) {
e.preventDefault();
});
$(function () {
$('#search-form').submit(function (e) {
e.preventDefault();
});
$('#getAll').click(function () {
var videoLink = new Array();
$("input:checkbox[name=videoCheckbox]").each(function () {
videoLink.push($(this).val());
});
saveIt(videoLink);
});
$('#getSelected').click(function () {
var videoLink = new Array();
$("input:checkbox[name=videoCheckbox]:checked").each(function () {
videoLink.push($(this).val());
});
saveIt(videoLink);
});
$('#getAll').click(function() {
var videoLink = new Array();
$("input:checkbox[name=videoCheckbox]").each(function() {
videoLink.push($(this).val());
});
saveIt(videoLink);
});
$('#getSelected').click(function() {
var videoLink = new Array();
$("input:checkbox[name=videoCheckbox]:checked").each(function() {
videoLink.push($(this).val());
});
saveIt(videoLink);
});
});
function saveIt(videoLink) {
modal.showPleaseWait();
setTimeout(function () {
var itemsToSave = [];
for (x in videoLink) {
if (typeof videoLink[x] === 'function') {
continue;
}
$.ajax({
url: "https://www.googleapis.com/youtube/v3/videos?id=" + videoLink[x] + "&part=id,snippet,contentDetails&key=" + gapikey,
async: false,
success: function (data) {
var item = {};
item.link = "https://youtube.com/embed/" + data.items[0].id;
item.title = data.items[0].snippet.title;
item.description = data.items[0].snippet.description;
item.duration = data.items[0].contentDetails.duration;
console.log(data.items[0].snippet);
item.thumbs = data.items[0].snippet.thumbnails.high.url;
itemsToSave.push(item);
}
});
function saveIt(videoLink) {
modal.showPleaseWait();
setTimeout(function() {
var itemsToSave = [];
for (x in videoLink) {
if (typeof videoLink[x] === 'function') {
continue;
}
$.ajax({
url: "https://www.googleapis.com/youtube/v3/videos?id=" + videoLink[x] + "&part=id,snippet,contentDetails&key=" + gapikey,
async: false,
success: function(data) {
var item = {};
item.link = "https://youtube.com/embed/" + data.items[0].id;
item.title = data.items[0].snippet.title;
item.description = data.items[0].snippet.description;
item.duration = data.items[0].contentDetails.duration;
console.log(data.items[0].snippet);
item.thumbs = data.items[0].snippet.thumbnails.high.url;
itemsToSave.push(item);
}
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/BulkEmbed/save.json.php',
data: {"itemsToSave": itemsToSave, playListName: playListName},
type: 'post',
success: function (response) {
if (!response.error) {
avideoAlert("<?php echo __("Congratulations!"); ?>", "<?php echo __("Your videos have been saved!"); ?>", "success");
} else {
avideoAlert("<?php echo __("Sorry!"); ?>", response.msg.join("<br>"), "error");
}
modal.hidePleaseWait();
}
});
}, 500);
});
}
function validURL(str) {
var pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
'(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
return !!pattern.test(str);
}
function getFromUrl(url) {
if (!validURL(url)) {
return false;
$.ajax({
url: webSiteRootURL + 'plugin/BulkEmbed/save.json.php',
data: {
"itemsToSave": itemsToSave,
playListName: playListName
},
type: 'post',
success: function(response) {
if (!response.error) {
avideoAlert("<?php echo __("Congratulations!"); ?>", "<?php echo __("Your videos have been saved!"); ?>", "success");
} else {
avideoAlert("<?php echo __("Sorry!"); ?>", response.msg.join("<br>"), "error");
}
modal.hidePleaseWait();
}
});
}, 500);
}
var regex = /[?&]([^=#]+)=([^&#]*)/g,
params = {},
match;
while (match = regex.exec(url)) {
params[match[1]] = match[2];
}
return params;
}
function validURL(str) {
var pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
'(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
return !!pattern.test(str);
}
function getPlayListId(url) {
var result = getFromUrl(url);
if (result && typeof result.list !== 'undefined') {
return result.list;
}
return false;
}
function getFromUrl(url) {
if (!validURL(url)) {
return false;
}
function search() {
// clear
$('#results').html('');
$('#buttons').html('');
var regex = /[?&]([^=#]+)=([^&#]*)/g,
params = {},
match;
while (match = regex.exec(url)) {
params[match[1]] = match[2];
}
return params;
}
// get form input
q = $('#query').val(); // this probably shouldn't be created as a global
function getPlayListId(url) {
var result = getFromUrl(url);
if (result && typeof result.list !== 'undefined') {
return result.list;
}
return false;
}
var playListId = getPlayListId(q);
function search() {
// clear
$('#results').html('');
$('#buttons').html('');
if (playListId) {
// get form input
q = $('#query').val(); // this probably shouldn't be created as a global
var playListId = getPlayListId(q);
if (playListId) {
$.get(
"https://www.googleapis.com/youtube/v3/playlists", {
part: 'snippet',
key: gapikey,
id: playListId
},
function(data) {
playListName = data.items[0].snippet.title;
$.get(
"https://www.googleapis.com/youtube/v3/playlists", {
part: 'snippet',
key: gapikey,
id: playListId
}, function (data) {
playListName = data.items[0].snippet.title;
$.get(
"https://www.googleapis.com/youtube/v3/playlistItems", {
part: 'snippet, id',
q: q,
type: 'video',
key: gapikey,
maxResults: 50,
videoEmbeddable: "true",
videoSyndicated: "true",
playlistId: playListId
}, function (data) {
"https://www.googleapis.com/youtube/v3/playlistItems", {
part: 'snippet, id',
q: q,
type: 'video',
key: gapikey,
maxResults: 50,
videoEmbeddable: "true",
videoSyndicated: "true",
playlistId: playListId
},
function(data) {
processData(data);
});
});
} else {
playListName = '';
// run get request on API
$.get(
"https://www.googleapis.com/youtube/v3/search", {
part: 'snippet, id',
q: q,
type: 'video',
key: gapikey,
maxResults: 50,
videoSyndicated: "true",
videoEmbeddable: "true"
}, function (data) {
processData(data);
});
}
});
} else {
playListName = '';
// run get request on API
$.get(
"https://www.googleapis.com/youtube/v3/search", {
part: 'snippet, id',
q: q,
type: 'video',
key: gapikey,
maxResults: 50,
videoSyndicated: "true",
videoEmbeddable: "true"
},
function(data) {
processData(data);
});
}
}
}
function processData(data) {
var nextPageToken = data.nextPageToken;
var prevPageToken = data.prevPageToken;
// Log data
//console.log(data);
$.each(data.items, function(i, item) {
// Get Output
var output = getOutput(item);
// display results
$('#results').append(output);
});
var buttons = getButtons(prevPageToken, nextPageToken);
// Display buttons
$('#buttons').append(buttons);
}
// Next page function
function nextPage() {
var token = $('#next-button').data('token');
var q = $('#next-button').data('query');
// clear
$('#results').html('');
$('#buttons').html('');
// get form input
q = $('#query').val(); // this probably shouldn't be created as a global
// run get request on API
$.get(
"https://www.googleapis.com/youtube/v3/search", {
part: 'snippet, id',
q: q,
pageToken: token,
type: 'video',
key: gapikey,
maxResults: 50,
videoEmbeddable: "true"
},
function(data) {
function processData(data) {
var nextPageToken = data.nextPageToken;
var prevPageToken = data.prevPageToken;
// Log data
//console.log(data);
console.log(data);
$.each(data.items, function(i, item) {
$.each(data.items, function (i, item) {
// Get Output
var output = getOutput(item);
@ -299,153 +342,110 @@ $obj = AVideoPlugin::getObjectData("BulkEmbed");
// Display buttons
$('#buttons').append(buttons);
}
});
}
// Next page function
function nextPage() {
var token = $('#next-button').data('token');
var q = $('#next-button').data('query');
// Previous page function
function prevPage() {
var token = $('#prev-button').data('token');
var q = $('#prev-button').data('query');
// clear
$('#results').html('');
$('#buttons').html('');
// clear
$('#results').html('');
$('#buttons').html('');
// get form input
q = $('#query').val(); // this probably shouldn't be created as a global
// get form input
q = $('#query').val(); // this probably shouldn't be created as a global
// run get request on API
$.get(
"https://www.googleapis.com/youtube/v3/search", {
part: 'snippet, id',
q: q,
pageToken: token,
type: 'video',
key: gapikey,
maxResults: 50,
videoEmbeddable: "true"
}, function (data) {
// run get request on API
$.get(
"https://www.googleapis.com/youtube/v3/search", {
part: 'snippet, id',
q: q,
pageToken: token,
type: 'video',
key: gapikey,
maxResults: 50,
videoEmbeddable: "true"
},
function(data) {
var nextPageToken = data.nextPageToken;
var prevPageToken = data.prevPageToken;
var nextPageToken = data.nextPageToken;
var prevPageToken = data.prevPageToken;
// Log data
console.log(data);
// Log data
console.log(data);
$.each(data.items, function (i, item) {
$.each(data.items, function(i, item) {
// Get Output
var output = getOutput(item);
// Get Output
var output = getOutput(item);
// display results
$('#results').append(output);
});
var buttons = getButtons(prevPageToken, nextPageToken);
// Display buttons
$('#buttons').append(buttons);
// display results
$('#results').append(output);
});
}
// Previous page function
function prevPage() {
var token = $('#prev-button').data('token');
var q = $('#prev-button').data('query');
var buttons = getButtons(prevPageToken, nextPageToken);
// Display buttons
$('#buttons').append(buttons);
});
}
// clear
$('#results').html('');
$('#buttons').html('');
// Build output
function getOutput(item) {
console.log(item);
var videoID;
if (typeof item.snippet.thumbnails === 'undefined') {
return true;
}
if (item.id.videoId) {
videoID = item.id.videoId;
} else {
videoID = item.snippet.resourceId.videoId;
}
var title = item.snippet.title;
var description = item.snippet.description;
var thumb = item.snippet.thumbnails.high.url;
var channelTitle = item.snippet.channelTitle;
var videoDate = item.snippet.publishedAt;
// get form input
q = $('#query').val(); // this probably shouldn't be created as a global
// Build output string
var output = '<li>' +
'<div class="list-left">' +
'<img src="' + thumb + '">' +
'</div>' +
'<div class="list-right">' +
'<h3><input type="checkbox" value="' + videoID + '" name="videoCheckbox"><a target="_blank" href="https://youtube.com/embed/' + videoID + '?rel=0">' + title + '</a></h3>' +
'<small>By <span class="cTitle">' + channelTitle + '</span> on ' + videoDate + '</small>' +
'<p>' + description + '</p>' +
'</div>' +
'</li>' +
'<div class="clearfix"></div>' +
'';
return output;
}
// run get request on API
$.get(
"https://www.googleapis.com/youtube/v3/search", {
part: 'snippet, id',
q: q,
pageToken: token,
type: 'video',
key: gapikey,
maxResults: 50,
videoEmbeddable: "true"
}, function (data) {
function getButtons(prevPageToken, nextPageToken) {
if (!prevPageToken) {
var btnoutput = '<div class="button-container">' +
'<button id="next-button" class="paging-button" data-token="' + nextPageToken + '" data-query="' + q + '"' +
'onclick = "nextPage();">Next Page</button>' +
'</div>';
} else {
var btnoutput = '<div class="button-container">' +
'<button id="prev-button" class="paging-button" data-token="' + prevPageToken + '" data-query="' + q + '"' +
'onclick = "prevPage();">Prev Page</button>' +
'<button id="next-button" class="paging-button" data-token="' + nextPageToken + '" data-query="' + q + '"' +
'onclick = "nextPage();">Next Page</button>' +
'</div>';
}
var nextPageToken = data.nextPageToken;
var prevPageToken = data.prevPageToken;
return btnoutput;
}
</script>
// Log data
console.log(data);
$.each(data.items, function (i, item) {
// Get Output
var output = getOutput(item);
// display results
$('#results').append(output);
});
var buttons = getButtons(prevPageToken, nextPageToken);
// Display buttons
$('#buttons').append(buttons);
});
}
// Build output
function getOutput(item) {
console.log(item);
var videoID;
if(typeof item.snippet.thumbnails === 'undefined'){
return true;
}
if(item.id.videoId){
videoID = item.id.videoId;
}else{
videoID = item.snippet.resourceId.videoId;
}
var title = item.snippet.title;
var description = item.snippet.description;
var thumb = item.snippet.thumbnails.high.url;
var channelTitle = item.snippet.channelTitle;
var videoDate = item.snippet.publishedAt;
// Build output string
var output = '<li>' +
'<div class="list-left">' +
'<img src="' + thumb + '">' +
'</div>' +
'<div class="list-right">' +
'<h3><input type="checkbox" value="' + videoID + '" name="videoCheckbox"><a target="_blank" href="https://youtube.com/embed/' + videoID + '?rel=0">' + title + '</a></h3>' +
'<small>By <span class="cTitle">' + channelTitle + '</span> on ' + videoDate + '</small>' +
'<p>' + description + '</p>' +
'</div>' +
'</li>' +
'<div class="clearfix"></div>' +
'';
return output;
}
function getButtons(prevPageToken, nextPageToken) {
if (!prevPageToken) {
var btnoutput = '<div class="button-container">' +
'<button id="next-button" class="paging-button" data-token="' + nextPageToken + '" data-query="' + q + '"' +
'onclick = "nextPage();">Next Page</button>' +
'</div>';
} else {
var btnoutput = '<div class="button-container">' +
'<button id="prev-button" class="paging-button" data-token="' + prevPageToken + '" data-query="' + q + '"' +
'onclick = "prevPage();">Prev Page</button>' +
'<button id="next-button" class="paging-button" data-token="' + nextPageToken + '" data-query="' + q + '"' +
'onclick = "nextPage();">Next Page</button>' +
'</div>';
}
return btnoutput;
}
</script>
</body>
</html>
<?php
$_page->print();
?>

View file

@ -12,31 +12,18 @@ if (!Video::canEdit($videos_id)) {
}
$video = Video::getVideoLight($videos_id);
$_page = new Page(array('Move Storage'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo $config->getWebSiteTitle(); ?> :: Move Storage</title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<?php
$isMoving = CDNStorage::isMoving($videos_id);
if (!empty($isMoving)) {
include './panelIsMoving.php';
} else {
include './panelMove.php';
}
?>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
<div class="container-fluid">
<?php
$isMoving = CDNStorage::isMoving($videos_id);
if (!empty($isMoving)) {
include './panelIsMoving.php';
} else {
include './panelMove.php';
}
?>
</div>
<?php
$_page->print();
?>

View file

@ -26,87 +26,73 @@ $height = 'calc(50vh - 50px)';
if (count($downloadOptions) == 1) {
$height = 'calc(100vh - 50px)';
}
$_page = new Page(array('Download Video'));
$_page->setExtraScripts(array('view/js/script.download.js'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo $config->getWebSiteTitle(); ?> :: Download Video</title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<style>
#downloadButtons .btn {
height: <?php echo $height; ?>;
font-size: 30px;
}
<style>
#downloadButtons .btn {
height: <?php echo $height; ?>;
font-size: 30px;
}
#downloadButtons a.btn span {
display: block !important;
white-space: break-spaces;
padding-top: 15vh;
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div id="downloadButtons">
<?php
$count = 0;
$lastURL = '';
$lastFormat = '';
foreach ($downloadOptions as $theLink) {
if (!empty($theLink)) {
$count++;
$lastURL = $theLink['url'];
$progress = $theLink['progress'];
$lastFormat = strtolower($theLink['name']);
?>
<button type="button" onclick="_goToURLOrAlertError('<?php echo $lastURL; ?>', '<?php echo $progress; ?>', '<?php echo $lastFormat; ?>');" class="btn btn-default btn-light btn-lg btn-block" target="_blank">
<i class="fas fa-download"></i> <?php echo __('Download'); ?> <?php echo $theLink['name']; ?>
</button>
<?php
}
}
$convertedFile = "{$global['systemRootPath']}videos/{$video['filename']}/index.mp4";
if (User::isAdmin() && file_exists($convertedFile)) {
$deleteURL = addQueryStringParameter($lastURL, 'delete', 1);
?>
<button type="button" onclick="avideoAlertAJAX('<?php echo $deleteURL; ?>');" class="btn btn-danger btn-block">
<i class="fa-solid fa-trash"></i> <?php echo __('Delete'); ?>
#downloadButtons a.btn span {
display: block !important;
white-space: break-spaces;
padding-top: 15vh;
}
</style>
<div class="container-fluid">
<div id="downloadButtons">
<?php
$count = 0;
$lastURL = '';
$lastFormat = '';
foreach ($downloadOptions as $theLink) {
if (!empty($theLink)) {
$count++;
$lastURL = $theLink['url'];
$progress = $theLink['progress'];
$lastFormat = strtolower($theLink['name']);
?>
<button type="button" onclick="_goToURLOrAlertError('<?php echo $lastURL; ?>', '<?php echo $progress; ?>', '<?php echo $lastFormat; ?>');" class="btn btn-default btn-light btn-lg btn-block" target="_blank">
<i class="fas fa-download"></i> <?php echo __('Download'); ?> <?php echo $theLink['name']; ?>
</button>
<?php
} else {
echo "<!-- converted file does not exists {$convertedFile} -->";
}
?>
</div>
</div>
<script>
function _goToURLOrAlertError(url, progress, format) {
avideoToastSuccess(<?php echo json_encode(__('Downloading') . '... ' . $video['title']); ?>);
downloadURLOrAlertError(url, {}, '<?php echo $video['clean_title']; ?>.' + format, progress);
}
</script>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
if ($count == 1) {
?>
<script>
$(function() {
_goToURLOrAlertError('<?php echo $lastURL; ?>', '<?php echo $progress; ?>', '<?php echo $lastFormat; ?>');
});
</script>
<?php
$convertedFile = "{$global['systemRootPath']}videos/{$video['filename']}/index.mp4";
if (User::isAdmin() && file_exists($convertedFile)) {
$deleteURL = addQueryStringParameter($lastURL, 'delete', 1);
?>
<button type="button" onclick="avideoAlertAJAX('<?php echo $deleteURL; ?>');" class="btn btn-danger btn-block">
<i class="fa-solid fa-trash"></i> <?php echo __('Delete'); ?>
</button>
<?php
} else {
echo "<!-- converted file does not exists {$convertedFile} -->";
}
?>
</div>
</div>
<script>
function _goToURLOrAlertError(url, progress, format) {
avideoToastSuccess(<?php echo json_encode(__('Downloading') . '... ' . $video['title']); ?>);
downloadURLOrAlertError(url, {}, '<?php echo $video['clean_title']; ?>.' + format, progress);
}
?>
<script src="<?php echo getURL('view/js/script.download.js'); ?>" type="text/javascript"></script>
</body>
</html>
</script>
<?php
if ($count == 1) {
?>
<script>
$(function() {
_goToURLOrAlertError('<?php echo $lastURL; ?>', '<?php echo $progress; ?>', '<?php echo $lastFormat; ?>');
});
</script>
<?php
}
?>
<?php
$_page->print();
?>

View file

@ -7,160 +7,154 @@ if (!isset($global['systemRootPath'])) {
$plugin = AVideoPlugin::loadPluginIfEnabled('CloneSite');
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<?php
echo getHTMLTitle(__("Clone Site"));
?>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.css"/>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fas fa-clone"></i> <?php echo __("Manage Clones"); ?>
</div>
<div class="panel-body">
<table id="campaignTable" class="display" width="100%" cellspacing="0">
<thead>
<tr>
<th><?php echo __("URL"); ?></th>
<th><?php echo __("Key"); ?></th>
<th><?php echo __("Last Clone"); ?></th>
<th><?php echo __("Status"); ?></th>
<th></th>
</tr>
</thead>
<tfoot>
<tr>
<th><?php echo __("URL"); ?></th>
<th><?php echo __("Key"); ?></th>
<th><?php echo __("Last Clone"); ?></th>
<th><?php echo __("Status"); ?></th>
<th></th>
</tr>
</tfoot>
</table>
</div>
</div>
$_page = new Page(array('Clone Site'));
$_page->setExtraScripts(
array(
'view/css/DataTables/datatables.min.js',
'view/js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js'
)
);
$_page->setExtraStyles(
array(
'view/css/DataTables/datatables.min.css',
'view/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css'
)
);
?><div class="container">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fas fa-clone"></i> <?php echo __("Manage Clones"); ?>
</div>
<div id="btnModelLinks" style="display: none;">
<div class="btn-group pull-right">
<button href="" class="editor_status btn {status-class} btn-xs">
<i class="{status-icon}"></i> {status-text}
</button>
<button href="" class="editor_delete_link btn btn-danger btn-xs">
<i class="fa fa-trash"></i>
</button>
</div>
<div class="panel-body">
<table id="campaignTable" class="display" width="100%" cellspacing="0">
<thead>
<tr>
<th><?php echo __("URL"); ?></th>
<th><?php echo __("Key"); ?></th>
<th><?php echo __("Last Clone"); ?></th>
<th><?php echo __("Status"); ?></th>
<th></th>
</tr>
</thead>
<tfoot>
<tr>
<th><?php echo __("URL"); ?></th>
<th><?php echo __("Key"); ?></th>
<th><?php echo __("Last Clone"); ?></th>
<th><?php echo __("Status"); ?></th>
<th></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div id="btnModelLinks" style="display: none;">
<div class="btn-group pull-right">
<button href="" class="editor_status btn {status-class} btn-xs">
<i class="{status-icon}"></i> {status-text}
</button>
<button href="" class="editor_delete_link btn btn-danger btn-xs">
<i class="fa fa-trash"></i>
</button>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script type="text/javascript" src="<?php echo getURL('view/css/DataTables/datatables.min.js'); ?>"></script>
<script type="text/javascript">
$(document).ready(function () {
var tableLinks = $('#campaignTable').DataTable({
"ajax": "<?php echo $global['webSiteRootURL']; ?>plugin/CloneSite/clones.json.php",
"columns": [
{"data": "url"},
{"data": "key"},
{"data": "last_clone_request"},
{
data: 'status',
"render": function (data, type, full, meta) {
var content = "<span class='label label-success'>Active</span>";
if(full.status === 'i'){
content = "<span class='label label-danger'>Inactive</span>";
}
return content;
}
},
{
data: 'status',
"render": function (data, type, full, meta) {
var content = $('#btnModelLinks').html();
if(full.status === 'i'){
content = content.replace("{status-class}", "btn-success");
content = content.replace("{status-icon}", "fas fa-check-square");
content = content.replace("{status-text}", "Activate");
}else{
content = content.replace("{status-class}", "btn-default");
content = content.replace("{status-icon}", "fas fa-ban");
content = content.replace("{status-text}", "Deactivate");
}
return content;
}
var tableLinks = $('#campaignTable').DataTable({
"ajax": "<?php echo $global['webSiteRootURL']; ?>plugin/CloneSite/clones.json.php",
"columns": [{
"data": "url"
},
{
"data": "key"
},
{
"data": "last_clone_request"
},
{
data: 'status',
"render": function(data, type, full, meta) {
var content = "<span class='label label-success'>Active</span>";
if (full.status === 'i') {
content = "<span class='label label-danger'>Inactive</span>";
}
],
select: true,
});
$('#campaignTable').on('click', 'button.editor_status', function (e) {
e.preventDefault();
var tr = $(this).closest('tr')[0];
var data = tableLinks.row(tr).data();
modal.showPleaseWait();
$.ajax({
type: "POST",
url: "<?php echo $global['webSiteRootURL']; ?>plugin/CloneSite/changeStatus.json.php",
data: data
}).done(function (resposta) {
if (resposta.error) {
avideoAlert("<?php echo __("Sorry!"); ?>", resposta.msg, "error");
return content;
}
},
{
data: 'status',
"render": function(data, type, full, meta) {
var content = $('#btnModelLinks').html();
if (full.status === 'i') {
content = content.replace("{status-class}", "btn-success");
content = content.replace("{status-icon}", "fas fa-check-square");
content = content.replace("{status-text}", "Activate");
} else {
content = content.replace("{status-class}", "btn-default");
content = content.replace("{status-icon}", "fas fa-ban");
content = content.replace("{status-text}", "Deactivate");
}
tableLinks.ajax.reload();
modal.hidePleaseWait();
});
});
$('#campaignTable').on('click', 'button.editor_delete_link', function (e) {
e.preventDefault();
var tr = $(this).closest('tr')[0];
var data = tableLinks.row(tr).data();
swal({
title: "<?php echo __("Are you sure?"); ?>",
text: "<?php echo __("You will not be able to recover this action!"); ?>",
icon: "warning",
buttons: true,
dangerMode: true,
})
.then(function(willDelete) {
if (willDelete) {
modal.showPleaseWait();
$.ajax({
type: "POST",
url: "<?php echo $global['webSiteRootURL']; ?>plugin/CloneSite/delete.json.php",
data: data
return content;
}
}
],
select: true,
});
$('#campaignTable').on('click', 'button.editor_status', function(e) {
e.preventDefault();
var tr = $(this).closest('tr')[0];
var data = tableLinks.row(tr).data();
modal.showPleaseWait();
$.ajax({
type: "POST",
url: "<?php echo $global['webSiteRootURL']; ?>plugin/CloneSite/changeStatus.json.php",
data: data
}).done(function (resposta) {
if (resposta.error) {
avideoAlert("<?php echo __("Sorry!"); ?>", resposta.msg, "error");
}
tableLinks.ajax.reload();
modal.hidePleaseWait();
});
}
}).done(function(resposta) {
if (resposta.error) {
avideoAlert("<?php echo __("Sorry!"); ?>", resposta.msg, "error");
}
tableLinks.ajax.reload();
modal.hidePleaseWait();
});
});
$('#campaignTable').on('click', 'button.editor_delete_link', function(e) {
e.preventDefault();
var tr = $(this).closest('tr')[0];
var data = tableLinks.row(tr).data();
swal({
title: "<?php echo __("Are you sure?"); ?>",
text: "<?php echo __("You will not be able to recover this action!"); ?>",
icon: "warning",
buttons: true,
dangerMode: true,
})
.then(function(willDelete) {
if (willDelete) {
modal.showPleaseWait();
$.ajax({
type: "POST",
url: "<?php echo $global['webSiteRootURL']; ?>plugin/CloneSite/delete.json.php",
data: data
}).done(function(resposta) {
if (resposta.error) {
avideoAlert("<?php echo __("Sorry!"); ?>", resposta.msg, "error");
}
tableLinks.ajax.reload();
modal.hidePleaseWait();
});
}
});
});
</script>
</body>
</html>
});
});
</script>
<?php
$_page->print();
?>

View file

@ -105,7 +105,7 @@ if (!User::isAdmin()) {
$(document).ready(function () {
$('#addCategories_has_users_groupsBtn').click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/View/addCategories_has_users_groupsVideo.php',
url: webSiteRootURL+'plugin/CustomizeUser/View/addCategories_has_users_groupsVideo.php',
data: $('#panelCategories_has_users_groupsForm').serialize(),
type: 'post',
success: function (response) {
@ -145,7 +145,7 @@ if (!User::isAdmin()) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/View/Categories_has_users_groups/add.json.php',
url: webSiteRootURL+'plugin/CustomizeUser/View/Categories_has_users_groups/add.json.php',
data: $('#panelCategories_has_users_groupsForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
@ -124,7 +124,7 @@ if (!User::isAdmin()) {
$(document).ready(function () {
$('#addUsers_affiliationsBtn').click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/View/addUsers_affiliationsVideo.php',
url: webSiteRootURL+'plugin/CustomizeUser/View/addUsers_affiliationsVideo.php',
data: $('#panelUsers_affiliationsForm').serialize(),
type: 'post',
success: function (response) {
@ -167,7 +167,7 @@ if (!User::isAdmin()) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/View/Users_affiliations/add.json.php',
url: webSiteRootURL+'plugin/CustomizeUser/View/Users_affiliations/add.json.php',
data: $('#panelUsers_affiliationsForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -153,7 +153,7 @@ if (!User::isAdmin()) {
});
$('#addUsers_extra_infoBtn').click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/View/addUsers_extra_infoVideo.php',
url: webSiteRootURL+'plugin/CustomizeUser/View/addUsers_extra_infoVideo.php',
data: $('#panelUsers_extra_infoForm').serialize(),
type: 'post',
success: function (response) {
@ -199,7 +199,7 @@ if (!User::isAdmin()) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/View/Users_extra_info/add.json.php',
url: webSiteRootURL+'plugin/CustomizeUser/View/Users_extra_info/add.json.php',
data: $('#panelUsers_extra_infoForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -4,54 +4,38 @@ if (!User::isAdmin()) {
forbiddenPage("Must be admin");
}
AVideoPlugin::loadPlugin("CustomizeUser");
$_page = new Page(array('Customize User'));
$_page->loadBasicCSSAndJS();
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo $config->getWebSiteTitle(); ?> :: CustomizeUser</title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.css"/>
<link href="<?php echo getCDN(); ?>view/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-user"></i> <?php echo __('CustomizeUser') ?></div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#Categories_has_users_groups"><i class="fas fa-list"></i> <?php echo __("Categories"); ?> <i class="fas fa-times"></i> <i class="fas fa-users"></i> <?php echo __("Categories Has Users Groups"); ?></a></li>
<li class=""><a data-toggle="tab" href="#Users_extra_info"><i class="fas fa-address-book"></i> <?php echo __("Users Extra Info"); ?></a></li>
<li class=""><a data-toggle="tab" href="#Users_affiliations"><i class="fas fa-child"></i> <?php echo __("Users Affiliations"); ?></a></li>
</ul>
<div class="tab-content">
<div id="Categories_has_users_groups" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/CustomizeUser/View/Categories_has_users_groups/index_body.php';
?>
</div>
<div id="Users_extra_info" class="tab-pane fade " style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/CustomizeUser/View/Users_extra_info/index_body.php';
?>
</div>
<div id="Users_affiliations" class="tab-pane fade" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/CustomizeUser/View/Users_affiliations/index_body.php';
?>
</div>
</div>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-user"></i> <?php echo __('CustomizeUser') ?></div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#Categories_has_users_groups"><i class="fas fa-list"></i> <?php echo __("Categories"); ?> <i class="fas fa-times"></i> <i class="fas fa-users"></i> <?php echo __("Categories Has Users Groups"); ?></a></li>
<li class=""><a data-toggle="tab" href="#Users_extra_info"><i class="fas fa-address-book"></i> <?php echo __("Users Extra Info"); ?></a></li>
<li class=""><a data-toggle="tab" href="#Users_affiliations"><i class="fas fa-child"></i> <?php echo __("Users Affiliations"); ?></a></li>
</ul>
<div class="tab-content">
<div id="Categories_has_users_groups" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/CustomizeUser/View/Categories_has_users_groups/index_body.php';
?>
</div>
<div id="Users_extra_info" class="tab-pane fade " style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/CustomizeUser/View/Users_extra_info/index_body.php';
?>
</div>
<div id="Users_affiliations" class="tab-pane fade" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/CustomizeUser/View/Users_affiliations/index_body.php';
?>
</div>
</div>
</div>
<script type="text/javascript" src="<?php echo getURL('view/css/DataTables/datatables.min.js'); ?>"></script>
<script src="<?php echo getCDN(); ?>js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
</div>
</div>
<?php
$_page->print();
?>

View file

@ -94,7 +94,7 @@
var data = Users_affiliationstableVar.row(tr).data();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/View/Users_affiliations/confirm.json.php',
url: webSiteRootURL+'plugin/CustomizeUser/View/Users_affiliations/confirm.json.php',
data: {id: data.id, confirm: confirm},
type: 'post',
success: function (response) {
@ -108,7 +108,7 @@
$(document).ready(function () {
$('#addUsers_affiliationsBtn').click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/View/addUsers_affiliationsVideo.php',
url: webSiteRootURL+'plugin/CustomizeUser/View/addUsers_affiliationsVideo.php',
data: $('#panelUsers_affiliationsForm').serialize(),
type: 'post',
success: function (response) {
@ -164,7 +164,7 @@ echo 'var sendConfirmationCancelButton = row.company_agree_date && row.affiliate
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/View/Users_affiliations/add.json.php',
url: webSiteRootURL+'plugin/CustomizeUser/View/Users_affiliations/add.json.php',
data: $('#panelUsers_affiliationsForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -118,7 +118,7 @@ if ($obj->allowWalletDirectTransferDonation && !empty($video['users_id']) && cla
function submitDonation<?php echo $uid; ?>() {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/donate.json.php',
url: webSiteRootURL+'plugin/CustomizeUser/donate.json.php',
data: {
"value": $('#donationValue<?php echo $uid; ?>').val(),
"videos_id": <?php echo intval(@$video['id']); ?>,
@ -144,7 +144,7 @@ if ($obj->allowWalletDirectTransferDonation && !empty($video['users_id']) && cla
function submitDonationButton<?php echo $uid; ?>(buttonIndex) {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/donate.json.php',
url: webSiteRootURL+'plugin/CustomizeUser/donate.json.php',
data: {
"buttonIndex": buttonIndex,
"videos_id": <?php echo intval(@$video['id']); ?>,

View file

@ -8,97 +8,88 @@ if (!empty($images->posterPortrait) && !ImagesPlaceHolders::isDefaultImage($imag
}
$imgw = 1280;
$imgh = 720;
$ogURL = Video::getLinkToVideo($video['id'], $video['clean_title'], false,false);
$ogURL = Video::getLinkToVideo($video['id'], $video['clean_title'], false, false);
$_page = new Page(array('Confirm Password'));
$_page->setIncludeNavbar(false);
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo __("Confirm Password") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<style>
body {
padding-top: 0;
}
footer{
display: none;
}
#bg{
position: fixed;
width: 100%;
height: 100%;
background-image: url('<?php echo $images->poster; ?>');
background-size: cover;
opacity: 0.3;
filter: alpha(opacity=30); /* For IE8 and earlier */
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
//include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div id="bg"></div>
<style>
body {
padding-top: 0;
}
<!-- Modal -->
<div id="myModal" class="modal fade in" role="dialog">
<div class="modal-dialog">
footer {
display: none;
}
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title">
<center>
<i class="fas fa-lock"></i> <?php echo $video['title']; ?> <?php echo __("is Private"); ?>
</center>
</h1>
#bg {
position: fixed;
width: 100%;
height: 100%;
background-image: url('<?php echo $images->poster; ?>');
background-size: cover;
opacity: 0.3;
filter: alpha(opacity=30);
/* For IE8 and earlier */
}
</style>
<div id="bg"></div>
<!-- Modal -->
<div id="myModal" class="modal fade in" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title">
<center>
<i class="fas fa-lock"></i> <?php echo $video['title']; ?> <?php echo __("is Private"); ?>
</center>
</h1>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<img src="<?php echo $img; ?>" class="img img-responsive" />
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<img src="<?php echo $img; ?>" class="img img-responsive"/>
</div>
<div class="col-sm-6">
<center>
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
<?php
if (!empty($_REQUEST['video_password'])) {
?>
<div class="alert alert-danger"><?php echo __("Your password does not match!"); ?></div>
<?php
}
?>
<div class="form-group">
<label for="video_password"><?php echo __("This Video Requires a Password"); ?></label>
<?php
echo getInputPassword('video_password', 'class="form-control"', __("Password"));
?>
</div>
<div class="row">
<div class="col-md-6">
<button type="submit" class="btn btn-success btn-block"><i class="fas fa-check-circle"></i> <?php echo __("Confirm"); ?></button>
</div>
<div class="col-md-6">
<a href="<?php echo getHomePageURL(); ?>" class="btn btn-danger btn-block"><i class="fas fa-times-circle"></i> <?php echo __("Cancel"); ?></a>
</div>
</div>
</form>
</center>
</div>
</div>
<div class="col-sm-6">
<center>
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
<?php
if (!empty($_REQUEST['video_password'])) {
?>
<div class="alert alert-danger"><?php echo __("Your password does not match!"); ?></div>
<?php
}
?>
<div class="form-group">
<label for="video_password"><?php echo __("This Video Requires a Password"); ?></label>
<?php
echo getInputPassword('video_password', 'class="form-control"', __("Password"));
?>
</div>
<div class="row">
<div class="col-md-6">
<button type="submit" class="btn btn-success btn-block"><i class="fas fa-check-circle"></i> <?php echo __("Confirm"); ?></button>
</div>
<div class="col-md-6">
<a href="<?php echo getHomePageURL(); ?>" class="btn btn-danger btn-block"><i class="fas fa-times-circle"></i> <?php echo __("Cancel"); ?></a>
</div>
</div>
</form>
</center>
</div>
</div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script type="text/javascript">
$(window).on('load', function () {
$('#myModal').modal('show');
});
</script>
</body>
</html>
</div>
</div>
<script type="text/javascript">
$(window).on('load', function() {
$('#myModal').modal('show');
});
</script>
<?php
$_page->print();
?>

View file

@ -20,52 +20,39 @@ if (empty($sources)) {
forbiddenPage("Empty sources");
}
//var_dump($sources);
$_page = new Page(array('Customize User'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo $config->getWebSiteTitle(); ?> :: CustomizeUser</title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fas fa-file"></i> <?php echo __('Source Files') ?>
</div>
<div class="panel-body">
<?php
foreach ($sources as $key => $value) {
?>
<div class="panel panel-default">
<div class="panel-heading">
<h1><?php echo strtoupper($key); ?></h1>
</div>
<div class="panel-body">
<?php
if(is_string($value)){
echo "$value <br>";
}else{
foreach ($value as $key2 => $value2) {
echo "<strong class='badge '>{$key2}</strong> $value2 <br>";
}
}
?>
</div>
</div>
<?php
}
?>
</div>
</div>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fas fa-file"></i> <?php echo __('Source Files') ?>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
<div class="panel-body">
<?php
foreach ($sources as $key => $value) {
?>
<div class="panel panel-default">
<div class="panel-heading">
<h1><?php echo strtoupper($key); ?></h1>
</div>
<div class="panel-body">
<?php
if (is_string($value)) {
echo "$value <br>";
} else {
foreach ($value as $key2 => $value2) {
echo "<strong class='badge '>{$key2}</strong> $value2 <br>";
}
}
?>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php
$_page->print();
?>

View file

@ -9,59 +9,49 @@ if (empty($users_id)) {
forbiddenPage('Empty users_id');
}
$pass = User::getProfilePassword($users_id);
$_page = new Page(array('Set Password'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo __("Set Password"); ?></title>
<div class="panel panel-default">
<div class="panel-heading">
<?php
include $global['systemRootPath'] . 'view/include/head.php';
echo Video::getCreatorHTML($users_id);
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<div class="panel panel-default">
<div class="panel-heading">
<?php
echo Video::getCreatorHTML($users_id);
?>
</div>
<div class="panel-body">
Protect the user's channel with a password
<?php
echo getInputPassword('ProfilePassword', 'maxlength="100" value="'.$pass.'" class="form-control"', __('Channel Password'));
?>
</div>
<div class="panel-footer">
<button class="btn btn-success btn-lg btn-block" onclick="setSubscribers();">
<i class="fas fa-save"></i> <?php echo __('Save'); ?>
</button>
</div>
</div>
</div>
<div class="panel-body">
Protect the user's channel with a password
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
echo getInputPassword('ProfilePassword', 'maxlength="100" value="' . $pass . '" class="form-control"', __('Channel Password'));
?>
<script type="text/javascript">
function setSubscribers() {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/CustomizeUser/setPassword.json.php',
method: 'POST',
data: {
users_id: <?php echo $users_id; ?>,
ProfilePassword: $('#ProfilePassword').val()
},
success: function (response) {
modal.hidePleaseWait();
avideoResponse(response);
}
});
</div>
<div class="panel-footer">
<button class="btn btn-success btn-lg btn-block" onclick="setSubscribers();">
<i class="fas fa-save"></i> <?php echo __('Save'); ?>
</button>
</div>
</div>
<script type="text/javascript">
function setSubscribers() {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/CustomizeUser/setPassword.json.php',
method: 'POST',
data: {
users_id: <?php echo $users_id; ?>,
ProfilePassword: $('#ProfilePassword').val()
},
success: function(response) {
modal.hidePleaseWait();
avideoResponse(response);
}
$(document).ready(function () {
});
}
$(document).ready(function() {
$('#ProfilePassword').keyup(function () {
$(this).val($(this).val().replace(/[^0-9a-z]/i, ''));
});
});
</script>
</body>
</html>
$('#ProfilePassword').keyup(function() {
$(this).val($(this).val().replace(/[^0-9a-z]/i, ''));
});
});
</script>
<?php
$_page->print();
?>

View file

@ -9,51 +9,44 @@ if (empty($users_id)) {
forbiddenPage('Empty users_id');
}
$count = User::getExtraSubscribers($users_id);
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo __("Set subscribers"); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<div class="panel panel-default">
<div class="panel-heading">
<?php
echo Video::getCreatorHTML($users_id);
?>
</div>
<div class="panel-body">
Add extra <input type="number" step="1" id="ExtraSubscribers" value="<?php echo $count; ?>"/> subscribers on his subscription counter.
$_page = new Page(array('Set subscribers'));
</div>
<div class="panel-footer">
<button class="btn btn-success btn-lg btn-block" onclick="setSubscribers();">
<i class="fas fa-save"></i> <?php echo __('Save'); ?>
</button>
</div>
?>
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">
<?php
echo Video::getCreatorHTML($users_id);
?>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script type="text/javascript">
function setSubscribers() {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/CustomizeUser/setSubscribers.json.php',
method: 'POST',
data: {
users_id: <?php echo $users_id; ?>,
ExtraSubscribers: $('#ExtraSubscribers').val()
},
success: function (response) {
modal.hidePleaseWait();
avideoResponse(response);
}
});
}
</script>
</body>
</html>
<div class="panel-body">
Add extra <input type="number" step="1" id="ExtraSubscribers" value="<?php echo $count; ?>" /> subscribers on his subscription counter.
</div>
<div class="panel-footer">
<button class="btn btn-success btn-lg btn-block" onclick="setSubscribers();">
<i class="fas fa-save"></i> <?php echo __('Save'); ?>
</button>
</div>
</div>
<script type="text/javascript">
function setSubscribers() {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/CustomizeUser/setSubscribers.json.php',
method: 'POST',
data: {
users_id: <?php echo $users_id; ?>,
ExtraSubscribers: $('#ExtraSubscribers').val()
},
success: function(response) {
modal.hidePleaseWait();
avideoResponse(response);
}
});
}
</script>
</div>
<?php
$_page->print();
?>

View file

@ -1,6 +1,6 @@
<?php
$uid = uniqid();
?>
<?php
$uid = uniqid();
?>
<div class="material-switch">
<input class="playerSwitchDefault" data-toggle="toggle" type="checkbox" value="" id="switch<?php echo $uid; ?>" <?php echo (CustomizeUser::canDownloadVideosFromUser($users_id)) ? "checked" : ""; ?>>
<label for="switch<?php echo $uid; ?>" class="label-primary"></label>
@ -10,7 +10,7 @@ $uid = uniqid();
$('#switch<?php echo $uid; ?>').change(function (e) {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/set.json.php',
url: webSiteRootURL+'plugin/CustomizeUser/set.json.php',
data: {"type": "userCanAllowFilesDownload", "value": $('#switch<?php echo $uid; ?>').is(":checked")},
type: 'post',
success: function (response) {

View file

@ -10,7 +10,7 @@ $uid = uniqid();
$('#switch<?php echo $uid; ?>').change(function (e) {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/CustomizeUser/set.json.php',
url: webSiteRootURL+'plugin/CustomizeUser/set.json.php',
data: {"type": "userCanAllowFilesShare", "value": $('#switch<?php echo $uid; ?>').is(":checked")},
type: 'post',
success: function (response) {

View file

@ -1,36 +1,21 @@
<?php
require_once '../../../videos/configuration.php';
$_page = new Page(array('Animations'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<div class="container-fluid">
<div class="row">
<?php
echo getHTMLTitle(__("Animations"));
foreach (glob("{$global['systemRootPath']}plugin/Layout/animatedBackGrounds/*.php") as $file) {
$name = basename($file);
if ($name === 'index.php') {
continue;
}
$url = str_replace($global['systemRootPath'], getCDN(), $file);
echo "<div class='col-sm-3'>{$name}<iframe src='{$url}' style='width:100%; height: 400px;'></iframe></div>";
}
?>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="row">
<?php
foreach (glob("{$global['systemRootPath']}plugin/Layout/animatedBackGrounds/*.php") as $file) {
$name = basename($file);
if($name === 'index.php'){
continue;
}
$url = str_replace($global['systemRootPath'], getCDN(), $file);
echo "<div class='col-sm-3'>{$name}<iframe src='{$url}' style='width:100%; height: 400px;'></iframe></div>";
}
?>
</div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
</div>
</div>
<?php
$_page->print();
?>

View file

@ -28,93 +28,87 @@ if (!empty($_REQUEST['live_schedule'])) {
}
$imgw = 640;
$imgh = 360;
$_page = new Page(array('Confirm Password'));
$_page->setIncludeNavbar(false);
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo __("Confirm Password"); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<style>
body {
padding-top: 0;
}
footer{
display: none;
}
#bg{
position: fixed;
width: 100%;
height: 100%;
background-image: url('<?php echo $img; ?>');
background-size: cover;
opacity: 0.3;
filter: alpha(opacity=30); /* For IE8 and earlier */
}
</style>
</head>
<body>
<div id="bg"></div>
<style>
body {
padding-top: 0;
}
<!-- Modal -->
<div id="myModal" class="modal fade in" role="dialog">
<div class="modal-dialog">
footer {
display: none;
}
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title">
<center>
<i class="fas fa-lock"></i> <?php echo $video['title']; ?> <?php echo __("is Private"); ?>
</center>
</h1>
#bg {
position: fixed;
width: 100%;
height: 100%;
background-image: url('<?php echo $img; ?>');
background-size: cover;
opacity: 0.3;
filter: alpha(opacity=30);
/* For IE8 and earlier */
}
</style>
<div id="bg"></div>
<!-- Modal -->
<div id="myModal" class="modal fade in" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title">
<center>
<i class="fas fa-lock"></i> <?php echo $video['title']; ?> <?php echo __("is Private"); ?>
</center>
</h1>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<img src="<?php echo $img; ?>" class="img img-responsive" />
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<img src="<?php echo $img; ?>" class="img img-responsive"/>
</div>
<div class="col-sm-6">
<center>
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
<?php
if (!empty($_POST['live_password'])) {
?>
<div class="alert alert-danger"><?php echo __("Your password does not match!"); ?></div>
<?php
}
?>
<div class="form-group">
<label for="live_password"><?php echo __("This Live Requires a Password"); ?></label>
<?php
echo getInputPassword('live_password', 'class="form-control"', __("Password"));
?>
</div>
<div class="row">
<div class="col-md-6">
<button type="submit" class="btn btn-success btn-block"><i class="fas fa-check-circle"></i> <?php echo __("Confirm"); ?></button>
</div>
<div class="col-md-6">
<a href="<?php echo getHomePageURL(); ?>" class="btn btn-danger btn-block"><i class="fas fa-times-circle"></i> <?php echo __("Cancel"); ?></a>
</div>
</div>
</form>
</center>
</div>
</div>
<div class="col-sm-6">
<center>
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
<?php
if (!empty($_POST['live_password'])) {
?>
<div class="alert alert-danger"><?php echo __("Your password does not match!"); ?></div>
<?php
}
?>
<div class="form-group">
<label for="live_password"><?php echo __("This Live Requires a Password"); ?></label>
<?php
echo getInputPassword('live_password', 'class="form-control"', __("Password"));
?>
</div>
<div class="row">
<div class="col-md-6">
<button type="submit" class="btn btn-success btn-block"><i class="fas fa-check-circle"></i> <?php echo __("Confirm"); ?></button>
</div>
<div class="col-md-6">
<a href="<?php echo getHomePageURL(); ?>" class="btn btn-danger btn-block"><i class="fas fa-times-circle"></i> <?php echo __("Cancel"); ?></a>
</div>
</div>
</form>
</center>
</div>
</div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script type="text/javascript">
$(window).on('load', function () {
$('#myModal').modal('show');
});
</script>
</body>
</html>
</div>
</div>
<script type="text/javascript">
$(window).on('load', function() {
$('#myModal').modal('show');
});
</script>
<?php
$_page->print();
?>

View file

@ -113,227 +113,188 @@ if (!empty($chat2) && !empty($chat2->useStaticLayout)) {
}
*/
$global['doNotLoadPlayer'] = 1;
$_page = new Page(array('Live'));
$_page->setExtraScripts(
array(
'view/js/bootstrap-fileinput/js/fileinput.min.js',
)
);
$_page->setExtraStyles(
array(
'view/js/bootstrap-fileinput/css/fileinput.min.css',
)
);
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<div class="container-fluid">
<head>
<title><?php echo __("Live") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<link href="<?php echo getURL('view/js/bootstrap-fileinput/css/fileinput.min.css'); ?>" rel="stylesheet" type="text/css" />
<script src="<?php echo getURL('view/js/bootstrap-fileinput/js/fileinput.min.js'); ?>" type="text/javascript"></script>
<style>
.krajee-default.file-preview-frame .kv-file-content {
width: auto;
height: auto;
}
#live .panel-body {
height: calc(100vh - 220px);
}
#live .panel-body>div,
#mainVideo {
height: -webkit-fill-available;
width: -webkit-fill-available;
}
<?php
/*
if (AVideoPlugin::isEnabledByName('Chat2')) {
?>
@media (max-width: 769px) {
#live .panel-body {
height: calc(50vh - 200px);
}
}
<div class="panel panel-default">
<div class="panel-heading tabbable-line">
<ul class="nav nav-tabs">
<?php
}
*
*/
?>
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading tabbable-line">
<ul class="nav nav-tabs">
$activeServerFound = false;
if (!$obj->useLiveServers) {
$liveStreamObject = new LiveStreamObject($trasnmition['key'], 0, @$_REQUEST['live_index'], 0);
$key = $liveStreamObject->getKeyWithIndex(true);
$activeServerFound = true;
$_REQUEST['live_servers_id'] = 0;
?>
<li class="active <?php echo getCSSAnimationClassAndStyle('animate__fadeInLeft', 'menu'); ?>">
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Live/?live_servers_id=0">
<i class="fas fa-broadcast-tower"></i> <?php echo __("Local Server"); ?>
</a>
</li>
<?php
$activeServerFound = false;
if (!$obj->useLiveServers) {
$liveStreamObject = new LiveStreamObject($trasnmition['key'], 0, @$_REQUEST['live_index'], 0);
} else {
$servers = Live::getAllServers();
$activeFound = false;
foreach ($servers as $index => $value) {
$liveStreamObject = new LiveStreamObject($trasnmition['key'], $value['id'], @$_REQUEST['live_index'], 0);
$key = $liveStreamObject->getKeyWithIndex(true);
$activeServerFound = true;
$_REQUEST['live_servers_id'] = 0;
?>
<li class="active <?php echo getCSSAnimationClassAndStyle('animate__fadeInLeft', 'menu'); ?>">
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Live/?live_servers_id=0">
<i class="fas fa-broadcast-tower"></i> <?php echo __("Local Server"); ?>
</a>
</li>
<?php
} else {
$servers = Live::getAllServers();
$activeFound = false;
foreach ($servers as $index => $value) {
$liveStreamObject = new LiveStreamObject($trasnmition['key'], $value['id'], @$_REQUEST['live_index'], 0);
$key = $liveStreamObject->getKeyWithIndex(true);
$active = "";
if (!empty($_REQUEST['live_servers_id'])) {
if ($_REQUEST['live_servers_id'] == $value['id']) {
$activeServerFound = true;
$active = "active";
}
} elseif ($index == 0) {
$_REQUEST['live_servers_id'] = $value['id'];
$active = "";
if (!empty($_REQUEST['live_servers_id'])) {
if ($_REQUEST['live_servers_id'] == $value['id']) {
$activeServerFound = true;
$active = "active";
}
?>
<li class="<?php echo $active; ?> <?php echo getCSSAnimationClassAndStyle('animate__fadeInLeft', 'menu'); ?>">
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Live/?live_servers_id=<?php echo $value['id']; ?>">
<i class="fas fa-broadcast-tower"></i> <?php echo $value['name']; ?>
</a>
</li>
<?php
} elseif ($index == 0) {
$_REQUEST['live_servers_id'] = $value['id'];
$activeServerFound = true;
$active = "active";
}
if (User::isAdmin()) {
?>
<button onclick="avideoModalIframeFullScreen(webSiteRootURL + 'plugin/Live/view/editor.php');" class="btn btn-primary pull-right"><i class="fa fa-edit"></i> Edit Live Servers</button>
<?php
}
}
if (Live::canStreamWithMeet()) {
?>
<button onclick="avideoModalIframeFullScreen(webSiteRootURL + 'plugin/Meet/');" class="btn btn-default pull-right">
<i class="fas fa-comments"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Start a Live Stream Meeting"); ?></span><span class="hidden-lg"><?php echo __("Meeting"); ?></span>
</button>
?>
<li class="<?php echo $active; ?> <?php echo getCSSAnimationClassAndStyle('animate__fadeInLeft', 'menu'); ?>">
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Live/?live_servers_id=<?php echo $value['id']; ?>">
<i class="fas fa-broadcast-tower"></i> <?php echo $value['name']; ?>
</a>
</li>
<?php
}
if (Live::canStreamWithWebRTC()) {
if (User::isAdmin()) {
?>
<button onclick="avideoModalIframeFullScreen(webSiteRootURL + 'plugin/Live/webcamFullscreen.php?avideoIframe=1');" class="btn btn-default pull-right" data-toggle="tooltip" title=<?php printJSString(__("Go Live With Webcam")); ?>>
<i class="fas fa-camera"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Go Live With Webcam"); ?></span><span class="hidden-lg"><?php echo __("Webcam"); ?></span>
</button>
<?php
}
if (empty($activeServerFound)) {
if (!empty($servers[0])) {
$_REQUEST['live_servers_id'] = $servers[0]['id'];
} else {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Live/view/editor.php" class="btn btn-danger">
<i class="fas fa-exclamation-triangle"></i> <?php echo __("Server not found or inactive"); ?>
</a>
</li>
<button onclick="avideoModalIframeFullScreen(webSiteRootURL + 'plugin/Live/view/editor.php');" class="btn btn-primary pull-right"><i class="fa fa-edit"></i> Edit Live Servers</button>
<?php
}
}
$_REQUEST['live_servers_id'] = Live::getLiveServersIdRequest();
$getLiveKey['live_servers_id'] = $_REQUEST['live_servers_id'];
$getLiveKey['live_index'] = @$_REQUEST['live_index'];
$poster = Live::getPosterImage(User::getId(), $_REQUEST['live_servers_id']);
}
if (Live::canStreamWithMeet()) {
?>
</ul>
</div>
<div class="panel-body">
<div class="col-lg-6" id="indexCol1">
<div class="row">
<div class="<?php echo $col1Class; ?>">
<?php
include $global['systemRootPath'] . 'plugin/Live/indexCol1.php';
?>
</div>
<div class="<?php echo $col2Class; ?>" id="yptRightBar">
<?php
include $global['systemRootPath'] . 'plugin/Live/indexCol2.php';
?>
</div>
<button onclick="avideoModalIframeFullScreen(webSiteRootURL + 'plugin/Meet/');" class="btn btn-default pull-right">
<i class="fas fa-comments"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Start a Live Stream Meeting"); ?></span><span class="hidden-lg"><?php echo __("Meeting"); ?></span>
</button>
<?php
}
if (Live::canStreamWithWebRTC()) {
?>
<button onclick="avideoModalIframeFullScreen(webSiteRootURL + 'plugin/Live/webcamFullscreen.php?avideoIframe=1');" class="btn btn-default pull-right" data-toggle="tooltip" title=<?php printJSString(__("Go Live With Webcam")); ?>>
<i class="fas fa-camera"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Go Live With Webcam"); ?></span><span class="hidden-lg"><?php echo __("Webcam"); ?></span>
</button>
<?php
}
if (empty($activeServerFound)) {
if (!empty($servers[0])) {
$_REQUEST['live_servers_id'] = $servers[0]['id'];
} else {
?>
<li>
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Live/view/editor.php" class="btn btn-danger">
<i class="fas fa-exclamation-triangle"></i> <?php echo __("Server not found or inactive"); ?>
</a>
</li>
<?php
}
}
$_REQUEST['live_servers_id'] = Live::getLiveServersIdRequest();
$getLiveKey['live_servers_id'] = $_REQUEST['live_servers_id'];
$getLiveKey['live_index'] = @$_REQUEST['live_index'];
$poster = Live::getPosterImage(User::getId(), $_REQUEST['live_servers_id']);
?>
</ul>
</div>
<div class="panel-body">
<div class="col-lg-6" id="indexCol1">
<div class="row">
<div class="<?php echo $col1Class; ?>">
<?php
include $global['systemRootPath'] . 'plugin/Live/indexCol1.php';
?>
</div>
<div class="<?php echo $col2Class; ?>" id="yptRightBar">
<?php
include $global['systemRootPath'] . 'plugin/Live/indexCol2.php';
?>
</div>
</div>
<div class="col-lg-6 " id="indexCol2">
<?php
include $global['systemRootPath'] . 'plugin/Live/indexCol3.php';
?>
</div>
</div>
<div class="col-lg-6 " id="indexCol2">
<?php
include $global['systemRootPath'] . 'plugin/Live/indexCol3.php';
?>
</div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
var flashvars = {
server: "<?php echo Live::getRTMPLinkWithOutKeyFromKey($trasnmition['key']); ?>",
stream: "<?php echo $trasnmition['key']; ?>"
};
var params = {};
var attributes = {};
function saveStream() {
</div>
<script>
var flashvars = {
server: "<?php echo Live::getRTMPLinkWithOutKeyFromKey($trasnmition['key']); ?>",
stream: "<?php echo $trasnmition['key']; ?>"
};
var params = {};
var attributes = {};
function saveStream() {
modal.showPleaseWait();
var selectedUserGroups = [];
$('.userGroups:checked').each(function() {
selectedUserGroups.push($(this).val());
});
$.ajax({
url: webSiteRootURL+'plugin/Live/saveLive.php',
data: {
"title": $('#title').val(),
"description": $('#description').val(),
"categories_id": $('select[name="categories_id"]').val(),
"key": "<?php echo $trasnmition['key']; ?>",
"listed": $('#listed').is(":checked"),
"saveTransmition": $('#recordLive').is(":checked"),
"userGroups": selectedUserGroups,
users_id: '<?php echo $users_id; ?>',
password: $('#password_livestream').val()
},
type: 'post',
success: function(response) {
modal.hidePleaseWait();
}
});
}
$(document).ready(function() {
$('#removePoster').click(function() {
modal.showPleaseWait();
var selectedUserGroups = [];
$('.userGroups:checked').each(function() {
selectedUserGroups.push($(this).val());
});
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Live/saveLive.php',
data: {
"title": $('#title').val(),
"description": $('#description').val(),
"categories_id": $('select[name="categories_id"]').val(),
"key": "<?php echo $trasnmition['key']; ?>",
"listed": $('#listed').is(":checked"),
"saveTransmition": $('#recordLive').is(":checked"),
"userGroups": selectedUserGroups,
users_id: '<?php echo $users_id; ?>',
password: $('#password_livestream').val()
},
type: 'post',
url: webSiteRootURL + "plugin/Live/removePoster.php?live_servers_id=<?php echo $_REQUEST['live_servers_id']; ?>",
success: function(response) {
modal.hidePleaseWait();
if (response.error) {
avideoAlert("<?php echo __("Sorry!"); ?>", response.msg, "error");
} else {
$('#mainVideo video').attr('poster', webSiteRootURL + response.newPoster);
$('#mainVideo .vjs-poster').css('background-image', 'url("' + webSiteRootURL + response.newPoster + '")');
$('.kv-file-content img').attr('src', '<?php echo $global['webSiteRootURL']; ?>' + response.newPoster);
}
}
});
}
$(document).ready(function() {
$('#removePoster').click(function() {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + "plugin/Live/removePoster.php?live_servers_id=<?php echo $_REQUEST['live_servers_id']; ?>",
success: function(response) {
modal.hidePleaseWait();
if (response.error) {
avideoAlert("<?php echo __("Sorry!"); ?>", response.msg, "error");
} else {
$('#mainVideo video').attr('poster', webSiteRootURL + response.newPoster);
$('#mainVideo .vjs-poster').css('background-image', 'url("' + webSiteRootURL + response.newPoster + '")');
$('.kv-file-content img').attr('src', '<?php echo $global['webSiteRootURL']; ?>' + response.newPoster);
}
}
});
});
$('.btnSaveStream').click(function() {
saveStream();
});
<?php
echo PlayerSkins::getStartPlayerJS("", "", true);
?>
});
</script>
</body>
$('.btnSaveStream').click(function() {
saveStream();
});
</html>
<?php include_once $global['systemRootPath'] . 'objects/include_end.php'; ?>
<?php
echo PlayerSkins::getStartPlayerJS("", "", true);
?>
});
</script>
<?php
$_page->print();
?>

View file

@ -14,55 +14,46 @@ $ls = new Live_schedule($_REQUEST['live_schedule_id']);
$liveImg = Live_schedule::getPosterURL($_REQUEST['live_schedule_id']);
$liveInfo = Live::getInfo($ls->getKey(), $ls->getLive_servers_id());
$_page = new Page(array('Remind me'));
//$_page->setIncludeNavbar(false);
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title>Remind me</title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<style>
.schedulePoster{
max-width: 20vw;
max-height: 10vh;
padding: 0 10px 0 0;
}
</style>
</head>
<body style="padding: 0 10px;">
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading clearfix">
<div class="pull-left">
<img src="<?php echo $liveImg; ?>" class="img img-responsive schedulePoster">
</div>
<h2>
<?php
echo __('Remind me');
?>
</h2>
<h3>
<?php
echo $ls->getTitle();
?>
</h3>
</div>
<div class="panel-body" style="padding: 10px;">
<?php
echo Live::getScheduleReminderOptions($_REQUEST['live_schedule_id']);
?>
</div>
<div class="panel-footer" >
<i class="far fa-clock"></i>
<?php
echo $liveInfo['displayTime'];
?>
</div>
<style>
.schedulePoster {
max-width: 20vw;
max-height: 10vh;
padding: 0 10px 0 0;
}
</style>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading clearfix">
<div class="pull-left">
<img src="<?php echo $liveImg; ?>" class="img img-responsive schedulePoster">
</div>
<h2>
<?php
echo __('Remind me');
?>
</h2>
<h3>
<?php
echo $ls->getTitle();
?>
</h3>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
<div class="panel-body" style="padding: 10px;">
<?php
echo Live::getScheduleReminderOptions($_REQUEST['live_schedule_id']);
?>
</div>
<div class="panel-footer">
<i class="far fa-clock"></i>
<?php
echo $liveInfo['displayTime'];
?>
</div>
</div>
</div>
<?php
$_page->print();
?>

View file

@ -7,223 +7,209 @@ if (!isset($global['systemRootPath'])) {
if (!Live::canRestream()) {
forbiddenPage('You cannot restream');
}
$_page = new Page(array('Active Lives'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo __("Live") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
//include $global['systemRootPath'] . 'plugin/Live/view/{$classname}/index_head.php';
?>
<style>
#livesRestreamList .livesRestreamStatus.inactive .hideWhenInactive,
#livesRestreamList .livesRestreamStatus.active .hideWhenActive,
#livesRestreamList .livesRestreamStatus.loading .hideWhenLoading,
#livesRestreamList .livesRestreamStatus.hasLog .hideWhenHasLog,
#livesRestreamList .livesRestreamStatus.hasNoLog .hideWhenHasNoLog{
display: none;
}
<style>
#livesRestreamList .livesRestreamStatus.inactive .hideWhenInactive,
#livesRestreamList .livesRestreamStatus.active .hideWhenActive,
#livesRestreamList .livesRestreamStatus.loading .hideWhenLoading,
#livesRestreamList .livesRestreamStatus.hasLog .hideWhenHasLog,
#livesRestreamList .livesRestreamStatus.hasNoLog .hideWhenHasNoLog {
display: none;
}
#livesRestreamList .livesRestreamStatus.active .showWhenActive{
display: inline-flex;
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading">
#livesRestreamList .livesRestreamStatus.active .showWhenActive {
display: inline-flex;
}
</style>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading">
</div>
<div class="panel-body">
<table class="table table-hover" id="livesRestreamList">
<thead>
<tr>
<th colspan="4"></th>
<th colspan="2" class="text-center">Viewers</th>
</tr>
<tr>
<th>ID</th>
<th>Title</th>
<th>Live Status</th>
<th>Key</th>
<th>Started</th>
<th><abbr title="<?php echo __('Max at same time'); ?>">Max</abbr></th>
<th>Total</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="panel-footer">
<button type="button" class="btn btn-info " onclick="getActiveLives();">
<i class="fas fa-sync faa-spin"></i>
<?php echo __('Reload'); ?>
</button>
</div>
</div>
</div>
<div class="panel-body">
<table class="table table-hover" id="livesRestreamList">
<thead>
<tr>
<th colspan="4"></th>
<th colspan="2" class="text-center">Viewers</th>
</tr>
<tr>
<th>ID</th>
<th>Title</th>
<th>Live Status</th>
<th>Key</th>
<th>Started</th>
<th><abbr title="<?php echo __('Max at same time'); ?>">Max</abbr></th>
<th>Total</th>
<th></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="panel-footer">
<button type="button" class="btn btn-info " onclick="getActiveLives();">
<i class="fas fa-sync faa-spin"></i>
<?php echo __('Reload'); ?>
</button>
</div>
</div>
</div>
<script>
var activeLiveTemplate = <?php echo json_encode(file_get_contents($global['systemRootPath'] . 'plugin/Live/view/getActiveLives.template.html')); ?>;
var activeLiveRestreamTemplate = <?php echo json_encode(file_get_contents($global['systemRootPath'] . 'plugin/Live/view/getActiveLivesRestreams.template.html')); ?>;
$(document).ready(function() {
getActiveLives();
});
function getAction(action, live_transmitions_history_id, live_restreams_id) {
var url = webSiteRootURL + 'plugin/Live/view/Live_restreams/getAction.json.php';
url = addQueryStringParameter(url, 'action', action);
url = addQueryStringParameter(url, 'live_transmitions_history_id', live_transmitions_history_id);
url = addQueryStringParameter(url, 'live_restreams_id', live_restreams_id);
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
var activeLiveTemplate = <?php echo json_encode(file_get_contents($global['systemRootPath'] . 'plugin/Live/view/getActiveLives.template.html')); ?>;
var activeLiveRestreamTemplate = <?php echo json_encode(file_get_contents($global['systemRootPath'] . 'plugin/Live/view/getActiveLivesRestreams.template.html')); ?>;
$(document).ready(function () {
modal.showPleaseWait();
$.ajax({
url: url,
success: function(response) {
modal.hidePleaseWait();
if (response.error) {
avideoAlertError(response.msg);
} else {
avideoToastSuccess(response.msg);
if (typeof response.eval !== 'undefined') {
eval(response.eval);
}
}
getActiveLives();
});
function getAction(action, live_transmitions_history_id, live_restreams_id) {
var url = webSiteRootURL + 'plugin/Live/view/Live_restreams/getAction.json.php';
url = addQueryStringParameter(url, 'action', action);
url = addQueryStringParameter(url, 'live_transmitions_history_id', live_transmitions_history_id);
url = addQueryStringParameter(url, 'live_restreams_id', live_restreams_id);
modal.showPleaseWait();
$.ajax({
url: url,
success: function (response) {
modal.hidePleaseWait();
if (response.error) {
avideoAlertError(response.msg);
} else {
avideoToastSuccess(response.msg);
if (typeof response.eval !== 'undefined') {
eval(response.eval);
}
}
getActiveLives();
}
});
}
});
}
function getActiveLives() {
var url = webSiteRootURL + 'plugin/Live/view/getActiveLives.json.php';
//modal.showPleaseWait();
$.ajax({
url: url,
success: function (response) {
console.log('getActiveLives', response);
//modal.hidePleaseWait();
if (response.error) {
avideoAlertError(response.msg);
} else {
activeLivesToTable(response.lives);
loadIfRestreamIsActive();
}
}
});
}
function activeLivesToTable(lives) {
var liveTemplate = activeLiveTemplate;
var restreamTemplate = activeLiveRestreamTemplate;
$('#livesRestreamList tbody').empty();
//console.log('activeLivesToTable', lives);
for (var i in lives) {
var live = lives[i];
if (typeof live == 'function') {
continue;
}
//console.log('activeLivesToTable restream_log', live.restream_log);
var restream = '';
for (var j in live.restream) {
var itemsArray = live.restream[j];
if (typeof itemsArray == 'function') {
continue;
}
itemsArray.live_transmitions_history_id = live.id;
itemsArray.live_restream_id = itemsArray.live_transmitions_history_id + '_' + itemsArray.id;
console.log('activeLivesToTable live', itemsArray);
restream += arrayToTemplate(itemsArray, restreamTemplate);
}
//console.log('activeLivesToTable restreams', restream);
live['restream'] = restream;
live['class'] = '';
liveHTML = arrayToTemplate(live, liveTemplate);
$('#livesRestreamList tbody').append(liveHTML);
function getActiveLives() {
var url = webSiteRootURL + 'plugin/Live/view/getActiveLives.json.php';
//modal.showPleaseWait();
$.ajax({
url: url,
success: function(response) {
console.log('getActiveLives', response);
//modal.hidePleaseWait();
if (response.error) {
avideoAlertError(response.msg);
} else {
activeLivesToTable(response.lives);
loadIfRestreamIsActive();
}
}
});
}
function loadIfRestreamIsActive() {
$(".livesRestreamStatus").each(function (index) {
var restreams_id = $(this).attr('restreams_id');
var live_transmitions_history_id = $(this).attr('live_transmitions_history_id');
function activeLivesToTable(lives) {
var liveTemplate = activeLiveTemplate;
var restreamTemplate = activeLiveRestreamTemplate;
$('#livesRestreamList tbody').empty();
//console.log('activeLivesToTable', lives);
for (var i in lives) {
var live = lives[i];
if (typeof live == 'function') {
continue;
}
//console.log('activeLivesToTable restream_log', live.restream_log);
var restream = '';
for (var j in live.restream) {
var itemsArray = live.restream[j];
if (typeof itemsArray == 'function') {
continue;
}
itemsArray.live_transmitions_history_id = live.id;
itemsArray.live_restream_id = itemsArray.live_transmitions_history_id + '_' + itemsArray.id;
console.log('activeLivesToTable live', itemsArray);
restream += arrayToTemplate(itemsArray, restreamTemplate);
}
//console.log('activeLivesToTable restreams', restream);
live['restream'] = restream;
live['class'] = '';
liveHTML = arrayToTemplate(live, liveTemplate);
$('#livesRestreamList tbody').append(liveHTML);
}
}
function loadIfRestreamIsActive() {
$(".livesRestreamStatus").each(function(index) {
var restreams_id = $(this).attr('restreams_id');
var live_transmitions_history_id = $(this).attr('live_transmitions_history_id');
checkIfRestreamIsActive(live_transmitions_history_id, restreams_id);
});
}
var checkIfRestreamIsActiveTimeout = [];
function checkIfRestreamIsActive(live_transmitions_history_id, restreams_id) {
var live_restream_id = live_transmitions_history_id + '_' + restreams_id;
clearTimeout(checkIfRestreamIsActiveTimeout[live_restream_id]);
setRestreamLogLoading(live_transmitions_history_id, restreams_id);
var url = webSiteRootURL + 'plugin/Live/view/getRestream.json.php';
url = addQueryStringParameter(url, 'live_transmitions_history_id', live_transmitions_history_id);
url = addQueryStringParameter(url, 'restreams_id', restreams_id);
$.ajax({
url: url,
success: function(response) {
if (response.error) {
avideoAlertError(response.msg);
} else {
if (response.log.error) {
avideoAlertError('Log error');
} else {
if (empty(response.log)) {
setRestreamHasNoLog(live_transmitions_history_id, restreams_id);
} else if (response.log.isActive) {
setRestreamLogActive(live_transmitions_history_id, restreams_id);
} else {
console.log('checkIfRestreamIsActive', live_transmitions_history_id, restreams_id, response.log, empty(response.log));
setRestreamLogInactive(live_transmitions_history_id, restreams_id);
}
}
}
checkIfRestreamIsActiveTimeout[live_restream_id] = setTimeout(function() {
checkIfRestreamIsActive(live_transmitions_history_id, restreams_id);
});
}, 120000);
}
});
var checkIfRestreamIsActiveTimeout = [];
function checkIfRestreamIsActive(live_transmitions_history_id, restreams_id) {
var live_restream_id = live_transmitions_history_id + '_' + restreams_id;
clearTimeout(checkIfRestreamIsActiveTimeout[live_restream_id]);
setRestreamLogLoading(live_transmitions_history_id, restreams_id);
var url = webSiteRootURL + 'plugin/Live/view/getRestream.json.php';
url = addQueryStringParameter(url, 'live_transmitions_history_id', live_transmitions_history_id);
url = addQueryStringParameter(url, 'restreams_id', restreams_id);
$.ajax({
url: url,
success: function (response) {
if (response.error) {
avideoAlertError(response.msg);
} else {
if (response.log.error) {
avideoAlertError('Log error');
} else {
if (empty(response.log)) {
setRestreamHasNoLog(live_transmitions_history_id, restreams_id);
} else if (response.log.isActive) {
setRestreamLogActive(live_transmitions_history_id, restreams_id);
} else {
console.log('checkIfRestreamIsActive', live_transmitions_history_id, restreams_id, response.log, empty(response.log));
setRestreamLogInactive(live_transmitions_history_id, restreams_id);
}
}
}
checkIfRestreamIsActiveTimeout[live_restream_id] = setTimeout(function () {
checkIfRestreamIsActive(live_transmitions_history_id, restreams_id);
}, 120000);
}
});
function setRestreamHasNoLog(live_transmitions_history_id, restreams_id) {
removeAllClassesAndAdd(live_transmitions_history_id, restreams_id, 'hasNoLog');
}
function setRestreamHasNoLog(live_transmitions_history_id, restreams_id) {
removeAllClassesAndAdd(live_transmitions_history_id, restreams_id, 'hasNoLog');
}
function setRestreamHasLog(live_transmitions_history_id, restreams_id) {
removeAllClassesAndAdd(live_transmitions_history_id, restreams_id, 'hasLog');
}
function setRestreamLogLoading(live_transmitions_history_id, restreams_id) {
removeAllClassesAndAdd(live_transmitions_history_id, restreams_id, 'loading');
}
function setRestreamLogActive(live_transmitions_history_id, restreams_id) {
removeAllClassesAndAdd(live_transmitions_history_id, restreams_id, 'active');
}
function setRestreamLogInactive(live_transmitions_history_id, restreams_id) {
removeAllClassesAndAdd(live_transmitions_history_id, restreams_id, 'inactive');
}
function setRestreamHasLog(live_transmitions_history_id, restreams_id) {
removeAllClassesAndAdd(live_transmitions_history_id, restreams_id, 'hasLog');
}
function removeAllClassesAndAdd(live_transmitions_history_id, restreams_id, addClass) {
var live_restream_id = live_transmitions_history_id + '_' + restreams_id;
$(".livesRestreamStatus_" + live_restream_id).removeClass('active');
$(".livesRestreamStatus_" + live_restream_id).removeClass('inactive');
$(".livesRestreamStatus_" + live_restream_id).removeClass('loading');
$(".livesRestreamStatus_" + live_restream_id).removeClass('hasNoLog');
$(".livesRestreamStatus_" + live_restream_id).removeClass('hasLog');
$(".livesRestreamStatus_" + live_restream_id).addClass(addClass);
}
}
</script>
</body>
</html>
function setRestreamLogLoading(live_transmitions_history_id, restreams_id) {
removeAllClassesAndAdd(live_transmitions_history_id, restreams_id, 'loading');
}
function setRestreamLogActive(live_transmitions_history_id, restreams_id) {
removeAllClassesAndAdd(live_transmitions_history_id, restreams_id, 'active');
}
function setRestreamLogInactive(live_transmitions_history_id, restreams_id) {
removeAllClassesAndAdd(live_transmitions_history_id, restreams_id, 'inactive');
}
function removeAllClassesAndAdd(live_transmitions_history_id, restreams_id, addClass) {
var live_restream_id = live_transmitions_history_id + '_' + restreams_id;
$(".livesRestreamStatus_" + live_restream_id).removeClass('active');
$(".livesRestreamStatus_" + live_restream_id).removeClass('inactive');
$(".livesRestreamStatus_" + live_restream_id).removeClass('loading');
$(".livesRestreamStatus_" + live_restream_id).removeClass('hasNoLog');
$(".livesRestreamStatus_" + live_restream_id).removeClass('hasLog');
$(".livesRestreamStatus_" + live_restream_id).addClass(addClass);
}
}
</script>
<?php
$_page->print();
?>

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
@ -119,7 +119,7 @@ if (!User::isAdmin()) {
$(document).ready(function () {
$('#addLive_restreamsBtn').click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Live/view/addLive_restreamsVideo.php',
url: webSiteRootURL+'plugin/Live/view/addLive_restreamsVideo.php',
data: $('#panelLive_restreamsForm').serialize(),
type: 'post',
success: function (response) {
@ -161,7 +161,7 @@ if (!User::isAdmin()) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Live/view/Live_restreams/add.json.php',
url: webSiteRootURL+'plugin/Live/view/Live_restreams/add.json.php',
data: $('#panelLive_restreamsForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
@ -178,7 +178,7 @@ if (!User::isAdmin()) {
$(document).ready(function () {
$('#addLive_scheduleBtn').click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Live/view/addLive_scheduleVideo.php',
url: webSiteRootURL+'plugin/Live/view/addLive_scheduleVideo.php',
data: $('#panelLive_scheduleForm').serialize(),
type: 'post',
success: function (response) {
@ -226,7 +226,7 @@ if (!User::isAdmin()) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Live/view/Live_schedule/add.json.php',
url: webSiteRootURL+'plugin/Live/view/Live_schedule/add.json.php',
data: $('#panelLive_scheduleForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -8,20 +8,7 @@ if (!User::canStream()) {
exit;
}
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo $config->getWebSiteTitle(); ?> :: Live</title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
include $global['systemRootPath'] . 'plugin/Live/view/Live_schedule/panel.php';
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
$_page = new Page(array('Live'));
include $global['systemRootPath'] . 'plugin/Live/view/Live_schedule/panel.php';
$_page->print();
?>

View file

@ -33,215 +33,199 @@ $image_postroll = getURL($poster);
$defaultTIme = 30;
$defaultCloseTIme = 10;
$_page = new Page(array('Upload Poster'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo $config->getWebSiteTitle(); ?> :: Upload Poster</title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="row">
<div class="col-sm-2">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo __('Poster Type'); ?>
</div>
<div class="panel-body">
<ul class="nav nav-pills nav-stacked">
<li class="active posterTypeBtn" posterType="<?php echo Live::$posterType_regular; ?>"><a href="#"><i class="fas fa-photo-video"></i> <?php echo __("Regular Poster"); ?></a></li>
<li class="posterTypeBtn" posterType="<?php echo Live::$posterType_preroll; ?>"><a href="#"><i class="fas fa-step-backward"></i> <?php echo __("Preroll Poster"); ?></a></li>
<li class="posterTypeBtn" posterType="<?php echo Live::$posterType_postroll; ?>"><a href="#"><i class="fas fa-step-forward"></i> <?php echo __("Postroll Poster"); ?></a></li>
</ul>
</div>
</div>
<div class="panel panel-default" id="PosterConfiguration" style="display: none;">
<div class="panel-heading">
<?php echo __('Poster Configuration'); ?>
</div>
<div class="panel-body">
<div class="form-group">
<label for="liveImgTimeInSeconds"><?php echo __('Poster Display Time'); ?></label>
<select class="form-control" id="liveImgTimeInSeconds">
<?php
$seconds = __('Seconds');
?>
<optgroup label="<?php echo $seconds; ?>">
<?php
for ($i = 0; $i < 10; $i++) {
echo "<option value=\"{$i}\">{$i} {$seconds}</option>";
}
?>
<?php
for ($i = 10; $i < 60; $i += 5) {
$selected = '';
if ($i == $defaultTIme) {
$selected = 'selected';
}
echo "<option value=\"{$i}\" {$selected}>{$i} {$seconds}</option>";
}
?>
</optgroup>
<?php
$minutes = __('Minutes');
?>
<optgroup label="<?php echo $minutes; ?>">
<?php
for ($i = 60; $i < 600; $i += 60) {
$selected = '';
if ($i == $defaultTIme) {
$selected = 'selected';
}
$min = intval($i / 60);
echo "<option value=\"{$i}\" {$selected}>{$min} {$minutes}</option>";
}
?>
<?php
for ($i = 600; $i <= 3600; $i += 300) {
$selected = '';
if ($i == $defaultTIme) {
$selected = 'selected';
}
$min = intval($i / 60);
echo "<option value=\"{$i}\" {$selected}>{$min} {$minutes}</option>";
}
?>
</optgroup>
</select>
</div>
<div class="form-group">
<label for="liveImgCloseTimeInSeconds"><?php echo __('Close Button Delay'); ?></label>
<select class="form-control" id="liveImgCloseTimeInSeconds">
<option value="-1" selected><?php echo __('Do not allow close'); ?></option>
<?php
$seconds = __('Seconds');
for ($i = 0; $i < 10; $i++) {
echo "<option value=\"{$i}\">{$i} {$seconds}</option>";
}
?>
<?php
for ($i = 10; $i < 600; $i += 5) {
$selected = '';
echo "<option value=\"{$i}\" {$selected}>{$i} {$seconds}</option>";
}
?>
</select>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-sm-2">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo __('Poster Type'); ?>
</div>
<div class="col-sm-10">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo __('Save Poster'); ?>
</div>
<div class="panel-body">
<div class="panel-body">
<ul class="nav nav-pills nav-stacked">
<li class="active posterTypeBtn" posterType="<?php echo Live::$posterType_regular; ?>"><a href="#"><i class="fas fa-photo-video"></i> <?php echo __("Regular Poster"); ?></a></li>
<li class="posterTypeBtn" posterType="<?php echo Live::$posterType_preroll; ?>"><a href="#"><i class="fas fa-step-backward"></i> <?php echo __("Preroll Poster"); ?></a></li>
<li class="posterTypeBtn" posterType="<?php echo Live::$posterType_postroll; ?>"><a href="#"><i class="fas fa-step-forward"></i> <?php echo __("Postroll Poster"); ?></a></li>
</ul>
</div>
</div>
<div class="panel panel-default" id="PosterConfiguration" style="display: none;">
<div class="panel-heading">
<?php echo __('Poster Configuration'); ?>
</div>
<div class="panel-body">
<div class="form-group">
<label for="liveImgTimeInSeconds"><?php echo __('Poster Display Time'); ?></label>
<select class="form-control" id="liveImgTimeInSeconds">
<?php
$croppie1 = getCroppie(__("Upload Poster"), $callBackJSFunction);
//var_dump($croppie1);exit;
echo $croppie1['html'];
$seconds = __('Seconds');
?>
</div>
<div class="panel-footer">
<button class="btn btn-success btn-lg btn-block" onclick="closeWindowAfterImageSave = true;<?php echo $croppie1['getCroppieFunction']; ?>"><i class="fas fa-save"></i> <?php echo __('Save'); ?></button>
</div>
<optgroup label="<?php echo $seconds; ?>">
<?php
for ($i = 0; $i < 10; $i++) {
echo "<option value=\"{$i}\">{$i} {$seconds}</option>";
}
?>
<?php
for ($i = 10; $i < 60; $i += 5) {
$selected = '';
if ($i == $defaultTIme) {
$selected = 'selected';
}
echo "<option value=\"{$i}\" {$selected}>{$i} {$seconds}</option>";
}
?>
</optgroup>
<?php
$minutes = __('Minutes');
?>
<optgroup label="<?php echo $minutes; ?>">
<?php
for ($i = 60; $i < 600; $i += 60) {
$selected = '';
if ($i == $defaultTIme) {
$selected = 'selected';
}
$min = intval($i / 60);
echo "<option value=\"{$i}\" {$selected}>{$min} {$minutes}</option>";
}
?>
<?php
for ($i = 600; $i <= 3600; $i += 300) {
$selected = '';
if ($i == $defaultTIme) {
$selected = 'selected';
}
$min = intval($i / 60);
echo "<option value=\"{$i}\" {$selected}>{$min} {$minutes}</option>";
}
?>
</optgroup>
</select>
</div>
<div class="form-group">
<label for="liveImgCloseTimeInSeconds"><?php echo __('Close Button Delay'); ?></label>
<select class="form-control" id="liveImgCloseTimeInSeconds">
<option value="-1" selected><?php echo __('Do not allow close'); ?></option>
<?php
$seconds = __('Seconds');
for ($i = 0; $i < 10; $i++) {
echo "<option value=\"{$i}\">{$i} {$seconds}</option>";
}
?>
<?php
for ($i = 10; $i < 600; $i += 5) {
$selected = '';
echo "<option value=\"{$i}\" {$selected}>{$i} {$seconds}</option>";
}
?>
</select>
</div>
</div>
</div>
</div>
<div class="col-sm-10">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo __('Save Poster'); ?>
</div>
<div class="panel-body">
<?php
$croppie1 = getCroppie(__("Upload Poster"), $callBackJSFunction);
//var_dump($croppie1);exit;
echo $croppie1['html'];
?>
</div>
<div class="panel-footer">
<button class="btn btn-success btn-lg btn-block" onclick="closeWindowAfterImageSave = true;<?php echo $croppie1['getCroppieFunction']; ?>"><i class="fas fa-save"></i> <?php echo __('Save'); ?></button>
</div>
</div>
</div>
</div>
</div>
<script>
var closeWindowAfterImageSave = false;
var posterType = 0;
function <?php echo $callBackJSFunction; ?>(image) {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/Live/uploadPoster.json.php',
data: {
posterType: posterType,
liveImgCloseTimeInSeconds: $('#liveImgCloseTimeInSeconds').val(),
liveImgTimeInSeconds: $('#liveImgTimeInSeconds').val(),
live_schedule_id: <?php echo $live_schedule_id; ?>,
live_servers_id: <?php echo $live_servers_id; ?>,
image: image,
},
type: 'post',
success: function(response) {
modal.hidePleaseWait();
avideoResponse(response);
if (response && !response.error) {
if (closeWindowAfterImageSave) {
var scheduleElem = $('#schedule_poster_<?php echo $live_schedule_id; ?>', window.parent.document);
$(scheduleElem).attr('src', addGetParam($(scheduleElem).attr('src'), 'cache', Math.random()));
avideoModalIframeClose();
}
}
}
});
}
$(document).ready(function() {
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
echo $croppie1['createCroppie'] . "('{$image}');";
?>
<script>
var closeWindowAfterImageSave = false;
var posterType = 0;
function <?php echo $callBackJSFunction; ?>(image) {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/Live/uploadPoster.json.php',
data: {
posterType: posterType,
liveImgCloseTimeInSeconds: $('#liveImgCloseTimeInSeconds').val(),
liveImgTimeInSeconds: $('#liveImgTimeInSeconds').val(),
live_schedule_id: <?php echo $live_schedule_id; ?>,
live_servers_id: <?php echo $live_servers_id; ?>,
image: image,
},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
avideoResponse(response);
if (response && !response.error) {
if (closeWindowAfterImageSave) {
var scheduleElem = $('#schedule_poster_<?php echo $live_schedule_id; ?>', window.parent.document);
$(scheduleElem).attr('src', addGetParam($(scheduleElem).attr('src'), 'cache', Math.random()));
avideoModalIframeClose();
}
}
}
});
}
$('.posterTypeBtn').click(function() {
posterType = parseInt($(this).attr('posterType'));
$('.posterTypeBtn').removeClass('active');
$('.posterTypeBtn[posterType="' + posterType + '"]').addClass('active');
var jsonFile = false;
switch (posterType) {
case <?php echo Live::$posterType_preroll; ?>:
$('#PosterConfiguration').slideDown();
imageToRelaod = '<?php echo $image_preroll; ?>';
jsonFile = imageToRelaod.replace('.jpg', '.json');
break;
case <?php echo Live::$posterType_postroll; ?>:
$('#PosterConfiguration').slideDown();
imageToRelaod = '<?php echo $image_postroll; ?>';
jsonFile = imageToRelaod.replace('.jpg', '.json');
break;
$(document).ready(function () {
<?php
echo $croppie1['createCroppie'] . "('{$image}');";
?>
$('.posterTypeBtn').click(function () {
posterType = parseInt($(this).attr('posterType'));
$('.posterTypeBtn').removeClass('active');
$('.posterTypeBtn[posterType="' + posterType + '"]').addClass('active');
var jsonFile = false;
switch (posterType) {
case <?php echo Live::$posterType_preroll; ?>:
$('#PosterConfiguration').slideDown();
imageToRelaod = '<?php echo $image_preroll; ?>';
jsonFile = imageToRelaod.replace('.jpg', '.json');
break;
case <?php echo Live::$posterType_postroll; ?>:
$('#PosterConfiguration').slideDown();
imageToRelaod = '<?php echo $image_postroll; ?>';
jsonFile = imageToRelaod.replace('.jpg', '.json');
break;
default:
$('#PosterConfiguration').slideUp();
imageToRelaod = '<?php echo $image; ?>';
break;
}
console.log('posterTypeBtn click', posterType, imageToRelaod);
<?php
echo $croppie1['restartCroppie'] . "(imageToRelaod);";
?>
var liveImgCloseTimeInSeconds = -1;
var liveImgTimeInSeconds = <?php echo $defaultTIme; ?>;
if (jsonFile) {
modal.showPleaseWait();
$.getJSON(jsonFile, function (data) {
if (data) {
liveImgCloseTimeInSeconds = data.liveImgCloseTimeInSeconds;
liveImgTimeInSeconds = data.liveImgTimeInSeconds;
}
}).always(function () {
modal.hidePleaseWait();
$('#liveImgCloseTimeInSeconds').val(liveImgCloseTimeInSeconds);
$('#liveImgTimeInSeconds').val(liveImgTimeInSeconds);
});
} else {
$('#liveImgCloseTimeInSeconds').val(liveImgCloseTimeInSeconds);
$('#liveImgTimeInSeconds').val(liveImgTimeInSeconds);
}
});
});
</script>
</body>
</html>
default:
$('#PosterConfiguration').slideUp();
imageToRelaod = '<?php echo $image; ?>';
break;
}
console.log('posterTypeBtn click', posterType, imageToRelaod);
<?php
echo $croppie1['restartCroppie'] . "(imageToRelaod);";
?>
var liveImgCloseTimeInSeconds = -1;
var liveImgTimeInSeconds = <?php echo $defaultTIme; ?>;
if (jsonFile) {
modal.showPleaseWait();
$.getJSON(jsonFile, function(data) {
if (data) {
liveImgCloseTimeInSeconds = data.liveImgCloseTimeInSeconds;
liveImgTimeInSeconds = data.liveImgTimeInSeconds;
}
}).always(function() {
modal.hidePleaseWait();
$('#liveImgCloseTimeInSeconds').val(liveImgCloseTimeInSeconds);
$('#liveImgTimeInSeconds').val(liveImgTimeInSeconds);
});
} else {
$('#liveImgCloseTimeInSeconds').val(liveImgCloseTimeInSeconds);
$('#liveImgTimeInSeconds').val(liveImgTimeInSeconds);
}
});
});
</script>

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
$obj = AVideoPlugin::getObjectData("Live");
@ -197,7 +197,7 @@ $obj = AVideoPlugin::getObjectData("Live");
$(document).ready(function() {
$('#addLiveBtn').click(function() {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Live/view/addLive_serversVideo.php',
url: webSiteRootURL+'plugin/Live/view/addLive_serversVideo.php',
data: $('#panelLive_serversForm').serialize(),
type: 'post',
success: function(response) {
@ -244,7 +244,7 @@ $obj = AVideoPlugin::getObjectData("Live");
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Live/view/Live_servers/add.json.php',
url: webSiteRootURL+'plugin/Live/view/Live_servers/add.json.php',
data: $('#panelLive_serversForm').serialize(),
type: 'post',
success: function(response) {

View file

@ -1,58 +1,42 @@
<?php
require_once '../../../videos/configuration.php';
AVideoPlugin::loadPlugin("Live");
$_page = new Page(array('Live'));
$_page->loadBasicCSSAndJS();
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo __("Live") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.css"/>
<link href="<?php echo getCDN(); ?>view/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Live') ?>
<div class="pull-right">
<?php echo AVideoPlugin::getSwitchButton("Live"); ?>
</div>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Live') ?>
<div class="pull-right">
<?php echo AVideoPlugin::getSwitchButton("Live"); ?>
</div>
</div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#Live_servers"><i class="fas fa-broadcast-tower"></i> <?php echo __("Live Servers"); ?></a></li>
<li class=""><a data-toggle="tab" href="#Live_restreams"><?php echo __("Live Restreams"); ?></a></li>
<li class=""><a data-toggle="tab" href="#Live_restreams_logs"><?php echo __("Live Restreams Logs"); ?></a></li>
</ul>
<div class="tab-content">
<div id="Live_servers" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/Live/view/Live_servers/index_body.php';
?>
</div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#Live_servers"><i class="fas fa-broadcast-tower"></i> <?php echo __("Live Servers"); ?></a></li>
<li class=""><a data-toggle="tab" href="#Live_restreams"><?php echo __("Live Restreams"); ?></a></li>
<li class=""><a data-toggle="tab" href="#Live_restreams_logs"><?php echo __("Live Restreams Logs"); ?></a></li>
</ul>
<div class="tab-content">
<div id="Live_servers" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/Live/view/Live_servers/index_body.php';
?>
</div>
<div id="Live_restreams" class="tab-pane fade" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/Live/view/Live_restreams/index_body.php';
?>
</div>
<div id="Live_restreams_logs" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/Live/view/Live_restreams_logs/index_body.php';
?>
</div>
</div>
<div id="Live_restreams" class="tab-pane fade" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/Live/view/Live_restreams/index_body.php';
?>
</div>
<div id="Live_restreams_logs" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/Live/view/Live_restreams_logs/index_body.php';
?>
</div>
</div>
</div>
<script type="text/javascript" src="<?php echo getURL('view/css/DataTables/datatables.min.js'); ?>"></script>
<script src="<?php echo getCDN(); ?>js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
</div>
</div>
<?php
$_page->print();
?>

View file

@ -109,155 +109,141 @@ if (isHTMLEmpty($sideAd)) {
}
// to fix the unfinished lives
$liveInfo = Live::getInfo($livet['key'], Live::getLiveServersIdRequest());
$_page = new Page(array('Live'));
$_page->setExtraScripts(
array(
'view/js/webui-popover/jquery.webui-popover.min.js',
'view/js/bootstrap-list-filter/bootstrap-list-filter.min.js'
)
);
$_page->setExtraStyles(
array(
'node_modules/video.js/dist/video-js.min.css',
'view/js/webui-popover/jquery.webui-popover.min.css'
)
);
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo $liveTitle . $config->getPageTitleSeparator() . __("Live") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<link href="<?php echo getURL('node_modules/video.js/dist/video-js.min.css'); ?>" rel="stylesheet" type="text/css" />
<link href="<?php echo getCDN(); ?>js/webui-popover/jquery.webui-popover.min.css" rel="stylesheet" type="text/css" />
<!-- Live modeYoutubeLive.php -->
<div class="container-fluid principalContainer" style="padding: 0; overflow: hidden;" id="modeYoutubePrincipal">
<?php
include $global['systemRootPath'] . 'view/include/head.php';
if (!$isCompressed) {
?>
<?php
//echo AVideoPlugin::getHeadCode();
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<!-- Live modeYoutubeLive.php -->
<div class="container-fluid principalContainer" style="padding: 0; overflow: hidden;" id="modeYoutubePrincipal">
<?php
if (!$isCompressed) {
?>
<div class="" id="modeYoutubeTop">
<div class="col-md-12">
<center style="margin:5px;">
<?php echo getAdsLeaderBoardTop(); ?>
</center>
</div>
<div class="col-md-12">
<?php require "{$global['systemRootPath']}plugin/Live/view/liveVideo.php"; ?>
</div>
<div class="col-md-12">
<center style="margin:5px;">
<?php echo getAdsLeaderBoardTop2(); ?>
</center>
</div>
<div class="" id="modeYoutubeTop">
<div class="col-md-12">
<center style="margin:5px;">
<?php echo getAdsLeaderBoardTop(); ?>
</center>
</div>
<?php
}
?>
<div class="row" id="modeYoutubeBottom" style="margin: 0;">
<div class="col-lg-1"></div>
<div class="<?php echo $modeYoutubeBottomClass1; ?>" id="modeYoutubeBottomContent">
<?php
if ($isCompressed) {
?>
<div class="" id="modeYoutubeTop">
<div class="col-md-12">
<center style="margin:5px;">
<?php echo getAdsLeaderBoardTop(); ?>
</center>
</div>
<div class="col-md-12">
<?php require "{$global['systemRootPath']}plugin/Live/view/liveVideo.php"; ?>
</div>
<div class="col-md-12">
<center style="margin:5px;">
<?php echo getAdsLeaderBoardTop2(); ?>
</center>
</div>
<div class="col-md-12">
<?php require "{$global['systemRootPath']}plugin/Live/view/liveVideo.php"; ?>
</div>
<div class="col-md-12">
<center style="margin:5px;">
<?php echo getAdsLeaderBoardTop2(); ?>
</center>
</div>
</div>
<?php
}
?>
<div class="row" id="modeYoutubeBottom" style="margin: 0;">
<div class="col-lg-1"></div>
<div class="<?php echo $modeYoutubeBottomClass1; ?>" id="modeYoutubeBottomContent">
<?php
if ($isCompressed) {
?>
<div class="" id="modeYoutubeTop">
<div class="col-md-12">
<center style="margin:5px;">
<?php echo getAdsLeaderBoardTop(); ?>
</center>
</div>
<?php
}
?>
<div class="panel panel-default">
<div class="panel-body">
<h1 itemprop="name">
<?php
if ($lt->isAPrivateLive()) {
?>
<i class="fas fa-lock"></i>
<?php
} else {
?>
<i class="fas fa-video"></i>
<?php
}
?>
<span class="title_liveKey_<?php echo $livet['key']?>"><?php echo getSEOTitle($liveTitle); ?></span>
<small class="text-muted">
<?php
echo $liveInfo['displayTime'];
?>
</small>
</h1>
<div class="col-xs-12 col-sm-12 col-lg-12"><?php echo $video['creator']; ?></div>
<p><?php echo nl2br(textToLink($liveDescription)); ?></p>
<div class="row">
<div class="col-md-12 watch8-action-buttons text-muted">
<?php if (isShareEnabled()) { ?>
<a href="#" class="btn btn-default no-outline" id="shareBtn">
<span class="fa fa-share"></span> <?php echo __("Share"); ?>
</a>
<?php
}
?>
<script>
$(document).ready(function() {
$("#shareDiv").slideUp();
$("#shareBtn").click(function() {
$(".menusDiv").not("#shareDiv").slideUp();
$("#shareDiv").slideToggle();
return false;
});
});
</script>
<?php echo AVideoPlugin::getWatchActionButton(0); ?>
</div>
</div>
<div class="col-md-12">
<?php require "{$global['systemRootPath']}plugin/Live/view/liveVideo.php"; ?>
</div>
<div class="col-md-12">
<center style="margin:5px;">
<?php echo getAdsLeaderBoardTop2(); ?>
</center>
</div>
</div>
<?php
}
?>
<div class="panel panel-default">
<div class="panel-body">
<h1 itemprop="name">
<?php
if ($lt->isAPrivateLive()) {
?>
<i class="fas fa-lock"></i>
<?php
} else {
?>
<i class="fas fa-video"></i>
<?php
$link = Live::getLinkToLiveFromUsers_id($user_id);
if (!empty($_REQUEST['live_schedule'])) {
$link = addQueryStringParameter($link, 'live_schedule', intval($_REQUEST['live_schedule']));
}
if (isShareEnabled()) {
getShareMenu($liveTitle, $link, $link, addQueryStringParameter($link, 'embed', 1), $img, "row bgWhite list-group-item menusDiv");
}
?>
<div class="row">
<div class="col-lg-12 col-sm-12 col-xs-12 extraVideos nopadding"></div>
<span class="title_liveKey_<?php echo $livet['key'] ?>"><?php echo getSEOTitle($liveTitle); ?></span>
<small class="text-muted">
<?php
echo $liveInfo['displayTime'];
?>
</small>
</h1>
<div class="col-xs-12 col-sm-12 col-lg-12"><?php echo $video['creator']; ?></div>
<p><?php echo nl2br(textToLink($liveDescription)); ?></p>
<div class="row">
<div class="col-md-12 watch8-action-buttons text-muted">
<?php if (isShareEnabled()) { ?>
<a href="#" class="btn btn-default no-outline" id="shareBtn">
<span class="fa fa-share"></span> <?php echo __("Share"); ?>
</a>
<?php
}
?>
<script>
$(document).ready(function() {
$("#shareDiv").slideUp();
$("#shareBtn").click(function() {
$(".menusDiv").not("#shareDiv").slideUp();
$("#shareDiv").slideToggle();
return false;
});
});
</script>
<?php echo AVideoPlugin::getWatchActionButton(0); ?>
</div>
</div>
<?php
$link = Live::getLinkToLiveFromUsers_id($user_id);
if (!empty($_REQUEST['live_schedule'])) {
$link = addQueryStringParameter($link, 'live_schedule', intval($_REQUEST['live_schedule']));
}
if (isShareEnabled()) {
getShareMenu($liveTitle, $link, $link, addQueryStringParameter($link, 'embed', 1), $img, "row bgWhite list-group-item menusDiv");
}
?>
<div class="row">
<div class="col-lg-12 col-sm-12 col-xs-12 extraVideos nopadding"></div>
</div>
</div>
</div>
<div class="<?php echo $modeYoutubeBottomClass2; ?> rightBar" id="yptRightBar">
<div class="list-group-item ">
<?php
echo $sideAd;
?>
</div>
</div>
<div class="col-lg-1"></div>
</div>
<div class="<?php echo $modeYoutubeBottomClass2; ?> rightBar" id="yptRightBar">
<div class="list-group-item ">
<?php
echo $sideAd;
?>
</div>
</div>
<div class="col-lg-1"></div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/video.min.js.php';
echo AVideoPlugin::afterVideoJS();
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script src="<?php echo getURL('js/webui-popover/jquery.webui-popover.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo getURL('js/bootstrap-list-filter/bootstrap-list-filter.min.js'); ?>" type="text/javascript"></script>
</body>
</html>
</div>
<?php
include $global['systemRootPath'] . 'objects/include_end.php';
include $global['systemRootPath'] . 'view/include/video.min.js.php';
echo AVideoPlugin::afterVideoJS();
?>
<?php
$_page->print();
?>

View file

@ -6,26 +6,13 @@ $plugin = AVideoPlugin::loadPluginIfEnabled('LiveLinks');
if (empty($plugin) || !$plugin->canAddLinks()) {
forbiddenPage(__("You can not do this"));
}
$_page = new Page(array('Live Links'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo __("Live Links") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container">
<?php
include_once './view/panel.php';
?>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
<div class="container">
<?php
include_once './view/panel.php';
?>
</div>
<?php
$_page->print();
?>

View file

@ -88,141 +88,121 @@ if (isHTMLEmpty($sideAd)) {
$modeYoutubeBottomClass1 = "col-sm-12 col-md-12 col-lg-10";
$modeYoutubeBottomClass2 = "hidden ";
}
$_page = new Page(array('Live Links'));
$_page->setExtraStyles(array('node_modules/video.js/dist/video-js.min.css'));
$_page->setExtraScripts(array('node_modules/videojs-contrib-ads/dist/videojs.ads.min.js'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo $t['title'] . $config->getPageTitleSeparator() . __("Live Links") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<link href="<?php echo getURL('node_modules/video.js/dist/video-js.min.css'); ?>" rel="stylesheet" type="text/css"/>
<link href="<?php echo getURL('node_modules/videojs-contrib-ads/dist/videojs.ads.min.js'); ?>" rel="stylesheet" type="text/css"/>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<div class="container-fluid principalContainer" style="padding: 0;overflow: hidden;" id="modeYoutubePrincipal">
<?php
if (!$isCompressed) {
?>
<div class="" id="modeYoutubeTop">
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<!-- LiveLinks Live.php -->
<div class="container-fluid principalContainer" style="padding: 0;overflow: hidden;" id="modeYoutubePrincipal">
<?php
if (!$isCompressed) {
<div class="col-md-12">
<center style="margin:5px;">
<?php echo getAdsLeaderBoardTop(); ?>
</center>
</div>
<div class="col-md-12">
<?php
require "{$global['systemRootPath']}plugin/LiveLinks/view/liveVideo.php";
?>
<div class="" id="modeYoutubeTop" >
</div>
<div class="col-md-12">
<center style="margin:5px;">
<?php echo getAdsLeaderBoardTop2(); ?>
</center>
</div>
</div>
<?php
}
?>
<div class="row" id="modeYoutubeBottom" style="margin: 0;">
<div class="col-lg-1"></div>
<div class="<?php echo $modeYoutubeBottomClass1; ?>" id="modeYoutubeBottomContent">
<?php
if ($isCompressed) {
?>
<div class="" id="modeYoutubeTop">
<div class="col-md-12">
<center style="margin:5px;">
<?php echo getAdsLeaderBoardTop(); ?>
</center>
</div>
</div>
<div class="col-md-12">
<?php
require "{$global['systemRootPath']}plugin/LiveLinks/view/liveVideo.php";
?>
</div>
</div>
<div class="col-md-12">
<center style="margin:5px;">
<?php echo getAdsLeaderBoardTop2(); ?>
</center>
</div>
</div>
</div>
<?php
<?php
}
?>
<div class="row" id="modeYoutubeBottom" style="margin: 0;">
<div class="col-lg-1"></div>
<div class="<?php echo $modeYoutubeBottomClass1; ?>" id="modeYoutubeBottomContent">
<?php
if ($isCompressed) {
?>
<div class="" id="modeYoutubeTop" >
<div class="panel panel-default">
<div class="panel-body">
<h1 itemprop="name"><i class="fas fa-video"></i> <?php echo getSEOTitle($t['title']); ?></h1>
<div class="col-xs-12 col-sm-12 col-lg-12"><?php echo $video['creator']; ?></div>
<p><?php echo nl2br(textToLink($t['description'])); ?></p>
<div class="col-md-12">
<center style="margin:5px;">
<?php echo getAdsLeaderBoardTop(); ?>
</center>
</div>
<div class="col-md-12">
<?php
require "{$global['systemRootPath']}plugin/LiveLinks/view/liveVideo.php";
?>
</div>
<div class="col-md-12">
<center style="margin:5px;">
<?php echo getAdsLeaderBoardTop2(); ?>
</center>
</div>
</div>
<?php
}
?>
<div class="panel panel-default">
<div class="panel-body">
<h1 itemprop="name"><i class="fas fa-video"></i> <?php echo getSEOTitle($t['title']); ?></h1>
<div class="col-xs-12 col-sm-12 col-lg-12"><?php echo $video['creator']; ?></div>
<p><?php echo nl2br(textToLink($t['description'])); ?></p>
<div class="row">
<div class="col-md-12 watch8-action-buttons text-muted">
<?php if (isShareEnabled()) { ?>
<a href="#" class="btn btn-default no-outline" id="shareBtn">
<span class="fa fa-share"></span> <?php echo __("Share"); ?>
</a>
<?php
}
?>
<script>
$(document).ready(function () {
$("#shareDiv").slideUp();
$("#shareBtn").click(function () {
$(".menusDiv").not("#shareDiv").slideUp();
$("#shareDiv").slideToggle();
return false;
});
});
</script>
<?php echo AVideoPlugin::getWatchActionButton(0); ?>
</div>
</div>
<div class="row">
<div class="col-md-12 watch8-action-buttons text-muted">
<?php if (isShareEnabled()) { ?>
<a href="#" class="btn btn-default no-outline" id="shareBtn">
<span class="fa fa-share"></span> <?php echo __("Share"); ?>
</a>
<?php
if (isShareEnabled()) {
/**
* @var string $link
* @var string $linkEmbed
*/
$link = LiveLinks::getLinkToLiveFromId($_GET['link']);
$linkEmbed = LiveLinks::getLinkToLiveFromId($_GET['link'], true);
getShareMenu($t['title'], $link, $link, $linkEmbed, $img, "row");
}
?>
<div class="row">
<div class="col-lg-12 col-sm-12 col-xs-12 extraVideos nopadding"></div>
</div>
<script>
$(document).ready(function() {
$("#shareDiv").slideUp();
$("#shareBtn").click(function() {
$(".menusDiv").not("#shareDiv").slideUp();
$("#shareDiv").slideToggle();
return false;
});
});
</script>
<?php echo AVideoPlugin::getWatchActionButton(0); ?>
</div>
</div>
</div>
<div class="<?php echo $modeYoutubeBottomClass2; ?> rightBar" id="yptRightBar">
<div class="list-group-item ">
<?php
echo $sideAd;
?>
<?php
if (isShareEnabled()) {
/**
* @var string $link
* @var string $linkEmbed
*/
$link = LiveLinks::getLinkToLiveFromId($_GET['link']);
$linkEmbed = LiveLinks::getLinkToLiveFromId($_GET['link'], true);
getShareMenu($t['title'], $link, $link, $linkEmbed, $img, "row");
}
?>
<div class="row">
<div class="col-lg-12 col-sm-12 col-xs-12 extraVideos nopadding"></div>
</div>
</div>
<div class="col-lg-1"></div>
</div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/video.min.js.php';
echo AVideoPlugin::afterVideoJS();
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
<div class="<?php echo $modeYoutubeBottomClass2; ?> rightBar" id="yptRightBar">
<div class="list-group-item ">
<?php
echo $sideAd;
?>
</div>
</div>
<div class="col-lg-1"></div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'objects/include_end.php';
include $global['systemRootPath'] . 'view/include/video.min.js.php';
echo AVideoPlugin::afterVideoJS();
?>
<?php
$_page->print();
?>

View file

@ -175,7 +175,7 @@
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/LiveLinks/view/addLiveLink.php',
url: webSiteRootURL+'plugin/LiveLinks/view/addLiveLink.php',
data: $('#liveLinksForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
@ -126,7 +126,7 @@ if (!User::isAdmin()) {
$(document).ready(function () {
$('#addlogincontrol_historyBtn').click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/LoginControl/View/addlogincontrol_historyVideo.php',
url: webSiteRootURL+'plugin/LoginControl/View/addlogincontrol_historyVideo.php',
data: $('#panellogincontrol_historyForm').serialize(),
type: 'post',
success: function (response) {
@ -168,7 +168,7 @@ if (!User::isAdmin()) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/LoginControl/View/Users_login_history/add.json.php',
url: webSiteRootURL+'plugin/LoginControl/View/Users_login_history/add.json.php',
data: $('#panellogincontrol_historyForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -1,46 +1,30 @@
<?php
require_once '../../../videos/configuration.php';
AVideoPlugin::loadPlugin("LoginControl");
$_page = new Page(array('Login Control'));
$_page->loadBasicCSSAndJS();
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo __("Login Control") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.css"/>
<link href="<?php echo getCDN(); ?>view/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('LoginControl') ?>
<div class="pull-right">
<?php echo AVideoPlugin::getSwitchButton("LoginControl"); ?>
</div>
</div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#logincontrol_history"><?php echo __("Users Login History"); ?></a></li>
</ul>
<div class="tab-content">
<div id="logincontrol_history" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/LoginControl/View/Users_login_history/index_body.php';
?>
</div>
</div>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('LoginControl') ?>
<div class="pull-right">
<?php echo AVideoPlugin::getSwitchButton("LoginControl"); ?>
</div>
</div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#logincontrol_history"><?php echo __("Users Login History"); ?></a></li>
</ul>
<div class="tab-content">
<div id="logincontrol_history" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/LoginControl/View/Users_login_history/index_body.php';
?>
</div>
</div>
</div>
<script type="text/javascript" src="<?php echo getURL('view/css/DataTables/datatables.min.js'); ?>"></script>
<script src="<?php echo getCDN(); ?>js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
</div>
</div>
<?php
$_page->print();
?>

View file

@ -11,42 +11,27 @@ if (empty($users_id)) {
forbiddenPage('Empty user ID');
}
$_page = new Page(array("Login History"));
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo __("Login History"); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body>
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading tabbable-line">
<?php
echo Video::getCreatorHTML($users_id);
?>
</div>
<div class="panel-body">
<?php
include '../../plugin/LoginControl/profileTabContent.php';
?>
</div>
</div>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading tabbable-line">
<?php
echo Video::getCreatorHTML($users_id);
?>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
$(document).ready(function () {
$('#loginHistory').addClass('in');
});
</script>
</body>
</html>
<div class="panel-body">
<?php
include '../../plugin/LoginControl/profileTabContent.php';
?>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('#loginHistory').addClass('in');
});
</script>
<?php
$_page->print();
?>

View file

@ -1,102 +1,89 @@
<?php
require_once dirname(__FILE__) . '/../../../videos/configuration.php';
AVideoPlugin::loadPlugin("LoginControl");
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo __("PGP Challenge"); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<br>
<div class="container">
<div class="row">
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo __('Two-Factor Challenge'); ?>
<button class="btn btn-default btn-xs pull-right" onclick="avideoModalIframe(webSiteRootURL + 'plugin/LoginControl/pgp/keys.php')"><i class="fas fa-key"></i> <?php echo __('Generate Keys'); ?>/<?php echo __('Tools'); ?></button>
<button class="btn btn-default pull-right btn-xs" onclick="copyToClipboard($('#pgpChallenge').val());"><i class="fas fa-copy"></i> <?php echo __('Copy to clipboard') ?></button>
</div>
<div class="panel-body">
<textarea class="form-control" rows="10" id="pgpChallenge"><?php echo LoginControl::getChallenge(); ?></textarea>
<?php echo __('Two-Factor Response'); ?>
<input type="text" class="form-control" id="pgpResponse" placeholder="<?php echo __('Enter Code'); ?>"/>
</div>
<div class="panel-footer">
<button class="btn btn-block btn-primary" onclick="checkCode();"><?php echo __('Check Code') ?></button>
</div>
</div>
<?php
require_once dirname(__FILE__) . '/../../../videos/configuration.php';
AVideoPlugin::loadPlugin("LoginControl");
$_page = new Page(array('PGP Challenge'));
?>
<div class="container">
<div class="row">
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo __('Two-Factor Challenge'); ?>
<button class="btn btn-default btn-xs pull-right" onclick="avideoModalIframe(webSiteRootURL + 'plugin/LoginControl/pgp/keys.php')"><i class="fas fa-key"></i> <?php echo __('Generate Keys'); ?>/<?php echo __('Tools'); ?></button>
<button class="btn btn-default pull-right btn-xs" onclick="copyToClipboard($('#pgpChallenge').val());"><i class="fas fa-copy"></i> <?php echo __('Copy to clipboard') ?></button>
</div>
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo __('Challenge Decryptor'); ?>
<i class="fas fa-info-circle" data-toggle="tooltip" title="<?php echo __('To increase your security, we recommend that you use your own PGP tools (offsite)'); ?>"></i>
</div>
<div class="panel-body">
<textarea class="form-control" rows="10" id="privateKeyToDecryptMsg" placeholder="<?php echo __('Private Key'); ?>"></textarea>
<?php echo __('Key Password'); ?>
<input type="password" class="form-control" id="keyPasswordToDecrypt" placeholder="<?php echo __('Key Password'); ?>"/>
</div>
<div class="panel-footer">
<button class="btn btn-block btn-primary" onclick="decryptMessage();"><?php echo __('Decrypt') ?></button>
</div>
</div>
<div class="panel-body">
<textarea class="form-control" rows="10" id="pgpChallenge"><?php echo LoginControl::getChallenge(); ?></textarea>
<?php echo __('Two-Factor Response'); ?>
<input type="text" class="form-control" id="pgpResponse" placeholder="<?php echo __('Enter Code'); ?>" />
</div>
<div class="panel-footer">
<button class="btn btn-block btn-primary" onclick="checkCode();"><?php echo __('Check Code') ?></button>
</div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
function checkCode() {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/LoginControl/pgp/verifyChallenge.json.php',
method: 'POST',
data: {
'response': $('#pgpResponse').val()
},
success: function (response) {
if (response.error) {
avideoAlertError(response.msg);
modal.hidePleaseWait();
} else {
avideoToastSuccess("Success");
location.reload();
}
}
});
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo __('Challenge Decryptor'); ?>
<i class="fas fa-info-circle" data-toggle="tooltip" title="<?php echo __('To increase your security, we recommend that you use your own PGP tools (offsite)'); ?>"></i>
</div>
<div class="panel-body">
<textarea class="form-control" rows="10" id="privateKeyToDecryptMsg" placeholder="<?php echo __('Private Key'); ?>"></textarea>
<?php echo __('Key Password'); ?>
<input type="password" class="form-control" id="keyPasswordToDecrypt" placeholder="<?php echo __('Key Password'); ?>" />
</div>
<div class="panel-footer">
<button class="btn btn-block btn-primary" onclick="decryptMessage();"><?php echo __('Decrypt') ?></button>
</div>
</div>
</div>
</div>
</div>
<script>
function checkCode() {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/LoginControl/pgp/verifyChallenge.json.php',
method: 'POST',
data: {
'response': $('#pgpResponse').val()
},
success: function(response) {
if (response.error) {
avideoAlertError(response.msg);
modal.hidePleaseWait();
} else {
avideoToastSuccess("Success");
location.reload();
}
}
function decryptMessage() {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/LoginControl/pgp/decryptMessage.json.php',
method: 'POST',
data: {
'privateKeyToDecryptMsg': $('#privateKeyToDecryptMsg').val(),
'textToDecrypt': $('#pgpChallenge').val(),
'keyPassword': $('#keyPasswordToDecrypt').val()
},
success: function (response) {
if (response.error) {
modal.hidePleaseWait();
avideoAlertError(response.msg);
} else {
$('#pgpResponse').val(response.textDecrypted);
modal.hidePleaseWait();
checkCode();
}
}
});
});
}
function decryptMessage() {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/LoginControl/pgp/decryptMessage.json.php',
method: 'POST',
data: {
'privateKeyToDecryptMsg': $('#privateKeyToDecryptMsg').val(),
'textToDecrypt': $('#pgpChallenge').val(),
'keyPassword': $('#keyPasswordToDecrypt').val()
},
success: function(response) {
if (response.error) {
modal.hidePleaseWait();
avideoAlertError(response.msg);
} else {
$('#pgpResponse').val(response.textDecrypted);
modal.hidePleaseWait();
checkCode();
}
}
</script>
</body>
</html>
});
}
</script>
<?php
$_page->print();
?>

View file

@ -1,73 +1,60 @@
<?php
require_once '../../../videos/configuration.php';
AVideoPlugin::loadPlugin("LoginControl");
require_once $global['systemRootPath'] . 'plugin/LoginControl/pgp/functions.php';
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo __("PGP Keys"); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<style>
.monospacedKey{
font-family: 'Courier New', monospace;
font-size: 0.8em;
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<br>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading tabbable-line">
<ul class="nav nav-tabs">
<li class="nav-item active">
<a class="nav-link " href="#decryptMessage" data-toggle="tab">
<i class="fas fa-unlock"></i> <?php echo __('Decrypt Message') ?>
</a>
</li>
<li class="nav-item">
<a class="nav-link " href="#encryptMessage" data-toggle="tab">
<i class="fas fa-lock"></i> <?php echo __('Encrypt Message') ?>
</a>
</li>
<li class="nav-item ">
<a class="nav-link " href="#generateKeys" data-toggle="tab">
<i class="fas fa-key"></i> <?php echo __('Generate Keys') ?>
</a>
</li>
</ul>
</div>
<div class="panel-body">
<div class="tab-content clearfix">
<div class="tab-pane active" id="decryptMessage">
<?php
include $global['systemRootPath'] . 'plugin/LoginControl/pgp/decryptMessage.php';
?>
</div>
<div class="tab-pane" id="encryptMessage">
<?php
include $global['systemRootPath'] . 'plugin/LoginControl/pgp/encryptMessage.php';
?>
</div>
<div class="tab-pane " id="generateKeys">
<?php
include $global['systemRootPath'] . 'plugin/LoginControl/pgp/generateKeys.php';
?>
</div>
</div>
<?php
require_once '../../../videos/configuration.php';
AVideoPlugin::loadPlugin("LoginControl");
require_once $global['systemRootPath'] . 'plugin/LoginControl/pgp/functions.php';
AVideoPlugin::loadPlugin("LoginControl");
$_page = new Page(array('PGP Keys'));
?>
<style>
.monospacedKey {
font-family: 'Courier New', monospace;
font-size: 0.8em;
}
</style>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading tabbable-line">
<ul class="nav nav-tabs">
<li class="nav-item active">
<a class="nav-link " href="#decryptMessage" data-toggle="tab">
<i class="fas fa-unlock"></i> <?php echo __('Decrypt Message') ?>
</a>
</li>
<li class="nav-item">
<a class="nav-link " href="#encryptMessage" data-toggle="tab">
<i class="fas fa-lock"></i> <?php echo __('Encrypt Message') ?>
</a>
</li>
<li class="nav-item ">
<a class="nav-link " href="#generateKeys" data-toggle="tab">
<i class="fas fa-key"></i> <?php echo __('Generate Keys') ?>
</a>
</li>
</ul>
</div>
<div class="panel-body">
<div class="tab-content clearfix">
<div class="tab-pane active" id="decryptMessage">
<?php
include $global['systemRootPath'] . 'plugin/LoginControl/pgp/decryptMessage.php';
?>
</div>
<div class="tab-pane" id="encryptMessage">
<?php
include $global['systemRootPath'] . 'plugin/LoginControl/pgp/encryptMessage.php';
?>
</div>
<div class="tab-pane " id="generateKeys">
<?php
include $global['systemRootPath'] . 'plugin/LoginControl/pgp/generateKeys.php';
?>
</div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
</div>
</div>
<?php
$_page->print();
?>

View file

@ -1,6 +1,6 @@
<?php
$uid = uniqid();
?>
<?php
$uid = uniqid();
?>
<div class="material-switch">
<input class="playerSwitchDefault" data-toggle="toggle" type="checkbox" value="" id="switch<?php echo $uid; ?>" <?php echo (LoginControl::is2FAEnabled($users_id)) ? "checked" : ""; ?>>
<label for="switch<?php echo $uid; ?>" class="label-primary"></label>
@ -10,7 +10,7 @@ $uid = uniqid();
$('#switch<?php echo $uid; ?>').change(function (e) {
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/LoginControl/set.json.php',
url: webSiteRootURL+'plugin/LoginControl/set.json.php',
data: {"type": "set2FA", "value": $('#switch<?php echo $uid; ?>').is(":checked")},
type: 'post',
success: function (response) {

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
@ -113,7 +113,7 @@ if (!User::isAdmin()) {
$(document).ready(function () {
$('#addMeet_join_logBtn').click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Meet/View/addMeet_join_logVideo.php',
url: webSiteRootURL+'plugin/Meet/View/addMeet_join_logVideo.php',
data: $('#panelMeet_join_logForm').serialize(),
type: 'post',
success: function (response) {
@ -152,7 +152,7 @@ if (!User::isAdmin()) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Meet/View/Meet_join_log/add.json.php',
url: webSiteRootURL+'plugin/Meet/View/Meet_join_log/add.json.php',
data: $('#panelMeet_join_logForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
@ -153,7 +153,7 @@ if (!User::isAdmin()) {
$(document).ready(function () {
$('#addMeet_scheduleBtn').click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Meet/View/addMeet_scheduleVideo.php',
url: webSiteRootURL+'plugin/Meet/View/addMeet_scheduleVideo.php',
data: $('#panelMeet_scheduleForm').serialize(),
type: 'post',
success: function (response) {
@ -199,7 +199,7 @@ if (!User::isAdmin()) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Meet/View/Meet_schedule/add.json.php',
url: webSiteRootURL+'plugin/Meet/View/Meet_schedule/add.json.php',
data: $('#panelMeet_scheduleForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
@ -21,7 +21,7 @@ if (!User::isAdmin()) {
<div class="panel-body">
<form id="panelMeet_schedule_has_users_groupsForm">
<div class="row">
<input type="hidden" name="id" id="Meet_schedule_has_users_groupsid" value="" >
<input type="hidden" name="id" id="Meet_schedule_has_users_groupsid" value="" >
<div class="form-group col-sm-12">
<label for="Meet_schedule_has_users_groupsmeet_schedule_id"><?php echo __("Meet Schedule Id"); ?>:</label>
<select class="form-control input-sm" name="meet_schedule_id" id="Meet_schedule_has_users_groupsmeet_schedule_id">
@ -32,7 +32,7 @@ if (!User::isAdmin()) {
}
?>
</select>
</div>
</div>
<div class="form-group col-sm-12">
<label for="Meet_schedule_has_users_groupsusers_groups_id"><?php echo __("Users Groups Id"); ?>:</label>
<select class="form-control input-sm" name="users_groups_id" id="Meet_schedule_has_users_groupsusers_groups_id">
@ -92,14 +92,14 @@ if (!User::isAdmin()) {
<script type="text/javascript">
function clearMeet_schedule_has_users_groupsForm() {
$('#Meet_schedule_has_users_groupsid').val('');
$('#Meet_schedule_has_users_groupsmeet_schedule_id').val('');
$('#Meet_schedule_has_users_groupsid').val('');
$('#Meet_schedule_has_users_groupsmeet_schedule_id').val('');
$('#Meet_schedule_has_users_groupsusers_groups_id').val('');
}
$(document).ready(function () {
$('#addMeet_schedule_has_users_groupsBtn').click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Meet/View/addMeet_schedule_has_users_groupsVideo.php',
url: webSiteRootURL+'plugin/Meet/View/addMeet_schedule_has_users_groupsVideo.php',
data: $('#panelMeet_schedule_has_users_groupsForm').serialize(),
type: 'post',
success: function (response) {
@ -136,7 +136,7 @@ $('#Meet_schedule_has_users_groupsusers_groups_id').val('');
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Meet/View/Meet_schedule_has_users_groups/add.json.php',
url: webSiteRootURL+'plugin/Meet/View/Meet_schedule_has_users_groups/add.json.php',
data: $('#panelMeet_schedule_has_users_groupsForm').serialize(),
type: 'post',
success: function (response) {
@ -187,8 +187,8 @@ $('#Meet_schedule_has_users_groupsusers_groups_id').val('');
e.preventDefault();
var tr = $(this).closest('tr')[0];
var data = Meet_schedule_has_users_groupstableVar.row(tr).data();
$('#Meet_schedule_has_users_groupsid').val(data.id);
$('#Meet_schedule_has_users_groupsmeet_schedule_id').val(data.meet_schedule_id);
$('#Meet_schedule_has_users_groupsid').val(data.id);
$('#Meet_schedule_has_users_groupsmeet_schedule_id').val(data.meet_schedule_id);
$('#Meet_schedule_has_users_groupsusers_groups_id').val(data.users_groups_id);
});
});

View file

@ -1,58 +1,42 @@
<?php
require_once '../../../videos/configuration.php';
AVideoPlugin::loadPlugin("Meet");
$_page = new Page(array('Meet'));
$_page->loadBasicCSSAndJS();
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo __("Meet") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.css"/>
<link href="<?php echo getCDN(); ?>view/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Meet') ?>
<div class="pull-right">
<?php echo AVideoPlugin::getSwitchButton("Meet"); ?>
</div>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Meet') ?>
<div class="pull-right">
<?php echo AVideoPlugin::getSwitchButton("Meet"); ?>
</div>
</div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#Meet_schedule"><?php echo __("Meet Schedule"); ?></a></li>
<li class=""><a data-toggle="tab" href="#Meet_schedule_has_users_groups"><?php echo __("Meet Schedule Has Users Groups"); ?></a></li>
<li class=""><a data-toggle="tab" href="#Meet_join_log"><?php echo __("Meet Join Log"); ?></a></li>
</ul>
<div class="tab-content">
<div id="Meet_schedule" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/Meet/View/Meet_schedule/index_body.php';
?>
</div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#Meet_schedule"><?php echo __("Meet Schedule"); ?></a></li>
<li class=""><a data-toggle="tab" href="#Meet_schedule_has_users_groups"><?php echo __("Meet Schedule Has Users Groups"); ?></a></li>
<li class=""><a data-toggle="tab" href="#Meet_join_log"><?php echo __("Meet Join Log"); ?></a></li>
</ul>
<div class="tab-content">
<div id="Meet_schedule" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/Meet/View/Meet_schedule/index_body.php';
?>
</div>
<div id="Meet_schedule_has_users_groups" class="tab-pane fade " style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/Meet/View/Meet_schedule_has_users_groups/index_body.php';
?>
</div>
<div id="Meet_join_log" class="tab-pane fade " style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/Meet/View/Meet_join_log/index_body.php';
?>
</div>
</div>
<div id="Meet_schedule_has_users_groups" class="tab-pane fade " style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/Meet/View/Meet_schedule_has_users_groups/index_body.php';
?>
</div>
<div id="Meet_join_log" class="tab-pane fade " style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/Meet/View/Meet_join_log/index_body.php';
?>
</div>
</div>
</div>
<script type="text/javascript" src="<?php echo getURL('view/css/DataTables/datatables.min.js'); ?>"></script>
<script src="<?php echo getCDN(); ?>js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
</div>
</div>
<?php
$_page->print();
?>

View file

@ -13,7 +13,7 @@ if (empty($obj)) {
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
@ -26,362 +26,349 @@ $m = AVideoPlugin::loadPlugin("Meet");
$emptyObject = $m->getEmptyDataObject();
$timeouts = 2000;
$_page = new Page(array('Check Meet Servers'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo __("Check Meet Servers") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading">
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Meet/" class="btn btn-default" data-toggle="tooltip" title="<?php echo __("Create a Meet"); ?> " data-placement="bottom" >
<i class="fas fa-comments"></i> <?php echo __("Create a Meet"); ?>
</a>
</div>
<div class="panel-body tabbable-line">
<div class="row">
<?php
foreach ($emptyObject->server->type as $key => $value) {
if ($key == "custom") {
?>
<div class="col-xs-6">
<div class="panel panel-default" id="panel<?php echo $newKey; ?>">
<div class="panel-heading ">
<?php
echo "<b>{$value} ({$obj->CUSTOM_JITSI_DOMAIN})</b> ";
if ($obj->server->value !== $key) {
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading">
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Meet/" class="btn btn-default" data-toggle="tooltip" title="<?php echo __("Create a Meet"); ?> " data-placement="bottom">
<i class="fas fa-comments"></i> <?php echo __("Create a Meet"); ?>
</a>
</div>
<div class="panel-body tabbable-line">
<div class="row">
<?php
foreach ($emptyObject->server->type as $key => $value) {
if ($key == "custom") {
?>
<div class="col-xs-6">
<div class="panel panel-default" id="panel<?php echo $newKey; ?>">
<div class="panel-heading ">
<?php
echo "<b>{$value} ({$obj->CUSTOM_JITSI_DOMAIN})</b> ";
if ($obj->server->value !== $key) {
?>
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Meet/?newServer=<?php echo $key; ?>" data-toggle="tooltip" data-placement="bottom" title="Change to (<?php echo $value; ?>) server" >
<i class="fas fa-random" ></i>
</a>
<?php
} else {
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Meet/?newServer=<?php echo $key; ?>" data-toggle="tooltip" data-placement="bottom" title="Change to (<?php echo $value; ?>) server">
<i class="fas fa-random"></i>
</a>
<?php
} else {
?>
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Meet/" data-toggle="tooltip" data-placement="bottom" title="Stay on (<?php echo $value; ?>)" >
<i class="fas fa-check" ></i>
</a>
<?php
} ?>
</div>
</div>
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Meet/" data-toggle="tooltip" data-placement="bottom" title="Stay on (<?php echo $value; ?>)">
<i class="fas fa-check"></i>
</a>
<?php
} ?>
</div>
<?php
} else {
$newKey = str_replace(".", "_", $key); ?>
<div class="col-xs-6">
<div class="panel panel-default" id="panel<?php echo $newKey; ?>">
<div class="panel-heading ">
<?php
echo "<b>{$value}</b> ";
if ($obj->server->value !== $key) {
</div>
</div>
<?php
} else {
$newKey = str_replace(".", "_", $key); ?>
<div class="col-xs-6">
<div class="panel panel-default" id="panel<?php echo $newKey; ?>">
<div class="panel-heading ">
<?php
echo "<b>{$value}</b> ";
if ($obj->server->value !== $key) {
?>
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Meet/?newServer=<?php echo $key; ?>" data-toggle="tooltip" data-placement="bottom" title="Change to (<?php echo $value; ?>) server" >
<i class="fas fa-random" ></i>
</a>
<?php
} else {
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Meet/?newServer=<?php echo $key; ?>" data-toggle="tooltip" data-placement="bottom" title="Change to (<?php echo $value; ?>) server">
<i class="fas fa-random"></i>
</a>
<?php
} else {
?>
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Meet/" data-toggle="tooltip" data-placement="bottom" title="Stay on (<?php echo $value; ?>)" >
<i class="fas fa-check" ></i>
</a>
<?php
} ?>
<span class="label label-primary grade pull-right" id="grade<?php echo $newKey; ?>">
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/Meet/" data-toggle="tooltip" data-placement="bottom" title="Stay on (<?php echo $value; ?>)">
<i class="fas fa-check"></i>
</a>
<?php
} ?>
<span class="label label-primary grade pull-right" id="grade<?php echo $newKey; ?>">
<i class="fas fa-cog"></i>
</span>
</div>
<div class="panel-body">
<ul class="list-group">
<li class="list-group-item">
<i class="fas fa-download"></i> Download Speed
<small class="text-muted" id='gradespeed<?php echo $newKey; ?>'></small>
<span class="badge" id='speed<?php echo $newKey; ?>'>
<i class="fas fa-cog"></i>
</span>
</div>
<div class="panel-body">
<ul class="list-group">
<li class="list-group-item">
<i class="fas fa-download"></i> Download Speed
<small class="text-muted" id='gradespeed<?php echo $newKey; ?>'></small>
<span class="badge" id='speed<?php echo $newKey; ?>'>
<i class="fas fa-cog"></i>
</span>
</li>
<li class="list-group-item">
<i class="fas fa-upload"></i> Upload Speed
<small class="text-muted" id='gradeUspeed<?php echo $newKey; ?>'></small>
<span class="badge" id='Uspeed<?php echo $newKey; ?>'>
<i class="fas fa-cog"></i>
</span>
</li>
<li class="list-group-item">
<i class="fas fa-stopwatch"></i> Response Time
<small class="text-muted" id='graderesponse<?php echo $newKey; ?>'></small>
<span class="badge" id='response<?php echo $newKey; ?>'>
<i class="fas fa-cog"></i>
</span>
</li>
<li class="list-group-item">
<i class="fas fa-network-wired"></i> Sites Active
<small class="text-muted" id='gradetotalSitesActive<?php echo $newKey; ?>'></small>
<span class="badge" id='totalSitesActive<?php echo $newKey; ?>'>
<i class="fas fa-cog"></i>
</span>
</li>
<li class="list-group-item">
<i class="fas fa-video"></i> Streamers Services
<small class="text-muted" id='gradeStreamersServices<?php echo $newKey; ?>'></small>
<span class="badge" id='StreamersServices<?php echo $newKey; ?>'>
<i class="fas fa-cog"></i>
</span>
</li>
</ul>
</div>
</div>
</li>
<li class="list-group-item">
<i class="fas fa-upload"></i> Upload Speed
<small class="text-muted" id='gradeUspeed<?php echo $newKey; ?>'></small>
<span class="badge" id='Uspeed<?php echo $newKey; ?>'>
<i class="fas fa-cog"></i>
</span>
</li>
<li class="list-group-item">
<i class="fas fa-stopwatch"></i> Response Time
<small class="text-muted" id='graderesponse<?php echo $newKey; ?>'></small>
<span class="badge" id='response<?php echo $newKey; ?>'>
<i class="fas fa-cog"></i>
</span>
</li>
<li class="list-group-item">
<i class="fas fa-network-wired"></i> Sites Active
<small class="text-muted" id='gradetotalSitesActive<?php echo $newKey; ?>'></small>
<span class="badge" id='totalSitesActive<?php echo $newKey; ?>'>
<i class="fas fa-cog"></i>
</span>
</li>
<li class="list-group-item">
<i class="fas fa-video"></i> Streamers Services
<small class="text-muted" id='gradeStreamersServices<?php echo $newKey; ?>'></small>
<span class="badge" id='StreamersServices<?php echo $newKey; ?>'>
<i class="fas fa-cog"></i>
</span>
</li>
</ul>
</div>
<?php
}
}
?>
</div>
</div>
<?php
}
}
?>
</div>
<div class="row">
<div class="col-sm-12">
<div class="alert alert-info">
Before Change the server make sure you do not have any meeting running.
Other users may not able to connect after you change it.
</div>
<div class="row">
<div class="col-sm-12">
<div class="alert alert-info">
Before Change the server make sure you do not have any meeting running.
Other users may not able to connect after you change it.
</div>
</div>
<div class="col-sm-12">
<div class="alert alert-info">
Higher grade, means the server is better for a meeting.
</div>
</div>
</div>
<div class="col-sm-12">
<div class="alert alert-info">
Higher grade, means the server is better for a meeting.
</div>
</div>
</div>
</div>
</div>
<script>
var roundedDecimals = 2;
var bytesInAKilobyte = 1024;
var tries = 1;
var timeouts = <?php echo $timeouts; ?>;
function speed(bitsPerSecond) {
var Kbps = (bitsPerSecond / bytesInAKilobyte).toFixed(roundedDecimals);
if (Kbps <= 1)
return {
value: bitsPerSecond,
units: "Bps"
};
var MBps = (Kbps / bytesInAKilobyte).toFixed(roundedDecimals);
//if (MBps <= 1)
return {
value: Kbps,
units: "Kbps",
text: Kbps + " Kbps",
bitsPerSecond: bitsPerSecond
};
//else
//return {value: MBps, units: "MBps", text: MBps + " MBps", bitsPerSecond: bitsPerSecond};
}
function checkSpeed(server) {
var imageAddr = "https://" + server + "/jesus.png?n=" + Math.random();
var startTime, endTime;
var downloadSize = 3881702; //3.70 MB
var download = new Image();
var serverId = server.replace(/[.]/g, "_");
var speedId = '#speed' + serverId;
var gradespeedId = '#gradespeed' + serverId;
download.onload = function() {
endTime = (new Date()).getTime();
var duration = (endTime - startTime) / 1000;
var bitsLoaded = downloadSize * 8;
var speedBps = (bitsLoaded / duration).toFixed(roundedDecimals);
var response = speed(speedBps);
console.log(speedBps);
$(gradespeedId).html("+" + (speedBps / 1000000).toFixed(2));
sitesGrade[server] += (speedBps / 1000000);
animateValue('speed' + serverId, 0, response.value, timeouts * 2, "", response.units);
}
download.onerror = function() {
$(speedId).html(response.text);
}
startTime = (new Date()).getTime();
download.src = imageAddr;
}
function checkServerUsage(server) {
var ajaxTime = new Date().getTime();
$.ajax({
url: "https://" + server + "/api/info.json.php",
}).done(function(response) {
var totalTime = new Date().getTime() - ajaxTime;
var serverId = server.replace(/[.]/g, "_");
animateValue('response' + serverId, 0, totalTime, timeouts * 2, "", "ms");
animateValue('totalSitesActive' + serverId, 0, response.totalSitesActive, timeouts * 2, "", "/" + (response.totalSitesActive + response.totalSitesInactive));
animateValue('StreamersServices' + serverId, 0, response.totalOnlineLiveStreamersServices, timeouts * 2, "", "/" + (response.totalLiveStreamersServices));
// calculate grade
sitesGrade[server] -= (response.totalOnlineLiveStreamersServices * 10);
sitesGrade[server] -= (response.totalLiveStreamersServices);
sitesGrade[server] -= (response.totalSitesActive);
sitesGrade[server] -= (totalTime / 50);
$('#graderesponse' + serverId).html("-" + (totalTime / 50).toFixed(2));
$('#gradetotalSitesActive' + serverId).html("-" + (response.totalSitesActive).toFixed(2));
$('#gradeStreamersServices' + serverId).html("-" + ((response.totalOnlineLiveStreamersServices * 10) + (response.totalLiveStreamersServices)).toFixed(2));
// Here I want to get the how long it took to load some.php and use it further
}).fail(function(jqXHR, textStatus) {
tries++;
setTimeout(function() {
checkServerUsage(server);
}, tries * timeouts);
});
}
function check(server) {
checkSpeed(server);
checkServerUsage(server);
}
function checkGrades() {
bestGrade = -1;
bestGradeServer = '';
for (const server in sitesGrade) {
if (bestGrade < sitesGrade[server]) {
bestGrade = sitesGrade[server];
bestGradeServer = server;
}
var serverId = server.replace(/[.]/g, "_");
$('#grade' + serverId).html("Grade: " + (sitesGrade[server].toFixed(2)));
}
var serverId = bestGradeServer.replace(/[.]/g, "_");
$('.grade').not('#grade' + serverId).removeClass('label-success');
$('.grade').not('#grade' + serverId).addClass('label-primary');
$('#grade' + serverId).addClass('label-success');
$('#grade' + serverId).removeClass('label-primary');
}
function checkUploadSpeed(server, iterations, update) {
var average = 0,
index = 0,
timer = window.setInterval(check, 5000);
check();
function check() {
var xhr = new XMLHttpRequest(),
url = 'https://' + server + '?cache=' + Math.floor(Math.random() * 10000), //prevent url cache
data = getRandomString(1), //1 meg POST size handled by all servers
startTime,
speed = 0;
xhr.onreadystatechange = function(event) {
if (xhr.readyState == 4) {
speed = Math.round(1024 / ((new Date() - startTime) / 1000));
average == 0 ?
average = speed :
average = Math.round((average + speed) / 2);
update(speed, average);
index++;
if (index == iterations) {
window.clearInterval(timer);
};
};
};
xhr.open('POST', url, true);
startTime = new Date();
xhr.send(data);
};
function getRandomString(sizeInMb) {
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~!@#$%^&*()_+`-=[]\{}|;':,./<>?", //random data prevents gzip effect
iterations = sizeInMb * 1024 * 1024, //get byte count
result = '';
for (var index = 0; index < iterations; index++) {
result += chars.charAt(Math.floor(Math.random() * chars.length));
};
return result;
};
}
function runAll(server) {
var serverId = server.replace(/[.]/g, '_');
$('#panel' + serverId + " .fa-cog").addClass('fa-spin');
sitesGrade[server] = 100;
check(server);
checkUploadSpeed(server, 1, function(speed, average) {
var serverId = server.replace(/[.]/g, '_');
animateValue('Uspeed' + serverId, 0, average, timeouts * 2, "", "Kbps");
if (previewsGrade[server]) {
sitesGrade[server] -= previewsGrade[server];
}
previewsGrade[server] = (average / 50);
sitesGrade[server] += previewsGrade[server];
$('#gradeUspeed' + serverId).html('+' + previewsGrade[server].toFixed(2));
});
}
function animateValue(id, start, end, duration, prepend, postpend) {
// assumes integer values for start and end
var obj = document.getElementById(id);
var range = end - start;
// no timer shorter than 50ms (not really visible any way)
var minTimer = 50;
// calc step time to show all interediate values
var stepTime = Math.abs(Math.floor(duration / range));
// never go below minTimer
stepTime = Math.max(stepTime, minTimer);
// get current time and calculate desired end time
var startTime = new Date().getTime();
var endTime = startTime + duration;
var timer;
function run() {
var now = new Date().getTime();
var remaining = Math.max((endTime - now) / duration, 0);
var value = Math.round(end - (remaining * range));
obj.innerHTML = prepend + " " + value + " " + postpend;
if (value == end) {
clearInterval(timer);
}
}
timer = setInterval(run, stepTime);
run();
}
var previewsGrade = {};
var sitesGrade = {};
$(document).ready(function() {
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
$count = 0;
foreach ($emptyObject->server->type as $key => $value) {
if ($key == 'custom') {
continue;
}
$count++;
echo "setTimeout(function(){runAll('{$key}')}," . ($count * $timeouts) . ");";
}
?>
<script>
var roundedDecimals = 2;
var bytesInAKilobyte = 1024;
var tries = 1;
var timeouts = <?php echo $timeouts; ?>;
function speed(bitsPerSecond) {
var Kbps = (bitsPerSecond / bytesInAKilobyte).toFixed(roundedDecimals);
if (Kbps <= 1)
return {value: bitsPerSecond, units: "Bps"};
var MBps = (Kbps / bytesInAKilobyte).toFixed(roundedDecimals);
//if (MBps <= 1)
return {value: Kbps, units: "Kbps", text: Kbps + " Kbps", bitsPerSecond: bitsPerSecond};
//else
//return {value: MBps, units: "MBps", text: MBps + " MBps", bitsPerSecond: bitsPerSecond};
}
function checkSpeed(server) {
var imageAddr = "https://" + server + "/jesus.png?n=" + Math.random();
var startTime, endTime;
var downloadSize = 3881702;//3.70 MB
var download = new Image();
var serverId = server.replace(/[.]/g, "_");
var speedId = '#speed' + serverId;
var gradespeedId = '#gradespeed' + serverId;
download.onload = function () {
endTime = (new Date()).getTime();
var duration = (endTime - startTime) / 1000;
var bitsLoaded = downloadSize * 8;
var speedBps = (bitsLoaded / duration).toFixed(roundedDecimals);
var response = speed(speedBps);
console.log(speedBps);
$(gradespeedId).html("+" + (speedBps / 1000000).toFixed(2));
sitesGrade[server] += (speedBps / 1000000);
animateValue('speed' + serverId, 0, response.value, timeouts * 2, "", response.units);
}
download.onerror = function () {
$(speedId).html(response.text);
}
startTime = (new Date()).getTime();
download.src = imageAddr;
}
function checkServerUsage(server) {
var ajaxTime = new Date().getTime();
$.ajax({
url: "https://" + server + "/api/info.json.php",
}).done(function (response) {
var totalTime = new Date().getTime() - ajaxTime;
var serverId = server.replace(/[.]/g, "_");
animateValue('response' + serverId, 0, totalTime, timeouts * 2, "", "ms");
animateValue('totalSitesActive' + serverId, 0, response.totalSitesActive, timeouts * 2, "", "/" + (response.totalSitesActive + response.totalSitesInactive));
animateValue('StreamersServices' + serverId, 0, response.totalOnlineLiveStreamersServices, timeouts * 2, "", "/" + (response.totalLiveStreamersServices));
// calculate grade
sitesGrade[server] -= (response.totalOnlineLiveStreamersServices * 10);
sitesGrade[server] -= (response.totalLiveStreamersServices);
sitesGrade[server] -= (response.totalSitesActive);
sitesGrade[server] -= (totalTime / 50);
$('#graderesponse' + serverId).html("-" + (totalTime / 50).toFixed(2));
$('#gradetotalSitesActive' + serverId).html("-" + (response.totalSitesActive).toFixed(2));
$('#gradeStreamersServices' + serverId).html("-" + ((response.totalOnlineLiveStreamersServices * 10) + (response.totalLiveStreamersServices)).toFixed(2));
// Here I want to get the how long it took to load some.php and use it further
}).fail(function (jqXHR, textStatus) {
tries++;
setTimeout(function () {
checkServerUsage(server);
}, tries * timeouts);
});
}
function check(server) {
checkSpeed(server);
checkServerUsage(server);
}
function checkGrades() {
bestGrade = -1;
bestGradeServer = '';
for (const server in sitesGrade) {
if (bestGrade < sitesGrade[server]) {
bestGrade = sitesGrade[server];
bestGradeServer = server;
}
var serverId = server.replace(/[.]/g, "_");
$('#grade' + serverId).html("Grade: " + (sitesGrade[server].toFixed(2)));
}
var serverId = bestGradeServer.replace(/[.]/g, "_");
$('.grade').not('#grade' + serverId).removeClass('label-success');
$('.grade').not('#grade' + serverId).addClass('label-primary');
$('#grade' + serverId).addClass('label-success');
$('#grade' + serverId).removeClass('label-primary');
}
function checkUploadSpeed(server, iterations, update) {
var average = 0,
index = 0,
timer = window.setInterval(check, 5000);
check();
function check() {
var xhr = new XMLHttpRequest(),
url = 'https://' + server + '?cache=' + Math.floor(Math.random() * 10000), //prevent url cache
data = getRandomString(1), //1 meg POST size handled by all servers
startTime,
speed = 0;
xhr.onreadystatechange = function (event) {
if (xhr.readyState == 4) {
speed = Math.round(1024 / ((new Date() - startTime) / 1000));
average == 0
? average = speed
: average = Math.round((average + speed) / 2);
update(speed, average);
index++;
if (index == iterations) {
window.clearInterval(timer);
}
;
}
;
};
xhr.open('POST', url, true);
startTime = new Date();
xhr.send(data);
}
;
function getRandomString(sizeInMb) {
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~!@#$%^&*()_+`-=[]\{}|;':,./<>?", //random data prevents gzip effect
iterations = sizeInMb * 1024 * 1024, //get byte count
result = '';
for (var index = 0; index < iterations; index++) {
result += chars.charAt(Math.floor(Math.random() * chars.length));
}
;
return result;
}
;
}
function runAll(server) {
var serverId = server.replace(/[.]/g, '_');
$('#panel' + serverId + " .fa-cog").addClass('fa-spin');
sitesGrade[server] = 100;
check(server);
checkUploadSpeed(server, 1, function (speed, average) {
var serverId = server.replace(/[.]/g, '_');
animateValue('Uspeed' + serverId, 0, average, timeouts * 2, "", "Kbps");
if (previewsGrade[server]) {
sitesGrade[server] -= previewsGrade[server];
}
previewsGrade[server] = (average / 50);
sitesGrade[server] += previewsGrade[server];
$('#gradeUspeed' + serverId).html('+' + previewsGrade[server].toFixed(2));
});
}
function animateValue(id, start, end, duration, prepend, postpend) {
// assumes integer values for start and end
var obj = document.getElementById(id);
var range = end - start;
// no timer shorter than 50ms (not really visible any way)
var minTimer = 50;
// calc step time to show all interediate values
var stepTime = Math.abs(Math.floor(duration / range));
// never go below minTimer
stepTime = Math.max(stepTime, minTimer);
// get current time and calculate desired end time
var startTime = new Date().getTime();
var endTime = startTime + duration;
var timer;
function run() {
var now = new Date().getTime();
var remaining = Math.max((endTime - now) / duration, 0);
var value = Math.round(end - (remaining * range));
obj.innerHTML = prepend + " " + value + " " + postpend;
if (value == end) {
clearInterval(timer);
}
}
timer = setInterval(run, stepTime);
run();
}
var previewsGrade = {};
var sitesGrade = {};
$(document).ready(function () {
setInterval(function() {
checkGrades();
}, 1000);
});
</script>
</div>
<?php
$count = 0;
foreach ($emptyObject->server->type as $key => $value) {
if ($key == 'custom') {
continue;
}
$count++;
echo "setTimeout(function(){runAll('{$key}')}," . ($count * $timeouts) . ");";
}
?>
setInterval(function () {
checkGrades();
}, 1000);
});
</script>
</div>
</body>
</html>
$_page->print();
?>

View file

@ -12,94 +12,85 @@ $meet = new Meet_schedule($meet_schedule_id);
$img = User::getBackgroundURLFromUserID($meet->getUsers_id());
$photo = User::getPhoto($meet->getUsers_id());
$_page = new Page(array('Confirm Meet Password'));
$_page->setIncludeNavbar(false);
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo __("Confirm Meet Password") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<style>
body {
padding-top: 0;
}
footer{
display: none;
}
#bg{
position: fixed;
width: 100%;
height: 100%;
background-image: url('<?php echo $global['webSiteRootURL'], $img; ?>');
background-size: cover;
opacity: 0.3;
filter: alpha(opacity=30); /* For IE8 and earlier */
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
//include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div id="bg"></div>
<!-- Modal -->
<div id="myModal" class="modal fade in" role="dialog">
<div class="modal-dialog">
<style>
body {
padding-top: 0;
}
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title">
<center>
<i class="fas fa-lock"></i> <?php echo __("Meet"); ?> <?php echo $meet->getTopic(); ?> <?php echo __("is Private"); ?>
</center>
</h1>
footer {
display: none;
}
#bg {
position: fixed;
width: 100%;
height: 100%;
background-image: url('<?php echo $global['webSiteRootURL'], $img; ?>');
background-size: cover;
opacity: 0.3;
filter: alpha(opacity=30);
/* For IE8 and earlier */
}
</style>
<div id="bg"></div>
<!-- Modal -->
<div id="myModal" class="modal fade in" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title">
<center>
<i class="fas fa-lock"></i> <?php echo __("Meet"); ?> <?php echo $meet->getTopic(); ?> <?php echo __("is Private"); ?>
</center>
</h1>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<img src="<?php echo $photo; ?>" class="img img-responsive" />
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6">
<img src="<?php echo $photo; ?>" class="img img-responsive"/>
</div>
<div class="col-sm-6">
<center>
<form method="post" action="<?php echo getSelfURI(); ?>">
<?php
if (!empty($_POST['meet_password'])) {
?>
<div class="alert alert-danger"><?php echo __("Your password does not match!"); ?></div>
<?php
}
?>
<div class="form-group">
<label for="meet_password"><?php echo __("This Meet Requires a Password"); ?></label>
<input type="text" class="form-control" id="meet_password" name="meet_password" placeholder="<?php echo __("Password"); ?>" required>
</div>
<div class="row">
<div class="col-md-6">
<button type="submit" class="btn btn-success btn-block"><i class="fas fa-check-circle"></i> <?php echo __("Confirm"); ?></button>
</div>
<div class="col-md-6">
<a href="<?php echo getHomePageURL(); ?>" class="btn btn-danger btn-block"><i class="fas fa-times-circle"></i> <?php echo __("Cancel"); ?></a>
</div>
</div>
</form>
</center>
</div>
</div>
<div class="col-sm-6">
<center>
<form method="post" action="<?php echo getSelfURI(); ?>">
<?php
if (!empty($_POST['meet_password'])) {
?>
<div class="alert alert-danger"><?php echo __("Your password does not match!"); ?></div>
<?php
}
?>
<div class="form-group">
<label for="meet_password"><?php echo __("This Meet Requires a Password"); ?></label>
<input type="text" class="form-control" id="meet_password" name="meet_password" placeholder="<?php echo __("Password"); ?>" required>
</div>
<div class="row">
<div class="col-md-6">
<button type="submit" class="btn btn-success btn-block"><i class="fas fa-check-circle"></i> <?php echo __("Confirm"); ?></button>
</div>
<div class="col-md-6">
<a href="<?php echo getHomePageURL(); ?>" class="btn btn-danger btn-block"><i class="fas fa-times-circle"></i> <?php echo __("Cancel"); ?></a>
</div>
</div>
</form>
</center>
</div>
</div>
</div>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script type="text/javascript">
$(window).on('load', function () {
$('#myModal').modal('show');
});
</script>
</body>
</html>
</div>
</div>
<script type="text/javascript">
$(window).on('load', function() {
$('#myModal').modal('show');
});
</script>
<?php
$_page->print();
?>

View file

@ -20,208 +20,183 @@ if (User::isAdmin() && !empty($_GET['newServer'])) {
$p = AVideoPlugin::loadPluginIfEnabled("Meet");
$p->setDataObjectParameter("server->value", preg_replace("/[^0-1a-z.]/i", "", $_GET['newServer']));
}
$_page = new Page(array('Meet'));
$_page->loadBasicCSSAndJS();
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<style>
.serverLabels {
padding-bottom: 15px;
}
<head>
<title><?php echo __("Meet") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
.serverLabels .label {
float: right;
margin: 0 2px;
}
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.css" />
<link href="<?php echo getCDN(); ?>view/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css" />
<style>
.serverLabels {
padding-bottom: 15px;
}
.serverLabels .label {
float: right;
margin: 0 2px;
}
#serverProgressBar,
#serverProgressBar .progress-bar {
transition: width 1s linear !important;
height: 2px;
margin-bottom: 0;
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading">
<i class="far fa-comments"></i> <?php echo __("Meeting"); ?>
<span id="serverTime" class="label label-default pull-right" data-toggle="tooltip" data-placement="bottom" title="Server Time"></span>
<span class="label label-default pull-right" data-toggle="tooltip" data-placement="bottom" title="Timezone"> <?php echo date_default_timezone_get(); ?> </span>
<div class="pull-right serverLabels">
<span class="label label-warning"><i class="fas fa-cog fa-spin"></i> <?php echo __("Loading Server Info"); ?></span>
</div>
<div class="clearfix"></div>
<div class="progress" id="serverProgressBar" data-toggle="tooltip" data-placement="bottom" title="Check Server Again">
<div class="progress-bar" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%; ">
</div>
#serverProgressBar,
#serverProgressBar .progress-bar {
transition: width 1s linear !important;
height: 2px;
margin-bottom: 0;
}
</style>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading">
<i class="far fa-comments"></i> <?php echo __("Meeting"); ?>
<span id="serverTime" class="label label-default pull-right" data-toggle="tooltip" data-placement="bottom" title="Server Time"></span>
<span class="label label-default pull-right" data-toggle="tooltip" data-placement="bottom" title="Timezone"> <?php echo date_default_timezone_get(); ?> </span>
<div class="pull-right serverLabels">
<span class="label label-warning"><i class="fas fa-cog fa-spin"></i> <?php echo __("Loading Server Info"); ?></span>
</div>
<div class="clearfix"></div>
<div class="progress" id="serverProgressBar" data-toggle="tooltip" data-placement="bottom" title="Check Server Again">
<div class="progress-bar" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%; ">
</div>
</div>
<div class="panel-body tabbable-line">
<div class="row">
<div class="col-xs-12 tabbable-line" id="indexTabs">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#meetLog"><i class="far fa-clock"></i> <span class="hidden-sm hidden-xs"><?php echo __("Meetings"); ?></span></a></li>
<?php
if (User::canCreateMeet()) {
?>
<li><a data-toggle="tab" href="#createMeet"><i class="far fa-calendar-alt"></i> <span class="hidden-sm hidden-xs"><?php echo __("Schedule"); ?></span></a></li>
<li><a data-toggle="tab" href="#none" onclick="_startMeetNow();return false;"><i class="far fa-comments"></i> <?php echo __("New Meet"); ?></a></li>
<?php
}
?>
</ul>
<div class="tab-content">
<div id="meetLog" class="tab-pane fade in active" url="<?php
echo $global['webSiteRootURL'] . 'plugin/Meet/meet_log.php?' . $userCredentials;
?>">
</div>
<div class="panel-body tabbable-line">
<div class="row">
<div class="col-xs-12 tabbable-line" id="indexTabs">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#meetLog"><i class="far fa-clock"></i> <span class="hidden-sm hidden-xs"><?php echo __("Meetings"); ?></span></a></li>
<?php
if (User::canCreateMeet()) {
?>
<li><a data-toggle="tab" href="#createMeet"><i class="far fa-calendar-alt"></i> <span class="hidden-sm hidden-xs"><?php echo __("Schedule"); ?></span></a></li>
<li><a data-toggle="tab" href="#none" onclick="_startMeetNow();return false;"><i class="far fa-comments"></i> <?php echo __("New Meet"); ?></a></li>
<?php
}
?>
</ul>
<div class="tab-content">
<div id="meetLog" class="tab-pane fade in active" url="<?php
echo $global['webSiteRootURL'] . 'plugin/Meet/meet_log.php?' . $userCredentials;
?>">
<div class="loader"></div>
</div>
<?php
if (User::canCreateMeet()) {
?>
<div id="createMeet" class="tab-pane fade" url="<?php
echo $global['webSiteRootURL'] . 'plugin/Meet/meet_manager.php?' . $userCredentials; ?>">
<div class="loader"></div>
</div>
<?php
if (User::canCreateMeet()) {
?>
<div id="createMeet" class="tab-pane fade" url="<?php
echo $global['webSiteRootURL'] . 'plugin/Meet/meet_manager.php?' . $userCredentials; ?>">
<div class="loader"></div>
</div>
<?php
}
?>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
var serverLabelsRequestTime;
$(document).ready(function() {
<?php $today = getdate(); ?>
var d = new Date(<?php echo $today['year'] . "," . $today['mon'] . "," . $today['mday'] . "," . $today['hours'] . "," . $today['minutes'] . "," . $today['seconds']; ?>);
setInterval(function() {
d.setSeconds(d.getSeconds() + 1);
$('#serverTime').html("<i class=\"far fa-clock\"></i> " + (d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds()));
}, 1000);
<script type="text/javascript" src="<?php echo getURL('view/css/DataTables/datatables.min.js'); ?>"></script>
<script src="<?php echo getCDN(); ?>js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
var serverLabelsRequestTime;
$(document).ready(function() {
<?php $today = getdate(); ?>
var d = new Date(<?php echo $today['year'] . "," . $today['mon'] . "," . $today['mday'] . "," . $today['hours'] . "," . $today['minutes'] . "," . $today['seconds']; ?>);
setInterval(function() {
d.setSeconds(d.getSeconds() + 1);
$('#serverTime').html("<i class=\"far fa-clock\"></i> " + (d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds()));
}, 1000);
$('#indexTabs .nav-tabs a').click(function(e) {
var href = $(this).attr('href');
if (href && href !== "#") {
var now_tab = $(href);
console.log("tab clicked");
if ($(now_tab).attr('url')) {
var url = $(now_tab).attr('url');
$(now_tab).attr('url', '');
if (url) {
$.ajax({
url: url,
success: function(response) {
$(now_tab).html(response);
}
});
$('#indexTabs .nav-tabs a').click(function(e) {
var href = $(this).attr('href');
if (href && href !== "#") {
var now_tab = $(href);
console.log("tab clicked");
if ($(now_tab).attr('url')) {
var url = $(now_tab).attr('url');
$(now_tab).attr('url', '');
if (url) {
$.ajax({
url: url,
success: function(response) {
$(now_tab).html(response);
}
} else {
console.log("no URL on tab clicked");
}
});
}
});
try {
$('#indexTabs .nav-tabs a').first().trigger("click");
} catch (e) {
} else {
console.log("no URL on tab clicked");
}
}
});
try {
$('#indexTabs .nav-tabs a').first().trigger("click");
} catch (e) {
}
serverLabels();
});
var serverLabelsStartTime;
var serverLabelsRunning = false;
function serverLabels() {
if (serverLabelsRunning) {
return false;
}
serverLabelsRunning = true;
serverLabelsStartTime = new Date().getTime();
$.ajax({
url: webSiteRootURL+'plugin/Meet/serverLabels.php?<?php echo $userCredentials; ?>',
success: function(response) {
setTimeout(function() {
serverLabelsRunning = false;
}, 2000);
serverLabelsRequestTime = new Date().getTime() - serverLabelsStartTime;
$('.serverLabels').html(response);
}
});
}
<?php
if (User::canCreateMeet()) {
?>
function _startMeetNow() {
var userCredentials = '<?php echo $userCredentials; ?>';
console.log('_startMeetNow 1');
swal({
text: __("Meet Topic"),
content: "input",
button: {
text: __("Start Now"),
closeModal: false,
},
}).then(function(name) {
if (!name)
throw null;
var url = webSiteRootURL + 'plugin/Meet/saveMeet.json.php?' + userCredentials + '&RoomTopic=' + encodeURI(name);
console.log('_startMeetNow 2', url);
return fetch(url);
}).then(function(results) {
console.log('_startMeetNow 3', results);
return results.json();
}).then(function(response) {
console.log('_startMeetNow 4', response);
if (response.error) {
avideoAlertError(response.msg);
modal.hidePleaseWait();
} else {
document.location = response.link + '?' + userCredentials;
}
}).catch(function(err) {
console.log('_startMeetNow 5', err);
if (err) {
swal("Oh noes!", "The AJAX request failed!", "error");
} else {
swal.stopLoading();
swal.close();
}
serverLabels();
});
var serverLabelsStartTime;
var serverLabelsRunning = false;
console.log('_startMeetNow 6');
return false;
function serverLabels() {
if (serverLabelsRunning) {
return false;
}
serverLabelsRunning = true;
serverLabelsStartTime = new Date().getTime();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Meet/serverLabels.php?<?php echo $userCredentials; ?>',
success: function(response) {
setTimeout(function() {
serverLabelsRunning = false;
}, 2000);
serverLabelsRequestTime = new Date().getTime() - serverLabelsStartTime;
$('.serverLabels').html(response);
}
});
}
<?php
if (User::canCreateMeet()) {
?>
function _startMeetNow() {
var userCredentials = '<?php echo $userCredentials; ?>';
console.log('_startMeetNow 1');
swal({
text: __("Meet Topic"),
content: "input",
button: {
text: __("Start Now"),
closeModal: false,
},
}).then(function(name) {
if (!name)
throw null;
var url = webSiteRootURL + 'plugin/Meet/saveMeet.json.php?' + userCredentials + '&RoomTopic=' + encodeURI(name);
console.log('_startMeetNow 2', url);
return fetch(url);
}).then(function(results) {
console.log('_startMeetNow 3', results);
return results.json();
}).then(function(response) {
console.log('_startMeetNow 4', response);
if (response.error) {
avideoAlertError(response.msg);
modal.hidePleaseWait();
} else {
document.location = response.link + '?' + userCredentials;
}
}).catch(function(err) {
console.log('_startMeetNow 5', err);
if (err) {
swal("Oh noes!", "The AJAX request failed!", "error");
} else {
swal.stopLoading();
swal.close();
}
});
console.log('_startMeetNow 6');
return false;
}
<?php
}
?>
</script>
</body>
</html>
}
<?php
}
?>
</script>
<?php
$_page->print();
?>

View file

@ -13,7 +13,7 @@ if (empty($obj)) {
}
if (!User::isLogged()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
$userCredentials = User::loginFromRequestToGet();

View file

@ -13,7 +13,7 @@ if (empty($obj)) {
}
if (!User::canCreateMeet()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
$userCredentials = User::loginFromRequestToGet();
@ -154,7 +154,7 @@ $userCredentials = User::loginFromRequestToGet();
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Meet/saveMeet.json.php?<?php echo $userCredentials; ?>',
url: webSiteRootURL+'plugin/Meet/saveMeet.json.php?<?php echo $userCredentials; ?>',
data: $('#formMeetManager').serialize(),
type: 'post',
success: function (response) {

View file

@ -1,21 +1,7 @@
<?php
require_once '../../../videos/configuration.php';
AVideoPlugin::loadPlugin("VideosStatistics");
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo $config->getWebSiteTitle(); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
include $global['systemRootPath'] . 'plugin/MonetizeUsers/View/report.php';
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
$_page = new Page(array('Monetize user'));
include $global['systemRootPath'] . 'plugin/MonetizeUsers/View/report.php';
$_page->print();
?>

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
@ -115,7 +115,7 @@ if (!User::isAdmin()) {
$(document).ready(function () {
$('#addPayPalYPT_logBtn').click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/PayPalYPT/View/addPayPalYPT_logVideo.php',
url: webSiteRootURL+'plugin/PayPalYPT/View/addPayPalYPT_logVideo.php',
data: $('#panelPayPalYPT_logForm').serialize(),
type: 'post',
success: function (response) {
@ -156,7 +156,7 @@ if (!User::isAdmin()) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/PayPalYPT/View/PayPalYPT_log/add.json.php',
url: webSiteRootURL+'plugin/PayPalYPT/View/PayPalYPT_log/add.json.php',
data: $('#panelPayPalYPT_logForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -1,46 +1,30 @@
<?php
require_once '../../../videos/configuration.php';
AVideoPlugin::loadPlugin("PayPalYPT");
$_page = new Page(array('PayPal'));
$_page->loadBasicCSSAndJS();
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo $config->getWebSiteTitle(); ?> :: PayPalYPT</title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<link rel="stylesheet" type="text/css" href="<?php echo $global['webSiteRootURL']; ?>view/css/DataTables/datatables.min.css"/>
<link href="<?php echo $global['webSiteRootURL']; ?>view/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('PayPalYPT') ?>
<div class="pull-right">
<?php echo AVideoPlugin::getSwitchButton("PayPalYPT"); ?>
</div>
</div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#PayPalYPT_log"><?php echo __("PayPalYPT Log"); ?></a></li>
</ul>
<div class="tab-content">
<div id="PayPalYPT_log" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/PayPalYPT/View/PayPalYPT_log/index_body.php';
?>
</div>
</div>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('PayPalYPT') ?>
<div class="pull-right">
<?php echo AVideoPlugin::getSwitchButton("PayPalYPT"); ?>
</div>
</div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#PayPalYPT_log"><?php echo __("PayPalYPT Log"); ?></a></li>
</ul>
<div class="tab-content">
<div id="PayPalYPT_log" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/PayPalYPT/View/PayPalYPT_log/index_body.php';
?>
</div>
</div>
</div>
<script type="text/javascript" src="<?php echo $global['webSiteRootURL']; ?>view/css/DataTables/datatables.min.js"></script>
<script src="<?php echo $global['webSiteRootURL']; ?>js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
</div>
</div>
<?php
$_page->print();
?>

View file

@ -1,6 +1,6 @@
<?php
$uid = uniqid();
?>
<?php
$uid = uniqid();
?>
<div class="form-group">
<label class="col-md-4 control-label"><?php echo __("PayPal payout email"); ?></label>
<div class="col-md-8 inputGroupContainer">
@ -35,7 +35,7 @@ $uid = uniqid();
}
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/PayPalYPT/savePayPalReceiverEmail.json.php',
url: webSiteRootURL+'plugin/PayPalYPT/savePayPalReceiverEmail.json.php',
data: {"PayPalReceiverEmail": PayPalReceiverEmail},
type: 'post',
success: function (response) {

View file

@ -7,109 +7,97 @@ if (!User::isLogged()) {
forbiddenPage();
}
$rows = PayPalYPT::getAllLogsFromUser(User::getId());
$_page = new Page(array('Paypal subscriptions'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title>Paypal subscriptions</title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container">
<div class="container">
<table class="display table table-bordered table-responsive table-striped table-hover table-condensed" width="100%" cellspacing="0">
<thead>
<tr>
<th>#</th>
<th><?php echo __("Type"); ?></th>
<th><?php echo __("Agreement ID"); ?></th>
<th><?php echo __("Status"); ?></th>
<th><?php echo __("Date"); ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach ($rows as $value) {
$json = json_decode($value['json']);
$value['status'] = '';
if (!empty($value['agreement_id'])) {
$agreement = PayPalYPT::getBillingAgreement($value['agreement_id']);
if (!empty($agreement)) {
$value['status'] = $agreement->getState();
}
} ?>
<tr id="tr<?php echo $value['agreement_id']; ?>">
<td><?php echo $value['id']; ?></td>
<td>
<?php echo $json->get->json->type; ?>
</td>
<td>
<?php echo $value['agreement_id']; ?>
</td>
<td>
<?php echo $value['created']; ?>
</td>
<td><?php echo $value['expiration']; ?></td>
<td><?php echo $value['expiration']; ?></td>
<td>
<?php
if ($value['status'] == 'Active') {
?>
<button class="btn btn-danger btn-xs" onclick="cancelAgreement('<?php echo $value['agreement_id']; ?>')">
<?php
echo __('Cancel Agreement'); ?>
</button>
<?php
} ?>
</td>
</tr>
<table class="display table table-bordered table-responsive table-striped table-hover table-condensed" width="100%" cellspacing="0">
<thead>
<tr>
<th>#</th>
<th><?php echo __("Type"); ?></th>
<th><?php echo __("Agreement ID"); ?></th>
<th><?php echo __("Status"); ?></th>
<th><?php echo __("Date"); ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach ($rows as $value) {
$json = json_decode($value['json']);
$value['status'] = '';
if (!empty($value['agreement_id'])) {
$agreement = PayPalYPT::getBillingAgreement($value['agreement_id']);
if (!empty($agreement)) {
$value['status'] = $agreement->getState();
}
} ?>
<tr id="tr<?php echo $value['agreement_id']; ?>">
<td><?php echo $value['id']; ?></td>
<td>
<?php echo $json->get->json->type; ?>
</td>
<td>
<?php echo $value['agreement_id']; ?>
</td>
<td>
<?php echo $value['created']; ?>
</td>
<td><?php echo $value['expiration']; ?></td>
<td><?php echo $value['expiration']; ?></td>
<td>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<th>#</th>
<th><?php echo __("Type"); ?></th>
<th><?php echo __("Agreement ID"); ?></th>
<th><?php echo __("Status"); ?></th>
<th><?php echo __("Date"); ?></th>
<th></th>
</tr>
</tfoot>
</table>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
$(document).ready(function () {
});
function cancelAgreement(agreement_id) {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/PayPalYPT/agreementCancel.json.php',
data: {agreement: agreement_id},
type: 'post',
success: function (response) {
if (response.error) {
avideoAlertError(response.msg);
} else {
$('.tr' + agreement_id).fadeOut();
avideoToastSuccess(response.msg);
}
modal.hidePleaseWait();
}
});
if ($value['status'] == 'Active') {
?>
<button class="btn btn-danger btn-xs" onclick="cancelAgreement('<?php echo $value['agreement_id']; ?>')">
<?php
echo __('Cancel Agreement'); ?>
</button>
<?php
} ?>
</td>
</tr>
<?php
}
</script>
</body>
</html>
?>
</tbody>
<tfoot>
<tr>
<th>#</th>
<th><?php echo __("Type"); ?></th>
<th><?php echo __("Agreement ID"); ?></th>
<th><?php echo __("Status"); ?></th>
<th><?php echo __("Date"); ?></th>
<th></th>
</tr>
</tfoot>
</table>
</div>
<script>
$(document).ready(function() {
});
function cancelAgreement(agreement_id) {
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'plugin/PayPalYPT/agreementCancel.json.php',
data: {
agreement: agreement_id
},
type: 'post',
success: function(response) {
if (response.error) {
avideoAlertError(response.msg);
} else {
$('.tr' + agreement_id).fadeOut();
avideoToastSuccess(response.msg);
}
modal.hidePleaseWait();
}
});
}
</script>
<?php
$_page->print();
?>

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
@ -124,7 +124,7 @@ if (!User::isAdmin()) {
$(document).ready(function () {
$('#addUsers_groups_permissionsBtn').click(function () {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Permissions/View/addUsers_groups_permissionsVideo.php',
url: webSiteRootURL+'plugin/Permissions/View/addUsers_groups_permissionsVideo.php',
data: $('#panelUsers_groups_permissionsForm').serialize(),
type: 'post',
success: function (response) {
@ -164,7 +164,7 @@ if (!User::isAdmin()) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Permissions/View/Users_groups_permissions/add.json.php',
url: webSiteRootURL+'plugin/Permissions/View/Users_groups_permissions/add.json.php',
data: $('#panelUsers_groups_permissionsForm').serialize(),
type: 'post',
success: function (response) {

View file

@ -1,46 +1,30 @@
<?php
require_once '../../../videos/configuration.php';
AVideoPlugin::loadPlugin("Permissions");
$_page = new Page(array('Permissions'));
$_page->loadBasicCSSAndJS();
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo __("Permissions") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.css"/>
<link href="<?php echo getCDN(); ?>view/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Permissions') ?>
<div class="pull-right">
<?php echo AVideoPlugin::getSwitchButton("Permissions"); ?>
</div>
</div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#Users_groups_permissions"><?php echo __("Users Groups Permissions"); ?></a></li>
</ul>
<div class="tab-content">
<div id="Users_groups_permissions" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/Permissions/View/Users_groups_permissions/index_body.php';
?>
</div>
</div>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('Permissions') ?>
<div class="pull-right">
<?php echo AVideoPlugin::getSwitchButton("Permissions"); ?>
</div>
</div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#Users_groups_permissions"><?php echo __("Users Groups Permissions"); ?></a></li>
</ul>
<div class="tab-content">
<div id="Users_groups_permissions" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/Permissions/View/Users_groups_permissions/index_body.php';
?>
</div>
</div>
</div>
<script type="text/javascript" src="<?php echo getURL('view/css/DataTables/datatables.min.js'); ?>"></script>
<script src="<?php echo getCDN(); ?>js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
</div>
</div>
<?php
$_page->print();
?>

View file

@ -82,7 +82,7 @@ $uid = uniqid();
console.log(users_groups_id, plugins_id, type);
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/Permissions/setPermission.json.php',
url: webSiteRootURL+'plugin/Permissions/setPermission.json.php',
data: {"users_groups_id": users_groups_id, "plugins_id": plugins_id, "type": type, "isEnabled": $('#pluginPermission'+users_groups_id+'<?php echo $uid; ?>_'+type).is(":checked")},
type: 'post',
success: function (response) {

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}

View file

@ -4,7 +4,7 @@ if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not do this"));
forbiddenPage("You can not do this");
exit;
}
?>
@ -155,7 +155,7 @@ if (!User::isAdmin()) {
$(document).ready(function() {
$('#addPlaylists_schedulesBtn').click(function() {
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/View/addPlaylists_schedulesVideo.php',
url: webSiteRootURL+'plugin/PlayLists/View/addPlaylists_schedulesVideo.php',
data: $('#panelPlaylists_schedulesForm').serialize(),
type: 'post',
success: function(response) {
@ -221,7 +221,7 @@ if (!User::isAdmin()) {
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/View/Playlists_schedules/add.json.php',
url: webSiteRootURL+'plugin/PlayLists/View/Playlists_schedules/add.json.php',
data: $('#panelPlaylists_schedulesForm').serialize(),
type: 'post',
success: function(response) {

View file

@ -215,7 +215,7 @@ $_page->setExtraScripts(
e.preventDefault();
modal.showPleaseWait();
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>plugin/PlayLists/View/Playlists_schedules/add.json.php',
url: webSiteRootURL+'plugin/PlayLists/View/Playlists_schedules/add.json.php',
data: $('#panelPlaylists_schedulesForm').serialize(),
type: 'post',
success: function(response) {

View file

@ -1,46 +1,30 @@
<?php
require_once '../../../videos/configuration.php';
AVideoPlugin::loadPlugin("PlayLists");
$_page = new Page(array("PlayLists"));
$_page->loadBasicCSSAndJS();
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo __("PlayLists") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<?php
include $global['systemRootPath'] . 'view/include/head.php';
?>
<link rel="stylesheet" type="text/css" href="<?php echo getCDN(); ?>view/css/DataTables/datatables.min.css"/>
<link href="<?php echo getCDN(); ?>view/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php
include $global['systemRootPath'] . 'view/include/navbar.php';
?>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('PlayLists') ?>
<div class="pull-right">
<?php echo AVideoPlugin::getSwitchButton("PlayLists"); ?>
</div>
</div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#Playlists_schedules"><?php echo __("Playlists Schedules"); ?></a></li>
</ul>
<div class="tab-content">
<div id="Playlists_schedules" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/PlayLists/View/Playlists_schedules/index_body.php';
?>
</div>
</div>
<div class="container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('PlayLists') ?>
<div class="pull-right">
<?php echo AVideoPlugin::getSwitchButton("PlayLists"); ?>
</div>
</div>
<div class="panel-body">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#Playlists_schedules"><?php echo __("Playlists Schedules"); ?></a></li>
</ul>
<div class="tab-content">
<div id="Playlists_schedules" class="tab-pane fade in active" style="padding: 10px;">
<?php
include $global['systemRootPath'] . 'plugin/PlayLists/View/Playlists_schedules/index_body.php';
?>
</div>
</div>
</div>
<script type="text/javascript" src="<?php echo getURL('view/css/DataTables/datatables.min.js'); ?>"></script>
<script src="<?php echo getCDN(); ?>js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
</body>
</html>
</div>
</div>
<?php
$_page->print();
?>

View file

@ -2,32 +2,17 @@
if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
$_page = new Page(array('EPG'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo __("EPG") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<?php include $global['systemRootPath'] . 'view/include/head.php'; ?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php include $global['systemRootPath'] . 'view/include/navbar.php'; ?>
<div class="container-fluid">
<?php
$_REQUEST['site'] = get_domain($global['webSiteRootURL']);
echo '<div class="panel panel-default"><div class="panel-heading">' . __("Now Playing") . '</div><div class="panel-body">';
//include_once $global['systemRootPath'] . 'plugin/PlayLists/epg.html.php';
include_once $global['systemRootPath'] . 'plugin/PlayLists/epg.day.php';
echo '</div></div>';
?>
</div>
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
</script>
</body>
</html>
<?php include $global['systemRootPath'] . 'objects/include_end.php'; ?>
<div class="container-fluid">
<?php
$_REQUEST['site'] = get_domain($global['webSiteRootURL']);
echo '<div class="panel panel-default"><div class="panel-heading">' . __("Now Playing") . '</div><div class="panel-body">';
//include_once $global['systemRootPath'] . 'plugin/PlayLists/epg.html.php';
include_once $global['systemRootPath'] . 'plugin/PlayLists/epg.day.php';
echo '</div></div>';
?>
</div>
<?php
$_page->print();
?>

View file

@ -7,7 +7,7 @@ require_once $global['systemRootPath'] . 'plugin/PlayLists/PlayListElement.php';
require_once $global['systemRootPath'] . 'plugin/Gallery/functions.php';
if (!PlayList::canSee($_GET['playlists_id'], User::getId())) {
forbiddenPage(_('You cannot see this playlist').' '.basename(__FILE__));
forbiddenPage(_('You cannot see this playlist') . ' ' . basename(__FILE__));
}
$global['doNotLoadPlayer'] = 1;
/*
@ -49,57 +49,45 @@ foreach ($playList as $key => $value) {
$videos[$key] = $value;
$videos[$key]['id'] = $value['videos_id'];
}
$_page = new Page(array($playListObj->getName()));
$_page->setExtraStyles(array('view/css/social.css', 'plugin/Gallery/style.css'));
$_page->setExtraScripts(array('plugin/Gallery/script.js'));
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo $playListObj->getName() . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<link href="<?php echo getURL('view/css/social.css'); ?>" rel="stylesheet" type="text/css"/>
<link href="<?php echo getURL('plugin/Gallery/style.css'); ?>" rel="stylesheet" type="text/css"/>
<script src="<?php echo getURL('plugin/Gallery/script.js'); ?>" type="text/javascript"></script>
<?php include $global['systemRootPath'] . 'view/include/head.php'; ?>
<style>
.clearfix {
margin-bottom: 10px;
}
</style>
</head>
<body class="<?php echo $global['bodyClass']; ?>" style="padding: 5px;">
<div class="container-fluid " style="overflow: hidden;">
<div class="gallery">
<?php
if (!empty($playList)) {
if(isMobile()){
createGallerySection($videos, true, true,6, 4, 2, 1, false);
}else{
createGallerySection($videos, true, true,6, 6, 4, 2, false);
}
} ?>
</div>
</div>
<style>
.clearfix {
margin-bottom: 10px;
}
</style>
<div class="container-fluid " style="overflow: hidden;">
<div class="gallery">
<?php
include $global['systemRootPath'] . 'view/include/footer.php';
?>
<script>
$(document).ready(function () {
$('.galleryVideo a').click(function(event){
event.preventDefault();
//avideoModalIframeFull($(this).attr('alternativeLink'));
var url = $(this).attr('embed');
if(empty(url)){
console.log('$(\'.galleryVideo a\').click does not have embed');
url = $(this).attr('href');
}
url = addGetParam(url, 'controls', -1);
url = addGetParam(url, 'showinfo', 0);
url = addGetParam(url, 'autoplay', 1);
console.log('$(\'.galleryVideo a\').click open', url);
avideoAddIframeIntoElement(this, url, '');
});
});
</script>
</body>
</html>
<?php include $global['systemRootPath'] . 'objects/include_end.php'; ?>
if (!empty($playList)) {
if (isMobile()) {
createGallerySection($videos, true, true, 6, 4, 2, 1, false);
} else {
createGallerySection($videos, true, true, 6, 6, 4, 2, false);
}
} ?>
</div>
</div>
<script>
$(document).ready(function() {
$('.galleryVideo a').click(function(event) {
event.preventDefault();
//avideoModalIframeFull($(this).attr('alternativeLink'));
var url = $(this).attr('embed');
if (empty(url)) {
console.log('$(\'.galleryVideo a\').click does not have embed');
url = $(this).attr('href');
}
url = addGetParam(url, 'controls', -1);
url = addGetParam(url, 'showinfo', 0);
url = addGetParam(url, 'autoplay', 1);
console.log('$(\'.galleryVideo a\').click open', url);
avideoAddIframeIntoElement(this, url, '');
});
});
</script>
<?php
$_page->print();
?>

View file

@ -1,348 +0,0 @@
<?php
if (!isset($global['systemRootPath'])) {
require_once '../../videos/configuration.php';
}
$isSerie = 1;
$isPlayList = true;
require_once $global['systemRootPath'] . 'objects/playlist.php';
require_once $global['systemRootPath'] . 'plugin/PlayLists/PlayListElement.php';
if (!PlayList::canSee($_GET['playlists_id'], User::getId())) {
die('{"error":"' . __("Permission denied") . '"}');
}
$playListObj = new PlayList($_GET['playlists_id']);
$playList = PlayList::getVideosFromPlaylist($_GET['playlists_id']);
$playListData = array();
$videoStartSeconds = array();
foreach ($playList as $value) {
if ($value['type'] === 'embed') {
$sources[0]['type'] = 'video';
$sources[0]['url'] = $value["videoLink"];
} else {
$sources = getVideosURL($value['filename']);
}
$images = Video::getImageFromFilename($value['filename'], $value['type']);
$externalOptions = _json_decode($value['externalOptions']);
$src = new stdClass();
$src->src = $images->thumbsJpg;
$thumbnail = array($src);
$playListSources = array();
foreach ($sources as $value2) {
if ($value2['type'] !== 'video' && $value2['type'] !== 'audio' && $value2['type'] !== 'serie') {
continue;
}
$playListSources[] = new playListSource($value2['url'], $value['type'] === 'embed');
}
if (empty($playListSources)) {
continue;
}
$playListData[] = new PlayListElement($value['title'], $value['description'], $value['duration'], $playListSources, $thumbnail, $images->poster, parseDurationToSeconds(@$externalOptions->videoStartSeconds), $value['cre'], $value['likes'], $value['views_count'], $value['videos_id']);
}
$video = PlayLists::isPlayListASerie($_GET['playlists_id']);
if (!empty($video['id'])) {
AVideoPlugin::getEmbed($video['id']);
}
?>
<!DOCTYPE html>
<html lang="<?php echo getLanguage(); ?>">
<head>
<title><?php echo $playListObj->getName() . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?></title>
<link href="<?php echo getURL('node_modules/video.js/dist/video-js.min.css'); ?>" rel="stylesheet" type="text/css"/>
<link href="<?php echo getCDN(); ?>view/css/social.css" rel="stylesheet" type="text/css"/>
<link href="<?php echo getCDN(); ?>node_modules/videojs-playlist-ui/dist/videojs-playlist-ui.css" rel="stylesheet">
<?php include $global['systemRootPath'] . 'view/include/head.php'; ?>
<style>
.next-button:before {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
display: inline-block;
font-style: normal;
font-variant: normal;
text-rendering: auto;
line-height: 1;
content: "\f051";
font-family: 'Font Awesome 5 Free';
font-weight: 900;
}
.video-js .next-button {width: 2em !important;}
</style>
<?php
if (!empty($video['id'])) {
getLdJson($video['id']);
getItemprop($video['id']);
}
?>
</head>
<body class="<?php echo $global['bodyClass']; ?>">
<?php include $global['systemRootPath'] . 'view/include/navbar.php'; ?>
<?php
if (!empty($advancedCustomUser->showChannelBannerOnModeYoutube)) {
?>
<div class="container" style="margin-bottom: 10px;">
<img src="<?php echo User::getBackground($video['users_id']); ?>" class="img img-responsive" />
</div>
<?php
}
?>
<div class="container-fluid principalContainer">
<?php
if (!empty($playListObj)) {
if (!empty($advancedCustom->showAdsenseBannerOnTop)) {
?>
<style>
.compress {
top: 100px !important;
}
</style>
<div class="row">
<div class="col-lg-12 col-sm-12 col-xs-12">
<center style="margin:5px;">
<?php
echo getAdsLeaderBoardTop();
?>
</center>
</div>
</div>
<?php
}
?>
<!-- playlist player -->
<div class="row main-video" id="mvideo">
<div class="col-sm-2 col-md-2 firstC"></div>
<div class="col-sm-8 col-md-8 secC">
<div id="videoContainer">
<div id="floatButtons" style="display: none;">
<p class="btn btn-outline btn-xs move">
<i class="fas fa-expand-arrows-alt"></i>
</p>
<button type="button" class="btn btn-outline btn-xs"
onclick="closeFloatVideo(); floatClosed = 1;">
<i class="fas fa-times"></i>
</button>
</div>
<div id="main-video" class="embed-responsive embed-responsive-16by9">
<video <?php echo PlayerSkins::getPlaysinline(); ?>
<?php if ($config->getAutoplay() && false) { // disable it for now ?>
autoplay="true"
muted="muted"
<?php } ?>
preload="auto"
controls class="embed-responsive-item video-js vjs-default-skin vjs-big-play-centered" id="mainVideo"
data-setup='{"techOrder": ["youtube","html5"]}'>
</video>
</div>
<?php
showCloseButton();
?>
</div>
</div>
<div class="col-sm-2 col-md-2"></div>
</div>
<div class="row" id="modeYoutubeBottom">
<div class="col-sm-1 col-md-1"></div>
<div class="col-sm-8 col-md-8" id="modeYoutubeBottomContent">
</div>
<div class="col-sm-2 col-md-2 bgWhite list-group-item rightBar">
<div class="col-lg-12 col-sm-12 col-xs-12">
<?php echo getAdsSideRectangle(); ?>
</div>
<input type="search" id="playListSearch" class="form-control" placeholder=" <?php echo __("Search"); ?>"/>
<select class="form-control" id="embededSortBy" >
<option value="default"> <?php echo __("Default"); ?></option>
<option value="titleAZ" data-icon="glyphicon-sort-by-attributes"> <?php echo __("Title (A-Z)"); ?></option>
<option value="titleZA" data-icon="glyphicon-sort-by-attributes-alt"> <?php echo __("Title (Z-A)"); ?></option>
<option value="newest" data-icon="glyphicon-sort-by-attributes"> <?php echo __("Date added (newest)"); ?></option>
<option value="oldest" data-icon="glyphicon-sort-by-attributes-alt" > <?php echo __("Date added (oldest)"); ?></option>
<option value="popular" data-icon="glyphicon-thumbs-up"> <?php echo __("Most popular"); ?></option>
<?php
if (empty($advancedCustom->doNotDisplayViews)) {
?>
<option value="views_count" data-icon="glyphicon-eye-open" <?php echo (!empty($_POST['sort']['views_count'])) ? "selected='selected'" : "" ?>> <?php echo __("Most watched"); ?></option>
<?php } ?>
</select>
<div class="vjs-playlist" style="" id="playList">
<!--
The contents of this element will be filled based on the
currently loaded playlist
-->
</div>
</div>
<div class="col-sm-1 col-md-1"></div>
</div>
<?php
} else {
?>
<br>
<br>
<br>
<br>
<div class="alert alert-warning">
<i class="fa-solid fa-video"></i> <strong><?php echo __("Attention"); ?>!</strong> <?php echo empty($advancedCustom->videoNotFoundText->value) ? __("We have not found any videos or audios to show") : $advancedCustom->videoNotFoundText->value; ?>.
</div>
<?php } ?>
</div>
<?php
include $global['systemRootPath'] . 'view/include/video.min.js.php';
?>
<?php
echo AVideoPlugin::afterVideoJS();
include $global['systemRootPath'] . 'view/include/footer.php';
$videoJSArray = array(
"view/js/BootstrapMenu.min.js");
$jsURL = combineFiles($videoJSArray, "js");
?>
<script src="<?php echo $jsURL; ?>" type="text/javascript"></script><script src="<?php echo getCDN(); ?>node_modules/videojs-playlist/dist/videojs-playlist.min.js"></script>
<script src="<?php echo getCDN(); ?>node_modules/videojs-playlist-ui/dist/videojs-playlist-ui.min.js"></script>
<script src="<?php echo getURL('node_modules/videojs-youtube/dist/Youtube.min.js'); ?>node_modules/videojs-playlist/dist/videojs-playlist.min.js"></script>
<script>
var playerPlaylist = <?php echo json_encode($playListData); ?>;
var originalPlayerPlaylist = playerPlaylist;
if (typeof player === 'undefined' && $('#mainVideo').length) {
player = videojs('mainVideo'<?php echo PlayerSkins::getDataSetup(); ?>);
}
var videos_id = playerPlaylist[0].videos_id;
player.on('play', function () {
addView(videos_id, this.currentTime());
});
player.on('timeupdate', function () {
var time = Math.round(this.currentTime());
if (time >= 5 && time % 5 === 0) {
addView(videos_id, time);
}
});
player.on('ended', function () {
var time = Math.round(this.currentTime());
addView(videos_id, time);
});
player.playlist(playerPlaylist);
player.playlist.autoadvance(0);
player.playlist.repeat(true);
// Initialize the playlist-ui plugin with no option (i.e. the defaults).
player.playlistUi();
var timeout;
$(document).ready(function () {
$("#playListSearch").keyup(function () {
var filter = $(this).val();
$(".vjs-playlist-item-list li").each(function () {
if ($(this).find('.vjs-playlist-name').text().search(new RegExp(filter, "i")) < 0) {
$(this).slideUp();
} else {
$(this).slideDown();
}
});
});
$('#embededSortBy').click(function () {
setTimeout(function () {
clearTimeout(timeout);
}, 2000);
});
$('#embededSortBy').change(function () {
var value = $(this).val();
playerPlaylist.sort(function (a, b) {
return compare(a, b, value);
});
player.playlist.sort(function (a, b) {
return compare(a, b, value);
});
});
//Prevent HTML5 video from being downloaded (right-click saved)?
$('#mainVideo').bind('contextmenu', function () {
return false;
});
player.currentTime(playerPlaylist[0].videoStartSeconds);
$("#modeYoutubeBottomContent").load("<?php echo $global['webSiteRootURL']; ?>view/modeYoutubeBottom.php?videos_id=" + playerPlaylist[0].videos_id);
$(".vjs-playlist-item ").click(function () {
});
player.on('playlistitem', function () {
index = player.playlist.currentIndex();
videos_id = playerPlaylist[index].videos_id;
$("#modeYoutubeBottomContent").load("<?php echo $global['webSiteRootURL']; ?>view/modeYoutubeBottom.php?videos_id=" + playerPlaylist[index].videos_id);
setTimeout(function () {
player.currentTime(playerPlaylist[index].videoStartSeconds);
}, 500);
if (typeof enableDownloadProtection === 'function') {
enableDownloadProtection();
}
});
setTimeout(function () {
var Button = videojs.getComponent('Button');
var nextButton = videojs.extend(Button, {
//constructor: function(player, options) {
constructor: function () {
Button.apply(this, arguments);
//this.addClass('vjs-chapters-button');
this.addClass('next-button');
this.addClass('vjs-button-fa-size');
this.controlText("Next");
},
handleClick: function () {
player.playlist.next();
}
});
// Register the new component
videojs.registerComponent('nextButton', nextButton);
player.getChild('controlBar').addChild('nextButton', {}, getPlayerButtonIndex('PlayToggle') + 1);
}, 30);
});
function compare(a, b, type) {
console.log(type);
switch (type) {
case "titleAZ":
return strcasecmp(a.name, b.name);
break;
case "titleZA":
return strcasecmp(b.name, a.name);
break;
case "newest":
return a.created > b.created ? 1 : (a.created < b.created ? -1 : 0);
break;
case "oldest":
return b.created > a.created ? 1 : (b.created < a.created ? -1 : 0);
break;
case "popular":
return a.likes > b.likes ? 1 : (a.likes < b.likes ? -1 : 0);
break;
default:
return 0;
break;
}
}
function strcasecmp(s1, s2) {
s1 = (s1 + '').toLowerCase();
s2 = (s2 + '').toLowerCase();
return s1 > s2 ? 1 : (s1 < s2 ? -1 : 0);
}
</script>
</body>
</html>
<?php include $global['systemRootPath'] . 'objects/include_end.php'; ?>

Some files were not shown because too many files have changed in this diff Show more