From 75f3afdc84d63d28f297ad6bcf2ecf8ee0f502f6 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 23 Oct 2019 09:06:19 +0200 Subject: [PATCH] new hooks processConfig and showConfig hook 'showConfig' is anly called for extension variables if the type is set to 'hook'. 'processConfig' is called after the extension configuration is read --- views/bootstrap/class.Settings.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/views/bootstrap/class.Settings.php b/views/bootstrap/class.Settings.php index c627bf913..a83cdf384 100644 --- a/views/bootstrap/class.Settings.php +++ b/views/bootstrap/class.Settings.php @@ -474,6 +474,8 @@ $this->showStartPaneContent('site', (!$currenttab || $currenttab == 'site')); --> $extconf) { + if($this->hasHook('processConfig')) + $extconf = $this->callHook('processConfig', $extname, $extconf); if($extconf['config']) { $this->showRawConfigHeadline("".$extconf['title']); foreach($extconf['config'] as $confkey=>$conf) { @@ -565,11 +567,14 @@ $this->showStartPaneContent('site', (!$currenttab || $currenttab == 'site')); } } break; + case 'hook': + echo $this->callHook('showConfig', $confkey, $extname, $extconf); + break; default: $this->showTextField("extensions[".$extname."][".$confkey."]", isset($settings->_extensions[$extname][$confkey]) ? $settings->_extensions[$extname][$confkey] : '', isset($conf['type']) ? $conf['type'] : '', isset($conf['placeholder']) ? $conf['placeholder'] : ''); } $html = ob_get_clean(); - $this->showConfigPlain($conf['title'], isset($conf['help']) ? $conf['help'] : '', $html); + $this->showConfigPlain($conf['title'], isset($conf['help']) ? $conf['help'] : '', $html); } } }