[Home]WikiPatches/Index

UseModWiki | WikiPatches | RecentChanges | Preferences

This patch provides an Index link on the GotoBar which is user controllable through Prefs.

## Patch: Index on GotoBar
sub GetIndexLink {
  return &ScriptLink("action=index", T('Index'));
} # End patch

sub GetPrefsLink {
  return &ScriptLink("action=editprefs", T('Preferences'));
}

...

sub GetGotoBar {
...
  $bartext .= " | " . &GetPageLink($RCName);
  if (&GetParam("linkindex", 1)) {
    $bartext .= " | " . &GetIndexLink(); ## Patch: Index in GotoBar
  }
  $bartext .= " | " . &GetPrefsLink();
...
}

...

sub DoEditPrefs {
...
  print '<br>', &GetFormCheck('toplinkbar', 1,
                              T('Show link bar on top'));
  print '<br>', &GetFormCheck('linkindex', 1,
                              T('Add "Index" link to link bar')); ## Patch: Index in GotoBar
  print '<br>', &GetFormCheck('linkrandom', 0,
                              T('Add "Random Page" link to link bar'));
...
}

....

sub DoUpdatePrefs {
...
  &UpdatePrefCheckbox("toplinkbar");
  &UpdatePrefCheckbox("linkindex"); ## Patch: Index in GotoBar
  &UpdatePrefCheckbox("linkrandom");
...
}

--DavidAndel


I like it, I used it, it works -- ''SimonDavis
It works flawlessly! Thank you! Note: As I am working with a translation file, inserting the 'Add "Index" link to link bar' in the language.pl + translation worked as expected. :) Happy I am :) -- Chris
Here's a unified diff version of the patch. -- MikeCastle

diff -ru usemod10.orig/wiki.pl usemod10/wiki.pl
--- usemod10.orig/wiki.pl       Thu Sep 11 05:21:02 2003
+++ usemod10/wiki.pl    Wed Oct  1 16:06:20 2003
@@ -1480,6 +1480,9 @@
     $bartext .= " | " . &GetPageLink($main);
   }
   $bartext .= " | " . &GetPageLink($RCName);
+  if (&GetParam("linkindex", 1)) {
+    $bartext .= " | " . &GetIndexLink(); ## Patch: Index in GotoBar
+  }
   $bartext .= " | " . &GetPrefsLink();
   if ($UseUpload && &UserCanUpload()) {
     $bartext .= " | " . &GetUploadLink();
@@ -3398,6 +3401,8 @@
 
   print '<br>', &GetFormCheck('toplinkbar', 1,
                               T('Show link bar on top'));
+  print '<br>', &GetFormCheck('linkindex', 1,
+                              T('Add "Index" link to link bar'));
   print '<br>', &GetFormCheck('linkrandom', 0,
                               T('Add "Random Page" link to link bar'));
   print '<br>' . T('StyleSheet URL:') . ' ',
@@ -3433,6 +3438,7 @@
 
   # All link bar settings should be updated before printing the header
   &UpdatePrefCheckbox("toplinkbar");
+  &UpdatePrefCheckbox("linkindex");
   &UpdatePrefCheckbox("linkrandom");
   print &GetHeader('',T('Saving Preferences'), '');
   print '<br>';
@@ -4842,6 +4848,14 @@
   return &ScriptLink("action=pagelock&set=$status&id=$id", $name);
 }
 
+sub GetIndexLink {
+  return &ScriptLink("action=index", T('Index'));
+} # End patch
+                              
+sub GetPrefsLink {
+  return &ScriptLink("action=editprefs", T('Preferences'));
+}
+
 sub GetAdminBar {
   my ($id) = @_;
   my ($result);

UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited October 19, 2007 1:03 pm by MarkusLude (diff)
Search: