From 323904db0a2d44cbe3f4fee059e0620238cdcceb Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Tue, 27 Apr 2021 21:21:58 +0200 Subject: [PATCH] Fix indentation. Again. --- opmlexport/opmlexport.php | 96 +++++++++++++++++++-------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/opmlexport/opmlexport.php b/opmlexport/opmlexport.php index 4e49562d..ca65cbaa 100644 --- a/opmlexport/opmlexport.php +++ b/opmlexport/opmlexport.php @@ -19,71 +19,71 @@ use Friendica\Model\Contact; function opmlexport_install() { - Hook::register('addon_settings', __FILE__, 'opmlexport_addon_settings'); - Hook::register('addon_settings_post', __FILE__, 'opmlexport_addon_settings_post'); - Logger::log('installed opmlexport Addon'); + Hook::register('addon_settings', __FILE__, 'opmlexport_addon_settings'); + Hook::register('addon_settings_post', __FILE__, 'opmlexport_addon_settings_post'); + Logger::log('installed opmlexport Addon'); } function opmlexport(App $a) { - $condition = [ - 'uid' => local_user(), - 'self' => false, - 'deleted' => false, - 'archive' => false, - 'blocked' => false, - 'pending' => false, - 'network' => Protocol::FEED - ]; - $data = Contact::selectToArray([], $condition, ['order' => ['name']]); + $condition = [ + 'uid' => local_user(), + 'self' => false, + 'deleted' => false, + 'archive' => false, + 'blocked' => false, + 'pending' => false, + 'network' => Protocol::FEED + ]; + $data = Contact::selectToArray([], $condition, ['order' => ['name']]); - $xml = new \DOMDocument( '1.0', 'utf-8' ); - $opml = $xml->createElement('opml'); - $head = $xml->createElement('head'); - $body = $xml->createElement('body'); - $outline = $xml->createElement('outline'); - $outline->setAttribute('title', $a->user['username'] . '\'s RSS/Atom contacts'); - $outline->setAttribute('text', $a->user['username'] . '\'s RSS/Atom contacts'); + $xml = new \DOMDocument( '1.0', 'utf-8' ); + $opml = $xml->createElement('opml'); + $head = $xml->createElement('head'); + $body = $xml->createElement('body'); + $outline = $xml->createElement('outline'); + $outline->setAttribute('title', $a->user['username'] . '\'s RSS/Atom contacts'); + $outline->setAttribute('text', $a->user['username'] . '\'s RSS/Atom contacts'); - foreach($data as $c) { - $entry = $xml->createElement('outline'); - $entry->setAttribute('title', $c['name']); - $entry->setAttribute('text', $c['name']); - $entry->setAttribute('xmlUrl', $c['url']); - $outline->appendChild($entry); - } + foreach($data as $c) { + $entry = $xml->createElement('outline'); + $entry->setAttribute('title', $c['name']); + $entry->setAttribute('text', $c['name']); + $entry->setAttribute('xmlUrl', $c['url']); + $outline->appendChild($entry); + } - $body->appendChild($outline); - $opml->appendChild($head); - $opml->appendChild($body); - $xml->appendChild($opml); - header('Content-Type: text/x-opml'); - header('Content-Disposition: attachment; filename=feeds.opml'); - $xml->formatOutput = true; - echo $xml->saveXML(); - die(); + $body->appendChild($outline); + $opml->appendChild($head); + $opml->appendChild($body); + $xml->appendChild($opml); + header('Content-Type: text/x-opml'); + header('Content-Disposition: attachment; filename=feeds.opml'); + $xml->formatOutput = true; + echo $xml->saveXML(); + die(); } function opmlexport_addon_settings(App $a, &$s) { - if (!local_user()) { - return; - } + if (!local_user()) { + 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'), - ]); + $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'), + ]); } function opmlexport_addon_settings_post(App $a, &$b) { - if (!local_user() || empty($_POST['opmlexport-submit'])) { - return; - } - opmlexport($a); + if (!local_user() || empty($_POST['opmlexport-submit'])) { + return; + } + opmlexport($a); }