summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwn_ <[email protected]>2021-11-14 22:03:52 +0000
committerwn_ <[email protected]>2021-11-14 22:03:52 +0000
commitbaa3cd37c996322fc8a314134d34f6e6e044faa3 (patch)
tree00c09e916d9cfc61278691afea6c2424412dc9e1
parent772aaf80ae16940567781a1a966607009321fb6b (diff)
Add PHPDoc stuff from Plugin, use constants for access level stuff.
-rw-r--r--init.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/init.php b/init.php
index 068cde6..d1e6392 100644
--- a/init.php
+++ b/init.php
@@ -7,6 +7,7 @@ class Prefs_Effective_Config extends Plugin {
Config::T_INT => 'integer',
];
+ /** @return array<null|float|string|bool> */
function about() {
return [
null, // version
@@ -17,10 +18,16 @@ class Prefs_Effective_Config extends Plugin {
];
}
+ /** @return int */
function api_version() {
return 2;
}
+ /**
+ * @param PluginHost $host
+ *
+ * @return void
+ * */
function init($host) {
$host->add_hook($host::HOOK_PREFS_TAB, $this);
}
@@ -144,7 +151,7 @@ class Prefs_Effective_Config extends Plugin {
}
private static function is_admin(): bool {
- return ($_SESSION['access_level'] ?? 0) >= 10;
+ return ($_SESSION['access_level'] ?? UserHelper::ACCESS_LEVEL_DISABLED) >= UserHelper::ACCESS_LEVEL_ADMIN;
}
/**