mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
Minor code style patch.
This commit is contained in:
parent
8108fc1e68
commit
172fa35b49
15 changed files with 72 additions and 79 deletions
|
@ -1,4 +1,3 @@
|
|||
<?php
|
||||
include './customize_settings_native.php';
|
||||
include './customize_settings_plugin.php';
|
||||
?>
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
header('Content-Type: application/json');
|
||||
global $global, $config;
|
||||
if(!isset($global['systemRootPath'])){
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
function createTable($pluginName, $filter = array()){
|
||||
function createTable($pluginName, $filter = array()) {
|
||||
$plugin = AVideoPlugin::getObjectData($pluginName);
|
||||
if(empty($filter)){
|
||||
if (empty($filter)) {
|
||||
foreach ($plugin as $keyJson => $valueJson) {
|
||||
$filter[$keyJson] = " ";
|
||||
}
|
||||
|
@ -15,8 +15,8 @@ function createTable($pluginName, $filter = array()){
|
|||
$pluginsList = array();
|
||||
if (!AVideoPlugin::exists($pluginName)) {
|
||||
echo "<tr><td colspan='2'> Sorry you do not have the plugin </td></tr>";
|
||||
}else{
|
||||
if(!empty($plugin)){
|
||||
} else {
|
||||
if (!empty($plugin)) {
|
||||
$form = jsonToFormElements($plugin,$filter);
|
||||
//var_dump($form);
|
||||
echo implode("", $form);
|
||||
|
@ -63,9 +63,9 @@ function jsonToFormElements($json, $filter = array()) {
|
|||
}
|
||||
|
||||
function getPluginSwitch($pluginName) {
|
||||
if(!AVideoPlugin::exists($pluginName)){
|
||||
if (!AVideoPlugin::exists($pluginName)) {
|
||||
$input = '<a href="https://www.avideo.com/plugins/" class="btn btn-danger btn-sm btn-xs">Buy this plugin now</a>';
|
||||
}else{
|
||||
} else {
|
||||
$plugin = AVideoPlugin::loadPluginIfEnabled($pluginName);
|
||||
$pluginForced = AVideoPlugin::loadPlugin($pluginName);
|
||||
$id = uniqid();
|
||||
|
|
|
@ -324,6 +324,3 @@ switch ($_GET['page']) {
|
|||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
header('Content-Type: application/json');
|
||||
global $global, $config;
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
|
@ -30,9 +29,9 @@ $pluginDB = Plugin::getPluginByName($pluginName);
|
|||
|
||||
foreach ($pluginDO as $key => $value) {
|
||||
if (isset($pluginValues[$key])) {
|
||||
if(is_bool($pluginDO->$key)){
|
||||
if (is_bool($pluginDO->$key)) {
|
||||
$pluginDO->$key = empty($pluginValues[$key])?false:true;
|
||||
}else{
|
||||
} else {
|
||||
//$pluginDO->$key = str_replace('"', '\\"', $pluginValues[$key]);
|
||||
$pluginDO->$key = $pluginValues[$key];
|
||||
}
|
||||
|
@ -44,6 +43,6 @@ $p->setObject_data(json_encode($pluginDO));
|
|||
|
||||
$obj = new stdClass();
|
||||
$obj->save = $p->save();
|
||||
if($obj->save === false) error_log("[ERROR] Error saving plugin $pluginName data. Maybe plugin is not enabled?");
|
||||
if ($obj->save === false) error_log("[ERROR] Error saving plugin $pluginName data. Maybe plugin is not enabled?");
|
||||
|
||||
echo (json_encode($obj));
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
header('Content-Type: application/json');
|
||||
global $global, $config;
|
||||
if(!isset($global['systemRootPath'])){
|
||||
if (!isset($global['systemRootPath'])) {
|
||||
require_once '../videos/configuration.php';
|
||||
}
|
||||
require_once $global['systemRootPath'] . 'objects/user.php';
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
|
||||
if(isset($_GET['getLanguage'])) {
|
||||
if (isset($_GET['getLanguage'])) {
|
||||
|
||||
$lngFile = './'.strtolower(str_replace(['.', '/', '\\'], '', $_GET['getLanguage'])).'.php';
|
||||
if(!file_exists($lngFile)) {
|
||||
if (!file_exists($lngFile)) {
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
exit;
|
||||
}
|
||||
|
@ -90,7 +89,7 @@ sort($vars);
|
|||
console.log("Found existing translation!");
|
||||
var arrayOfLines = $('#originalWords').val().split('\n');
|
||||
$.each(arrayOfLines, function(index, item) {
|
||||
if(data.hasOwnProperty(item)) {
|
||||
if (data.hasOwnProperty(item)) {
|
||||
$('#translatedCode').append(data[item]+'\n');
|
||||
} else {
|
||||
$('#translatedCode').append('\n');
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
|
||||
header('Content-Type: application/json');
|
||||
if (empty($global['systemRootPath'])) {
|
||||
$global['systemRootPath'] = "../";
|
||||
|
@ -22,7 +21,7 @@ if (!is_writable($dir)) {
|
|||
}
|
||||
$file = $dir.strtolower($_POST['flag']).".php";
|
||||
$myfile = fopen($file, "w") or die("Unable to open file!");
|
||||
if(!$myfile){
|
||||
if (!$myfile) {
|
||||
$obj->status = 0;
|
||||
$obj->error = __("Unable to open file!");
|
||||
die(json_encode($obj));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue