From 72fad2941fc251ce6ec5c404511e0de09b7cbdb3 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 14 Dec 2016 11:51:58 -0700 Subject: [PATCH] - Allow extending classes to easily override config index - Allow config settings to be arrays --- admin/inc/class.admin_config.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/admin/inc/class.admin_config.inc.php b/admin/inc/class.admin_config.inc.php index de58c3d782..b3d6102c96 100644 --- a/admin/inc/class.admin_config.inc.php +++ b/admin/inc/class.admin_config.inc.php @@ -159,7 +159,7 @@ class admin_config // for security reasons we do not send all config to client-side, but only ones mentioned in templates $matches = null; - preg_match_all('/id="newsettings\[([^]]+)\]"/', file_get_contents($path), $matches, PREG_PATTERN_ORDER); + preg_match_all('/id="newsettings\[([^]]+)\]/', file_get_contents($path), $matches, PREG_PATTERN_ORDER); foreach($matches[1] as $name) { $content['newsettings'][$name] = isset($config[$name]) ? $config[$name] : ''; @@ -173,6 +173,7 @@ class admin_config } $tmpl->read('admin.site-config'); - $tmpl->exec('admin.admin_config.index', $content, $sel_options, $readonlys, array('appname' => $appname)); + $method = (get_called_class() == __CLASS__) ? 'admin.admin_config.index' : "$appname.".get_called_class().'.'.__FUNCTION__; + $tmpl->exec($method, $content, $sel_options, $readonlys, array('appname' => $appname)); } }