Merge branch 'xorg/maint'
[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
eef027aa 9$EnablePageListProtect = 0; # We use our own permission system.
121cdae0 10
251b9351 11$ScriptUrl = '.'; #\
12$UploadUrlFmt = './uploads'; # } works thanks to the <base /> in skin
13$PubDirUrl = './wiki'; #/
915d4fae 14
251b9351 15$WorkDir = '../spool/wiki.d';
16$WikiDir = new PageStore('$FarmD/'.$WorkDir.'/$FullName');
2c799249 17$InterMapFiles[] = $globals->spoolroot.'/configs/pmwiki.intermap.txt';
121cdae0 18
251b9351 19$Skin = 'empty';
121cdae0 20
121cdae0 21@include_once("$FarmD/cookbook/e-protect.php");
eaf30d86 22include_once($FarmD.'/scripts/xlpage-utf-8.php');
bfa466a8 23$pagename = ResolvePageName($pagename);
121cdae0 24
0a5cc8b1 25if ($action == 'rss' || $action == 'atom' || $action == 'rdf' || $action == 'dc') {
0a5cc8b1 26 $FmtPV['$MarkupExcerpt'] = '$page["text"]';
27 $FeedFmt[$action]['item']['title'] = '[$Group] {$Title}';
28 $FeedFmt[$action]['item']['description'] = '$LastModifiedSummary';
29 $FeedFmt[$action]['feed']['title'] = 'Polytechnique.org :: Wiki :: $FullName';
0f384dd3 30 $pagelist = null;
31 include_once("$FarmD/scripts/feeds.php");
0a5cc8b1 32}
90489c07 33
251b9351 34// Theme-ing {{{
121cdae0 35
36## The following lines make additional editing buttons appear in the
37## edit page for subheadings, lists, tables, etc.
8ac323de 38$GUIButtons['h2'] = array(400, '\\n!! ', '\\n', '$[Heading]',
39 '$GUIButtonDirUrlFmt/h2.gif"$[Heading]"');
40$GUIButtons['h3'] = array(402, '\\n!!! ', '\\n', '$[Subheading]',
41 '$GUIButtonDirUrlFmt/h3.gif"$[Subheading]"');
42$GUIButtons['indent'] = array(500, '\\n->', '\\n', '$[Indented text]',
43 '$GUIButtonDirUrlFmt/indent.gif"$[Indented text]"');
44$GUIButtons['outdent'] = array(510, '\\n-<', '\\n', '$[Hanging indent]',
45 '$GUIButtonDirUrlFmt/outdent.gif"$[Hanging indent]"');
46$GUIButtons['ol'] = array(520, '\\n# ', '\\n', '$[Ordered list]',
47 '$GUIButtonDirUrlFmt/ol.gif"$[Ordered (numbered) list]"');
48$GUIButtons['ul'] = array(530, '\\n* ', '\\n', '$[Unordered list]',
49 '$GUIButtonDirUrlFmt/ul.gif"$[Unordered (bullet) list]"');
50$GUIButtons['hr'] = array(540, '\\n----\\n', '', '',
51 '$GUIButtonDirUrlFmt/hr.gif"$[Horizontal rule]"');
52$GUIButtons['table'] = array(600,
eaf30d86 53 '||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n|| || || ||\\n|| || || ||\\n', '', '',
8ac323de 54 '$GUIButtonDirUrlFmt/table.gif"$[Table]"');
0df3edb9 55
5dbdcb8c 56// set default author
2c141369 57$Author = $_SESSION['hruid'].'|'.$_SESSION['prenom'].' '.$_SESSION['nom'];
5dbdcb8c 58
59$InputTags['e_form'] = array(
eaf30d86
PH
60 ':html' => "<form action='{\$PageUrl}?action=edit' method='post'><div><input
61 type='hidden' name='action' value='edit' /><input
62 type='hidden' name='n' value='{\$FullName}' /><input
5dbdcb8c 63 type='hidden' name='basetime' value='\$EditBaseTime' /></div>");
64
65// set profiles to point to plat/al fiche
fb7e68a2 66Markup('[[~platal', '<[[~', '/\[\[~([^|\]]*)(?:\|([^\]]*))?\]\]/e',
67 'PreserveText("=", doPlatalLink("$1", "$2"), "")');
5dbdcb8c 68
0a5cc8b1 69// Preserve javascript
70Markup('[[javascript', '<[[javascript:', '/\[\[javascript:([^\|]*)\|([^\]]*)?\]\]/e',
71 'PreserveText("=", \'<a href="javascript:\' . htmlentities("$1") . \'">\', "") . "$2" . PreserveText("=", "</a>", "")');
72
a7de4ef7 73// prevent restorelinks before block apply (otherwise [[Sécurité]] will give
74// .../S<span class='e9curit'>e9'>Sécurité</a>
5dbdcb8c 75Markup('restorelinks','<%%',"//", '');
76
77## [[#anchor]] in standard XHTML
78Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e',
79 "Keep(\"<a id='$1'></a>\",'L')");
eaf30d86 80
5dbdcb8c 81Markup('tablebicol', '<block', '/\(:tablebicol ?([a-z_]+)?:\)/e', 'doBicol("$1")');
eaf30d86 82Markup('pairrows', '_end', '/class=\'pair\_pmwiki\_([0-9]+)\'/e',
5dbdcb8c 83 "($1 == 1)?'':('class=\"'.(($1 % 2 == 0)?'impair':'pair').'\"')");
84Markup('noclassth', '_end', '/<th class=\'[a-z_]+\'/', '<th');
85
86Markup('div', '<links', '/\(:div([^:]*):([^\)]*):\)/i', '<div$1>$2</div>');
87
88function doBicol($column=false)
89{
90 global $TableRowIndexMax, $TableRowAttrFmt, $TableCellAttrFmt;
91 $TableRowAttrFmt = "class='pair_pmwiki_\$TableRowCount'";
92 if ($column) {
93 $TableCellAttrFmt = "class='$column'";
94 }
95}
251b9351 96
fb7e68a2 97function doPlatalLink($link, $text)
98{
eaf30d86 99 if (strlen(trim($text)) == 0) {
1d917e76 100 $profile = Profile::get($link);
0a7895a3
FB
101 if (!$profile) {
102 return '##Utilisateur inconnu##' . $text . '##';
103 }
1d917e76 104 $text = $profile->fullName();
fb7e68a2 105 }
106 return '<a href="profile/' . $link . '" class="popup2">' . $text . '</a>';
107}
108
251b9351 109// }}}
4fc62bc4 110
ffdefc6a 111$AuthFunction = 'ReadPage';
4fc62bc4 112
ffdefc6a 113$HandleAuth['diff'] = 'edit';
114$HandleAuth['source'] = 'edit';
4fc62bc4 115
448c8cdc 116// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
8ac323de 117?>