243d2d893ab90a77d7be4542a117b5cf551f76dd
1 <?php
if (!defined('PmWiki')) exit();
3 $EnablePathInfo = 1; # in fact works with apache rewrite, name is misleading
6 $UploadMaxSize = 500000;
7 $LinkWikiWords = 0; # disable WikiWord links
8 $EnableIMSCaching = 1; # allow browser caching
9 $EnablePageListProtect = 0; # We use our own permission system.
12 $UploadUrlFmt = './uploads'; # } works thanks to the <base /> in skin
13 $PubDirUrl = './wiki'; #/
15 $WorkDir = '../spool/wiki.d';
16 $WikiDir = new PageStore('$FarmD/'.$WorkDir.'/$FullName');
17 $InterMapFiles[] = $globals->spoolroot
.'/configs/pmwiki.intermap.txt';
21 @include_once
("$FarmD/cookbook/e-protect.php");
22 include_once($FarmD.'/scripts/xlpage-utf-8.php');
23 $pagename = ResolvePageName($pagename);
25 if ($action == 'rss' ||
$action == 'atom' ||
$action == 'rdf' ||
$action == 'dc') {
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';
31 include_once("$FarmD/scripts/feeds.php");
36 ## The following lines make additional editing buttons appear in the
37 ## edit page for subheadings, lists, tables, etc.
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,
53 '||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n|| || || ||\\n|| || || ||\\n', '', '',
54 '$GUIButtonDirUrlFmt/table.gif"$[Table]"');
57 $Author = $_SESSION['hruid'].'|'.$_SESSION['prenom'].' '.$_SESSION['nom'];
59 $InputTags['e_form'] = array(
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
63 type='hidden' name='basetime' value='\$EditBaseTime' /></div>");
65 // set profiles to point to plat/al fiche
66 Markup('[[~platal', '<[[~', '/\[\[~([^|\]]*)(?:\|([^\]]*))?\]\]/e',
67 'PreserveText("=", doPlatalLink("$1", "$2"), "")');
69 // Preserve javascript
70 Markup('[[javascript', '<[[javascript:', '/\[\[javascript:([^\|]*)\|([^\]]*)?\]\]/e',
71 'PreserveText("=", \'<a href="javascript:\' . htmlentities("$1") . \'">\', "") . "$2" . PreserveText("=", "</a>", "")');
73 // prevent restorelinks before block apply (otherwise [[Sécurité]] will give
74 // .../S<span class='e9curit'>e9'>Sécurité</a>
75 Markup('restorelinks','<%%',"//", '');
77 ## [[#anchor]] in standard XHTML
78 Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e',
79 "Keep(\"<a id='$1'></a>\",'L')");
81 Markup('tablebicol', '<block', '/\(:tablebicol ?([a-z_]+)?:\)/e', 'doBicol("$1")');
82 Markup('pairrows', '_end', '/class=\'pair\_pmwiki\_([0-9]+)\'/e',
83 "($1 == 1)?'':('class=\"'.(($1 % 2 == 0)?'impair':'pair').'\"')");
84 Markup('noclassth', '_end', '/<th class=\'[a-z_]+\'/', '<th');
86 Markup('div', '<links', '/\(:div([^:]*):([^\)]*):\)/i', '<div$1>$2</div>');
88 function doBicol($column=false
)
90 global $TableRowIndexMax, $TableRowAttrFmt, $TableCellAttrFmt;
91 $TableRowAttrFmt = "class='pair_pmwiki_\$TableRowCount'";
93 $TableCellAttrFmt = "class='$column'";
97 function doPlatalLink($link, $text)
99 if (strlen(trim($text)) == 0) {
100 $profile = Profile
::get($link);
101 $text = $profile->fullName();
103 return '<a href="profile/' . $link . '" class="popup2">' . $text . '</a>';
108 $AuthFunction = 'ReadPage';
110 $HandleAuth['diff'] = 'edit';
111 $HandleAuth['source'] = 'edit';
113 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: