Social forum

Code review and fixes proposals for autoview

 
Picture of Valery Fremaux
Code review and fixes proposals for autoview
by Valery Fremaux - Monday, 28 April 2008, 4:10 PM
 

HiTim,

here is a complete archive of reviewed autoview with important patches and alternative resources (french files)

check the file report_05_08.txt for a list of major patches that were found in order to :

  • get correct languange initialization on non english platforms
  • get user-contextual initialization depending on Moodle recorded language for the use.
  • all french files reviewed
  • hard coded strings in XSL pulled back for internationalization
  • some small fixes
  • moodle side code review with phpdoc documentation add-ons

detailed report in the file.

Take as much seems relevant to you...

Cheers.

Picture of Tim Williams
Re: Code review and fixes proposals for autoview
by Tim Williams - Tuesday, 6 May 2008, 1:51 PM
 

French translations have now been copied across to the dev code. Going through your other patches, comments below :

php files have been lightly be "beautified" as to cope with Moodle standard writing habits and Developer Recomendations (http://docs.moodle.org/en/Development:Coding).
all php files "phpdoc" headers written for future third party documentation generation by Moodle.org.
all in-code documentation reviewed for "phpdoc" compliance.
Will look into this shortly.

php files where print_header where patched for compatibility with 1.9 versions (dual compatibility 1.8/1/9), using build_navigation().
Added to current dev code.

autoview.php was patched §91 to add french avedit support.
Added to current dev code.

recieveXML.php was patched from §30 to §34 to get rid of deprecated isteacher() function.
db/access.php added for setting a "mod/autoview:edit" capability for teachers and similar roles. (refer previous)
I think we both fixed this at the same time, I added my own role code and removed the isteacher() calls from the dev code a few weeks ago.

version.php locally incremented for capability loading (may not cope with yours now) (refer previous)
Not a problem

view.php was patched to set initial left frame to 250 pix, better copes with french strings for editor.
Could be an issue for other languages too, so this change has been made in the dev code.

in editor.js, some strings still hardcoded in optionsDisplay(), fixed and replaced by getString() calls. Added to current dev code.

in autoview.php, passing an additional currentUserLang, based on the real language used by the user to initialize autoview language.
in templates/autoview.xsl : imported currentUserLang parameter and passed to Javascript §99 to §101 (refer previous)
in vresource/autoview.js : added code §541 to §548 for searching moodle imported user language
Added to dev code with modifications.

  • Using a method setPreferedLang to set the specify the user language instead of setting a variable. This fits in with the way other parameters are set and ensures compatibility of the autoview core with older presentations that use handwritten config files.
  • _utf8 stripped out in php code before being passed through to XSL.