Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
listener.php
01 <?php
02 /**
03 *
04 * VigLink extension for the phpBB Forum Software package.
05 *
06 * @copyright (c) 2014 phpBB Limited <https://www.phpbb.com>
07 * @license GNU General Public License, version 2 (GPL-2.0)
08 *
09 */
10
11 namespace phpbb\viglink\event;
12
13 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
14
15 /**
16 * Event listener
17 */
18 class listener implements EventSubscriberInterface
19 {
20 /** @var \phpbb\config\config $config Config object */
21 protected $config;
22
23 /** @var \phpbb\template\template $template Template object */
24 protected $template;
25
26 /**
27 * Constructor
28 *
29 * @param \phpbb\config\config $config Config object
30 * @param \phpbb\template\template $template Template object
31 */
32 public function __construct(\phpbb\config\config $config, \phpbb\template\template $template)
33 {
34 $this->config = $config;
35 $this->template = $template;
36 }
37
38 /**
39 * {@inheritDoc}
40 */
41 static public function getSubscribedEvents()
42 {
43 return array(
44 'core.viewtopic_post_row_after' => 'display_viglink',
45 );
46 }
47
48 /**
49 * Insert the VigLink JS code into forum pages
50 *
51 * @return void
52 */
53 public function display_viglink()
54 {
55 $viglink_key = '';
56
57 if ($this->config['allow_viglink_phpbb'] && $this->config['phpbb_viglink_api_key'])
58 {
59 // Use phpBB API key if VigLink is allowed for phpBB
60 $viglink_key = $this->config['phpbb_viglink_api_key'];
61 }
62
63 $this->template->assign_vars(array(
64 'VIGLINK_ENABLED' => $this->config['viglink_enabled'] && $viglink_key,
65 'VIGLINK_API_KEY' => $viglink_key,
66 'VIGLINK_SUB_ID' => md5(urlencode($this->config['viglink_api_siteid']) . $this->config['questionnaire_unique_id']),
67 ));
68 }
69 }
70