[feature/template-events] Really basic template hook implementation.

PHPBB3-9550
This commit is contained in:
Oleg Pudeyev 2011-11-27 00:49:39 -05:00
parent 09aae1ea30
commit 66232031e4

View file

@ -870,6 +870,26 @@ class phpbb_template_filter extends php_user_filter
var_dump($tag_args);
}
$location = $tag_args;
if ($this->phpbb_extension_manager)
{
$finder = $this->phpbb_extension_manager->get_finder();
$files = $finder
->extension_prefix($location)
->extension_suffix('.html')
->extension_directory("/styles/universal/template")
->get_files();
$all_compiled = '';
foreach ($files as $file)
{
$compiled = $this->template_compile->compile_file($file);
$all_compiled .= $compiled;
}
return '?>' . $all_compiled . '<?php';
}
// 1. find all mods defining hooks for location
// 2. obtain mods' template fragments
// 3. compile template fragments