]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Event.php
Removed unused template variables
[friendica.git] / src / Model / Event.php
index ce2e9d53b2cc98b43a537bcb7db3e01af66dc209..6f8ed123c17396bc4fd6e45f8405e13e33018967 100644 (file)
@@ -1,14 +1,30 @@
 <?php
 /**
- * @file src/Model/Event.php
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  */
 
 namespace Friendica\Model;
 
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\Hook;
-use Friendica\Core\L10n;
 use Friendica\Core\Logger;
+use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
@@ -355,6 +371,7 @@ class Event
                                $item_arr['origin']        = $event['cid'] === 0 ? 1 : 0;
                                $item_arr['body']          = self::getBBCode($event);
                                $item_arr['event-id']      = $event['id'];
+                               $item_arr['network']       = Protocol::DFRN;
 
                                $item_arr['object']  = '<object><type>' . XML::escape(Activity\ObjectType::EVENT) . '</type><title></title><id>' . XML::escape($event['uri']) . '</id>';
                                $item_arr['object'] .= '<content>' . XML::escape(self::getBBCode($event)) . '</content>';
@@ -596,14 +613,12 @@ class Event
 
                        $title = BBCode::convert(Strings::escapeHtml($event['summary']));
                        if (!$title) {
-                               list($title, $_trash) = explode("<br", BBCode::convert(Strings::escapeHtml($event['desc'])), 2);
+                               list($title, $_trash) = explode("<br", BBCode::convert(Strings::escapeHtml($event['desc'])), BBCode::API);
                        }
 
                        $author_link = $event['author-link'];
-                       $plink       = $event['plink'];
 
                        $event['author-link'] = Contact::magicLink($author_link);
-                       $event['plink']       = Contact::magicLink($author_link, $plink);
 
                        $html = self::getHTML($event);
                        $event['summary']  = BBCode::convert(Strings::escapeHtml($event['summary']));
@@ -623,7 +638,7 @@ class Event
                                'is_first' => $is_first,
                                'item'     => $event,
                                'html'     => $html,
-                               'plink'    => [$event['plink'], DI::l10n()->t('link to source'), '', ''],
+                               'plink'    => Item::getPlink($event),
                        ];
                }