diff options
| author | Simon Rettberg | 2026-01-20 15:52:04 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2026-01-20 15:52:04 +0100 |
| commit | 24f5c388cd1246074bf5d39c5a0c484d0d625d80 (patch) | |
| tree | a961f7bbc10d62b30e43ecbf898818cc21660287 /modules-available/locationinfo/install.inc.php | |
| parent | IntelliJ: Mark Testdir (diff) | |
| download | slx-admin-24f5c388cd1246074bf5d39c5a0c484d0d625d80.tar.gz slx-admin-24f5c388cd1246074bf5d39c5a0c484d0d625d80.tar.xz slx-admin-24f5c388cd1246074bf5d39c5a0c484d0d625d80.zip | |
[locationinfo] Add panel query API, add option to mark panels as public
This adds the option to query a JSON of all available info panels.
In addition, info panels can be marked as public/private, and only
public panels will be returned in the JSON.
Diffstat (limited to 'modules-available/locationinfo/install.inc.php')
| -rw-r--r-- | modules-available/locationinfo/install.inc.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modules-available/locationinfo/install.inc.php b/modules-available/locationinfo/install.inc.php index 732ea6e9..f4bbca1c 100644 --- a/modules-available/locationinfo/install.inc.php +++ b/modules-available/locationinfo/install.inc.php @@ -30,6 +30,7 @@ $t3 = $res[] = tableCreate('locationinfo_panel', " `paneltype` enum('DEFAULT', 'SUMMARY', 'URL', 'UPCOMING') NOT NULL, `panelconfig` blob NOT NULL, `lastchange` int(10) UNSIGNED NOT NULL DEFAULT 0, + `ispublic` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`paneluuid`), KEY `panelname` (`panelname`) "); @@ -103,7 +104,7 @@ if (tableGetConstraints('locationinfo_backendlog', 'serverid', 'locationinfo_coursebackend', 'serverid', 'ON UPDATE CASCADE ON DELETE CASCADE'); } -// 2025-06-17: Make locationds text column +// 2025-06-17: Make locationids text column if (stripos(tableColumnType('locationinfo_panel', 'locationids'), 'text') === false) { if (Database::exec('ALTER TABLE `locationinfo_panel` MODIFY `locationids` text CHAR SET ascii NOT NULL')) { $res[] = UPDATE_DONE; @@ -112,6 +113,15 @@ if (stripos(tableColumnType('locationinfo_panel', 'locationids'), 'text') === fa } } +// 2025-12-12: Add "public" column +if (!tableHasColumn('locationinfo_panel', 'ispublic')) { + if (Database::exec('ALTER TABLE `locationinfo_panel` ADD `ispublic` tinyint(1) NOT NULL DEFAULT 0') !== false) { + $res[] = UPDATE_DONE; + } else { + $res[] = UPDATE_FAILED; + } +} + // Create response for browser if (in_array(UPDATE_RETRY, $res)) { |
