Moving the Choose link to the left column of the file picker in Moodle 1.9

1762
Moodle’s marching on strong with the release of Moodle 2.3. For those of you who have yet to migrate over to Moodle 2.x, here’s another hack for the venerable Moodle 1.9. I’ve used this on my production site, mainly out of necessity. One of the issues I face of the file picker in Moodle 1.9 is that the Choose link is on the far right of the file name.

Post Pages - Post Inline - WIRIS

That’s not really a problem when your file names are short. However, if a particular file name is unusually long, then the Choose link can be difficult to access. To be honest, in my classes, I often switch to 800×600 pixel resolution when projecting a Moodle course page on the whitescreen. So having the Choose link brought forward is really necessary for me.

The change seems trivial but wading through the code is not that easy. Anyway, here’s how to do it. The code to modify is /files/index.php.

Step 1. Cut the code in the block of lines 799 to 803.

Step 2. Paste the block after line 790.

Step 3. Cut the block shown below …


Step 4…. and paste it in here.


Step 5.
Now to adjust the header titles. Cut the following code…

Step 6. …and paste it a few lines above its original position.

Now you can enjoy the fruit of your labour. Check out the screenshots below which begin with the “Add a new resource or link to a website” resource.


Clicking on the “Choose or upload a file” reveals a file picker screen with a facelift! Viva la difference! You screen should now show the Choose link on the left. Mission accomplished.

To make your life much easier, you can download the modified /files/index.php of Moodle 1.9. from here.

Until the next time, happy Moodling!
Frankie Kam
Malaysia

Previous articleWizIQ announces plugin for Moodle 2.3
Next articleEarly Bird Registration for the 1st Moodle Research Conference ends 7/18