From 3e9ca9fbc55ce67a11482456776a3380a19fa2be Mon Sep 17 00:00:00 2001
From: moodler Program - an external program that requires information passed to it
about the current Moodle user and course. This allows external web applications
to cooperate with Moodle.
+
+ Wiki text - allows more formatting options that Plain Text without having to learn HTML.
+You type plain text but a large range of formatting characters can be included
+(e.g. *this will be bold* /this will be emphasised/) to easily create complex formatting.
\n";
+ $buffer = $buffer . $this->line_replace( eregi_replace( "^>","",$line) ). "\n";
+ $this->block_state = STATE_BLOCKQUOTE;
+ }
+ else
+ if (eregi( "^ ",$line) ) {
+ // preformatted text
+ $buffer = $buffer . "\n";
+ $buffer = $buffer . $this->line_replace($line) . "\n";
+ $this->block_state = STATE_PREFORM;
+ }
+ else
+ if (eregi("^\% ",$line) ) {
+ // preformatted text - no processing
+ $buffer = $buffer . "\n";
+ $buffer = $buffer . eregi_replace( "^\%","",$line) . "\n";
+ $this->block_state = STATE_NOTIKI;
+ }
+ else {
+ // ordinary paragraph
+ $buffer = $buffer . "\n";
+ $buffer = $buffer . $this->line_replace($line) . "\n";
+ $this->block_state = STATE_PARAGRAPH;
+ }
+ continue;
+ }
+
+ if (($this->block_state == STATE_PARAGRAPH) |
+ ($this->block_state == STATE_BLOCKQUOTE) |
+ ($this->block_state == STATE_PREFORM) ) {
+ $buffer = $buffer . $this->line_replace($line) . "\n";
+ continue;
+ }
+ elseif ($this->block_state == STATE_NOTIKI) {
+ $buffer = $buffer . $line . "\n";
+ }
+ }
+
+ // close off any block level tags
+ $buffer = $buffer . $this->close_block( $this->block_state );
+
+ return $buffer;
+ }
+
+}
+
+?>
diff --git a/mod/resource/details.php b/mod/resource/details.php
index 94e97c06d16..664e73c47cf 100644
--- a/mod/resource/details.php
+++ b/mod/resource/details.php
@@ -149,6 +149,24 @@
break;
+ case WIKITEXT:
+ $strfulltext = get_string("fulltext", "resource");
+ ?>
+
+
+ =$strfulltext?>:
+
+ helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?>
+ helpbutton("wiki", get_string("helpwiki"), "moodle", true, true) ?>
+
+
+
+
+
+
+
+ break;
+
case HTML:
$strhtmlfragment = get_string("htmlfragment", "resource");
?>
diff --git a/mod/resource/lib.php b/mod/resource/lib.php
index bf5687a4d34..8e54de4d0af 100644
--- a/mod/resource/lib.php
+++ b/mod/resource/lib.php
@@ -7,6 +7,7 @@ define("PLAINTEXT", "4");
define("WEBLINK", "5");
define("HTML", "6");
define("PROGRAM", "7");
+define("WIKITEXT", "8");
$RESOURCE_TYPE = array (REFERENCE => get_string("resourcetype1", "resource"),
WEBPAGE => get_string("resourcetype2", "resource"),
@@ -14,7 +15,8 @@ $RESOURCE_TYPE = array (REFERENCE => get_string("resourcetype1", "resource"),
PLAINTEXT => get_string("resourcetype4", "resource"),
WEBLINK => get_string("resourcetype5", "resource"),
HTML => get_string("resourcetype6", "resource"),
- PROGRAM => get_string("resourcetype7", "resource") );
+ PROGRAM => get_string("resourcetype7", "resource"),
+ WIKITEXT => get_string("resourcetype8", "resource") );
$RESOURCE_FRAME_SIZE = 130;
diff --git a/mod/resource/view.php b/mod/resource/view.php
index 6c751a6eafb..2c5e12771ce 100644
--- a/mod/resource/view.php
+++ b/mod/resource/view.php
@@ -179,6 +179,19 @@
redirect($temp);
break;
+ case WIKITEXT:
+ add_to_log($course->id, "resource", "view", "view.php?id=$cm->id", "$resource->id");
+ print_header("$course->shortname: $resource->name", "$course->fullname", "$navigation $resource->name",
+ "", "", true, update_module_button($cm->id, $course->id, $strresource), navmenu($course, $cm));
+
+ print_simple_box(wiki_to_html($resource->alltext), "CENTER", "", "$THEME->cellcontent", "20" );
+
+ echo "$strlastmodified: ".userdate($resource->timemodified)."
";
+
+ print_footer($course);
+ break;
+
+
default:
print_header("$course->shortname: $resource->name", "$course->fullname", "$navigation $resource->name",
"", "", true, update_module_button($cm->id, $course->id, $strresource), navmenu($course, $cm));