+
+ /**
+ * get private link for item
+ * @param array $item
+ * @return boolean|array False if item has not plink, otherwise array('href'=>plink url, 'title'=>translated title)
+ */
+ public static function getPlink($item)
+ {
+ $a = self::getApp();
+
+ if ($a->user['nickname'] != "") {
+ $ret = [
+ 'href' => "display/" . $item['guid'],
+ 'orig' => "display/" . $item['guid'],
+ 'title' => L10n::t('View on separate page'),
+ 'orig_title' => L10n::t('view on separate page'),
+ ];
+
+ if (!empty($item['plink'])) {
+ $ret["href"] = $a->removeBaseURL($item['plink']);
+ $ret["title"] = L10n::t('link to source');
+ }
+
+ } elseif (!empty($item['plink']) && ($item['private'] != 1)) {
+ $ret = [
+ 'href' => $item['plink'],
+ 'orig' => $item['plink'],
+ 'title' => L10n::t('link to source'),
+ ];
+ } else {
+ $ret = [];
+ }
+
+ return $ret;
+ }