[Home]WikiPatches/EmbedInheritance

UseModWiki | WikiPatches | RecentChanges | Preferences

The following copy of the ScriptLink subroutine adds the embed and the toplinkbar parameter to all local links, if it being used on the current page.

sub ScriptLink {
  my ($action, $text) = @_;
  # inherit some parameters
  if (not $EmbedWiki and GetParam('embed',0)) {
    if ($action =~ /=/) {
      $action .= '&embed=1';
    } else {
      $action = 'action=browse&embed=1&id=' . $action;
    }
  }
  if (not GetParam('toplinkbar',1)) {
    if ($action =~ /=/) {
      $action .= '&toplinkbar=0';
    } else {
      $action = 'action=browse&toplinkbar=0&id=' . $action;
    }
  }
  return "<a href=\"$ScriptName?$action\">$text</a>";
}


WikiPatches

UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited July 7, 2007 3:18 am by MarkusLude (diff)
Search: