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
11 $UploadUrlFmt = './uploads'; # } works thanks to the <base /> in skin
12 $PubDirUrl = './wiki'; #/
14 $WorkDir = '../spool/wiki.d';
15 $WikiDir = new PageStore('$FarmD/'.$WorkDir.'/$FullName');
16 $InterMapFiles[] = $globals->spoolroot
.'/configs/pmwiki.intermap.txt';
20 @include_once
("$FarmD/cookbook/e-protect.php");
21 include_once($FarmD.'/scripts/xlpage-utf-8.php');
23 if ($action == 'rss' ||
26 $action == 'dc') include_once("$FarmD/scripts/feeds.php");
30 ## The following lines make additional editing buttons appear in the
31 ## edit page for subheadings, lists, tables, etc.
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]"');
51 $Author = $_SESSION['forlife'].'|'.$_SESSION['prenom'].' '.$_SESSION['nom'];
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>");
59 // set profiles to point to plat/al fiche
60 Markup('[[~platal', '<[[~', '/\[\[~([^|\]]*)(?:\|([^\]]*))?\]\]/e',
61 'PreserveText("=", doPlatalLink("$1", "$2"), "")');
63 // prevent restorelinks before block apply (otherwise [[Sécurité]] will give
64 // .../S<span class='e9curit'>e9'>Sécurité</a>
65 Markup('restorelinks','<%%',"//", '');
67 ## [[#anchor]] in standard XHTML
68 Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e',
69 "Keep(\"<a id='$1'></a>\",'L')");
71 Markup('tablebicol', '<block', '/\(:tablebicol ?([a-z_]+)?:\)/e', 'doBicol("$1")');
72 Markup('pairrows', '_end', '/class=\'pair\_pmwiki\_([0-9]+)\'/e',
73 "($1 == 1)?'':('class=\"'.(($1 % 2 == 0)?'impair':'pair').'\"')");
74 Markup('noclassth', '_end', '/<th class=\'[a-z_]+\'/', '<th');
76 Markup('div', '<links', '/\(:div([^:]*):([^\)]*):\)/i', '<div$1>$2</div>');
78 function doBicol($column=false
)
80 global $TableRowIndexMax, $TableRowAttrFmt, $TableCellAttrFmt;
81 $TableRowAttrFmt = "class='pair_pmwiki_\$TableRowCount'";
83 $TableCellAttrFmt = "class='$column'";
87 function doPlatalLink($link, $text)
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'];
98 $text .= ' (alias ' . $row['surnom'] . ')';
101 return '<a href="profile/' . $link . '" class="popup2">' . $text . '</a>';
106 $AuthFunction = 'ReadPage';
108 $HandleAuth['diff'] = 'edit';
109 $HandleAuth['source'] = 'edit';
111 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: