[Home]WikiPatches/SSIPatch

UseModWiki | WikiPatches | RecentChanges | Preferences

Purpose of this patch is to display (include) the content of a wiki page (e.g. SandBox) in any html-Page.

--- usemod092/wiki.pl   Sun Apr 22 02:44:10 2001
+++ wiki.pl     Sun Aug 11 17:08:41 2002
@@ -349,13 +349,14 @@
 }

 sub DoBrowseRequest {
-  my ($id, $action, $text);
+  my ($id) = @_;
+  my ($action, $text);

   if (!$q->param) {             # No parameter
     &BrowsePage($HomePage);
     return 1;
   }
-  $id = &GetParam('keywords', '');
+  $id ||= &GetParam('keywords', '');
   if ($id) {                    # Just script?PageName
     if ($FreeLinks && (!-f &GetPageFile($id))) {
       $id = &FreeToNormal($id);
@@ -461,11 +462,11 @@
     $fullHtml .= &GetDiffHTML($showDiff, $id, $diffRevision, $newText);
   }
   $fullHtml .= &WikiToHTML($Text{'text'});
-  $fullHtml .= "<hr>\n"  if (!&GetParam('embed', $EmbedWiki));
+  $fullHtml .= "<hr>\n" if (! (&GetParam('embed', $EmbedWiki) || &GetParam('ssi', "") ));
   if (($id eq $RCName) || (T($RCName) eq $id) || (T($id) eq $RCName)) {
     print $fullHtml;
     &DoRc();
-    print "<hr>\n"  if (!&GetParam('embed', $EmbedWiki));
+    print "<hr>\n" if (! (&GetParam('embed', $EmbedWiki) || &GetParam('ssi', "") ));
     print &GetFooterText($id, $goodRevision);
     return;
   }
@@ -941,6 +942,7 @@
   my $embed = &GetParam('embed', $EmbedWiki);
   my $altText = T('[Home]');

+  return "\n" if ( &GetParam('ssi', 0) );
   $result = &GetHttpHeader();
   if ($FreeLinks) {
     $title =~ s/_/ /g;   # Display as spaces
@@ -1022,6 +1024,7 @@
   my ($id, $rev) = @_;
   my $result = '';

+  return "\n" if ( &GetParam('ssi', 0) );
   if (&GetParam('embed', $EmbedWiki)) {
     return $q->end_html;
   }
@@ -1072,6 +1075,7 @@
 }

 sub GetMinimumFooter {
+  return "\n" if ( &GetParam('ssi', 0) );
   if ($FooterNote ne '') {
     return T($FooterNote) . $q->end_html;  # Allow local translations
   }
@@ -1969,8 +1973,11 @@
 # ==== Misc. functions ====
 sub ReportError {
   my ($errmsg) = @_;
-
-  print $q->header, "<H2>", $errmsg, "</H2>", $q->end_html;
+  if (&GetParam('ssi', 0)) {
+    print  "<p>", $errmsg, "<p>\n";
+  } else {
+    print $q->header, "<H2>", $errmsg, "</H2>", $q->end_html;
+  }
 }

 sub ValidId {
@@ -2479,6 +2486,10 @@
       # Later improve error reporting
       &ReportError(Ts('Invalid action parameter %s', $action));
     }
+    return;
+  }
+  if (&GetParam("ssi", 0)) {
+    &DoBrowseRequest($id);
     return;
   }
   if (&GetParam("edit_prefs", 0)) {
--MatthiasWeingart

UseModWiki | WikiPatches | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited October 2, 2007 6:39 pm by MarkusLude (diff)
Search: