So here is my thought on how a plugin will work:
User logs in, main config file is parsed out, which includes plugin configs.
Baisc syntax:
$plugins['pluginname']['key'] = "value";
the $plugins array is itterated though, for each element, an array is expected. What goes in there is up to the plugin author, except for the manditory "enabled" option. If $plugins['pluginname']['enabled'] is anything but true, the plugin will not be loaded. This array is then stored in $_SESSION once its all been parsed. The config will not be parsed again during the session.
Then HM does include($pluginname+"_src.php") and calls $pluginname+"_register"() which is expected to register any hooks (which will be documented). This will only be done once per session.
Each time a hook is encountered (list_folders, whatever) from that point forward, $pluginname+"_"+$hookname($args) is called.
Future page loads only call hooks. One such important and spcial hook will be "init" which is called before other processing is done at each page load (so the plugin can initialize database connections, or whatnot). But the "init" hook will only be called if the plugin has other hooks to be called on this page load. This means HM needs to know very early in the process what hooks will be called on that page load.
Here are some example syntaxes for the plugin config
Good point about needing an init function, defining the hooks based on the page should not be a problem. Also we want to provide additional means to create stand along pages within the site (not ones that hook into existing pages) so we need a mechanism for that, which I already have floating around in my head. It would be very much like the existing mechanism for outputting pages within framework, but encapsulated into the plugin include file.
I think you have an extra step in the initial process. What if we have only the main plugin config file, parsed at login and stored in the session. There is no need to parse individual files from the plugin until a hook (or init for that page) is called. Then when we hit a hook execution point we include the file associated with that hook/plugin and run a predetermined function in the plugin file. There are no arguments to the hook function. Everything they might need to do can be done by including the global $user object.
Plugins should use the same theme or color scheme as the rest of hm2. At least as a default option. There could be reasons to use a special one if it was a photo album or something.