Merge branch 'platal-0.9.17'
[platal.git] / include / wiki / farmconfig.php
index ee13e1a..b867000 100644 (file)
@@ -18,6 +18,17 @@ $InterMapFiles[]  = $globals->spoolroot.'/configs/pmwiki.intermap.txt';
 $Skin             = 'empty';
 
 @include_once("$FarmD/cookbook/e-protect.php");
+include_once($FarmD.'/scripts/xlpage-utf-8.php');
+ResolvePageName();
+
+if ($action == 'rss'  || $action == 'atom' || $action == 'rdf'  || $action == 'dc') {
+    $FmtPV['$MarkupExcerpt'] = '$page["text"]';
+    $FeedFmt[$action]['item']['title'] = '[$Group] {$Title}';
+    $FeedFmt[$action]['item']['description'] = '$LastModifiedSummary';
+    $FeedFmt[$action]['feed']['title'] = 'Polytechnique.org :: Wiki :: $FullName';
+    $pagelist = null;
+    include_once("$FarmD/scripts/feeds.php");
+}
 
 // Theme-ing {{{
 
@@ -38,32 +49,36 @@ $GUIButtons['ul'] = array(530, '\\n* ', '\\n', '$[Unordered list]',
 $GUIButtons['hr'] = array(540, '\\n----\\n', '', '',
                  '$GUIButtonDirUrlFmt/hr.gif"$[Horizontal rule]"');
 $GUIButtons['table'] = array(600,
-                   '||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n||     ||     ||     ||\\n||     ||     ||     ||\\n', '', '', 
+                   '||border=1 width=80%\\n||!Hdr ||!Hdr ||!Hdr ||\\n||     ||     ||     ||\\n||     ||     ||     ||\\n', '', '',
                  '$GUIButtonDirUrlFmt/table.gif"$[Table]"');
 
 // set default author
 $Author = $_SESSION['forlife'].'|'.$_SESSION['prenom'].' '.$_SESSION['nom'];
 
 $InputTags['e_form'] = array(
-  ':html' => "<form action='{\$PageUrl}?action=edit' method='post'><div><input 
-    type='hidden' name='action' value='edit' /><input 
-    type='hidden' name='n' value='{\$FullName}' /><input 
+  ':html' => "<form action='{\$PageUrl}?action=edit' method='post'><div><input
+    type='hidden' name='action' value='edit' /><input
+    type='hidden' name='n' value='{\$FullName}' /><input
     type='hidden' name='basetime' value='\$EditBaseTime' /></div>");
 
 // set profiles to point to plat/al fiche
 Markup('[[~platal', '<[[~', '/\[\[~([^|\]]*)(?:\|([^\]]*))?\]\]/e',
     'PreserveText("=", doPlatalLink("$1", "$2"), "")');
 
-// prevent restorelinks before block apply (otherwise [[Sécurité]] will give
-//  .../S<span class='e9curit'>e9'>Sécurité</a>
+// Preserve javascript
+Markup('[[javascript', '<[[javascript:', '/\[\[javascript:([^\|]*)\|([^\]]*)?\]\]/e',
+       'PreserveText("=", \'<a href="javascript:\' . htmlentities("$1") . \'">\', "") . "$2" . PreserveText("=", "</a>", "")');
+
+// prevent restorelinks before block apply (otherwise [[Sécurité]] will give
+//  .../S<span class='e9curit'>e9'>Sécurité</a>
 Markup('restorelinks','<%%',"//", '');
 
 ## [[#anchor]] in standard XHTML
 Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e',
   "Keep(\"<a id='$1'></a>\",'L')");
-  
+
 Markup('tablebicol', '<block', '/\(:tablebicol ?([a-z_]+)?:\)/e', 'doBicol("$1")');
-Markup('pairrows', '_end', '/class=\'pair\_pmwiki\_([0-9]+)\'/e', 
+Markup('pairrows', '_end', '/class=\'pair\_pmwiki\_([0-9]+)\'/e',
     "($1 == 1)?'':('class=\"'.(($1 % 2 == 0)?'impair':'pair').'\"')");
 Markup('noclassth', '_end', '/<th class=\'[a-z_]+\'/', '<th');
 
@@ -80,7 +95,7 @@ function doBicol($column=false)
 
 function doPlatalLink($link, $text)
 {
-    if (strlen(trim($text)) == 0) { 
+    if (strlen(trim($text)) == 0) {
         $res = XDB::query("SELECT u.nom, u.prenom, u.promo, q.profile_nick AS surnom
                              FROM auth_user_md5   AS u
                        INNER JOIN auth_user_quick AS q USING(user_id)
@@ -89,7 +104,7 @@ function doPlatalLink($link, $text)
         $row = $res->fetchOneAssoc();
         $text = $row['prenom'] . ' ' . $row['nom'] . ' X' . $row['promo'];
         if ($row['surnom']) {
-            $text .= ' (aka ' . $row['surnom'] . ')';
+            $text .= ' (alias ' . $row['surnom'] . ')';
         }
     }
     return '<a href="profile/' . $link . '" class="popup2">' . $text . '</a>';
@@ -102,4 +117,5 @@ $AuthFunction = 'ReadPage';
 $HandleAuth['diff']   = 'edit';
 $HandleAuth['source'] = 'edit';
 
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>