]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed filtering of wiki output to only apply to wiki text pages and not action pages.
authormchurch <mchurch>
Mon, 23 Aug 2004 21:56:47 +0000 (21:56 +0000)
committermchurch <mchurch>
Mon, 23 Aug 2004 21:56:47 +0000 (21:56 +0000)
mod/wiki/ewiki/ewiki.php
mod/wiki/view.php

index 91f5d20d264ab51406038d65df6bc65cc6b8334a..073069beff7aed793dfdacfdca9794a6c55cdada 100644 (file)
@@ -594,6 +594,7 @@ function ewiki_page($id=false) {
          $pf($o, $id, $data, $action);
       }
    }
+
    (EWIKI_ESCAPE_AT) && ($o = str_replace("@", "&#x40;", $o));
 
    return($o);
index b11ad4f9d34f5ba7df62ca49ba73b38846abc6e4..b5681c027e24fa46e195db4089b918fde23ecd27 100644 (file)
     if ($canedit) {   /// Print tabs with commands for this page
         $tabstyle = ' style="padding-left: 5px;padding-right: 5px" ';
 
-        echo "<table align=right border=0>";
+        echo "<table border=0>";
         echo "<tr>";
         $tabs = array('view', 'edit','links','info');
         if ($binary) {
         echo "</table>";
     }
     print_simple_box_start( "right", "100%", "$THEME->cellcontent", "20");
-    if($ewiki_action=="edit") {
-      # When editing, the filters shall not interfere the wiki-source
-      print $content.$content2;
-    } else {
-      //print(format_text($content, $moodle_format));    /// DISABLED UNTIL IT CAN BE FIXED
-      print $content;
-      print $content2;
+
+    /// Don't filter any pages containing wiki actions (except view). A wiki page containing
+    /// actions will have the form [action]/[pagename]. If the '/' isn't there, or the action
+    /// is 'view', filter it. Also, if the page doesn't exist, it will default to 'edit'.
+    $actions = explode('/', $wikipage);
+    if ($ewiki_action == "edit" || ($actions !== false && count($actions) > 1 && $actions[0] != 'view') ||
+        (count($actions) == 1 && !record_exists('wiki_pages', 'pagename', $wikipage, 'wiki', $wiki_entry->id))) {
+        print $content;
+    }
+    else {
+        print(format_text($content, $moodle_format));    /// DISABLED UNTIL IT CAN BE FIXED
     }
+    print $content2;
     print_simple_box_end();
     echo "<br clear=all />";