reopening:
1/ M.util.in_array() not in cvs yet (committed)
2/ the gui_header_js is mixing three different inits in one huge class which is extremely confusing, going to split it into 3 separate init functions with standard coding style
3/ gui_ajax - there is incorrect new function() { handler code } in the mouse events, also I do not like the YUI.add() stuff much (the same as in 2/)
I personally think the YUI.add() is worse than real external YUI modules because:
- the requires at the bottom of YUI.add does not work and has to be duplicated in the standard PHP $module->requires
- there are some changes planned in YUI 3.1.x that may significantly change how loading of YUI modules works, I took that into consideration when designing the ->js_init_call() and ->js_module()
- the Y is duplicated - first in YUI.add callback and then in js_init_call which is confusing
In general the mod/chat/ is not the best example how to write modular modules because the chat interfaces are not real plugins, going to note this both in PHP and JS code.
I was kind of surprised to see the "themes" in the code, I think this duplication should be removed or at least it should by renamed to something else, not theme.
There is another pending problem in chatd.php because it needs the allow_call_time_pass_reference which is deprecated in 5.3 and will be remove in PHP 6. In theory it might be possible to make the ajax chat fast enough and remove the chat deamon+sockets client+gui_header...... (probably Moodle 2.1 target)
Committing my refactored code, please close after review, feel free to propose any improvements...
All YUI3 now + tested, still not the nicest module but major improvements will probably come as of 2.1.
Let me know if you spot any problems Petr,
Cheers
Sam