print.php 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. <?php if (!defined('PmWiki')) exit();
  2. /* Copyright 2004 Patrick R. Michaud (pmichaud@pobox.com)
  3. This file is part of PmWiki; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published
  5. by the Free Software Foundation; either version 2 of the License, or
  6. (at your option) any later version. See pmwiki.php for full details.
  7. This script defines the ?action=print action to give a printable
  8. view of a page. Essentially it performs the following modifications:
  9. - Changes the page skin to 'print' (locally defined by $PrintSkin)
  10. - Redefines the standard layout to a format suitable for printing
  11. - Redefines internal links to keep ?action=print
  12. - Changes the display of URL and mailto: links
  13. - Uses GroupPrintHeader and GroupPrintFooter pages instead
  14. of GroupHeader and GroupFooter
  15. */
  16. if ($action=='print') {
  17. SDV($PrintTemplateFmt,"$FarmD/pub/skins/print/print.tmpl");
  18. $PageTemplateFmt = $PrintTemplateFmt;
  19. $WikiPageExistsFmt = "<a class='wikilink' href='\$PageUrl?action=print\$Fragment'>\$LinkText</a>";
  20. $UrlLinkTextFmt = "<cite class='urllink'>\$LinkText</cite> [<a class='urllink' href='\$Url'>\$Url</a>]";
  21. SDV($GroupPrintHeaderFmt,'$Group.GroupPrintHeader');
  22. SDV($GroupPrintFooterFmt,'$Group.GroupPrintFooter');
  23. $GroupHeaderFmt = $GroupPrintHeaderFmt;
  24. $GroupFooterFmt = $GroupPrintFooterFmt;
  25. $DoubleBrackets["/\\[\\[mailto:($UrlPathPattern)(.*?)\\]\\]/"] =
  26. "''\$2'' [mailto:\$1]";
  27. }
  28. ?>