Skip to content

Commit d96c6f8

Browse files
committed
Add description to "who is online"
Rename header_events.php to base_events.php
1 parent 42c516c commit d96c6f8

4 files changed

Lines changed: 18 additions & 3 deletions

File tree

config/services.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ services:
2727
- %phpbbde.pastebin.geshi%
2828
- %phpbbde.pastebin.geshilangs%
2929
- %tables.phpbbde.pastebin.pastebin%
30-
phpbbde.pastebin.header_listener:
31-
class: phpbbde\pastebin\event\header_events
30+
phpbbde.pastebin.base_listener:
31+
class: phpbbde\pastebin\event\base_events
3232
arguments:
3333
- @auth
3434
- @template
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
/**
1818
* Event listener
1919
*/
20-
class header_events implements EventSubscriberInterface
20+
class base_events implements EventSubscriberInterface
2121
{
2222
static public function getSubscribedEvents()
2323
{
2424
return array(
2525
'core.page_header_after' => 'page_header_after',
26+
'core.viewonline_overwrite_location' => 'viewonline_page',
2627
);
2728
}
2829

@@ -55,4 +56,16 @@ public function page_header_after($event)
5556
'U_PASTEBIN' => $this->helper->route('phpbbde_pastebin_main_controller'),
5657
));
5758
}
59+
60+
public function viewonline_page($event)
61+
{
62+
if ($event['on_page'][1] == 'app')
63+
{
64+
if(strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/rules') === 0)
65+
{
66+
$event['location'] = $this->user->lang('PASTEBIN_VIEWONLINE');
67+
$event['location_url'] = $this->helper->route('phpbbde_pastebin_main_controller');
68+
}
69+
}
70+
}
5871
}

language/de/global.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@
2626
$lang = array_merge($lang, array(
2727
// Globally used language variables (e.g. for the header)
2828
'PASTEBIN' => 'Pastebin',
29+
'PASTEBIN_VIEWONLINE' => 'Im Pastebin',
2930
));

language/en/global.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@
2626
$lang = array_merge($lang, array(
2727
// Globally used language variables (e.g. for the header)
2828
'PASTEBIN' => 'Pastebin',
29+
'PASTEBIN_VIEWONLINE' => 'In pastebin',
2930
));

0 commit comments

Comments
 (0)