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

Add help on videos manager

This commit is contained in:
Daniel Neto 2024-10-02 13:37:18 -03:00
parent 86bc51d6da
commit e08269c9c2
3 changed files with 213 additions and 127 deletions

View file

@ -2998,7 +2998,7 @@ $(document).ready(function () {
var innerDiv = $(this).find("div.hidden"); var innerDiv = $(this).find("div.hidden");
avideoAlertInfo(innerDiv.html()); avideoAlertInfo(innerDiv.html());
}); });
setInterval(function () { setInterval(function () {
TotalPageLoadSeconds++; TotalPageLoadSeconds++;
}, 1000); }, 1000);
@ -4358,9 +4358,16 @@ function startTour(stepsFileRelativePath) {
success: function (response) { success: function (response) {
// Initialize the tour with the fetched data // Initialize the tour with the fetched data
var tour = introJs(); var tour = introJs();
tour.setOptions({ var filteredSteps = $.grep(response, function (step) {
steps: response var $element = $(step.element);
// Only include steps where the element exists and is fully visible (not in a hidden parent)
return $element.length > 0 && isElementVisible($element);
}); });
tour.setOptions({
steps: filteredSteps
});
tour.start(); tour.start();
}, },
error: function (xhr, status, error) { error: function (xhr, status, error) {
@ -4368,6 +4375,10 @@ function startTour(stepsFileRelativePath) {
} }
}); });
} }
function isElementVisible($element) {
// Check if the element itself and its parent chain are visible
return $element.is(':visible') && $element.closest(':hidden').length === 0;
}
} }
function findIndex(value, array) { function findIndex(value, array) {

View file

@ -0,0 +1,107 @@
[
{
"element": "#userGroupsButton",
"intro": "This button allows you to manage User Groups in your platform.",
"position": "bottom"
},
{
"element": "#usersButton",
"intro": "This button provides access to the Users management page.",
"position": "bottom"
},
{
"element": "#videoChartButton",
"intro": "Use this button to view the Video Chart statistics.",
"position": "bottom"
},
{
"element": "#advertisingManagerButton",
"intro": "This button opens the Advertising Manager for managing ads on your platform.",
"position": "bottom"
},
{
"element": "#encodeVideoButton",
"intro": "Click here to encode video and audio using the encoding service.",
"position": "bottom"
},
{
"element": "#uploadMp4Button",
"intro": "This button lets you upload files directly without encoding, including formats like pdf, images, zip, mp4, and mp3.",
"position": "bottom"
},
{
"element": "#embedVideoLinkButton",
"intro": "Use this button to embed a video link from external sources.",
"position": "bottom"
},
{
"element": "#addArticleButton",
"intro": "Click here to add a new article to your platform.",
"position": "bottom"
},
{
"element": "#sortVideosButton",
"intro": "This button allows you to sort your videos for better organization.",
"position": "bottom"
},
{
"element": "#checkBtn",
"intro": "This button allows you to select or deselect all videos in the grid manager.",
"position": "bottom"
},
{
"element": "#statusBtnGroup",
"intro": "Here you can change the status of the selected videos to Active, Inactive, Unlisted, or Unpublished.",
"position": "bottom"
},
{
"element": "#addUserGroupBtnGroup",
"intro": "This option allows you to add the selected videos to a specific user group for controlled access.",
"position": "bottom"
},
{
"element": "#removeUserGroupBtnGroup",
"intro": "This option allows you to remove the selected videos from a specific user group.",
"position": "bottom"
},
{
"element": "#swapBtn",
"intro": "Use this button to swap the video file for another one while keeping the current video metadata.",
"position": "bottom"
},
{
"element": "#updateAllUsage",
"intro": "Click here to update the disk usage for all videos, providing updated storage statistics.",
"position": "bottom"
},
{
"element": "#deleteBtn",
"intro": "This button allows you to delete the selected videos from the system.",
"position": "bottom"
},
{
"element": "#filterButtonsVideoManagerCategory",
"intro": "Use this dropdown to filter videos by categories. You can search and select the category you want to filter.",
"position": "bottom"
},
{
"element": "#filterButtonsVideoManager",
"intro": "Filter videos by status such as Active, Inactive, Encoding, and more.",
"position": "bottom"
},
{
"element": "#filterTypeButtonsVideoManager",
"intro": "Use this dropdown to filter videos by type. You can choose between video, embed, image, article, or series.",
"position": "bottom"
},
{
"element": "#filterSearchButtonsVideoManager",
"intro": "Customize your search fields here. You can select which fields to search for when you are filtering videos.",
"position": "bottom"
},
{
"element": "#compactMode",
"intro": "Enable or disable compact mode to adjust the display of the video list.",
"position": "bottom"
}
]

View file

@ -175,79 +175,53 @@ if (!empty($video_id) && Video::canEdit($video_id)) {
<div class="btn-group btn-block"> <div class="btn-group btn-block">
<?php if (Permissions::canAdminVideos()) { ?> <?php if (Permissions::canAdminVideos()) { ?>
<a href="<?php echo $global['webSiteRootURL']; ?>usersGroups" class="btn btn-sm btn-xs btn-warning"> <a href="<?php echo $global['webSiteRootURL']; ?>usersGroups" class="btn btn-sm btn-xs btn-warning" id="userGroupsButton">
<span class="fa fa-users"></span> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("User Groups"); ?></span> <span class="fa fa-users"></span> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("User Groups"); ?></span>
</a> </a>
<a href="<?php echo $global['webSiteRootURL']; ?>users" class="btn btn-sm btn-xs btn-primary"> <a href="<?php echo $global['webSiteRootURL']; ?>users" class="btn btn-sm btn-xs btn-primary" id="usersButton">
<span class="fa fa-user"></span> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Users"); ?></span> <span class="fa fa-user"></span> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Users"); ?></span>
</a> </a>
<?php } ?> <?php } ?>
<a href="<?php echo $global['webSiteRootURL']; ?>charts" class="btn btn-sm btn-xs btn-info"> <a href="<?php echo $global['webSiteRootURL']; ?>charts" class="btn btn-sm btn-xs btn-info" id="videoChartButton">
<i class="fas fa-chart-bar"></i> <i class="fas fa-chart-bar"></i>
<span class="hidden-md hidden-sm hidden-xs"><?php echo __("Video Chart"); ?></span> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Video Chart"); ?></span>
</a> </a>
<?php <?php if (Permissions::canAdminVideos()) { ?>
if (Permissions::canAdminVideos()) { <a href="<?php echo $global['webSiteRootURL']; ?>plugin/AD_Server/" class="btn btn-sm btn-xs btn-danger" id="advertisingManagerButton">
?>
<a href="<?php echo $global['webSiteRootURL']; ?>plugin/AD_Server/" class="btn btn-sm btn-xs btn-danger">
<span class="far fa-money-bill-alt"></span> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Advertising Manager"); ?></span> <span class="far fa-money-bill-alt"></span> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Advertising Manager"); ?></span>
</a> </a>
<?php } <?php } ?>
?>
<?php <form id="formEncoderVideosM" method="post" action="<?php echo $config->getEncoderURL(); ?>" target="encoder">
unset($_GET['parentsOnly']); <input type="hidden" name="webSiteRootURL" value="<?php echo $global['webSiteRootURL']; ?>" />
$categories = Category::getAllCategories(Permissions::canAdminVideos() ? false : true); <input type="hidden" name="user" value="<?php echo User::getUserName(); ?>" />
array_multisort(array_column($categories, 'hierarchyAndName'), SORT_ASC, $categories); <input type="hidden" name="pass" value="<?php echo User::getUserPass(); ?>" />
if (User::canUpload()) { </form>
if (empty($advancedCustom->doNotShowEncoderButton)) { <a href="#" onclick="$('#formEncoderVideosM').submit(); return false;" class="btn btn-sm btn-xs btn-default" id="encodeVideoButton">
if (!empty($config->getEncoderURL())) { <span class="fa fa-cog"></span> <span class="hidden-md hidden-sm hidden-xs"><?php echo empty($advancedCustom->encoderButtonLabel) ? __("Encode video and audio") : __($advancedCustom->encoderButtonLabel); ?></span>
} </a>
?>
<form id="formEncoderVideosM" method="post" action="<?php echo $config->getEncoderURL(); ?>" target="encoder"> <button class="btn btn-sm btn-xs btn-default" onclick="newDirectUploadVideo();" id="uploadMp4Button" data-toggle="tooltip" title="<?php echo __("Upload files without encode"), ' ', implode(', ', CustomizeAdvanced::directUploadFiletypes()); ?>">
<input type="hidden" name="webSiteRootURL" value="<?php echo $global['webSiteRootURL']; ?>" /> <span class="fa fa-upload"></span>
<input type="hidden" name="user" value="<?php echo User::getUserName(); ?>" /> <span class="hidden-md hidden-sm hidden-xs"><?php echo empty($advancedCustom->uploadMP4ButtonLabel) ? __("Direct upload") : __($advancedCustom->uploadMP4ButtonLabel); ?></span>
<input type="hidden" name="pass" value="<?php echo User::getUserPass(); ?>" /> </button>
</form>
<a href="#" onclick="$('#formEncoderVideosM').submit(); return false;" class="btn btn-sm btn-xs btn-default"> <button class="btn btn-sm btn-xs btn-default" id="embedVideoLinkButton">
<span class="fa fa-cog"></span> <span class="hidden-md hidden-sm hidden-xs"><?php echo empty($advancedCustom->encoderButtonLabel) ? __("Encode video and audio") : __($advancedCustom->encoderButtonLabel); ?></span> <span class="fa fa-link"></span>
</a> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Embed a video link"); ?></span>
<?php </button>
}
if (CustomizeAdvanced::showDirectUploadButton()) { <button class="btn btn-sm btn-xs btn-default" id="addArticleButton" onclick="newArticle()">
?> <i class="far fa-newspaper"></i>
<button class="btn btn-sm btn-xs btn-default" onclick="newDirectUploadVideo();" id="uploadMp4" data-toggle="tooltip" title="<?php echo __("Upload files without encode"), ' ', implode(', ', CustomizeAdvanced::directUploadFiletypes()); ?>"> <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Add Article"); ?></span>
<span class="fa fa-upload"></span> </button>
<span class="hidden-md hidden-sm hidden-xs"><?php echo empty($advancedCustom->uploadMP4ButtonLabel) ? __("Direct upload") : __($advancedCustom->uploadMP4ButtonLabel); ?></span>
</button> <button class="btn btn-sm btn-xs btn-default" id="sortVideosButton" onclick="avideoModalIframeFullScreen(webSiteRootURL+'view/managerVideosOrganize.php');">
<?php <i class="fas fa-sort-amount-up-alt"></i>
} <span class="hidden-md hidden-sm hidden-xs"><?php echo __("Sort Videos"); ?></span>
if (empty($advancedCustom->doNotShowEmbedButton)) { </button>
?>
<button class="btn btn-sm btn-xs btn-default" id="linkExternalVideo">
<span class="fa fa-link"></span>
<span class="hidden-md hidden-sm hidden-xs"><?php echo __("Embed a video link"); ?></span>
</button>
<?php
}
if (AVideoPlugin::isEnabledByName("Articles")) {
?>
<button class="btn btn-sm btn-xs btn-default" id="addArticle" onclick="newArticle()">
<i class="far fa-newspaper"></i>
<span class="hidden-md hidden-sm hidden-xs"><?php echo __("Add Article"); ?></span>
</button>
<?php
}
if (Permissions::canAdminVideos()) {
?>
<button class="btn btn-sm btn-xs btn-default" onclick="avideoModalIframeFullScreen(webSiteRootURL+'view/managerVideosOrganize.php');">
<i class="fas fa-sort-amount-up-alt"></i>
<span class="hidden-md hidden-sm hidden-xs"><?php echo __("Sort Videos"); ?></span>
</button>
<?php
}
}
?>
</div> </div>
</div> </div>
</div> </div>
<div class="panel panel-default"> <div class="panel panel-default">
@ -291,56 +265,49 @@ if (!empty($video_id) && Video::canEdit($video_id)) {
<button class="btn btn-default" id="checkBtn"> <button class="btn btn-default" id="checkBtn">
<i class="far fa-square" aria-hidden="true" id="chk"></i> <i class="far fa-square" aria-hidden="true" id="chk"></i>
</button> </button>
<?php <?php if ($advancedCustom->videosManegerBulkActionButtons) {
if ($advancedCustom->videosManegerBulkActionButtons) {
if (!empty($categories)) { if (!empty($categories)) {
if (empty($advancedCustomUser->userCanNotChangeCategory) || Permissions::canAdminVideos()) { if (empty($advancedCustomUser->userCanNotChangeCategory) || Permissions::canAdminVideos()) { ?>
?> <div class="btn-group" id="categoriesBtnGroup">
<div class="btn-group"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" id="categoriesBtn">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<i class="far fa-object-group"></i> <i class="far fa-object-group"></i>
<span class="hidden-md hidden-sm hidden-xs"> <span class="hidden-md hidden-sm hidden-xs"><?php echo __('Categories'); ?></span>
<?php echo __('Categories'); ?>
</span>
<span class="caret"></span> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<?php <?php foreach ($categories as $value) {
foreach ($categories as $value) { echo "<li><a href=\"#\" onclick=\"changeCategory({$value['id']});return false;\"><i class=\"{$value['iconClass']}\"></i> {$value['hierarchyAndName']}</a></li>";
echo "<li><a href=\"#\" onclick=\"changeCategory({$value['id']});return false;\" ><i class=\"{$value['iconClass']}\"></i> {$value['hierarchyAndName']}</a></li>"; } ?>
}
?>
</ul> </ul>
</div> </div>
<?php <?php }
} } ?>
}
?> <div class="btn-group" id="statusBtnGroup">
<div class="btn-group"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" id="statusBtn">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <i class="far fa-eye"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __('Status'); ?></span>
<i class="far fa-eye"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __('Status'); ?></span> <span class="caret"></span></button> <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<?php <?php foreach ($statusThatTheUserCanUpdate as $value) {
foreach ($statusThatTheUserCanUpdate as $value) {
$statusIndex = $value[0]; $statusIndex = $value[0];
$statusColor = $value[1]; $statusColor = $value[1];
echo "<li><a href=\"#\" onclick=\"changeStatus('" . $statusIndex . "'); return false;\" style=\"color: {$statusColor}\">" echo "<li><a href=\"#\" onclick=\"changeStatus('" . $statusIndex . "'); return false;\" style=\"color: {$statusColor}\">"
. Video::$statusIcons[$statusIndex] . ' ' . __(Video::$statusDesc[$statusIndex]) . "</a></li>"; . Video::$statusIcons[$statusIndex] . ' ' . __(Video::$statusDesc[$statusIndex]) . "</a></li>";
} } ?>
?>
</ul> </ul>
</div> </div>
<?php
if (empty($advancedCustomUser->userCanNotChangeUserGroup) || Permissions::canAdminVideos()) { <?php if (empty($advancedCustomUser->userCanNotChangeUserGroup) || Permissions::canAdminVideos()) {
$userGroups = UserGroups::getAllUsersGroups(); $userGroups = UserGroups::getAllUsersGroups(); ?>
?>
<div class="btn-group"> <div class="btn-group" id="addUserGroupBtnGroup">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" id="addUserGroupBtn">
<i class="fas fa-users"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __('Add User Group'); ?></span> <span class="caret"></span></button> <i class="fas fa-users"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __('Add User Group'); ?></span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<?php <?php foreach ($userGroups as $value) { ?>
foreach ($userGroups as $value) {
?>
<li> <li>
<a href="#" onclick="userGroupSave(<?php echo $value['id']; ?>, 1); return false;"> <a href="#" onclick="userGroupSave(<?php echo $value['id']; ?>, 1); return false;">
<span class="fa fa-lock"></span> <span class="fa fa-lock"></span>
@ -348,17 +315,17 @@ if (!empty($video_id) && Video::canEdit($video_id)) {
<?php echo $value['group_name']; ?> <?php echo $value['group_name']; ?>
</a> </a>
</li> </li>
<?php } <?php } ?>
?>
</ul> </ul>
</div> </div>
<div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"> <div class="btn-group" id="removeUserGroupBtnGroup">
<i class="fas fa-user-slash"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __('Remove User Group'); ?></span> <span class="caret"></span></button> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" id="removeUserGroupBtn">
<i class="fas fa-user-slash"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __('Remove User Group'); ?></span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<?php <?php foreach ($userGroups as $value) { ?>
foreach ($userGroups as $value) {
?>
<li> <li>
<a href="#" onclick="userGroupSave(<?php echo $value['id']; ?>, 0); return false;"> <a href="#" onclick="userGroupSave(<?php echo $value['id']; ?>, 0); return false;">
<span class="fa fa-lock"></span> <span class="fa fa-lock"></span>
@ -366,35 +333,36 @@ if (!empty($video_id) && Video::canEdit($video_id)) {
<?php echo $value['group_name']; ?> <?php echo $value['group_name']; ?>
</a> </a>
</li> </li>
<?php } <?php } ?>
?>
</ul> </ul>
</div> </div>
<?php <?php } ?>
}
if (empty($advancedCustom->disableVideoSwap) && (empty($advancedCustom->makeSwapVideosOnlyForAdmin) || Permissions::canAdminVideos())) { <?php if (empty($advancedCustom->disableVideoSwap) && (empty($advancedCustom->makeSwapVideosOnlyForAdmin) || Permissions::canAdminVideos())) { ?>
?>
<button class="btn btn-primary" id="swapBtn"> <button class="btn btn-primary" id="swapBtn">
<i class="fas fa-random"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __('Swap Video File'); ?></span> <i class="fas fa-random"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __('Swap Video File'); ?></span>
</button> </button>
<?php <?php } ?>
}
if (Permissions::canAdminVideos()) { <?php if (Permissions::canAdminVideos()) { ?>
?>
<button class="btn btn-primary" id="updateAllUsage"> <button class="btn btn-primary" id="updateAllUsage">
<i class="fas fa-chart-line"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __('Update all videos disk usage'); ?></span> <i class="fas fa-chart-line"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __('Update all videos disk usage'); ?></span>
</button> </button>
<?php <?php } ?>
}
if (AVideoPlugin::isEnabledByName('CDN') && CDN::userCanMoveVideoStorage()) { <?php if (AVideoPlugin::isEnabledByName('CDN') && CDN::userCanMoveVideoStorage()) {
include $global['systemRootPath'] . 'plugin/CDN/Storage/getVideoManagerButton.php'; include $global['systemRootPath'] . 'plugin/CDN/Storage/getVideoManagerButton.php';
} } ?>
?>
<button class="btn btn-danger" id="deleteBtn"> <button class="btn btn-danger" id="deleteBtn">
<i class="fa fa-trash" aria-hidden="true"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __('Delete'); ?></span> <i class="fa fa-trash" aria-hidden="true"></i> <span class="hidden-md hidden-sm hidden-xs"><?php echo __('Delete'); ?></span>
</button> </button>
<?php } ?>
</div>
<div class="pull-right">
<?php <?php
} echo getTourHelpButton('view/managerVideos_body.help.json', 'btn btn-default', false);
?> ?>
</div> </div>
</div> </div>
@ -688,9 +656,9 @@ if (empty($advancedCustom->disableHTMLDescription)) {
'playlists_id': playlists_id 'playlists_id': playlists_id
}, },
success: function(response) { success: function(response) {
if(response.error){ if (response.error) {
avideoToastError(__('Error on playlist')); avideoToastError(__('Error on playlist'));
}else{ } else {
avideoToastSuccess(__('Success')); avideoToastSuccess(__('Success'));
} }
modal.hidePleaseWait(); modal.hidePleaseWait();
@ -2298,4 +2266,4 @@ if (empty($advancedCustom->disableHTMLDescription)) {
}, 500); }, 500);
} }
</script> </script>