Commit 04cd163818a2d240a6bde51a73e7e8daa848b926

Created a theme dir.
index.php
(14 / 5)
  
1616 if (!isset($DEFAULT_PAGE)) { $DEFAULT_PAGE = "Home"; }
1717 if (!isset($DEFAULT_AUTHOR)) { $DEFAULT_AUTHOR = 'Anonymous <anonymous@wigit>'; }
1818 if (!isset($AUTHORS)) { $AUTHORS = array(); }
19 if (!isset($THEME)) { $THEME = "default"; }
1920
2021
2122 // --------------------------------------------------------------------------
5858 return $history;
5959 }
6060
61 function getThemeDir() {
62 global $THEME;
63 return "themes/$THEME";
64 }
65
6166 function getAuthorForUser($user) {
6267 global $AUTHORS, $DEFAULT_AUTHOR;
6368
212212 return $wikiPage;
213213 }
214214
215 function getCSSURL() {
216 return getThemeDir() . "/style.css";
217 }
215218
216219 // --------------------------------------------------------------------------
217220 // Initialize globals
270270 if ($wikiPage == "history") {
271271 $wikiHistory = getHistory();
272272 $wikiPage = "";
273 include('templates/history.php');
273 include(getThemeDir() . "/history.php");
274274 }
275275 // Viewing
276276 else if ($wikiSubPage == "view") {
293293
294294 // Put in template
295295 $wikiContent = $formattedData;
296 include('templates/view.php');
296 include(getThemeDir() . "/view.php");
297297 }
298298 // Editing
299299 else if ($wikiSubPage == "edit") {
304304
305305 // Put in template
306306 $wikiData = $data;
307 include('templates/edit.php');
307 include(getThemeDir() . "/edit.php");
308308 }
309309 else if ($wikiSubPage == "history") {
310310 $wikiHistory = getHistory($wikiPage);
311 include('templates/history.php');
311 include(getThemeDir() . "/history.php");
312312 }
313313 else {
314314 // Try commit.
327327 // Put in template
328328 // FIXME: Remove edit links
329329 $wikiContent = $formattedData;
330 include('templates/view.php');
330 include(getThemeDir() . "/view.php");
331331 return;
332332 }
333333
  
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() ?> &raquo; 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>
  
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() ?> &raquo; <?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>
  
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() ?> &raquo; <?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>
  
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() ?> &raquo; 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>
  
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() ?> &raquo; <?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>
  
1body, textarea {
2 font: 100% "Trebuchet MS", Trebuchet, sans-serif;
3}
4
5p {
6 margin: 0 0 1em 0;
7 padding-left: .5em;
8}
9
10a {
11 color: #f50;
12 text-decoration: none;
13}
14
15a:hover {
16 text-decoration: underline;
17}
18
19acronym, abbr, span.caps {
20 cursor: help;
21}
22
23acronym, 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}
  
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() ?> &raquo; <?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)
  
1body, textarea {
2 font: 100% "Trebuchet MS", Trebuchet, sans-serif;
3}
4
5p {
6 margin: 0 0 1em 0;
7 padding-left: .5em;
8}
9
10a {
11 color: #f50;
12 text-decoration: none;
13}
14
15a:hover {
16 text-decoration: underline;
17}
18
19acronym, abbr, span.caps {
20 cursor: help;
21}
22
23acronym, 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}