* Allow template set to override plugin configuration by either
* adding or removing plugins.
*
+ * NOTE: due to when this code executes, plugins activated here
+ * do not have access to the config_override and loading_prefs
+ * hooks; instead, such plugins can use the
+ * "template_plugins_override_after" hook defined below.
+ *
*/
function override_plugins() {
- global $disable_plugins, $plugins, $squirrelmail_plugin_hooks;
+ global $disable_plugins, $plugins, $squirrelmail_plugin_hooks, $null;
if ($disable_plugins) return;
$add_plugins = Template::get_template_config($this->template_set_id,
}
}
+ do_hook('template_plugins_override_after', $null);
+
}
/**
} else {
$aPluginOutput = array();
- // At this moment concat_hook_function can return string and arrays.
- // In php 4.3.x a notice will be raised when a string is passed as $aPluginOutput
- // TODO, only return an arrays by concat_hook_function.
- $mixedOutput = concat_hook_function('template_construct_' . $file,
- $temp=array(&$aPluginOutput, &$this));
- if (is_array($mixedOutput)) {
- $aPluginOutput = $mixedOutput;
- }
+ $aPluginOutput = concat_hook_function('template_construct_' . $file,
+ $temp=array(&$aPluginOutput, &$this),
+ TRUE);
$this->assign('plugin_output', $aPluginOutput);
//$output = $this->apply_template($template);