get('plugins.UMAMI_URL'); $umamiSiteid = $conf->get('plugins.UMAMI_SITEID'); if (empty($umamiUrl) || empty($umamiSiteid)) { $error = t('Umami plugin error: ' . 'Please define UMAMI_URL and UMAMI_SITEID in the plugin administration page.'); return [$error]; } } /** * Hook render_footer. * Executed on every page redering. * * Template placeholders: * - text * - endofpage * - js_files * * Data: * - _PAGE_: current page * - _LOGGEDIN_: true/false * * @param array $data data passed to plugin * * @return array altered $data. */ function hook_umami_render_footer($data, $conf) { $umamiUrl = $conf->get('plugins.UMAMI_URL'); $umamiSiteid = $conf->get('plugins.UMAMI_SITEID'); if (empty($umamiUrl) || empty($umamiSiteid)) { return $data; } // Free elements at the end of the page. $data['endofpage'][] = sprintf( file_get_contents(PluginManager::$PLUGINS_PATH . '/umami/umami.html'), $umamiSiteid, $umamiUrl ); return $data; } /** * This function is never called, but contains translation calls for GNU gettext extraction. */ function umami_dummy_translation() { // meta t('A plugin that adds umami tracking code to Shaarli pages.'); t('Umami URL'); t('Umami site ID'); }