1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00

fix tompenu

This commit is contained in:
daniel 2018-11-14 13:31:08 -03:00
parent b901ef2914
commit c933c312dd
6 changed files with 74 additions and 28 deletions

View file

@ -3,8 +3,8 @@
function createTable($pluginName, $filter = array()){
$plugin = YouPHPTubePlugin::getObjectData($pluginName);
if(empty($filter)){
foreach ($plugin as $key => $value) {
$filter[$key] = " ";
foreach ($plugin as $keyJson => $valueJson) {
$filter[$keyJson] = " ";
}
}
//var_dump($filter);exit;
@ -30,32 +30,32 @@ function createTable($pluginName, $filter = array()){
function jsonToFormElements($json, $filter = array()) {
//var_dump($json, $filter);exit;
$elements = array();
foreach ($json as $key => $value) {
if (!empty($filter) && empty($filter[$key])) {
foreach ($json as $keyJson => $valueJson) {
if (!empty($filter) && empty($filter[$keyJson])) {
continue;
}
$label = "<label>{$key}</label>";
$label = "<label>{$keyJson}</label>";
$help = "";
if (!empty($filter[$key])) {
$help = "<small class=\"form-text text-muted\">{$filter[$key]}</small>";
if (!empty($filter[$keyJson])) {
$help = "<small class=\"form-text text-muted\">{$filter[$keyJson]}</small>";
}
$input = "";
if (is_object($value)) {
if ($value->type === 'textarea') {
$input = "<textarea class='form-control jsonElement' name='{$key}' pluginType='object'>{$value->value}</textarea>";
} else {
$input = "<input class='form-control jsonElement' name='{$key}' pluginType='object' type='{$value->type}' value='{$value->value}'/>";
if (is_object($valueJson)) {
if ($valueJson->type === 'textarea') {
$input = "<textarea class='form-control jsonElement' name='{$keyJson}' pluginType='object'>{$valueJson->value}</textarea>";
} else { var_dump($keyJson, $valueJson);
$input = "<input class='form-control jsonElement' name='{$keyJson}' pluginType='object' type='{$valueJson->type}' value='{$valueJson->value}'/>";
}
$elements[] = "<tr><td>{$label} </td><td>{$input}{$help}</td></tr>";
} else if (is_bool($value)) {
} else if (is_bool($valueJson)) {
$id = uniqid();
$input = '<div class="material-switch">
<input data-toggle="toggle" type="checkbox" id="' . $key . $id . '" name="' . $key . '" value="1" ' . ($value ? "checked" : "") . ' >
<label for="' . $key . $id . '" class="label-primary"></label>
<input data-toggle="toggle" type="checkbox" id="' . $keyJson . $id . '" name="' . $keyJson . '" value="1" ' . ($valueJson ? "checked" : "") . ' >
<label for="' . $keyJson . $id . '" class="label-primary"></label>
</div>';
$elements[] = "<tr><td>{$input}</td><td>{$label}<br>{$help}</td></tr>";
} else {
$input = "<input class='form-control jsonElement' name='{$key}' type='text' value='{$value}'/>";
$input = "<input class='form-control jsonElement' name='{$keyJson}' type='text' value='{$valueJson}'/>";
$elements[] = "<tr><td>{$label} </td><td>{$input}{$help}</td></tr>";
}
}

View file

@ -116,7 +116,9 @@ switch ($_GET['page']) {
break;
case "monetize_subscription":
$includeHead = $global['systemRootPath'] . 'plugin/Subscription/page/editor_head.php';
$includeBody = $global['systemRootPath'] . 'plugin/Subscription/page/editor_body.php';
$includeBody = array();
$includeBody[] = $global['systemRootPath'] . 'admin/monetize_subscription.php';
$includeBody[] = $global['systemRootPath'] . 'plugin/Subscription/page/editor_body.php';
break;
case "monetize_vast":
$includeHead = $global['systemRootPath'] . 'plugin/AD_Server/index_head.php';
@ -242,17 +244,32 @@ switch ($_GET['page']) {
<div class="col-sm-9 col-md-9 col-sm-offset-3 col-md-offset-3 ">
<?php
if (!empty($includeBody)) {
if (is_array($includeBody)) {
foreach ($includeBody as $value) {
if (file_exists($value)) {
include $value;
} else {
?>
<div class="alert alert-danger">
Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store
<a class="btn btn-danger" href="https://www.youphptube.com/plugins/">Plugin Store</a>
</div>
<?php
}
}
} else {
if (file_exists($includeBody)) {
include $includeBody;
} else {
?>
<div class="alert alert-danger">
Sorry you do not have this plugin yet. you can buy it on the
Please forgive us for bothering you, but unfortunately you do not have this plugin yet. But do not hesitate to purchase it in our online store
<a class="btn btn-danger" href="https://www.youphptube.com/plugins/">Plugin Store</a>
</div>
<?php
}
}
}
?>
</div>
</div>

View file

@ -0,0 +1,12 @@
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-aws"></i> Subscription </div>
<div class="panel-body" style="overflow: hidden;">
<?php
createTable("Subscription");
?>
</div>
</div>
</div>
</div>

View file

@ -1,4 +1,18 @@
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fa fa-cog"></i> Customize options <div class="pull-right"><?php echo getPluginSwitch('CustomizeAdvanced'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
<?php
$filter = array(
'disableNativeSignUp' => 'The form to signup will not exists',
'disableNativeSignIn' => 'The regular form to signin will not exist, if you check this will only have social login or LDAP option',
'userMustBeLoggedIn' => 'The site will display only a login form to un authenticated users');
createTable("CustomizeAdvanced", $filter);
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-facebook-square"></i> Facebook <div class="pull-right"><?php echo getPluginSwitch('LoginFacebook'); ?></div></div>

View file

@ -1,5 +1,5 @@
<div class="row">
<div class="col-md-12">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fab fa-aws"></i> S3 Storage <div class="pull-right"><?php echo getPluginSwitch('AWS_S3'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">
@ -9,7 +9,7 @@
</div>
</div>
</div>
<div class="col-md-12">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-hdd"></i> B2 Storage <div class="pull-right"><?php echo getPluginSwitch('Blackblaze_B2'); ?></div></div>
<div class="panel-body" style="overflow: hidden;">

View file

@ -273,6 +273,9 @@ class Plugin extends ObjectYPT {
function save() {
global $global;
$this->object_data = $global['mysqli']->real_escape_string($this->object_data);
if(empty($this->object_data)){
$this->object_data = 'null';
}
return parent::save();
}