Commit 04cd163818a2d240a6bde51a73e7e8daa848b926
- Diff rendering mode:
- inline
- side by side
index.php
(14 / 5)
|   | |||
| 16 | 16 | if (!isset($DEFAULT_PAGE)) { $DEFAULT_PAGE = "Home"; } | |
| 17 | 17 | if (!isset($DEFAULT_AUTHOR)) { $DEFAULT_AUTHOR = 'Anonymous <anonymous@wigit>'; } | |
| 18 | 18 | if (!isset($AUTHORS)) { $AUTHORS = array(); } | |
| 19 | if (!isset($THEME)) { $THEME = "default"; } | ||
| 19 | 20 | ||
| 20 | 21 | ||
| 21 | 22 | // -------------------------------------------------------------------------- | |
| … | … | ||
| 58 | 58 | return $history; | |
| 59 | 59 | } | |
| 60 | 60 | ||
| 61 | function getThemeDir() { | ||
| 62 | global $THEME; | ||
| 63 | return "themes/$THEME"; | ||
| 64 | } | ||
| 65 | |||
| 61 | 66 | function getAuthorForUser($user) { | |
| 62 | 67 | global $AUTHORS, $DEFAULT_AUTHOR; | |
| 63 | 68 | ||
| … | … | ||
| 212 | 212 | return $wikiPage; | |
| 213 | 213 | } | |
| 214 | 214 | ||
| 215 | function getCSSURL() { | ||
| 216 | return getThemeDir() . "/style.css"; | ||
| 217 | } | ||
| 215 | 218 | ||
| 216 | 219 | // -------------------------------------------------------------------------- | |
| 217 | 220 | // Initialize globals | |
| … | … | ||
| 270 | 270 | if ($wikiPage == "history") { | |
| 271 | 271 | $wikiHistory = getHistory(); | |
| 272 | 272 | $wikiPage = ""; | |
| 273 | include('templates/history.php'); | ||
| 273 | include(getThemeDir() . "/history.php"); | ||
| 274 | 274 | } | |
| 275 | 275 | // Viewing | |
| 276 | 276 | else if ($wikiSubPage == "view") { | |
| … | … | ||
| 293 | 293 | ||
| 294 | 294 | // Put in template | |
| 295 | 295 | $wikiContent = $formattedData; | |
| 296 | include('templates/view.php'); | ||
| 296 | include(getThemeDir() . "/view.php"); | ||
| 297 | 297 | } | |
| 298 | 298 | // Editing | |
| 299 | 299 | else if ($wikiSubPage == "edit") { | |
| … | … | ||
| 304 | 304 | ||
| 305 | 305 | // Put in template | |
| 306 | 306 | $wikiData = $data; | |
| 307 | include('templates/edit.php'); | ||
| 307 | include(getThemeDir() . "/edit.php"); | ||
| 308 | 308 | } | |
| 309 | 309 | else if ($wikiSubPage == "history") { | |
| 310 | 310 | $wikiHistory = getHistory($wikiPage); | |
| 311 | include('templates/history.php'); | ||
| 311 | include(getThemeDir() . "/history.php"); | ||
| 312 | 312 | } | |
| 313 | 313 | else { | |
| 314 | 314 | // Try commit. | |
| … | … | ||
| 327 | 327 | // Put in template | |
| 328 | 328 | // FIXME: Remove edit links | |
| 329 | 329 | $wikiContent = $formattedData; | |
| 330 | include('templates/view.php'); | ||
| 330 | include(getThemeDir() . "/view.php"); | ||
| 331 | 331 | return; | |
| 332 | 332 | } | |
| 333 | 333 |
templates/edit.php
(0 / 30)
|   | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| 4 | <title><?php print getTitle() ?> » Editing <?php print getPage() ?></title> | ||
| 5 | <link rel="stylesheet" type="text/css" href="<?php print $wikiCSS ?>" /> | ||
| 6 | </head> | ||
| 7 | <body> | ||
| 8 | <div id="navigation"> | ||
| 9 | <p><a href="<?php print getHomeURL() ?>">Home</a></p> | ||
| 10 | </div> | ||
| 11 | |||
| 12 | <div id="header"> | ||
| 13 | <h1 id="title">Editing <?php print getPage() ?></h1> | ||
| 14 | </div> | ||
| 15 | |||
| 16 | <div id="form"> | ||
| 17 | <form method="post" action="<?php print getPostURL(); ?>"> | ||
| 18 | <p><textarea name="data" cols="80" rows="20" style="width: 100%"><?php print $wikiData; ?></textarea></p> | ||
| 19 | <p><input type="submit" value="publish" /></p> | ||
| 20 | </form> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <div id="footer"> | ||
| 24 | <?php if (getUser() != "") { ?> | ||
| 25 | <p>Logged in as <?php print getUser(); ?></p> | ||
| 26 | <?php } ?> | ||
| 27 | </div> | ||
| 28 | |||
| 29 | </body> | ||
| 30 | </html> |
templates/history.php
(0 / 40)
|   | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <?php $historyTitle = "History" . (getPage() == "" ? "" : " of " . getPage()); ?> | ||
| 3 | |||
| 4 | <head> | ||
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| 6 | <title><?php print getTitle() ?> » <?php print $historyTitle ?></title> | ||
| 7 | <link rel="stylesheet" type="text/css" href="<?php print $wikiCSS ?>" /> | ||
| 8 | </head> | ||
| 9 | <body> | ||
| 10 | <div id="navigation"> | ||
| 11 | <p><a href="<?php print getHomeURL() ?>">Home</a> | ||
| 12 | | <a href="<?php print getGlobalHistoryURL() ?>">History</a> | ||
| 13 | <?php if (getUser() != "") { ?>| Logged in as <?php print getUser(); } ?> | ||
| 14 | </p> | ||
| 15 | </div> | ||
| 16 | |||
| 17 | <div id="header"> | ||
| 18 | <h1 id="title"><?php print $historyTitle ?></h1> | ||
| 19 | <p>[ <a href="<?php print getViewURL(getPage()); ?>">view</a> ]</p> | ||
| 20 | </div> | ||
| 21 | |||
| 22 | <div id="history"> | ||
| 23 | <table> | ||
| 24 | <tr><th>Date</th><th>Author</th><th>Page</th><th>Message</th></tr> | ||
| 25 | <?php | ||
| 26 | foreach ($wikiHistory as $item) { | ||
| 27 | print "<tr>" | ||
| 28 | . "<td>" . $item["date"] . "</td>" | ||
| 29 | . "<td class='author'>" . $item["linked-author"] . "</td>" | ||
| 30 | . "<td class='page'><a href=\"" . getViewURL($item["page"]) . "\">" . $item["page"] . "</a></td>" | ||
| 31 | . "<td>" . $item["message"] . "</td>" | ||
| 32 | . "<td>" . "<a href=\"" . getViewURL($item["page"], $item["commit"]) . "\">View</a></td>" | ||
| 33 | . "<td>" . "</td>" | ||
| 34 | . "</tr>\n"; | ||
| 35 | } | ||
| 36 | ?> | ||
| 37 | </table> | ||
| 38 | </div> | ||
| 39 | </body> | ||
| 40 | </html> |
templates/view.php
(0 / 29)
|   | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| 4 | <title><?php print getTitle() ?> » <?php print getPage() ?></title> | ||
| 5 | <link rel="stylesheet" type="text/css" href="<?php print $wikiCSS ?>" /> | ||
| 6 | </head> | ||
| 7 | <body> | ||
| 8 | <div id="navigation"> | ||
| 9 | <p><a href="<?php print getHomeURL() ?>">Home</a> | ||
| 10 | | <a href="<?php print getGlobalHistoryURL() ?>">History</a> | ||
| 11 | <?php if (getUser() != "") { ?>| Logged in as <?php print getUser(); } ?> | ||
| 12 | </p> | ||
| 13 | </div> | ||
| 14 | |||
| 15 | <div id="header"> | ||
| 16 | <h1 id="title"><?php print getPage() ?></h1> | ||
| 17 | <p>[ <a href="<?php print getEditURL()?>">edit</a> | | ||
| 18 | <a href="<?php print getHistoryURL()?>">history</a> ]</p> | ||
| 19 | </div> | ||
| 20 | |||
| 21 | <div id="content"> | ||
| 22 | <?php print $wikiContent; ?> | ||
| 23 | </div> | ||
| 24 | |||
| 25 | <div id="footer"> | ||
| 26 | <p>Last modified on <?php print date("F d Y H:i:s", filemtime($wikiFile)); ?> </p> | ||
| 27 | </div> | ||
| 28 | </body> | ||
| 29 | </html> |
themes/default/edit.php
(30 / 0)
|   | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| 4 | <title><?php print getTitle() ?> » Editing <?php print getPage() ?></title> | ||
| 5 | <link rel="stylesheet" type="text/css" href="<?php print getCSSURL() ?>" /> | ||
| 6 | </head> | ||
| 7 | <body> | ||
| 8 | <div id="navigation"> | ||
| 9 | <p><a href="<?php print getHomeURL() ?>">Home</a></p> | ||
| 10 | </div> | ||
| 11 | |||
| 12 | <div id="header"> | ||
| 13 | <h1 id="title">Editing <?php print getPage() ?></h1> | ||
| 14 | </div> | ||
| 15 | |||
| 16 | <div id="form"> | ||
| 17 | <form method="post" action="<?php print getPostURL(); ?>"> | ||
| 18 | <p><textarea name="data" cols="80" rows="20" style="width: 100%"><?php print $wikiData; ?></textarea></p> | ||
| 19 | <p><input type="submit" value="publish" /></p> | ||
| 20 | </form> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <div id="footer"> | ||
| 24 | <?php if (getUser() != "") { ?> | ||
| 25 | <p>Logged in as <?php print getUser(); ?></p> | ||
| 26 | <?php } ?> | ||
| 27 | </div> | ||
| 28 | |||
| 29 | </body> | ||
| 30 | </html> |
themes/default/history.php
(40 / 0)
|   | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <?php $historyTitle = "History" . (getPage() == "" ? "" : " of " . getPage()); ?> | ||
| 3 | |||
| 4 | <head> | ||
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| 6 | <title><?php print getTitle() ?> » <?php print $historyTitle ?></title> | ||
| 7 | <link rel="stylesheet" type="text/css" href="<?php print getCSSURL() ?>" /> | ||
| 8 | </head> | ||
| 9 | <body> | ||
| 10 | <div id="navigation"> | ||
| 11 | <p><a href="<?php print getHomeURL() ?>">Home</a> | ||
| 12 | | <a href="<?php print getGlobalHistoryURL() ?>">History</a> | ||
| 13 | <?php if (getUser() != "") { ?>| Logged in as <?php print getUser(); } ?> | ||
| 14 | </p> | ||
| 15 | </div> | ||
| 16 | |||
| 17 | <div id="header"> | ||
| 18 | <h1 id="title"><?php print $historyTitle ?></h1> | ||
| 19 | <p>[ <a href="<?php print getViewURL(getPage()); ?>">view</a> ]</p> | ||
| 20 | </div> | ||
| 21 | |||
| 22 | <div id="history"> | ||
| 23 | <table> | ||
| 24 | <tr><th>Date</th><th>Author</th><th>Page</th><th>Message</th></tr> | ||
| 25 | <?php | ||
| 26 | foreach ($wikiHistory as $item) { | ||
| 27 | print "<tr>" | ||
| 28 | . "<td>" . $item["date"] . "</td>" | ||
| 29 | . "<td class='author'>" . $item["linked-author"] . "</td>" | ||
| 30 | . "<td class='page'><a href=\"" . getViewURL($item["page"]) . "\">" . $item["page"] . "</a></td>" | ||
| 31 | . "<td>" . $item["message"] . "</td>" | ||
| 32 | . "<td>" . "<a href=\"" . getViewURL($item["page"], $item["commit"]) . "\">View</a></td>" | ||
| 33 | . "<td>" . "</td>" | ||
| 34 | . "</tr>\n"; | ||
| 35 | } | ||
| 36 | ?> | ||
| 37 | </table> | ||
| 38 | </div> | ||
| 39 | </body> | ||
| 40 | </html> |
themes/default/style.css
(116 / 0)
|   | |||
| 1 | body, textarea { | ||
| 2 | font: 100% "Trebuchet MS", Trebuchet, sans-serif; | ||
| 3 | } | ||
| 4 | |||
| 5 | p { | ||
| 6 | margin: 0 0 1em 0; | ||
| 7 | padding-left: .5em; | ||
| 8 | } | ||
| 9 | |||
| 10 | a { | ||
| 11 | color: #f50; | ||
| 12 | text-decoration: none; | ||
| 13 | } | ||
| 14 | |||
| 15 | a:hover { | ||
| 16 | text-decoration: underline; | ||
| 17 | } | ||
| 18 | |||
| 19 | acronym, abbr, span.caps { | ||
| 20 | cursor: help; | ||
| 21 | } | ||
| 22 | |||
| 23 | acronym, abbr { | ||
| 24 | border-bottom: 1px dashed #999; | ||
| 25 | } | ||
| 26 | |||
| 27 | #navigation p { | ||
| 28 | margin: 0; | ||
| 29 | padding: 0; | ||
| 30 | font-size: .8em; | ||
| 31 | text-align: right; | ||
| 32 | } | ||
| 33 | |||
| 34 | #header { | ||
| 35 | background-color: #C3D9FF; | ||
| 36 | text-align: center; | ||
| 37 | padding: 0.3em; | ||
| 38 | margin-top: .2em; | ||
| 39 | } | ||
| 40 | |||
| 41 | #header p { | ||
| 42 | font-size: .8em; | ||
| 43 | padding: 0; | ||
| 44 | margin: .2em; | ||
| 45 | } | ||
| 46 | |||
| 47 | #header h1 { | ||
| 48 | font-size: 2em; | ||
| 49 | padding: 0; | ||
| 50 | margin: 0; | ||
| 51 | } | ||
| 52 | |||
| 53 | #content h1 { | ||
| 54 | background-color: #7799BB; | ||
| 55 | font-color: white; | ||
| 56 | font-size: 1.2em; | ||
| 57 | color: white; | ||
| 58 | font-weight: bold; | ||
| 59 | padding: .2em .5em .2em .5em; | ||
| 60 | margin: 1em 0 0 0; | ||
| 61 | } | ||
| 62 | |||
| 63 | #content h2 { | ||
| 64 | font-size: 1.2em; | ||
| 65 | border-bottom: thin solid gray; | ||
| 66 | padding-bottom: .2em; | ||
| 67 | padding-left: .5em; | ||
| 68 | margin: .5em 0 .2em 0; | ||
| 69 | } | ||
| 70 | |||
| 71 | #content { | ||
| 72 | width: 80%; | ||
| 73 | margin: 0em auto; | ||
| 74 | } | ||
| 75 | |||
| 76 | #content pre { | ||
| 77 | border: 1px solid #eee; | ||
| 78 | background-color: #fff; | ||
| 79 | padding: 1em 5px; | ||
| 80 | font-family: monospace; | ||
| 81 | } | ||
| 82 | |||
| 83 | #footer { | ||
| 84 | text-align: center; | ||
| 85 | font-size: 0.7em; | ||
| 86 | border-top: thin solid #999; | ||
| 87 | text-align: center; | ||
| 88 | padding: .5em; | ||
| 89 | background-color: #ddd; | ||
| 90 | margin: 0em; | ||
| 91 | } | ||
| 92 | |||
| 93 | #history { | ||
| 94 | margin-top: 20pt; | ||
| 95 | margin-bottom: 20pt; | ||
| 96 | text-align: center; | ||
| 97 | } | ||
| 98 | |||
| 99 | #history table { | ||
| 100 | border-collapse: collapse; | ||
| 101 | } | ||
| 102 | |||
| 103 | #history td { | ||
| 104 | padding-left: 10pt; | ||
| 105 | padding-right: 10pt; | ||
| 106 | border-top: dashed thin gray; | ||
| 107 | border-bottom: dashed thin gray; | ||
| 108 | } | ||
| 109 | |||
| 110 | #history td.author { | ||
| 111 | text-align: center; | ||
| 112 | } | ||
| 113 | |||
| 114 | #history td.page { | ||
| 115 | text-align: center; | ||
| 116 | } |
themes/default/view.php
(29 / 0)
|   | |||
| 1 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
| 2 | <head> | ||
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
| 4 | <title><?php print getTitle() ?> » <?php print getPage() ?></title> | ||
| 5 | <link rel="stylesheet" type="text/css" href="<?php print getCSSURL() ?>" /> | ||
| 6 | </head> | ||
| 7 | <body> | ||
| 8 | <div id="navigation"> | ||
| 9 | <p><a href="<?php print getHomeURL() ?>">Home</a> | ||
| 10 | | <a href="<?php print getGlobalHistoryURL() ?>">History</a> | ||
| 11 | <?php if (getUser() != "") { ?>| Logged in as <?php print getUser(); } ?> | ||
| 12 | </p> | ||
| 13 | </div> | ||
| 14 | |||
| 15 | <div id="header"> | ||
| 16 | <h1 id="title"><?php print getPage() ?></h1> | ||
| 17 | <p>[ <a href="<?php print getEditURL()?>">edit</a> | | ||
| 18 | <a href="<?php print getHistoryURL()?>">history</a> ]</p> | ||
| 19 | </div> | ||
| 20 | |||
| 21 | <div id="content"> | ||
| 22 | <?php print $wikiContent; ?> | ||
| 23 | </div> | ||
| 24 | |||
| 25 | <div id="footer"> | ||
| 26 | <p>Last modified on <?php print date("F d Y H:i:s", filemtime($wikiFile)); ?> </p> | ||
| 27 | </div> | ||
| 28 | </body> | ||
| 29 | </html> |
wigit.css
(0 / 116)
|   | |||
| 1 | body, textarea { | ||
| 2 | font: 100% "Trebuchet MS", Trebuchet, sans-serif; | ||
| 3 | } | ||
| 4 | |||
| 5 | p { | ||
| 6 | margin: 0 0 1em 0; | ||
| 7 | padding-left: .5em; | ||
| 8 | } | ||
| 9 | |||
| 10 | a { | ||
| 11 | color: #f50; | ||
| 12 | text-decoration: none; | ||
| 13 | } | ||
| 14 | |||
| 15 | a:hover { | ||
| 16 | text-decoration: underline; | ||
| 17 | } | ||
| 18 | |||
| 19 | acronym, abbr, span.caps { | ||
| 20 | cursor: help; | ||
| 21 | } | ||
| 22 | |||
| 23 | acronym, abbr { | ||
| 24 | border-bottom: 1px dashed #999; | ||
| 25 | } | ||
| 26 | |||
| 27 | #navigation p { | ||
| 28 | margin: 0; | ||
| 29 | padding: 0; | ||
| 30 | font-size: .8em; | ||
| 31 | text-align: right; | ||
| 32 | } | ||
| 33 | |||
| 34 | #header { | ||
| 35 | background-color: #C3D9FF; | ||
| 36 | text-align: center; | ||
| 37 | padding: 0.3em; | ||
| 38 | margin-top: .2em; | ||
| 39 | } | ||
| 40 | |||
| 41 | #header p { | ||
| 42 | font-size: .8em; | ||
| 43 | padding: 0; | ||
| 44 | margin: .2em; | ||
| 45 | } | ||
| 46 | |||
| 47 | #header h1 { | ||
| 48 | font-size: 2em; | ||
| 49 | padding: 0; | ||
| 50 | margin: 0; | ||
| 51 | } | ||
| 52 | |||
| 53 | #content h1 { | ||
| 54 | background-color: #7799BB; | ||
| 55 | font-color: white; | ||
| 56 | font-size: 1.2em; | ||
| 57 | color: white; | ||
| 58 | font-weight: bold; | ||
| 59 | padding: .2em .5em .2em .5em; | ||
| 60 | margin: 1em 0 0 0; | ||
| 61 | } | ||
| 62 | |||
| 63 | #content h2 { | ||
| 64 | font-size: 1.2em; | ||
| 65 | border-bottom: thin solid gray; | ||
| 66 | padding-bottom: .2em; | ||
| 67 | padding-left: .5em; | ||
| 68 | margin: .5em 0 .2em 0; | ||
| 69 | } | ||
| 70 | |||
| 71 | #content { | ||
| 72 | width: 80%; | ||
| 73 | margin: 0em auto; | ||
| 74 | } | ||
| 75 | |||
| 76 | #content pre { | ||
| 77 | border: 1px solid #eee; | ||
| 78 | background-color: #fff; | ||
| 79 | padding: 1em 5px; | ||
| 80 | font-family: monospace; | ||
| 81 | } | ||
| 82 | |||
| 83 | #footer { | ||
| 84 | text-align: center; | ||
| 85 | font-size: 0.7em; | ||
| 86 | border-top: thin solid #999; | ||
| 87 | text-align: center; | ||
| 88 | padding: .5em; | ||
| 89 | background-color: #ddd; | ||
| 90 | margin: 0em; | ||
| 91 | } | ||
| 92 | |||
| 93 | #history { | ||
| 94 | margin-top: 20pt; | ||
| 95 | margin-bottom: 20pt; | ||
| 96 | text-align: center; | ||
| 97 | } | ||
| 98 | |||
| 99 | #history table { | ||
| 100 | border-collapse: collapse; | ||
| 101 | } | ||
| 102 | |||
| 103 | #history td { | ||
| 104 | padding-left: 10pt; | ||
| 105 | padding-right: 10pt; | ||
| 106 | border-top: dashed thin gray; | ||
| 107 | border-bottom: dashed thin gray; | ||
| 108 | } | ||
| 109 | |||
| 110 | #history td.author { | ||
| 111 | text-align: center; | ||
| 112 | } | ||
| 113 | |||
| 114 | #history td.page { | ||
| 115 | text-align: center; | ||
| 116 | } |

