]> git.mjollnir.org Git - moodle.git/commitdiff
Added support for mailto links
authorthepurpleblob <thepurpleblob>
Tue, 8 Jul 2003 09:10:22 +0000 (09:10 +0000)
committerthepurpleblob <thepurpleblob>
Tue, 8 Jul 2003 09:10:22 +0000 (09:10 +0000)
lang/en/help/wiki.html
lib/wiki.php

index 91cbc2b2a860874d183070d0b3d86202dc900654..5fb630ad24bf07e384b3a43c754c32f86f673dd1 100644 (file)
@@ -89,8 +89,12 @@ is parenthesis. There must be no space between the acronym and the parenthesis.
 \r
 <h3>Hyper Links</h3>\r
 \r
-Links can be placed in the text and are followed (with no spaces) by the text to be displayed in brackets. Example: </em>http://www.google.com/(Search Now)</em> will be converted to \r
-<a href="http://www.google.com/">Search Now</a>.\r
+<p>Links can be placed in the text and are followed (with no spaces) by the text to be displayed in brackets. Example: </em>http://www.google.com/(Search Now)</em> will be converted to \r
+<a href="http://www.google.com/">Search Now</a>.</p>\r
+\r
+<p>Mail links can be acheived the same way, e.g.,</p>\r
+<p>nobody@example.com(Test User) will be converted to\r
+<a href="mailto:nobody@example.com">Test User</a></p>\r
 \r
 <h3>Moodle Module Links</h3>\r
 \r
index 4345b595c043f80c883e1f8f51b9607568cedf85..44b1fe9a7b6a5a61e0d28405ab8ee1a293b9299f 100644 (file)
@@ -244,6 +244,10 @@ class Wiki {
     $line = eregi_replace("([[:space:]])www\.([^[:space:]]*)([[:alnum:]#?/&=])", \r
       "\\1<A HREF=\"http://www.\\2\\3\" TARGET=\"newpage\">www.\\2\\3</A>", $line);\r
 \r
+    // make email addresses into mailtos....\r
+    $line = eregi_replace("([[:space:]]|^)([a-zA-Z0-9@.]+)\(([^)]+)\)",\r
+      "\\1<a href=\"mailto:\\2\">\\3</a>", $line);\r
+\r
     // !# at the beginning of any lines means a heading\r
     $line = eregi_replace( "^!([1-6]) (.*)$", "<h\\1>\\2</h\\1>", $line );\r
     \r
@@ -260,10 +264,10 @@ class Wiki {
       global $course;    // This is a bit risky - it won't work everywhere\r
 \r
       if ($CFG->slasharguments) {\r
-        $line = eregi_replace( "/([a-zA-Z./_-]+)(png|gif|jpg)\(([^)]+)\)",\r
+        $line = eregi_replace( "/([a-zA-Z0-9./_-]+)(png|gif|jpg)\(([^)]+)\)",\r
           "<img src=\"$CFG->wwwroot/file.php/$course->id/\\1\\2\" alt=\"\\3\" />", $line );\r
       } else {\r
-        $line = eregi_replace( "/([a-zA-Z./_-]+)(png|gif|jpg)\(([^)]+)\)",\r
+        $line = eregi_replace( "/([a-zA-Z0-9./_-]+)(png|gif|jpg)\(([^)]+)\)",\r
           "<img src=\"$CFG->wwwroot/file.php\?file=$course->id/\\1\\2\" alt=\"\\3\" />", $line );\r
       }\r
 \r