From c8d09bb7182b5590caf2e683fc457ee01b625cff Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Mon, 13 Sep 2021 22:28:51 +0200 Subject: Add a settings page, mostly for information for now. --- unshorturl/unshorturl.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/unshorturl/unshorturl.php b/unshorturl/unshorturl.php index cd09e13..7c45743 100644 --- a/unshorturl/unshorturl.php +++ b/unshorturl/unshorturl.php @@ -15,13 +15,24 @@ use Zotlabs\Lib\Apps; use Zotlabs\Extend\Hook; function unshorturl_install() { + Hook::register('feature_settings', 'addon/unshorturl/unshorturl.php', 'unshorturl_feature_settings', 1); Hook::register('prepare_body', 'addon/unshorturl/unshorturl.php', 'unshorturl_prepare_body', 1); } function unshorturl_uninstall() { + Hook::unregister('feature_settings', 'addon/unshorturl/unshorturl.php', 'unshorturl_feature_settings'); Hook::unregister('prepare_body', 'addon/unshorturl/unshorturl.php', 'unshorturl_prepare_body'); } +function unshorturl_feature_settings(&$a, &$html) { + $html = + '
' + . '

UnshortURL

' + . '

Expand shortened URL\'s into their full representation.

' + . '
' + . '
'; +} + function unshorturl_get_long_url($shorturl) { $ch = curl_init($shorturl); curl_setopt_array($ch, [ -- cgit v1.2.3