Lines Matching defs:link

198      * @param string $id the hash link
490 // output the footnote reference and link
823 * Render a CamelCase link
825 * @param string $link The link name
831 public function camelcaselink($link, $returnonly = false)
834 return $this->internallink($link, $link, null, true);
836 $this->internallink($link, $link);
841 * Render a page local link
843 * @param string $hash hash link identifier
844 * @param string $name name for the link
873 * @param string|null $name link name
908 $link = [];
915 $link['rel'] = 'nofollow';
926 $link['target'] = $conf['target']['wiki'];
927 $link['style'] = '';
928 $link['pre'] = '';
929 $link['suf'] = '';
930 $link['more'] = 'data-wiki-id="' . $id . '"'; // id is already cleaned
931 $link['class'] = $class;
935 $link['url'] = wl($id, $params);
936 $link['name'] = $name;
937 $link['title'] = $id;
940 ($conf['userewrite']) ? $link['url'] .= '?' : $link['url'] .= '&';
943 $link['url'] .= 's[]=' . implode('&s[]=', $search);
945 $link['url'] .= 's=' . rawurlencode($search);
950 if ($hash) $link['url'] .= '#' . $hash;
954 return $this->_formatLink($link);
956 $this->doc .= $this->_formatLink($link);
961 * Render an external link
964 * @param string|array $name name for the link, array for media file
998 $link = [];
999 $link['target'] = $conf['target']['extern'];
1000 $link['style'] = '';
1001 $link['pre'] = '';
1002 $link['suf'] = '';
1003 $link['more'] = '';
1004 $link['class'] = $class;
1005 $link['url'] = $url;
1006 $link['rel'] = '';
1008 $link['name'] = $name;
1009 $link['title'] = $this->_xmlEntities($url);
1010 if ($conf['relnofollow']) $link['rel'] .= ' ugc nofollow';
1011 if ($conf['target']['extern']) $link['rel'] .= ' noopener';
1015 return $this->_formatLink($link);
1017 $this->doc .= $this->_formatLink($link);
1022 * Render an interwiki link
1026 * @param string $match original link - probably not much use
1027 * @param string|array $name name for the link, array for media file
1029 * @param string $wikiUri the fragment parsed from the original link
1037 $link = [];
1038 $link['target'] = $conf['target']['interwiki'];
1039 $link['pre'] = '';
1040 $link['suf'] = '';
1041 $link['more'] = '';
1042 $link['name'] = $this->_getLinkTitle($name, $wikiUri, $isImage);
1043 $link['rel'] = '';
1051 $link['class'] = "interwiki iw_$class";
1053 $link['class'] = 'media';
1058 $link['target'] = $conf['target']['wiki'];
1062 $link['class'] .= ' wikilink1';
1064 $link['class'] .= ' wikilink2';
1065 $link['rel'] .= ' nofollow';
1068 if ($conf['target']['interwiki']) $link['rel'] .= ' noopener';
1070 $link['url'] = $url;
1071 $link['title'] = $this->_xmlEntities($link['url']);
1075 if ($url == '') return $link['name'];
1076 return $this->_formatLink($link);
1078 $this->doc .= $link['name'];
1079 } else $this->doc .= $this->_formatLink($link);
1085 * @param string $url the link
1086 * @param string|array $name name for the link, array for media file
1095 $link = [];
1096 $link['target'] = $conf['target']['windows'];
1097 $link['pre'] = '';
1098 $link['suf'] = '';
1099 $link['style'] = '';
1101 $link['name'] = $this->_getLinkTitle($name, $url, $isImage);
1103 $link['class'] = 'windows';
1105 $link['class'] = 'media';
1108 $link['title'] = $this->_xmlEntities($url);
1111 $link['url'] = $url;
1115 return $this->_formatLink($link);
1117 $this->doc .= $this->_formatLink($link);
1127 * @param string|array $name name for the link, array for media file
1135 $link = [];
1136 $link['target'] = '';
1137 $link['pre'] = '';
1138 $link['suf'] = '';
1139 $link['style'] = '';
1140 $link['more'] = '';
1144 $link['class'] = 'mail';
1146 $link['class'] = 'media';
1160 $link['url'] = 'mailto:' . $address;
1161 $link['name'] = $name;
1162 $link['title'] = $title;
1166 return $this->_formatLink($link);
1168 $this->doc .= $this->_formatLink($link);
1204 $link = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render);
1208 $link['url'] = ml(
1218 // don't link movies
1223 $link['class'] .= ' mediafile mf_' . $class;
1224 $link['url'] = ml(
1233 if ($exists) $link['title'] .= ' (' . filesize_h(filesize(mediaFN($src))) . ')';
1236 if (!empty($hash)) $link['url'] .= '#' . $hash;
1240 $link['class'] .= ' wikilink2';
1246 return $link['name'];
1248 return $this->_formatLink($link);
1251 $this->doc .= $link['name'];
1253 $this->doc .= $this->_formatLink($link);
1292 // only output plaintext without link if there is no src
1296 $link = $this->_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render);
1298 $link['url'] = ml($src, ['cache' => $cache]);
1302 // link only jpeg images
1305 // don't link movies
1310 $link['class'] .= ' mediafile mf_' . $class;
1313 if ($hash) $link['url'] .= '#' . $hash;
1317 if ($linking == 'nolink' || $noLink) return $link['name'];
1318 else return $this->_formatLink($link);
1320 $this->doc .= $link['name'];
1321 } else $this->doc .= $this->_formatLink($link);
1618 * Build a link
1620 * Assembles all parts defined in $link returns HTML for the link
1622 * @param array $link attributes of a link
1627 public function _formatLink($link)
1630 if (!str_starts_with($link['url'], 'mailto:')) {
1631 $link['url'] = str_replace('&', '&', $link['url']);
1632 $link['url'] = str_replace('&', '&', $link['url']);
1635 $link['title'] = str_replace('&', '&', $link['title']);
1639 $link['url'] = strtr($link['url'], ['>' => '%3E', '<' => '%3C', '"' => '%22']);
1640 $link['title'] = strtr($link['title'], ['>' => '&gt;', '<' => '&lt;', '"' => '&quot;']);
1643 $ret .= $link['pre'];
1644 $ret .= '<a href="' . $link['url'] . '"';
1645 if (!empty($link['class'])) $ret .= ' class="' . $link['class'] . '"';
1646 if (!empty($link['target'])) $ret .= ' target="' . $link['target'] . '"';
1647 if (!empty($link['title'])) $ret .= ' title="' . $link['title'] . '"';
1648 if (!empty($link['style'])) $ret .= ' style="' . $link['style'] . '"';
1649 if (!empty($link['rel'])) $ret .= ' rel="' . trim($link['rel']) . '"';
1650 if (!empty($link['more'])) $ret .= ' ' . $link['more'];
1652 $ret .= $link['name'];
1654 $ret .= $link['suf'];
1836 * Returns HTML code for images used in link titles
1864 * helperfunction to return a basic link to a media
1875 * @return array associative array with link config
1882 $link = [];
1883 $link['class'] = 'media';
1884 $link['style'] = '';
1885 $link['pre'] = '';
1886 $link['suf'] = '';
1887 $link['more'] = '';
1888 $link['target'] = $conf['target']['media'];
1889 if ($conf['target']['media']) $link['rel'] = 'noopener';
1890 $link['title'] = $this->_xmlEntities($src);
1891 $link['name'] = $this->_media($src, $title, $align, $width, $height, $cache, $render);
1893 return $link;
1958 // alternative content (just a link to the file)
2026 // alternative content (just a link to the file)