MyBB Community Forums

Full Version: Custom Peekers Hooks
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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:

$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.
I'm sure this has been suggested before, but I'll give every instance of this being suggested a +1.
I did a search first and didn't find it as being suggested.
I'm 100% behind this.