1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-02 23:07:39 +02:00

Merge pull request #1643 from rechosen/ticket/11777

[ticket/11777] Search for template listeners in the php event listeners way
This commit is contained in:
Joas Schilling
2013-08-12 06:37:47 -07:00
12 changed files with 7 additions and 1 deletions

View File

@@ -18,6 +18,12 @@ if (!defined('IN_PHPBB'))
class phpbb_template_twig_node_event extends Twig_Node class phpbb_template_twig_node_event extends Twig_Node
{ {
/**
* The subdirectory in which all template listener files must be placed
* @var string
*/
protected $listener_directory = 'event/';
/** @var Twig_Environment */ /** @var Twig_Environment */
protected $environment; protected $environment;
@@ -37,7 +43,7 @@ class phpbb_template_twig_node_event extends Twig_Node
{ {
$compiler->addDebugInfo($this); $compiler->addDebugInfo($this);
$location = $this->getNode('expr')->getAttribute('name'); $location = $this->listener_directory . $this->getNode('expr')->getAttribute('name') . '_listener';
foreach ($this->environment->get_phpbb_extensions() as $ext_namespace => $ext_path) foreach ($this->environment->get_phpbb_extensions() as $ext_namespace => $ext_path)
{ {