UseModWiki | RecentChanges | Preferences

General Description of function:

Given input

  my ($id, $name) = @_;

Returns results


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?

  1. reset the $exists variable
  2. find out if this page exists
    1. if yes, return the output from GetPageLinkText
    2. if no, process to put [ ] around multi-word links, and return the output from GetEditLink

UseModWiki | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited May 13, 2004 11:06 am by (diff)