mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/15214] Adjust core event name and docblock
PHPBB3-15214
This commit is contained in:
parent
43cf7b73bd
commit
ccbdfb49c7
5 changed files with 24 additions and 10 deletions
|
@ -42,7 +42,7 @@ class event extends \Twig\TokenParser\AbstractTokenParser
|
||||||
* In case of equal priority values, corresponding template event listeners will be handled in default compilation order.
|
* In case of equal priority values, corresponding template event listeners will be handled in default compilation order.
|
||||||
* If not set, template event listener priority will be assigned to the value of 0.
|
* If not set, template event listener priority will be assigned to the value of 0.
|
||||||
*
|
*
|
||||||
* @event core.twig_tokenparser_constructor
|
* @event core.twig_event_tokenparser_constructor
|
||||||
* @var array template_event_priority_array Array with template event priority assignments per extension namespace
|
* @var array template_event_priority_array Array with template event priority assignments per extension namespace
|
||||||
* Usage:
|
* Usage:
|
||||||
* '<author>_<extension_name>' => [
|
* '<author>_<extension_name>' => [
|
||||||
|
@ -50,17 +50,31 @@ class event extends \Twig\TokenParser\AbstractTokenParser
|
||||||
* ],
|
* ],
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* 'phpbb_viglink' => [
|
* class template_event_order implements EventSubscriberInterface
|
||||||
* 'event/acp_help_phpbb_stats_after' => 80,
|
* {
|
||||||
* 'event/overall_footer_after' => 100,
|
* static public function getSubscribedEvents()
|
||||||
* ],
|
* {
|
||||||
|
* return [
|
||||||
|
* 'core.twig_event_tokenparser_constructor' => 'set_template_event_priority',
|
||||||
|
* ];
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* public function set_template_event_priority($event)
|
||||||
|
* {
|
||||||
|
* $template_event_priority_array = $event['template_event_priority_array'];
|
||||||
|
* $template_event_priority_array['vendor_name'] = [
|
||||||
|
* 'event/navbar_header_quick_links_after' => -1,
|
||||||
|
* ];
|
||||||
|
* $event['template_event_priority_array'] = $template_event_priority_array;
|
||||||
|
* }
|
||||||
|
* }
|
||||||
*
|
*
|
||||||
* @since 4.0.0-a1
|
* @since 4.0.0-a1
|
||||||
*/
|
*/
|
||||||
if ($this->phpbb_dispatcher)
|
if ($this->phpbb_dispatcher)
|
||||||
{
|
{
|
||||||
$vars = ['template_event_priority_array'];
|
$vars = ['template_event_priority_array'];
|
||||||
extract($this->phpbb_dispatcher->trigger_event('core.twig_tokenparser_constructor', compact($vars)));
|
extract($this->phpbb_dispatcher->trigger_event('core.twig_event_tokenparser_constructor', compact($vars)));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->template_event_priority_array = $template_event_priority_array;
|
$this->template_event_priority_array = $template_event_priority_array;
|
||||||
|
|
|
@ -23,7 +23,7 @@ class template_event_order implements EventSubscriberInterface
|
||||||
static public function getSubscribedEvents()
|
static public function getSubscribedEvents()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'core.twig_tokenparser_constructor' => 'set_template_event_priority',
|
'core.twig_event_tokenparser_constructor' => 'set_template_event_priority',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ class template_event_order implements EventSubscriberInterface
|
||||||
static public function getSubscribedEvents()
|
static public function getSubscribedEvents()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'core.twig_tokenparser_constructor' => 'set_template_event_priority',
|
'core.twig_event_tokenparser_constructor' => 'set_template_event_priority',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ class template_event_order implements EventSubscriberInterface
|
||||||
static public function getSubscribedEvents()
|
static public function getSubscribedEvents()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'core.twig_tokenparser_constructor' => 'set_template_event_priority',
|
'core.twig_event_tokenparser_constructor' => 'set_template_event_priority',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ class template_event_order implements EventSubscriberInterface
|
||||||
static public function getSubscribedEvents()
|
static public function getSubscribedEvents()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'core.twig_tokenparser_constructor' => 'set_template_event_priority',
|
'core.twig_event_tokenparser_constructor' => 'set_template_event_priority',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue