1 <?php
if (!defined('PmWiki')) exit();
3 $EnablePathInfo = 1; # in fact works with apache rewrite, name is misleading
6 $LinkWikiWords = 0; # disable WikiWord links
7 $EnableIMSCaching = 1; # allow browser caching
10 $UploadUrlFmt = './uploads'; # } works thanks to the <base /> in skin
11 $PubDirUrl = './wiki'; #/
13 $WorkDir = '../spool/wiki.d';
14 $WikiDir = new PageStore('$FarmD/'.$WorkDir.'/$FullName');
15 $InterMapFiles[] = $globals->spoolroot
.'plugins/pmwiki.intermap.txt';
19 XLSDV('en', array('EnterAttributes' =>
20 "Entre ici les différents droit pour la page. Les champs laissés en blanc ne seront pas modifiés.
21 Pour enlever une restriction ou une autorisation entre <strong>clear</strong>.
22 Les différentes restrictions possibles sont :
24 <li><strong>public:</strong> (pour tout le monde)</li>
25 <li><strong>logged:</strong> (pour ceux qui ont rentré leur mot de passe ou qui ont un cookie permanent)</li>
26 <li><strong>identified:</strong> (exige une identification par mot de passe)</li>
27 <li><strong>has_perms:</strong> (pour les administrateurs de la page)</li>
29 Le <strong>:</strong> à la fin de chaque mot clef est important. Tu peux également combiner plusieurs mots clefs avec <strong>and:</strong>
30 ou des espaces (qui remplace le <em>ou</em> logique)<br/>"));
32 @include_once
("$FarmD/cookbook/e-protect.php");
34 $DefaultPasswords['read'] = 'logged:';
35 $DefaultPasswords['edit'] = 'has_perms:';
36 $DefaultPasswords['attr'] = 'has_perms: and: identified:';
37 $DefaultPasswords['admin'] = 'has_perms: and: identified:';
38 $DefaultPasswords['upload'] = 'has_perms: and: identified:';
42 ## The following lines make additional editing buttons appear in the
43 ## edit page for subheadings, lists, tables, etc.
44 $GUIButtons['h2'] = array(400, '\\n!! ', '\\n', '$[Heading]',
45 '$GUIButtonDirUrlFmt/h2.gif"$[Heading]"');
46 $GUIButtons['h3'] = array(402, '\\n!!! ', '\\n', '$[Subheading]',
47 '$GUIButtonDirUrlFmt/h3.gif"$[Subheading]"');
48 $GUIButtons['indent'] = array(500, '\\n->', '\\n', '$[Indented text]',
49 '$GUIButtonDirUrlFmt/indent.gif"$[Indented text]"');
50 $GUIButtons['outdent'] = array(510, '\\n-<', '\\n', '$[Hanging indent]',
51 '$GUIButtonDirUrlFmt/outdent.gif"$[Hanging indent]"');
52 $GUIButtons['ol'] = array(520, '\\n# ', '\\n', '$[Ordered list]',
53 '$GUIButtonDirUrlFmt/ol.gif"$[Ordered (numbered) list]"');
54 $GUIButtons['ul'] = array(530, '\\n* ', '\\n', '$[Unordered list]',
55 '$GUIButtonDirUrlFmt/ul.gif"$[Unordered (bullet) list]"');
56 $GUIButtons['hr'] = array(540, '\\n----\\n', '', '',
57 '$GUIButtonDirUrlFmt/hr.gif"$[Horizontal rule]"');
58 $GUIButtons['table'] = array(600,
59 '||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n|| || || ||\\n|| || || ||\\n', '', '',
60 '$GUIButtonDirUrlFmt/table.gif"$[Table]"');
63 $Author = $_SESSION['forlife'].'|'.$_SESSION['prenom'].' '.$_SESSION['nom'];
65 $InputTags['e_form'] = array(
66 ':html' => "<form action='{\$PageUrl}?action=edit' method='post'><div><input
67 type='hidden' name='action' value='edit' /><input
68 type='hidden' name='n' value='{\$FullName}' /><input
69 type='hidden' name='basetime' value='\$EditBaseTime' /></div>");
71 // set profiles to point to plat/al fiche
72 Markup('[[~platal', '<[[~', '/\[\[~([^|\]]*)\|([^\]]*)\]\]/e',
73 'PreserveText("=", \'<a href="profile/$1" class="popup2">$2</a>\', "")');
75 // prevent restorelinks before block apply (otherwise [[Sécurité]] will give
76 // .../S<span class='e9curit'>e9'>Sécurité</a>
77 Markup('restorelinks','<%%',"//", '');
79 ## [[#anchor]] in standard XHTML
80 Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e',
81 "Keep(\"<a id='$1'></a>\",'L')");
83 Markup('tablebicol', '<block', '/\(:tablebicol ?([a-z_]+)?:\)/e', 'doBicol("$1")');
84 Markup('pairrows', '_end', '/class=\'pair\_pmwiki\_([0-9]+)\'/e',
85 "($1 == 1)?'':('class=\"'.(($1 % 2 == 0)?'impair':'pair').'\"')");
86 Markup('noclassth', '_end', '/<th class=\'[a-z_]+\'/', '<th');
88 Markup('div', '<links', '/\(:div([^:]*):([^\)]*):\)/i', '<div$1>$2</div>');
90 function doBicol($column=false
)
92 global $TableRowIndexMax, $TableRowAttrFmt, $TableCellAttrFmt;
93 $TableRowAttrFmt = "class='pair_pmwiki_\$TableRowCount'";
95 $TableCellAttrFmt = "class='$column'";
102 $AuthFunction = 'AuthPlatal';
104 $HandleAuth['diff'] = 'edit';
105 $HandleAuth['source'] = 'edit';
107 // impossible to see the diff without the source because of the smarty tags
108 $DiffShow['source'] = 'y';
111 // for read pages: will come only once so we have to be careful
112 // and translate any auth from the wiki to smarty auth
113 function AuthPlatal($pagename, $level, $authprompt)
117 $page_read = ReadPage($pagename);
119 $levels = array('read', 'attr', 'edit', 'upload');
121 if (S
::identified() && S
::has_perms())
123 $page_read['=passwd'] = $passwds;
124 $page_read['=pwsource'] = $pwsources;
129 // if we arrive here, the user doesn't have enough permission to access page
131 // maybe it is because he is not identified
132 if ($authprompt && !S
::identified()) {
133 require_once dirname(__FILE__
).'/../classes/Platal.php';
134 require_once dirname(__FILE__
).'/../classes/PLModule.php';
135 $platal = new Platal();
136 $platal->force_login($page);
139 if (S
::has_perms()) {
140 $page->trig('Erreur : page Wiki inutilisable sur plat/al');