Simple.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /**
  3. * See docs/skin.txt
  4. *
  5. * @todo document
  6. * @file
  7. * @ingroup Skins
  8. */
  9. if( !defined( 'MEDIAWIKI' ) )
  10. die( -1 );
  11. /** */
  12. require_once( dirname(__FILE__) . '/MonoBook.php' );
  13. /**
  14. * @todo document
  15. * @ingroup Skins
  16. */
  17. class SkinSimple extends SkinTemplate {
  18. function initPage( OutputPage $out ) {
  19. SkinTemplate::initPage( $out );
  20. $this->skinname = 'simple';
  21. $this->stylename = 'simple';
  22. $this->template = 'MonoBookTemplate';
  23. }
  24. function setupSkinUserCss( OutputPage $out ){
  25. $out->addStyle( 'simple/main.css', 'screen' );
  26. $out->addStyle( 'simple/rtl.css', '', '', 'rtl' );
  27. }
  28. function reallyGenerateUserStylesheet() {
  29. global $wgUser;
  30. $s = '';
  31. if (($undopt = $wgUser->getOption("underline")) != 2) {
  32. $underline = $undopt ? 'underline' : 'none';
  33. $s .= "a { text-decoration: $underline; }\n";
  34. }
  35. if ($wgUser->getOption('highlightbroken')) {
  36. $s .= "a.new, #quickbar a.new { text-decoration: line-through; }\n";
  37. } else {
  38. $s .= <<<END
  39. a.new, #quickbar a.new,
  40. a.stub, #quickbar a.stub {
  41. color: inherit;
  42. text-decoration: inherit;
  43. }
  44. a.new:after, #quickbar a.new:after {
  45. content: "?";
  46. color: #CC2200;
  47. text-decoration: $underline;
  48. }
  49. a.stub:after, #quickbar a.stub:after {
  50. content: "!";
  51. color: #772233;
  52. text-decoration: $underline;
  53. }
  54. END;
  55. }
  56. if ($wgUser->getOption('justify')) {
  57. $s .= "#article, #bodyContent { text-align: justify; }\n";
  58. }
  59. if (!$wgUser->getOption('showtoc')) {
  60. $s .= "#toc { display: none; }\n";
  61. }
  62. if (!$wgUser->getOption('editsection')) {
  63. $s .= ".editsection { display: none; }\n";
  64. }
  65. return $s;
  66. }
  67. }