From 01260c78fa26d49b73320a7c20da44e5bf48b777 Mon Sep 17 00:00:00 2001 From: dongsheng Date: Wed, 30 Apr 2008 03:49:12 +0000 Subject: [PATCH] "MDL-13233, make emoticons documentation should be dynamic" --- help.php | 26 ++++++- lang/en_utf8/help/emoticons.html | 118 +------------------------------ lang/en_utf8/help/richtext.html | 118 +------------------------------ lang/en_utf8/help/text.html | 118 +------------------------------ 4 files changed, 32 insertions(+), 348 deletions(-) diff --git a/help.php b/help.php index 5d034a5aae..6c8b3b6b2e 100644 --- a/help.php +++ b/help.php @@ -140,6 +140,11 @@ if(preg_match('~^(.*?)(.*?)(.*)$~s',$output,$matches)) { $title=$title.' - '.$matches[2]; } +// use ##emoticons_html## to replace the emoticons documentation +if(preg_match('~(##emoticons_html##)~', $output, $matches)) { + $output = preg_replace('~(##emoticons_html##)~', get_emoticons_html(), $output); +} + // Do the main output. print_header($title); print_simple_box_start(); @@ -160,6 +165,25 @@ print_footer('none'); // Utility function ================================================================= +function get_emoticons_html(){ + global $CFG; + $output = ''; + $emoticonstring = $CFG->emoticons; + $output .= ''; + return $output; + +} + function file_exists_and_readable($filepath) { return file_exists($filepath) and is_file($filepath) and is_readable($filepath); } @@ -170,7 +194,7 @@ function include_help_for_each_module($file, $langs, $helpdir) { global $CFG; if (!$modules = get_records('modules', 'visible', 1)) { - print_error('No modules found!!'); // Should never happen + print_error('nomodules', 'debug'); // Should never happen } $grade = new stdClass(); diff --git a/lang/en_utf8/help/emoticons.html b/lang/en_utf8/help/emoticons.html index 3c6babd815..8b34e5778d 100644 --- a/lang/en_utf8/help/emoticons.html +++ b/lang/en_utf8/help/emoticons.html @@ -1,119 +1,7 @@

Using Smilies (emoticons)

- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
smile:-)
big grin:-D
wink;-)
mixed:-/
thoughtfulV-.
tongue out:-P
coolB-)
approve^-)
wide eyes8-)
surprise8-o
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sad:-(
shy8-.
blush:-I
kisses:-X
clown:o)
black eyeP-|
angry8-[
deadxx-P
sleepy|-.
evil}-]
-
+
##emoticons_html##
+

When writing online, it can sometimes difficult to express emotion with plain text. These little icons can help.

@@ -122,4 +10,4 @@

Note that the codes themselves are like little pictures - just turn your head to the left when looking at them

- \ No newline at end of file + diff --git a/lang/en_utf8/help/richtext.html b/lang/en_utf8/help/richtext.html index c7ef61ed98..dc240a64a9 100644 --- a/lang/en_utf8/help/richtext.html +++ b/lang/en_utf8/help/richtext.html @@ -43,120 +43,6 @@

Inserting smilies (emoticons)

To embed these small icons in your text, click on the smiley icon in the toolbar. A dialog will pop up that allows you to select from the following smiley icons. (Alternatively, you can just type the corresponding code straight into your text and it will be converted later when your text is displayed).

- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
smile:-)
big grin:-D
wink;-)
mixed:-/
thoughtfulV-.
tongue out:-P
coolB-)
approve^-)
wide eyes8-)
surprise8-o
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sad:-(
shy8-.
blush:-I
kisses:-X
clown:o)
black eyeP-|
angry8-[
deadxx-P
sleepy|-.
evil}-]
-
- +
##emoticons_html##
- - +
 
diff --git a/lang/en_utf8/help/text.html b/lang/en_utf8/help/text.html index ad62aba9ec..b384bbc53e 100644 --- a/lang/en_utf8/help/text.html +++ b/lang/en_utf8/help/text.html @@ -5,123 +5,9 @@ Writing text in Moodle works pretty much the way you would expect, but you also

Smilies (emoticons)

To embed these small icons in your text, just type the associated code. These codes themselves are like little pictures if you turn your head to the left when looking at them.

- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
smile:-)
big grin:-D
wink;-)
mixed:-/
thoughtfulV-.
tongue out:-P
coolB-)
approve^-)
wide eyes8-)
surprise8-o
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sad:-(
shy8-.
blush:-I
kisses:-X
clown:o)
black eyeP-|
angry8-[
deadxx-P
sleepy|-.
evil}-]
-
- +
##emoticons_html##
- +

URLs

Any "word" starting with www. or http:// will automatically be turned into a clickable link.

-- 2.39.5