X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=opmlexport%2Fopmlexport.php;h=fdfacc3e3084bcb312bfd5706c98eabdf6e3c0bf;hb=14fd9006286f338848876b843d060c629b59afb5;hp=c92b5960097ebd22613f3b5efb4534253a2c2a3a;hpb=779b38ec0988a2b92e1fe5db3a8f59e76a64f58d;p=friendica-addons.git diff --git a/opmlexport/opmlexport.php b/opmlexport/opmlexport.php index c92b5960..fdfacc3e 100644 --- a/opmlexport/opmlexport.php +++ b/opmlexport/opmlexport.php @@ -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,9 +68,9 @@ function opmlexport(App $a) } -function opmlexport_addon_settings(App $a, array &$data) +function opmlexport_addon_settings(array &$data) { - if (!local_user()) { + if (!DI::userSession()->getLocalUserId()) { return; } @@ -82,10 +82,11 @@ function opmlexport_addon_settings(App $a, array &$data) } -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(); }