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

View file

@ -116,7 +116,9 @@ switch ($_GET['page']) {
break; break;
case "monetize_subscription": case "monetize_subscription":
$includeHead = $global['systemRootPath'] . 'plugin/Subscription/page/editor_head.php'; $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; break;
case "monetize_vast": case "monetize_vast":
$includeHead = $global['systemRootPath'] . 'plugin/AD_Server/index_head.php'; $includeHead = $global['systemRootPath'] . 'plugin/AD_Server/index_head.php';
@ -242,15 +244,30 @@ switch ($_GET['page']) {
<div class="col-sm-9 col-md-9 col-sm-offset-3 col-md-offset-3 "> <div class="col-sm-9 col-md-9 col-sm-offset-3 col-md-offset-3 ">
<?php <?php
if (!empty($includeBody)) { if (!empty($includeBody)) {
if (file_exists($includeBody)) { if (is_array($includeBody)) {
include $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 { } else {
?> if (file_exists($includeBody)) {
<div class="alert alert-danger"> include $includeBody;
Sorry you do not have this plugin yet. you can buy it on the } else {
<a class="btn btn-danger" href="https://www.youphptube.com/plugins/">Plugin Store</a> ?>
</div> <div class="alert alert-danger">
<?php 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
}
} }
} }
?> ?>

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="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="col-md-6">
<div class="panel panel-default"> <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> <div class="panel-heading"><i class="fab fa-facebook-square"></i> Facebook <div class="pull-right"><?php echo getPluginSwitch('LoginFacebook'); ?></div></div>
@ -85,7 +99,7 @@
<small class="form-text text-muted"> <small class="form-text text-muted">
<a href="https://github.com/DanielnetoDotCom/YouPHPTube/wiki/Configure-LDAP-Plugin">Help Page</a> <a href="https://github.com/DanielnetoDotCom/YouPHPTube/wiki/Configure-LDAP-Plugin">Help Page</a>
</small> </small>
</div> </div>
</div> </div>
</div> </div>

View file

@ -1,5 +1,5 @@
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-6">
<div class="panel panel-default"> <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-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;"> <div class="panel-body" style="overflow: hidden;">
@ -9,7 +9,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="col-md-6">
<div class="panel panel-default"> <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-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;"> <div class="panel-body" style="overflow: hidden;">

View file

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