summaryrefslogtreecommitdiffstats
path: root/modules-available/locations/inc
diff options
context:
space:
mode:
authorSimon Rettberg2021-11-30 15:27:59 +0100
committerSimon Rettberg2022-03-09 15:06:54 +0100
commit41612c4481111969367d1a228ad4875d781558a2 (patch)
treed59bc50a3a2822faa6b800bd1f74f97c5ca692b3 /modules-available/locations/inc
parent[permissionmanager] Fix for PHP 8 (diff)
downloadslx-admin-41612c4481111969367d1a228ad4875d781558a2.tar.gz
slx-admin-41612c4481111969367d1a228ad4875d781558a2.tar.xz
slx-admin-41612c4481111969367d1a228ad4875d781558a2.zip
[locations] Modularize additional column handling
Additional columns are now added through a hook, moving specialized code where it belongs.
Diffstat (limited to 'modules-available/locations/inc')
-rw-r--r--modules-available/locations/inc/abstractlocationcolumn.inc.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/modules-available/locations/inc/abstractlocationcolumn.inc.php b/modules-available/locations/inc/abstractlocationcolumn.inc.php
new file mode 100644
index 00000000..9583429e
--- /dev/null
+++ b/modules-available/locations/inc/abstractlocationcolumn.inc.php
@@ -0,0 +1,24 @@
+<?php
+
+abstract class AbstractLocationColumn
+{
+
+ public abstract function getColumnHtml(int $locationId): string;
+
+ public abstract function getEditUrl(int $locationId): string;
+
+ public abstract function header(): string;
+
+ public abstract function priority(): int;
+
+ public function propagateColumn(): bool
+ {
+ return false;
+ }
+
+ public function propagateDefaultHtml(): string
+ {
+ return $this->getColumnHtml(0);
+ }
+
+} \ No newline at end of file