| 1 | <?php if (!defined('PmWiki')) exit(); |
| 2 | |
| 3 | $EnablePathInfo = 1; # in fact works with apache rewrite, name is misleading |
| 4 | $EnableGUIButtons = 1; |
| 5 | $EnableUpload = 1; |
| 6 | $UploadMaxSize = 500000; |
| 7 | $LinkWikiWords = 0; # disable WikiWord links |
| 8 | $EnableIMSCaching = 1; # allow browser caching |
| 9 | $EnablePageListProtect = 0; # We use our own permission system. |
| 10 | |
| 11 | $ScriptUrl = '.'; #\ |
| 12 | $UploadUrlFmt = './uploads'; # } works thanks to the <base /> in skin |
| 13 | $PubDirUrl = './wiki'; #/ |
| 14 | |
| 15 | $WorkDir = '../spool/wiki.d'; |
| 16 | $WikiDir = new PageStore('$FarmD/'.$WorkDir.'/$FullName'); |
| 17 | $InterMapFiles[] = $globals->spoolroot.'/configs/pmwiki.intermap.txt'; |
| 18 | |
| 19 | $Skin = 'empty'; |
| 20 | |
| 21 | @include_once("$FarmD/cookbook/e-protect.php"); |
| 22 | include_once($FarmD.'/scripts/xlpage-utf-8.php'); |
| 23 | ResolvePageName(); |
| 24 | |
| 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'; |
| 30 | $pagelist = null; |
| 31 | include_once("$FarmD/scripts/feeds.php"); |
| 32 | } |
| 33 | |
| 34 | // Theme-ing {{{ |
| 35 | |
| 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]"'); |
| 55 | |
| 56 | // set default author |
| 57 | $Author = $_SESSION['hruid'].'|'.$_SESSION['prenom'].' '.$_SESSION['nom']; |
| 58 | |
| 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>"); |
| 64 | |
| 65 | // set profiles to point to plat/al fiche |
| 66 | Markup('[[~platal', '<[[~', '/\[\[~([^|\]]*)(?:\|([^\]]*))?\]\]/e', |
| 67 | 'PreserveText("=", doPlatalLink("$1", "$2"), "")'); |
| 68 | |
| 69 | // Preserve javascript |
| 70 | Markup('[[javascript', '<[[javascript:', '/\[\[javascript:([^\|]*)\|([^\]]*)?\]\]/e', |
| 71 | 'PreserveText("=", \'<a href="javascript:\' . htmlentities("$1") . \'">\', "") . "$2" . PreserveText("=", "</a>", "")'); |
| 72 | |
| 73 | // prevent restorelinks before block apply (otherwise [[Sécurité]] will give |
| 74 | // .../S<span class='e9curit'>e9'>Sécurité</a> |
| 75 | Markup('restorelinks','<%%',"//", ''); |
| 76 | |
| 77 | ## [[#anchor]] in standard XHTML |
| 78 | Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e', |
| 79 | "Keep(\"<a id='$1'></a>\",'L')"); |
| 80 | |
| 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'); |
| 85 | |
| 86 | Markup('div', '<links', '/\(:div([^:]*):([^\)]*):\)/i', '<div$1>$2</div>'); |
| 87 | |
| 88 | function doBicol($column=false) |
| 89 | { |
| 90 | global $TableRowIndexMax, $TableRowAttrFmt, $TableCellAttrFmt; |
| 91 | $TableRowAttrFmt = "class='pair_pmwiki_\$TableRowCount'"; |
| 92 | if ($column) { |
| 93 | $TableCellAttrFmt = "class='$column'"; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | function doPlatalLink($link, $text) |
| 98 | { |
| 99 | if (strlen(trim($text)) == 0) { |
| 100 | $profile = Profile::get($link); |
| 101 | $text = $profile->fullName(); |
| 102 | } |
| 103 | return '<a href="profile/' . $link . '" class="popup2">' . $text . '</a>'; |
| 104 | } |
| 105 | |
| 106 | // }}} |
| 107 | |
| 108 | $AuthFunction = 'ReadPage'; |
| 109 | |
| 110 | $HandleAuth['diff'] = 'edit'; |
| 111 | $HandleAuth['source'] = 'edit'; |
| 112 | |
| 113 | // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: |
| 114 | ?> |