bye install.d/wiki.
[platal.git] / include / wiki / farmconfig.php
1 <?php if (!defined('PmWiki')) exit();
2
3 $EnablePathInfo = 1; # in fact works with apache rewrite, name is misleading
4 $EnableGUIButtons = 1;
5 $EnableUpload = 1;
6 $UploadMaxSize = 500000;
7 $LinkWikiWords = 0; # disable WikiWord links
8 $EnableIMSCaching = 1; # allow browser caching
9
10 $ScriptUrl = '.'; #\
11 $UploadUrlFmt = './uploads'; # } works thanks to the <base /> in skin
12 $PubDirUrl = './wiki'; #/
13
14 $WorkDir = '../spool/wiki.d';
15 $WikiDir = new PageStore('$FarmD/'.$WorkDir.'/$FullName');
16 $InterMapFiles[] = $globals->spoolroot.'/configs/pmwiki.intermap.txt';
17
18 $Skin = 'empty';
19
20 @include_once("$FarmD/cookbook/e-protect.php");
21
22 // Theme-ing {{{
23
24 ## The following lines make additional editing buttons appear in the
25 ## edit page for subheadings, lists, tables, etc.
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]"');
43
44 // set default author
45 $Author = $_SESSION['forlife'].'|'.$_SESSION['prenom'].' '.$_SESSION['nom'];
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
54 Markup('[[~platal', '<[[~', '/\[\[~([^|\]]*)(?:\|([^\]]*))?\]\]/e',
55 'PreserveText("=", doPlatalLink("$1", "$2"), "")');
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 }
80
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']) {
92 $text .= ' (aka ' . $row['surnom'] . ')';
93 }
94 }
95 return '<a href="profile/' . $link . '" class="popup2">' . $text . '</a>';
96 }
97
98 // }}}
99
100 $AuthFunction = 'ReadPage';
101
102 $HandleAuth['diff'] = 'edit';
103 $HandleAuth['source'] = 'edit';
104
105 ?>