121cdae0 |
1 | <?php if (!defined('PmWiki')) exit(); |
2 | |
251b9351 |
3 | $EnablePathInfo = 1; # in fact works with apache rewrite, name is misleading |
4 | $EnableGUIButtons = 1; |
5 | $EnableUpload = 1; |
887e363f |
6 | $UploadMaxSize = 500000; |
251b9351 |
7 | $LinkWikiWords = 0; # disable WikiWord links |
8 | $EnableIMSCaching = 1; # allow browser caching |
121cdae0 |
9 | |
251b9351 |
10 | $ScriptUrl = '.'; #\ |
11 | $UploadUrlFmt = './uploads'; # } works thanks to the <base /> in skin |
12 | $PubDirUrl = './wiki'; #/ |
915d4fae |
13 | |
251b9351 |
14 | $WorkDir = '../spool/wiki.d'; |
15 | $WikiDir = new PageStore('$FarmD/'.$WorkDir.'/$FullName'); |
2c799249 |
16 | $InterMapFiles[] = $globals->spoolroot.'/configs/pmwiki.intermap.txt'; |
121cdae0 |
17 | |
251b9351 |
18 | $Skin = 'empty'; |
121cdae0 |
19 | |
121cdae0 |
20 | @include_once("$FarmD/cookbook/e-protect.php"); |
21 | |
251b9351 |
22 | // Theme-ing {{{ |
121cdae0 |
23 | |
24 | ## The following lines make additional editing buttons appear in the |
25 | ## edit page for subheadings, lists, tables, etc. |
8ac323de |
26 | $GUIButtons['h2'] = array(400, '\\n!! ', '\\n', '$[Heading]', |
27 | '$GUIButtonDirUrlFmt/h2.gif"$[Heading]"'); |
28 | $GUIButtons['h3'] = array(402, '\\n!!! ', '\\n', '$[Subheading]', |
29 | '$GUIButtonDirUrlFmt/h3.gif"$[Subheading]"'); |
30 | $GUIButtons['indent'] = array(500, '\\n->', '\\n', '$[Indented text]', |
31 | '$GUIButtonDirUrlFmt/indent.gif"$[Indented text]"'); |
32 | $GUIButtons['outdent'] = array(510, '\\n-<', '\\n', '$[Hanging indent]', |
33 | '$GUIButtonDirUrlFmt/outdent.gif"$[Hanging indent]"'); |
34 | $GUIButtons['ol'] = array(520, '\\n# ', '\\n', '$[Ordered list]', |
35 | '$GUIButtonDirUrlFmt/ol.gif"$[Ordered (numbered) list]"'); |
36 | $GUIButtons['ul'] = array(530, '\\n* ', '\\n', '$[Unordered list]', |
37 | '$GUIButtonDirUrlFmt/ul.gif"$[Unordered (bullet) list]"'); |
38 | $GUIButtons['hr'] = array(540, '\\n----\\n', '', '', |
39 | '$GUIButtonDirUrlFmt/hr.gif"$[Horizontal rule]"'); |
40 | $GUIButtons['table'] = array(600, |
41 | '||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n|| || || ||\\n|| || || ||\\n', '', '', |
42 | '$GUIButtonDirUrlFmt/table.gif"$[Table]"'); |
0df3edb9 |
43 | |
5dbdcb8c |
44 | // set default author |
251b9351 |
45 | $Author = $_SESSION['forlife'].'|'.$_SESSION['prenom'].' '.$_SESSION['nom']; |
5dbdcb8c |
46 | |
47 | $InputTags['e_form'] = array( |
48 | ':html' => "<form action='{\$PageUrl}?action=edit' method='post'><div><input |
49 | type='hidden' name='action' value='edit' /><input |
50 | type='hidden' name='n' value='{\$FullName}' /><input |
51 | type='hidden' name='basetime' value='\$EditBaseTime' /></div>"); |
52 | |
53 | // set profiles to point to plat/al fiche |
fb7e68a2 |
54 | Markup('[[~platal', '<[[~', '/\[\[~([^|\]]*)(?:\|([^\]]*))?\]\]/e', |
55 | 'PreserveText("=", doPlatalLink("$1", "$2"), "")'); |
5dbdcb8c |
56 | |
57 | // prevent restorelinks before block apply (otherwise [[Sécurité]] will give |
58 | // .../S<span class='e9curit'>e9'>Sécurité</a> |
59 | Markup('restorelinks','<%%',"//", ''); |
60 | |
61 | ## [[#anchor]] in standard XHTML |
62 | Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e', |
63 | "Keep(\"<a id='$1'></a>\",'L')"); |
64 | |
65 | Markup('tablebicol', '<block', '/\(:tablebicol ?([a-z_]+)?:\)/e', 'doBicol("$1")'); |
66 | Markup('pairrows', '_end', '/class=\'pair\_pmwiki\_([0-9]+)\'/e', |
67 | "($1 == 1)?'':('class=\"'.(($1 % 2 == 0)?'impair':'pair').'\"')"); |
68 | Markup('noclassth', '_end', '/<th class=\'[a-z_]+\'/', '<th'); |
69 | |
70 | Markup('div', '<links', '/\(:div([^:]*):([^\)]*):\)/i', '<div$1>$2</div>'); |
71 | |
72 | function doBicol($column=false) |
73 | { |
74 | global $TableRowIndexMax, $TableRowAttrFmt, $TableCellAttrFmt; |
75 | $TableRowAttrFmt = "class='pair_pmwiki_\$TableRowCount'"; |
76 | if ($column) { |
77 | $TableCellAttrFmt = "class='$column'"; |
78 | } |
79 | } |
251b9351 |
80 | |
fb7e68a2 |
81 | function doPlatalLink($link, $text) |
82 | { |
83 | if (strlen(trim($text)) == 0) { |
84 | $res = XDB::query("SELECT u.nom, u.prenom, u.promo, q.profile_nick AS surnom |
85 | FROM auth_user_md5 AS u |
86 | INNER JOIN auth_user_quick AS q USING(user_id) |
87 | INNER JOIN aliases AS a ON u.user_id = a.id |
88 | WHERE a.alias = {?}", $link); |
89 | $row = $res->fetchOneAssoc(); |
90 | $text = $row['prenom'] . ' ' . $row['nom'] . ' X' . $row['promo']; |
91 | if ($row['surnom']) { |
0fb07071 |
92 | $text .= ' (alias ' . $row['surnom'] . ')'; |
fb7e68a2 |
93 | } |
94 | } |
95 | return '<a href="profile/' . $link . '" class="popup2">' . $text . '</a>'; |
96 | } |
97 | |
251b9351 |
98 | // }}} |
4fc62bc4 |
99 | |
ffdefc6a |
100 | $AuthFunction = 'ReadPage'; |
4fc62bc4 |
101 | |
ffdefc6a |
102 | $HandleAuth['diff'] = 'edit'; |
103 | $HandleAuth['source'] = 'edit'; |
4fc62bc4 |
104 | |
8ac323de |
105 | ?> |