Permalink
Browse files

Set Moodle filtering for wiki text only.

  • Loading branch information...
1 parent ae7fb33 commit 75c180d2e3c89cccf153aa3440f33cae63fab1b6 mchurch committed Aug 24, 2004
Showing with 20 additions and 10 deletions.
  1. +4 −0 mod/wiki/ewiki/ewiki.php
  2. +16 −10 mod/wiki/view.php
View
4 mod/wiki/ewiki/ewiki.php
@@ -731,7 +731,11 @@ function ewiki_page_view($id, &$data, $action, $all=1) {
return($o);
}
#### MOODLE CHANGE
+ /// Add Moodle filters to text porion of wiki.
+ global $moodle_format; // from wiki/view.php
+ $o = format_text($o, $moodle_format);
$o.= "<br><br>";
+
#-- control line + other per-page info stuff
if ($pf_a = $ewiki_plugins["view_append"]) {
ksort($pf_a);
View
26 mod/wiki/view.php
@@ -70,7 +70,8 @@
/// or the default value in the 'lang' file if the specified value was empty.
define("EWIKI_PAGE_INDEX",$wiki_entry->pagename);
- $wikipage = ($wikipage === false) ? EWIKI_PAGE_INDEX: $wikipage;
+ /// If the page has a ' in it, it may have slashes added to it. Remove them if it does.
+ $wikipage = ($wikipage === false) ? stripslashes(EWIKI_PAGE_INDEX) : stripslashes($wikipage);
/// ### Prevent ewiki getting id as PageID...
unset($_REQUEST["id"]);
@@ -319,17 +320,22 @@
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 $content;
+ print $content2;
print_simple_box_end();
echo "<br clear=all />";
/// Finish the page
print_footer($course);
-?>
+?>

0 comments on commit 75c180d

Please sign in to comment.