Issue Details (XML | Word | Printable)

Key: MDL-13233
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Dongsheng Cai
Reporter: Dan Poltawski
Votes: 0
Watchers: 3
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Emoticons Documentation should be dynamic with the new configuration settings

Created: 30/Jan/08 12:17 AM   Updated: 25/Sep/08 03:14 PM
Return to search
Component/s: Documentation
Affects Version/s: 1.9
Fix Version/s: 2.0

File Attachments: 1. Text File emoticons-2.patch (11 kB)
2. Text File emoticons.patch (18 kB)

Issue Links:
Relates

Participants: Dan Poltawski, Dongsheng Cai, Eloy Lafuente (stronk7), Martin Dougiamas and Nicolas Martignoni
Security Level: None
QA Assignee: Eloy Lafuente (stronk7)
Resolved date: 07/May/08
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_20_STABLE


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

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) added a comment - 21/Apr/08 11:45 PM
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


Martin Dougiamas added a comment - 22/Apr/08 09:49 AM
Sounds perfect, Eloy!

Dongsheng Cai added a comment - 22/Apr/08 11:56 AM
Eloy, I made a patch here, please review, if it is good, I will commit to CVS, thanks.

Dongsheng Cai added a comment - 22/Apr/08 01:37 PM
This patch is against HEAD.

Dongsheng Cai added a comment - 22/Apr/08 01:57 PM
Please ignore my previous patch, try this latest one.

Eloy Lafuente (stronk7) added a comment - 23/Apr/08 07:15 AM
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


Dongsheng Cai added a comment - 24/Apr/08 04:12 PM
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?

Dongsheng Cai added a comment - 29/Apr/08 10:35 AM
The new patch, fix all known problems

Martin Dougiamas added a comment - 30/Apr/08 10:40 AM
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.

Dongsheng Cai added a comment - 30/Apr/08 11:50 AM
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.

Eloy Lafuente (stronk7) added a comment - 01/May/08 07:17 AM
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.


Dongsheng Cai added a comment - 01/May/08 01:14 PM
Fixed, tested, Thanks, Eloy.
Feel free to reopen..

Eloy Lafuente (stronk7) added a comment - 02/May/08 05:57 AM
Feeling happy to close! :-P Thanks!

Nicolas Martignoni added a comment - 02/May/08 05:10 PM
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 ?


Eloy Lafuente (stronk7) added a comment - 05/May/08 05:56 AM
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


Dongsheng Cai added a comment - 06/May/08 12:02 PM
Put a patch here, all the helpbuttons are fixed(`grep "helpbutton(.*(text|richtext|emoticons)" -r /var/www/dev`)

Dongsheng Cai added a comment - 07/May/08 11:09 AM
Fixed in HEAD, please review, feel free to reopen, thanks

Eloy Lafuente (stronk7) added a comment - 12/May/08 06:22 AM
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


Dongsheng Cai added a comment - 12/May/08 09:29 PM
This commit can fix a javascript error, if the parent window is not existed, it will stop here.

Eloy Lafuente (stronk7) added a comment - 14/May/08 06:56 AM
aha. Cool! Thanks!