Papyrus skin for PmWiki.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

papyrus.php 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php if (!defined('PmWiki')) exit();
  2. /* PAPYRUS skin for PmWiki
  3. Copyright 2019 Said Achmiz
  4. Version: 2019-01-28-2
  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. global $FmtPV;
  16. $FmtPV['$SkinName'] = '"Papyrus"';
  17. $FmtPV['$SkinVersion'] = '"2019-01-28-2"';
  18. ## Append the modification time to the URL as a GET parameter; this should be ignored
  19. ## by the web server, but is seen as part of the unique URL of the remote resource by
  20. ## the browser; when it changes (because the attachment has been modified), the
  21. ## browser will see that it doesn’t have a cached version of the resource under the
  22. ## new URL, and will retrieve the updated version.
  23. $filepath = "$SkinDir/papyrus.css";
  24. $path = "$SkinDirUrl/papyrus.css";
  25. $versioned_path = $path . "?v=" . filemtime($filepath);
  26. global $VersionedAssetsReattachFileExtension;
  27. if ($VersionedAssetsReattachFileExtension == true) {
  28. ## Re-attach the file extension.
  29. preg_match("/\\.[^\\.]+$/", $path, $matches);
  30. $versioned_path .= $matches[0];
  31. }
  32. global $HTMLHeaderFmt;
  33. $HTMLHeaderFmt[] = "<link rel='stylesheet' type='text/css' href='$versioned_path' />\n";
  34. ## Label the body element with a class indicating the current page action.
  35. global $HTMLFooterFmt, $action;
  36. $HTMLFooterFmt[] = "<script type='text/javascript'>document.querySelector('body').classList.add('action-{$action}');</script>";
  37. ## Enable the (:notitlegroup:) and (:titlegroup:) directives.
  38. Markup('notitlegroup', 'directives', '/\\(:notitlegroup:\\)/i', function ($m) {
  39. global $HTMLStylesFmt;
  40. $HTMLStylesFmt['papyrus-title-group'] = "#pageTitle .title-group { display: none; }";
  41. });
  42. Markup('titlegroup', 'directives', '/\\(:titlegroup:\\)/i', function ($m) {
  43. global $HTMLStylesFmt;
  44. $HTMLStylesFmt['papyrus-title-group'] = "";
  45. });