*/ class action_plugin_vshare extends ActionPlugin { /** @inheritDoc */ public function register(EventHandler $controller) { $controller->register_hook('DOKUWIKI_STARTED', 'AFTER', $this, 'addSites'); } /** * Add the site regexes * * @param Event $event event object by reference * @param mixed $param optional parameter passed when event was registered * @return void */ public function addSites(Event $event, $param) { global $JSINFO; $sites = parse_ini_file(__DIR__ . '/sites.ini', true, INI_SCANNER_RAW); $js = []; foreach ($sites as $site => $data) { if (empty($data['rex'])) continue; $js[$site] = $data['rex']; } $JSINFO['plugins']['vshare'] = $js; } }