]> git.mxchange.org Git - friendica-addons.git/blobdiff - irc/irc.php
ZH CN translation update wppost addon THX vicdorke
[friendica-addons.git] / irc / irc.php
index c5d50d4e96952b732e136a832ad87e93f7a72abb..b5ba5172d7fcc4d530ea6f10ddda02d483293acc 100644 (file)
@@ -7,7 +7,6 @@
 * Author: Tobias Diekershoff <https://f.diekershoff.de/u/tobias>
 */
 
-use Friendica\Core\Config;
 use Friendica\Core\Hook;
 use Friendica\Core\Renderer;
 use Friendica\DI;
@@ -18,13 +17,6 @@ function irc_install() {
        Hook::register('addon_settings_post', 'addon/irc/irc.php', 'irc_addon_settings_post');
 }
 
-function irc_uninstall() {
-       Hook::unregister('app_menu', 'addon/irc/irc.php', 'irc_app_menu');
-       Hook::unregister('addon_settings', 'addon/irc/irc.php', 'irc_addon_settings');
-
-}
-
-
 function irc_addon_settings(&$a,&$s) {
        if(! local_user())
                return;
@@ -63,7 +55,6 @@ function irc_addon_settings_post(&$a, &$b) {
                        DI::pConfig()->set(local_user(), 'irc', 'sitechats', trim($_POST['sitechats']));
                }
                /* upid pop-up thing */
-               info(DI::l10n()->t('IRC settings saved.') . EOL);
        }
 }
 
@@ -86,9 +77,9 @@ function irc_content(&$a) {
        if (local_user()) {
            $sitechats = DI::pConfig()->get( local_user(), 'irc', 'sitechats');
            if (!$sitechats)
-               $sitechats = Config::get('irc', 'sitechats');
+               $sitechats = DI::config()->get('irc', 'sitechats');
        } else {
-           $sitechats = Config::get('irc','sitechats');
+           $sitechats = DI::config()->get('irc','sitechats');
        }
        if($sitechats)
                $chats = explode(',',$sitechats);
@@ -106,9 +97,9 @@ function irc_content(&$a) {
        if (local_user()) {
            $autochans = DI::pConfig()->get(local_user(), 'irc', 'autochans');
            if (!$autochans)
-               $autochans = Config::get('irc','autochans');
+               $autochans = DI::config()->get('irc','autochans');
        } else {
-           $autochans = Config::get('irc','autochans');
+           $autochans = DI::config()->get('irc','autochans');
        }
        if($autochans)
                $channels = $autochans;
@@ -118,7 +109,7 @@ function irc_content(&$a) {
 /* add the chatroom frame and some html */
   $o .= <<< EOT
 <h2>IRC chat</h2>
-<p><a href="http://tldp.org/HOWTO/IRC/beginners.html" target="_blank">A beginner's guide to using IRC. [en]</a></p>
+<p><a href="http://tldp.org/HOWTO/IRC/beginners.html" target="_blank" rel="noopener noreferrer">A beginner's guide to using IRC. [en]</a></p>
 <iframe src="//webchat.freenode.net?channels=$channels" style="width:100%; max-width:900px; height: 600px;"></iframe>
 EOT;
 
@@ -131,15 +122,13 @@ function irc_addon_admin_post (&$a) {
                return;
 
        if($_POST['irc-submit']) {
-               Config::set('irc','autochans',trim($_POST['autochans']));
-               Config::set('irc','sitechats',trim($_POST['sitechats']));
-               /* stupid pop-up thing */
-               info(DI::l10n()->t('IRC settings saved.') . EOL);
+               DI::config()->set('irc','autochans',trim($_POST['autochans']));
+               DI::config()->set('irc','sitechats',trim($_POST['sitechats']));
        }
 }
 function irc_addon_admin (&$a, &$o) {
-       $sitechats = Config::get('irc','sitechats'); /* popular channels */
-       $autochans = Config::get('irc','autochans');  /* auto connect chans */
+       $sitechats = DI::config()->get('irc','sitechats'); /* popular channels */
+       $autochans = DI::config()->get('irc','autochans');  /* auto connect chans */
        $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/irc/" );
        $o = Renderer::replaceMacros($t, [
                '$submit' => DI::l10n()->t('Save Settings'),