Refactor AdminPanel: extract module, add collapsible sections & shared-links management, enforce PascalCase controllers

This commit is contained in:
Ryan
2025-05-03 23:41:02 -04:00
committed by GitHub
parent 274bedd186
commit f3977153fb
68 changed files with 5678 additions and 590 deletions

View File

@@ -570,4 +570,29 @@ class FolderModel
return ["success" => "File uploaded successfully.", "newFilename" => $newFilename];
}
public static function getAllShareFolderLinks(): array
{
$shareFile = META_DIR . "share_folder_links.json";
if (!file_exists($shareFile)) {
return [];
}
$links = json_decode(file_get_contents($shareFile), true);
return is_array($links) ? $links : [];
}
public static function deleteShareFolderLink(string $token): bool
{
$shareFile = META_DIR . "share_folder_links.json";
if (!file_exists($shareFile)) {
return false;
}
$links = json_decode(file_get_contents($shareFile), true);
if (!is_array($links) || !isset($links[$token])) {
return false;
}
unset($links[$token]);
file_put_contents($shareFile, json_encode($links, JSON_PRETTY_PRINT));
return true;
}
}