- Allow extending classes to easily override config index

- Allow config settings to be arrays
This commit is contained in:
nathangray 2016-12-14 11:51:58 -07:00
parent 2d1bb1ecc3
commit 72fad2941f

View File

@ -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));
}
}