1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 02:39:46 +02:00
Oinktube/plugin/VideoLogoOverlay/page/editorSave.php
DanielnetoDotCom 14c93eb2cc Now you can use the user logo as the logo overlay
also it will stay on the fullscreen
2021-05-18 15:48:47 -03:00

32 lines
No EOL
1,004 B
PHP

<?php
require_once '../../../videos/configuration.php';
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/plugin.php';
if (!User::isAdmin()) {
header("Location: {$global['webSiteRootURL']}?error=" . __("You can not manager plugin logo overlay"));
exit;
}
header('Content-Type: application/json');
require_once $global['systemRootPath'] . 'plugin/VideoLogoOverlay/VideoLogoOverlay.php';
$plugin = new VideoLogoOverlay();
$obj = new stdClass();
$o = $plugin->getDataObject();
$o->position->value = $_POST['position'];
$o->opacity = $_POST['opacity'];
$o->url = $_POST['url'];
$fileData = base64DataToImage($_POST['logoImgBase64']);
$fileName = 'logoOverlay.png';
$photoPath = $global['systemRootPath'] . '/videos/' . $fileName;
$obj->bytes = file_put_contents($photoPath, $fileData);
$p = new Plugin(0);
$p->loadFromUUID($plugin->getUUID());
$p->setObject_data(json_encode($o));
$obj->saved = $p->save();
echo json_encode($obj);
?>