mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
Now plugins can add buttons on the upload menu
This commit is contained in:
parent
e1583edfab
commit
72d88a997c
7 changed files with 68 additions and 24 deletions
|
@ -29,6 +29,7 @@ class BulkEmbed extends PluginAbstract {
|
|||
$obj = new stdClass();
|
||||
|
||||
$obj->API_KEY = "AIzaSyCIqxE86BawU33Um2HEGtX4PcrUWeCh_6o";
|
||||
$obj->onlyAdminCanBulkEmbed = true;
|
||||
return $obj;
|
||||
}
|
||||
|
||||
|
@ -42,6 +43,16 @@ class BulkEmbed extends PluginAbstract {
|
|||
$menu = '<a href="' . $global['webSiteRootURL'] . 'plugin/BulkEmbed/search.php" class="btn btn-primary btn-xs btn-block" target="_blank">Search</a>';
|
||||
return $menu;
|
||||
}
|
||||
|
||||
public function getDownloadMenuButton(){
|
||||
global $global;
|
||||
$obj = $this->getDataObject();
|
||||
if($obj->onlyAdminCanBulkEmbed && !User::isAdmin()){
|
||||
return '';
|
||||
}
|
||||
|
||||
return '<li><a href="'.$global['webSiteRootURL'].'plugin/BulkEmbed/search.php" ><span class="fa fa-link"></span>'.__("Bulk Embed").'</a></li>';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -44,8 +44,14 @@ $obj = new stdClass();
|
|||
$obj->error = true;
|
||||
$obj->msg = array();
|
||||
|
||||
if (!User::canUpload()) {
|
||||
|
||||
$objo = YouPHPTubePlugin::getObjectDataIfEnabled('BulkEmbed');
|
||||
if(empty($objo) || ($objo->onlyAdminCanBulkEmbed && !User::isAdmin())){
|
||||
$obj->msg[] = __("Permission denied");
|
||||
$obj->msg[] = "Plugin disabled";
|
||||
}else if (!User::canUpload()) {
|
||||
$obj->msg[] = __("Permission denied");
|
||||
$obj->msg[] = "User can not upload videos";
|
||||
} else if (!empty($_POST['itemsToSave'])) {
|
||||
|
||||
foreach ($_POST['itemsToSave'] as $value) {
|
||||
|
|
|
@ -96,32 +96,36 @@ $obj = YouPHPTubePlugin::getObjectData("BulkEmbed");
|
|||
include $global['systemRootPath'] . 'view/include/navbar.php';
|
||||
?>
|
||||
<div class="container">
|
||||
<section>
|
||||
<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" />
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-info btn-lg" type="button">
|
||||
<i class="glyphicon glyphicon-search"></i>
|
||||
</button>
|
||||
</span>
|
||||
|
||||
<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" />
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-info btn-lg" type="button">
|
||||
<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>
|
||||
</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>
|
||||
<br>
|
||||
<ul id="results"></ul>
|
||||
<div id="buttons"></div>
|
||||
</section>
|
||||
<div class="panel-body">
|
||||
<ul id="results"></ul>
|
||||
<div id="buttons"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'view/include/footer.php';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue