Forgotten files in last commit
[platal.git] / include / wiki / farmconfig.php
CommitLineData
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");
3a824ce3 21include_once($FarmD.'/scripts/xlpage-utf-8.php');
121cdae0 22
90489c07 23if ($action == 'rss' ||
24 $action == 'atom' ||
25 $action == 'rdf' ||
26 $action == 'dc') include_once("$FarmD/scripts/feeds.php");
27
251b9351 28// Theme-ing {{{
121cdae0 29
30## The following lines make additional editing buttons appear in the
31## edit page for subheadings, lists, tables, etc.
8ac323de 32$GUIButtons['h2'] = array(400, '\\n!! ', '\\n', '$[Heading]',
33 '$GUIButtonDirUrlFmt/h2.gif"$[Heading]"');
34$GUIButtons['h3'] = array(402, '\\n!!! ', '\\n', '$[Subheading]',
35 '$GUIButtonDirUrlFmt/h3.gif"$[Subheading]"');
36$GUIButtons['indent'] = array(500, '\\n->', '\\n', '$[Indented text]',
37 '$GUIButtonDirUrlFmt/indent.gif"$[Indented text]"');
38$GUIButtons['outdent'] = array(510, '\\n-<', '\\n', '$[Hanging indent]',
39 '$GUIButtonDirUrlFmt/outdent.gif"$[Hanging indent]"');
40$GUIButtons['ol'] = array(520, '\\n# ', '\\n', '$[Ordered list]',
41 '$GUIButtonDirUrlFmt/ol.gif"$[Ordered (numbered) list]"');
42$GUIButtons['ul'] = array(530, '\\n* ', '\\n', '$[Unordered list]',
43 '$GUIButtonDirUrlFmt/ul.gif"$[Unordered (bullet) list]"');
44$GUIButtons['hr'] = array(540, '\\n----\\n', '', '',
45 '$GUIButtonDirUrlFmt/hr.gif"$[Horizontal rule]"');
46$GUIButtons['table'] = array(600,
47 '||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n|| || || ||\\n|| || || ||\\n', '', '',
48 '$GUIButtonDirUrlFmt/table.gif"$[Table]"');
0df3edb9 49
5dbdcb8c 50// set default author
251b9351 51$Author = $_SESSION['forlife'].'|'.$_SESSION['prenom'].' '.$_SESSION['nom'];
5dbdcb8c 52
53$InputTags['e_form'] = array(
54 ':html' => "<form action='{\$PageUrl}?action=edit' method='post'><div><input
55 type='hidden' name='action' value='edit' /><input
56 type='hidden' name='n' value='{\$FullName}' /><input
57 type='hidden' name='basetime' value='\$EditBaseTime' /></div>");
58
59// set profiles to point to plat/al fiche
fb7e68a2 60Markup('[[~platal', '<[[~', '/\[\[~([^|\]]*)(?:\|([^\]]*))?\]\]/e',
61 'PreserveText("=", doPlatalLink("$1", "$2"), "")');
5dbdcb8c 62
a7de4ef7 63// prevent restorelinks before block apply (otherwise [[Sécurité]] will give
64// .../S<span class='e9curit'>e9'>Sécurité</a>
5dbdcb8c 65Markup('restorelinks','<%%',"//", '');
66
67## [[#anchor]] in standard XHTML
68Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e',
69 "Keep(\"<a id='$1'></a>\",'L')");
70
71Markup('tablebicol', '<block', '/\(:tablebicol ?([a-z_]+)?:\)/e', 'doBicol("$1")');
72Markup('pairrows', '_end', '/class=\'pair\_pmwiki\_([0-9]+)\'/e',
73 "($1 == 1)?'':('class=\"'.(($1 % 2 == 0)?'impair':'pair').'\"')");
74Markup('noclassth', '_end', '/<th class=\'[a-z_]+\'/', '<th');
75
76Markup('div', '<links', '/\(:div([^:]*):([^\)]*):\)/i', '<div$1>$2</div>');
77
78function doBicol($column=false)
79{
80 global $TableRowIndexMax, $TableRowAttrFmt, $TableCellAttrFmt;
81 $TableRowAttrFmt = "class='pair_pmwiki_\$TableRowCount'";
82 if ($column) {
83 $TableCellAttrFmt = "class='$column'";
84 }
85}
251b9351 86
fb7e68a2 87function doPlatalLink($link, $text)
88{
89 if (strlen(trim($text)) == 0) {
90 $res = XDB::query("SELECT u.nom, u.prenom, u.promo, q.profile_nick AS surnom
91 FROM auth_user_md5 AS u
92 INNER JOIN auth_user_quick AS q USING(user_id)
93 INNER JOIN aliases AS a ON u.user_id = a.id
94 WHERE a.alias = {?}", $link);
95 $row = $res->fetchOneAssoc();
96 $text = $row['prenom'] . ' ' . $row['nom'] . ' X' . $row['promo'];
97 if ($row['surnom']) {
0fb07071 98 $text .= ' (alias ' . $row['surnom'] . ')';
fb7e68a2 99 }
100 }
101 return '<a href="profile/' . $link . '" class="popup2">' . $text . '</a>';
102}
103
251b9351 104// }}}
4fc62bc4 105
ffdefc6a 106$AuthFunction = 'ReadPage';
4fc62bc4 107
ffdefc6a 108$HandleAuth['diff'] = 'edit';
109$HandleAuth['source'] = 'edit';
4fc62bc4 110
a7de4ef7 111// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
8ac323de 112?>