General Description of function:
Given input
my ($id, $name) = @_;
- $id - the real name of the page (though may need to be canonized, stripped of spaces etc)
- $name - what appears in the text (ie pipe links)
Returns results
Notes
What does this code do? Looks like it returns a link, but what exactly?
1.1. does the link have a pipe?
if $name is an empty string (ie a link with no pipe) then set it equal to $id
if (!defined($name) || $name eq "") {
$name = $id;
if ($FreeLinks) {
$name =~ s/_/ /g;
}
}
1.2. subpage of current page?
if $id begins with a / then the link is a subpage of the current page. Insert the name of the main page.
$id =~ s|^/|$MainPage/|;
1.3. Freelinks?
if using
FreeLinks, convert to canonical or something (
FreeToNormal)
if ($FreeLinks) {
$id = &FreeToNormal($id);
}
1.4. Exists?
- reset the $exists variable
- find out if this page exists
- if yes, return the output from GetPageLinkText
- if no, process to put [ ] around multi-word links, and return the output from GetEditLink