2013-09-01, 09:36 AM
For plugins that create settings into the database, it would be great to have a couple of hooks that will allow Plugin authors to use the Peeker Javascript object.
As a test case, I was able to use the Peeker object simply by adding a custom hook in MYBB_ROOT/admin/modules/config/settings.php.
And since there are only two times that the print_setting_peekers() function is called, we only need two new hooks probably with the following names:
As for the code that my plugin had to implement, I just echo'd out:
If this were part of the core files, plugin authors wouldn't have to edit the core files to get this working.
As a test case, I was able to use the Peeker object simply by adding a custom hook in MYBB_ROOT/admin/modules/config/settings.php.
And since there are only two times that the print_setting_peekers() function is called, we only need two new hooks probably with the following names:
$plugins->run_hooks("admin_config_settings_change_custom_peekers");
$plugins->run_hooks("admin_config_settings_custom_peekers");
As for the code that my plugin had to implement, I just echo'd out:
<script type="text/javascript">
Event.observe(window, "load", function() {
loadPluginPeekers();
});
function loadPluginPeekers()
{
new Peeker($$(".setting_plugin_enabled"), $("row_setting_plugin_string"), /1/, true);
}
</script>
If this were part of the core files, plugin authors wouldn't have to edit the core files to get this working.