Moodle

Emoticons Documentation should be dynamic with the new configuration settings

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 2.0
  • Component/s: Documentation
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

Since its now possible to customise emoticons, the help menu should really be dynamic generated for the configuration settings.

  1. emoticons.patch
    29/Apr/08 10:35 AM
    18 kB
    Dongsheng Cai
  2. emoticons-2.patch
    06/May/08 12:02 PM
    11 kB
    Dongsheng Cai

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Uhm.. this could be problematic (because of the nature html of help files).

What if we try to address this as follows:

1) Create one function, call it: get_emoticons_html() responsible to look for current emotions defined and generate the proper HTML (the "table" of emoticons).
2) In the emoticons help page (and others where present), delete the "table" of emoticons and insert something like:

#emoticons_html#

3) that "tag" will be parsed by help.php replacing the tag with the calculated table.

Both the parsing and get_emoticons_html() function must be within help.php.

Assigning to Dongsheng... discuss and confirm with MD before, please.

Any idea will be welcome, of course! Ciao

Show
Eloy Lafuente (stronk7) added a comment - Uhm.. this could be problematic (because of the nature html of help files). What if we try to address this as follows: 1) Create one function, call it: get_emoticons_html() responsible to look for current emotions defined and generate the proper HTML (the "table" of emoticons). 2) In the emoticons help page (and others where present), delete the "table" of emoticons and insert something like: #emoticons_html# 3) that "tag" will be parsed by help.php replacing the tag with the calculated table. Both the parsing and get_emoticons_html() function must be within help.php. Assigning to Dongsheng... discuss and confirm with MD before, please. Any idea will be welcome, of course! Ciao
Hide
Martin Dougiamas added a comment -

Sounds perfect, Eloy!

Show
Martin Dougiamas added a comment - Sounds perfect, Eloy!
Hide
Dongsheng Cai added a comment -

Eloy, I made a patch here, please review, if it is good, I will commit to CVS, thanks.

Show
Dongsheng Cai added a comment - Eloy, I made a patch here, please review, if it is good, I will commit to CVS, thanks.
Hide
Dongsheng Cai added a comment -

This patch is against HEAD.

Show
Dongsheng Cai added a comment - This patch is against HEAD.
Hide
Dongsheng Cai added a comment -

Please ignore my previous patch, try this latest one.

Show
Dongsheng Cai added a comment - Please ignore my previous patch, try this latest one.
Hide
Eloy Lafuente (stronk7) added a comment -

Hi Dongsheg some comments about your patch:

1) Icons aren't displayed properly. It seems that the extension is missing in the icons.
2) Those styles within the body... they break XHTML I guess you'll need to add them to the standard theme, just add them in the section: Help files (/lang/-/help) and prefix all them with #help" to be applied only in those pages.
3) The same content must be replaced in other help files apart from emoticons.html. Take a look to richtext.html and text.html.
4) It's "emoticons" not "emotions"

Plz, send a patch fixing all these. TIA!

Backporting to 19_STABLE will require to backport also MDL-14286. I'd suggest you to request MD for confirmation. If answer is no, we can leave this for 2.0 only.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Hi Dongsheg some comments about your patch: 1) Icons aren't displayed properly. It seems that the extension is missing in the icons. 2) Those styles within the body... they break XHTML I guess you'll need to add them to the standard theme, just add them in the section: Help files (/lang/-/help) and prefix all them with #help" to be applied only in those pages. 3) The same content must be replaced in other help files apart from emoticons.html. Take a look to richtext.html and text.html. 4) It's "emoticons" not "emotions" Plz, send a patch fixing all these. TIA! Backporting to 19_STABLE will require to backport also MDL-14286. I'd suggest you to request MD for confirmation. If answer is no, we can leave this for 2.0 only. Ciao
Hide
Dongsheng Cai added a comment -

Eloy,I attached another patch which fixed 2), 3), 4)
What do you mean extension is missing, I got the emoticons from $CFG->emoticons, is this wrong?

Show
Dongsheng Cai added a comment - Eloy,I attached another patch which fixed 2), 3), 4) What do you mean extension is missing, I got the emoticons from $CFG->emoticons, is this wrong?
Hide
Dongsheng Cai added a comment -

The new patch, fix all known problems

Show
Dongsheng Cai added a comment - The new patch, fix all known problems
Hide
Martin Dougiamas added a comment -

Thanks Dongsheng, can you put this in HEAD? I think it's OK for 1.9 too but I'd like to test it a little first.

Show
Martin Dougiamas added a comment - Thanks Dongsheng, can you put this in HEAD? I think it's OK for 1.9 too but I'd like to test it a little first.
Hide
Dongsheng Cai added a comment -

Committed to HEAD only, please review, feel free to reopen if you find any problem or this change need to backport to moodle 1.9.

Show
Dongsheng Cai added a comment - Committed to HEAD only, please review, feel free to reopen if you find any problem or this change need to backport to moodle 1.9.
Hide
Eloy Lafuente (stronk7) added a comment -

reopening this a bit...

1) <li> elements aren't closed.
2) help/emoticons.html seems to have <html><body> tags. Shouldn't have them

Both 1 & 2 causes XHTML breakage. Can you fix them, plz.

TIA and ciao

P.S: Trick: it's highly recommended to have FF with some nice extensions installed (Web Developer Extension, HTML Validator...). And highly recommended to check that pages we are committing are, always, valid XHTML.

Show
Eloy Lafuente (stronk7) added a comment - reopening this a bit... 1) <li> elements aren't closed. 2) help/emoticons.html seems to have <html><body> tags. Shouldn't have them Both 1 & 2 causes XHTML breakage. Can you fix them, plz. TIA and ciao P.S: Trick: it's highly recommended to have FF with some nice extensions installed (Web Developer Extension, HTML Validator...). And highly recommended to check that pages we are committing are, always, valid XHTML.
Hide
Dongsheng Cai added a comment -

Fixed, tested, Thanks, Eloy.
Feel free to reopen..

Show
Dongsheng Cai added a comment - Fixed, tested, Thanks, Eloy. Feel free to reopen..
Hide
Eloy Lafuente (stronk7) added a comment -

Feeling happy to close! :-P Thanks!

Show
Eloy Lafuente (stronk7) added a comment - Feeling happy to close! :-P Thanks!
Hide
Nicolas Martignoni added a comment -

The fixing of this issue modifies substantially 3 help files:
*help/emoticons.html
*help/text.html
*help/richtext.html
which breaks backward compatibility in lang packs.

Our policy would be to create new files emoticons2.html, etc. or am I wrong ?

Show
Nicolas Martignoni added a comment - The fixing of this issue modifies substantially 3 help files: *help/emoticons.html *help/text.html *help/richtext.html which breaks backward compatibility in lang packs. Our policy would be to create new files emoticons2.html, etc. or am I wrong ?
Hide
Eloy Lafuente (stronk7) added a comment -

Ah ,crap!

I forgot that completely! Well spotted Nicolas!

Hi Dongsheng. The cause for this is that other langs only have one version (HEAD) but English has one version per release. And if we change the en_utf8 help files in HEAD as we have done, soon other translators will change their HEAD languages too... but that will break those help files when used in older Moodle releases because old Moodle releases don't know about the #emoticons_html# thing at all.

This means that...

1) We must revert to previous versions of:

*help/emoticons.html
*help/text.html
*help/richtext.html

2) We must create new versions of them, called:

*help/emoticons2.html
*help/text2.html
*help/richtext2.html

3) We must go across all Moodle (HEAD) code and switch all the uses of old files to the new ones.

TIA & ciao

Show
Eloy Lafuente (stronk7) added a comment - Ah ,crap! I forgot that completely! Well spotted Nicolas! Hi Dongsheng. The cause for this is that other langs only have one version (HEAD) but English has one version per release. And if we change the en_utf8 help files in HEAD as we have done, soon other translators will change their HEAD languages too... but that will break those help files when used in older Moodle releases because old Moodle releases don't know about the #emoticons_html# thing at all. This means that... 1) We must revert to previous versions of: *help/emoticons.html *help/text.html *help/richtext.html 2) We must create new versions of them, called: *help/emoticons2.html *help/text2.html *help/richtext2.html 3) We must go across all Moodle (HEAD) code and switch all the uses of old files to the new ones. TIA & ciao
Hide
Dongsheng Cai added a comment -

Put a patch here, all the helpbuttons are fixed(`grep "helpbutton(.*(text|richtext|emoticons)" -r /var/www/dev`)

Show
Dongsheng Cai added a comment - Put a patch here, all the helpbuttons are fixed(`grep "helpbutton(.*(text|richtext|emoticons)" -r /var/www/dev`)
Hide
Dongsheng Cai added a comment -

Fixed in HEAD, please review, feel free to reopen, thanks

Show
Dongsheng Cai added a comment - Fixed in HEAD, please review, feel free to reopen, thanks
Hide
Eloy Lafuente (stronk7) added a comment -

Hi Dongsheng,

I think everything is ok... B-) just found one "strange" commit:

http://cvs.moodle.org/moodle/lib/javascript.php?r1=1.38&r2=1.39

What is that intended for?

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Hi Dongsheng, I think everything is ok... B-) just found one "strange" commit: http://cvs.moodle.org/moodle/lib/javascript.php?r1=1.38&r2=1.39 What is that intended for? Ciao
Hide
Dongsheng Cai added a comment -

This commit can fix a javascript error, if the parent window is not existed, it will stop here.

Show
Dongsheng Cai added a comment - This commit can fix a javascript error, if the parent window is not existed, it will stop here.
Hide
Eloy Lafuente (stronk7) added a comment -

aha. Cool! Thanks!

Show
Eloy Lafuente (stronk7) added a comment - aha. Cool! Thanks!

Dates

  • Created:
    Updated:
    Resolved: