Hi Abrar.
Well I've successfully implemented your mod and minor hacks as pointed out on your module page. THANK YOU FOR A WONDERFUL RESOURCE!
Initially I though that it could be used just for multi-lines labels. Then it dawned upon me that I could use it to store embedded Web 2.0 code so that I can save vertical space on my Moodle coursepages.
Here'a screenshot of the Accordion resource in a closed-state on my site:
If I do a mouse over with my mouse pointer, the Accordian tab changes colour to a green pattern and colour (actually the original colour was blue but I wanted something that harmonised with my coursepage theme's colour):
And after I click on the green rounded tab, the Accordion opens up and I get:
I can immediately see the application of your Moodle 1.9.x Accordion resource (does Moodle 2.0.x have this mod?):
I. Reduce / Eliminate the infamous Moodle "Scroll of Death" (SOD)
- by emdedding Web 2.0 embed code (e.g., Moodle labels, Youtube, Blip.tv, any HTML code, etc.).
- On my Moodle courses, I use the Accordion resource together with the Collapsible Topics format to keep things simple and neat. This helps to cut down the SOD to a manageable level. What do you think?
II. Aesthetic Visual effect
- Nice pop-down effect of the embedded HTML or Web 2.0 code object (e.g., Blip.tv or Youtube video)
II. A choice of NOT using links which lead to pop-up WIndows
- With this Accordion Resource, a link to a webpage or that in turn opens out to a new Window, can be done away with. Instead of this clumbersome way of displaying Web 2.0 code, you can now have an Accordion link that opens to reveal the Web 2.0 object (e.g. Youtube or Blip.tv video) up in a pop-down method without leaving the Moodle coursepage!
Installing the mod
Your code works, but I spend a couple of hours to figure out exactly how to edit the file "..\course\lib.php" as it was not clear from the module page. Type the hack code wrongly or in the wrong way, and you end up crashing your lib.php code. So a backup of the original lib.php is a must so that you can restore it in case the worst happens.
Well for the benefit of others, the bold-faced black colour code shows where exactly the hack code is to be inserted inside the lib.php file. Here it is:
...starting from line 1356...
if (!empty($CFG->enablegroupings) && !empty($mod->groupingid) && has_capability('moodle/course:managegroups', get_context_instance(CONTEXT_COURSE, $course->id))) {
if (!isset($groupings)) {
$groupings = groups_get_all_groupings($course->id);
}
echo " <span class=\"groupinglabel\">(".format_string($groupings[$mod->groupingid]->name).')</span>';
}
} elseif ($mod->modname=="accordion") {
include('../mod/accordion/accordionlib.php');
} else { // Normal activity
...
The code and files I used to implement your Accordian Resource can be downloaded from here. Caution! Read the instructions by Abrar found here.
I also used http://pixlr.com/express/ to change the colour of the Accordian bars to suit my Moodle theme. Works for me.
If anyone needs any help getting this Accordion resource running on his or her Moodle site, feel free to contact me at boonsengkam at gmail dot com. And for a LIVE demo, you can login to my website http://scm.moodleace.com by using:
Username: student
Password: moodle
Specifically, you can head over to http://scm.moodleace.com/course/view.php?id=8
Lastly Abrar, if you are reading this, THANK YOU.
Regards
Frankie Kam
Melaka, Malaysia
"Malaysia can Moodle"