feat: option to hide disabled subscriptions (#286)
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
require_once '../../includes/connect_endpoint.php';
|
||||
session_start();
|
||||
if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) {
|
||||
die(json_encode([
|
||||
"success" => false,
|
||||
"message" => translate('session_expired', $i18n)
|
||||
]));
|
||||
}
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] === "POST") {
|
||||
$postData = file_get_contents("php://input");
|
||||
$data = json_decode($postData, true);
|
||||
|
||||
$hide_disabled = $data['value'];
|
||||
|
||||
$stmt = $db->prepare('UPDATE settings SET hide_disabled = :hide_disabled');
|
||||
$stmt->bindParam(':hide_disabled', $hide_disabled, SQLITE3_INTEGER);
|
||||
|
||||
if ($stmt->execute()) {
|
||||
die(json_encode([
|
||||
"success" => true,
|
||||
"message" => translate("success", $i18n)
|
||||
]));
|
||||
} else {
|
||||
die(json_encode([
|
||||
"success" => false,
|
||||
"message" => translate("error", $i18n)
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -70,6 +70,9 @@
|
||||
|
||||
$defaultLogo = $theme == "light" ? "images/siteicons/" . $colorTheme . "/wallos.png" : "images/siteicons/" . $colorTheme . "/walloswhite.png";
|
||||
foreach ($subscriptions as $subscription) {
|
||||
if ($subscription['inactive'] == 1 && isset($settings['hideDisabledSubscriptions']) && $settings['hideDisabledSubscriptions'] === 'true') {
|
||||
continue;
|
||||
}
|
||||
$id = $subscription['id'];
|
||||
$print[$id]['id'] = $id;
|
||||
$print[$id]['logo'] = $subscription['logo'] != "" ? "images/uploads/logos/".$subscription['logo'] : $defaultLogo;
|
||||
|
||||
Reference in New Issue
Block a user