mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 19:42:38 +02:00
Adds 2 capabilities to plugins: 1) add custom routes, 2) add custom configuration variables to CustomizeAdvanced and removes it when disabled
This commit is contained in:
parent
c1c5c2fb9c
commit
e09a11e07f
5 changed files with 82 additions and 3 deletions
|
@ -5,6 +5,7 @@ require_once $global['systemRootPath'] . 'plugin/Plugin.abstract.php';
|
|||
|
||||
class CustomizeAdvanced extends PluginAbstract {
|
||||
|
||||
|
||||
public function getDescription() {
|
||||
$txt = "Fine Tuning your YouPHPTube";
|
||||
$help = "<br><small><a href='https://github.com/DanielnetoDotCom/YouPHPTube/wiki/Advanced-Customization-Plugin' target='__blank'><i class='fas fa-question-circle'></i> Help</a></small>";
|
||||
|
@ -18,7 +19,7 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
public function getUUID() {
|
||||
return "55a4fa56-8a30-48d4-a0fb-8aa6b3f69033";
|
||||
}
|
||||
|
||||
|
||||
public function getEmptyDataObject() {
|
||||
$obj = new stdClass();
|
||||
$obj->doNotShowUploadMP4Button = true;
|
||||
|
@ -65,6 +66,21 @@ class CustomizeAdvanced extends PluginAbstract {
|
|||
$o->value = "";
|
||||
$obj->underMenuBarHTMLCode = $o;
|
||||
$obj->encoderNetwork = "";// an url for encoder network
|
||||
|
||||
$plugins = Plugin::getAllEnabled();
|
||||
//import external plugins configuration options
|
||||
foreach ($plugins as $value) {
|
||||
$p = YouPHPTubePlugin::loadPlugin($value['dirName']);
|
||||
if (is_object($p)) {
|
||||
$foreginObjects=$p->getCustomizeAdvancedOptions();
|
||||
if($foreginObjects)
|
||||
{
|
||||
foreach($foreginObjects as $optionName => $defaultValue)
|
||||
$obj->{$optionName}=$defaultValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $obj;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue