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