Papyrus skin for PmWiki.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

papyrus.php 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php if (!defined('PmWiki')) exit();
  2. /* PAPYRUS skin for PmWiki
  3. Copyright 2019 Said Achmiz
  4. Version: 2019-01-28
  5. More info at these URLs:
  6. * https://www.pmwiki.org/wiki/Skins/Papyrus
  7. * https://www.pmwiki.org/wiki/Profiles/SaidAchmiz
  8. The Papyrus skin includes:
  9. * papyrus.php (skin script file)
  10. * papyrus.css (style sheet)
  11. * papyrus.jpg (background pattern)
  12. * papyrus.tmpl (skin template)
  13. * ReadMe.txt (instructions & info)
  14. */
  15. $filepath = "$SkinDir/papyrus.css";
  16. $path = "$SkinDirUrl/papyrus.css";
  17. ## Append the modification time to the URL as a GET parameter; this should be ignored
  18. ## by the web server, but is seen as part of the unique URL of the remote resource by
  19. ## the browser; when it changes (because the attachment has been modified), the
  20. ## browser will see that it doesn’t have a cached version of the resource under the
  21. ## new URL, and will retrieve the updated version.
  22. $versioned_path = $path . "?v=" . filemtime($filepath);
  23. global $VersionedAssetsReattachFileExtension;
  24. if ($VersionedAssetsReattachFileExtension == true) {
  25. ## Re-attach the file extension.
  26. preg_match("/\\.[^\\.]+$/", $path, $matches);
  27. $versioned_path .= $matches[0];
  28. }
  29. global $HTMLHeaderFmt;
  30. $HTMLHeaderFmt[] = "<link rel='stylesheet' type='text/css' href='$versioned_path' />\n";
  31. ## Label the body element with a class indicating the current page action.
  32. global $HTMLFooterFmt, $action;
  33. $HTMLFooterFmt[] = "<script type='text/javascript'>document.querySelector('body').classList.add('action-{$action}');</script>";
  34. ## Enable the (:notitlegroup:) and (:titlegroup:) directives.
  35. Markup('notitlegroup', 'directives', '/\\(:notitlegroup:\\)/i', function ($m) {
  36. global $HTMLStylesFmt;
  37. $HTMLStylesFmt['papyrus-title-group'] = "#pageTitle .title-group { display: none; }";
  38. });
  39. Markup('titlegroup', 'directives', '/\\(:titlegroup:\\)/i', function ($m) {
  40. global $HTMLStylesFmt;
  41. $HTMLStylesFmt['papyrus-title-group'] = "";
  42. });