]> git.mxchange.org Git - friendica-addons.git/blobdiff - opmlexport/opmlexport.php
Store hash tags
[friendica-addons.git] / opmlexport / opmlexport.php
index 238185ed364fc5f52828b1458ea90c269ccfd805..fdfacc3e3084bcb312bfd5706c98eabdf6e3c0bf 100644 (file)
@@ -26,10 +26,10 @@ function opmlexport_install()
 }
 
 
-function opmlexport(App $a)
+function opmlexport()
 {
        $condition = [
-               'uid' => local_user(),
+               'uid' => DI::userSession()->getLocalUserId(),
                'self' => false,
                'deleted' => false,
                'archive' => false,
@@ -38,7 +38,7 @@ function opmlexport(App $a)
                'network' => Protocol::FEED
        ];
        $data = Contact::selectToArray([], $condition, ['order' => ['name']]);
-       $user = User::getById(local_user());
+       $user = User::getById(DI::userSession()->getLocalUserId());
 
        $xml = new \DOMDocument( '1.0', 'utf-8' );
        $opml = $xml->createElement('opml');
@@ -68,24 +68,25 @@ function opmlexport(App $a)
 }
 
 
-function opmlexport_addon_settings(App $a, &$s)
+function opmlexport_addon_settings(array &$data)
 {
-       if (!local_user()) {
+       if (!DI::userSession()->getLocalUserId()) {
                return;
        }
 
-       $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/opmlexport/');
-       $s .= Renderer::replaceMacros($t, [
-               '$title'   => DI::l10n()->t('OPML Export'),
-               '$submit'  => DI::l10n()->t('Export RSS/Atom contacts'),
-       ]);
+       $data = [
+               'addon'  => 'opmlexport',
+               'title'  => DI::l10n()->t('OPML Export'),
+               'submit' => DI::l10n()->t('Export RSS/Atom contacts'),
+       ];
 }
 
 
-function opmlexport_addon_settings_post(App $a, &$b)
+function opmlexport_addon_settings_post(array &$b)
 {
-       if (!local_user() || empty($_POST['opmlexport-submit'])) {
+       if (!DI::userSession()->getLocalUserId() || empty($_POST['opmlexport-submit'])) {
                return;
        }
-       opmlexport($a);
+
+       opmlexport();
 }