nosearch.pl 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Copyright (C) 2008 Radomir Dopieralski <home@sheep.art.pl>
  2. #
  3. # This program is free software: you can redistribute it and/or modify it under
  4. # the terms of the GNU General Public License as published by the Free Software
  5. # Foundation, either version 3 of the License, or (at your option) any later
  6. # version.
  7. #
  8. # This program is distributed in the hope that it will be useful, but WITHOUT
  9. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  10. # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  11. #
  12. # You should have received a copy of the GNU General Public License along with
  13. # this program. If not, see <http://www.gnu.org/licenses/>.
  14. use strict;
  15. use v5.10;
  16. AddModuleDescription('nosearch.pl');
  17. our ($q, @MyAdminCode);
  18. *OldGetSearchLink = \&GetSearchLink;
  19. *GetSearchLink = \&NewGetSearchLink;
  20. sub NewGetSearchLink {
  21. my ($text, $class, $name, $title) = @_;
  22. $name = UrlEncode($name);
  23. $text =~ s/_/ /g;
  24. return $q->span({-class=>$class}, $text);
  25. }
  26. push(@MyAdminCode, \&BacklinksMenu);
  27. sub BacklinksMenu {
  28. my ($id, $menuref, $restref) = @_;
  29. if ($id) {
  30. my $text = T('Backlinks');
  31. my $class = 'backlinks';
  32. my $name = 'backlinks';
  33. my $title = T('Click to search for references to this page');
  34. my $link = ScriptLink('search=' . $id, $text, $class, $name, $title);
  35. push(@$menuref, $link);
  36. }
  37. }