Commit e797d019 authored by Marius Burkard's avatar Marius Burkard
Browse files

- Fixed some hook handling problems

parent 1b9d2f34
......@@ -45,12 +45,12 @@ class plugin {
if(isset($_SESSION['s']['plugin_cache'])) unset($_SESSION['s']['plugin_cache']);
$plugin_dirs = array();
$plugin_dirs[] = ISPC_LIB_PATH.FS_DIV.'plugins'.FS_DIV;
$plugin_dirs[] = ISPC_LIB_PATH.FS_DIV.'plugins';
if(is_dir(ISPC_WEB_PATH)) {
if($dh = opendir(ISPC_WEB_PATH)) {
while(($file = readdir($dh)) !== false) {
if($file !== '.' && $file !== '..' && is_dir($file) && is_dir(ISPC_WEB_PATH . FS_DIV . $file . FS_DIV . 'lib' . FS_DIV . 'plugin.d')) $plugin_dirs[] = ISPC_WEB_PATH . FS_DIV . $file . FS_DIV . 'lib' . FS_DIV . 'plugin.d';
if($file !== '.' && $file !== '..' && is_dir(ISPC_WEB_PATH . FS_DIV . $file) && is_dir(ISPC_WEB_PATH . FS_DIV . $file . FS_DIV . 'lib' . FS_DIV . 'plugin.d')) $plugin_dirs[] = ISPC_WEB_PATH . FS_DIV . $file . FS_DIV . 'lib' . FS_DIV . 'plugin.d';
}
closedir($dh);
}
......@@ -63,6 +63,7 @@ class plugin {
$plugins_dir = $plugin_dirs[$d];
if (is_dir($plugins_dir)) {
if ($dh = opendir($plugins_dir)) {
$tmp_plugins = array();
//** Go trough all files in the plugin dir
while (($file = readdir($dh)) !== false) {
if($file !== '.' && $file !== '..' && substr($file, -8, 8) == '.inc.php') {
......@@ -76,7 +77,7 @@ class plugin {
//** load the plugins
foreach($tmp_plugins as $plugin_name => $file) {
include_once $plugins_dir.$file;
require $plugins_dir . FS_DIV . $file;
if($this->debug) $app->log('Loading plugin: '.$plugin_name, LOGLEVEL_DEBUG);
$app->loaded_plugins[$plugin_name] = new $plugin_name;
$app->loaded_plugins[$plugin_name]->onLoad();
......@@ -187,7 +188,6 @@ class plugin {
$tmpresult = call_user_func(array($app->loaded_plugins[$plugin_name], $function_name), $event_name, $data);
if($return_data == true && $tmpresult) $result .= $tmpresult;
}
}
......
......@@ -1078,7 +1078,7 @@ if (!defined('vlibTemplateClassLoaded')) {
global $app;
$module_name = '';
if(strpos($name, ':') !== false) list($name, $module_name) = explode(':', $name, 2);
if(strpos($name, ':') !== false) list($module_name, $name) = explode(':', $name, 2);
$result = $app->plugin->raiseEvent('on_template_content_hook', array(
'type' => $type,
......@@ -1086,6 +1086,7 @@ if (!defined('vlibTemplateClassLoaded')) {
'module' => $module_name
), true);
if(!$result) $result = '';
else $result = $this->_getData($result, false, true);
return $result;
}
......
......@@ -13,7 +13,7 @@
</tmpl_if>
{tmpl_hook name="begin_form"}
{tmpl_hook name="begin_form" value="web_vhost_domain_edit"}
<tmpl_if name="vhostdomain_type" value="domain">
<tmpl_if name="is_admin">
<div class="form-group">
......@@ -222,32 +222,32 @@
{tmpl_var name='php'}
</select></div>
</div>
{tmpl_hook name="begin_field" value="fastcgi_php_version"}
{tmpl_hook name="begin_field" value="web_vhost_domain_edit:fastcgi_php_version"}
<div class="form-group fastcgi_php_version">
<label for="fastcgi_php_version" class="col-sm-3 control-label">{tmpl_var name='fastcgi_php_version_txt'}</label>
<div class="col-sm-9"><select name="fastcgi_php_version" id="fastcgi_php_version" class="form-control">
{tmpl_var name='fastcgi_php_version'}
</select></div>
</div>
{tmpl_hook name="end_field" value="fastcgi_php_version"}
{tmpl_hook name="end_field" value="web_vhost_domain_edit:fastcgi_php_version"}
{tmpl_var name="directive_snippets_id"}
{tmpl_hook name="begin_field" value="enable_pagespeed"}
{tmpl_hook name="begin_field" value="web_vhost_domain_edit:enable_pagespeed"}
<div class="form-group nginx pagespeed">
<label class="col-sm-3 control-label">{tmpl_var name='enable_pagespeed_txt'}</label>
<div class="col-sm-9">
{tmpl_var name="enable_pagespeed"}
</div>
</div>
{tmpl_hook name="end_field" value="enable_pagespeed"}
{tmpl_hook name="begin_field" value="active"}
{tmpl_hook name="end_field" value="web_vhost_domain_edit:enable_pagespeed"}
{tmpl_hook name="begin_field" value="web_vhost_domain_edit:active"}
<div class="form-group">
<label class="col-sm-3 control-label">{tmpl_var name='active_txt'}</label>
<div class="col-sm-9">
{tmpl_var name='active'}
</div>
</div>
{tmpl_hook name="end_field" value="active"}
{tmpl_hook name="end_form"}
{tmpl_hook name="end_field" value="web_vhost_domain_edit:active"}
{tmpl_hook name="end_form" value="web_vhost_domain_edit"}
<input type="hidden" name="id" value="{tmpl_var name='id'}">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment