Misc
+ {include '../components/settings/misc.latte'} +diff --git a/app/Controllers/SettingsController.php b/app/Controllers/SettingsController.php index f3fb979..68707d9 100644 --- a/app/Controllers/SettingsController.php +++ b/app/Controllers/SettingsController.php @@ -34,6 +34,14 @@ class SettingsController { self::redirect(); } + static public function misc() { + if (isset($_POST['misc-sw'])) { + $sw = $_POST['misc-sw']; + Cookies::set("misc-sw", $sw); + } + self::redirect(); + } + static private function redirect() { $url = Misc::url('/settings'); header("Location: {$url}"); diff --git a/app/Helpers/UrlBuilder.php b/app/Helpers/UrlBuilder.php index 5a36ca3..62bff30 100644 --- a/app/Helpers/UrlBuilder.php +++ b/app/Helpers/UrlBuilder.php @@ -7,6 +7,7 @@ class UrlBuilder { } static public function download(string $url, string $username, string $id, bool $watermark): string { + // {path('/download?url=' . urlencode($playAddr) . '&id=' . $id . '&user=' . $uniqueId) . '&watermark=1'} $down_url = Misc::url('/download?url=' . urlencode($url) . '&id=' . $id . '&user=' . $username); if ($watermark) $down_url .= '&watermark=1'; return $down_url; diff --git a/components/head.latte b/components/head.latte index ef6a9dc..cce56a1 100644 --- a/components/head.latte +++ b/components/head.latte @@ -16,6 +16,8 @@
This can be used to install the PWA version of ProxiTok
+Api
{include '../components/settings/api.latte'} +Misc
+ {include '../components/settings/misc.latte'} +