Hi Gareth,
Git is very powerful, but can take a bit of getting your head around. The usage I was suggesting is to perform an interactive rebase to then combine commits together. I wrote a
blog post on splitting commits ages ago (
http://thamblings.blogspot.com/2010/08/power-of-git-splitting-commit.html). The process of squashing (merging) commits together is very similar. Essentially though:
git checkout -b rebase
git rebase -i HEAD~4
(change the 'pick' to a 'squash' for the commits you wish to merge and save + exit your editor)
For the pix_url bits, You should be able to use a CSS syntax like:
background: url([[pix:i/arrow_down]])
and in your JavaScript:
M.util.image_url('i/arrow_down');
require_capability should work in a very similar way to has_capability as you suggest, but will throw an error instead. The code in the topics/format uses has_capability to only apply logic to certain areas. Thinking about it, you probably don't want to wrap that require_capability in an if statement as the exception will break out anyway:
$PAGE->set_context($coursecontext);
require_capability('moodle/course:update', $coursecontext);
if (!$PAGE->user_is_editing()) {
$courseurl = new moodle_url('/course/view.php', array('id' => $courseid))
redirect($courseurl);
}
It's generally safest not to write the XML by hand, but to use the XMLDB editor - see the usage documentation on the developer pages at
http://docs.moodle.org/dev/XMLDB_editor
It will create the XML for you and ensure that the all of the fields are correct. It's also capable of generating the PHP required in the upgrade.php file.
The sesskey stuff ensures that malicious links don't make changes without your realising (e.g. a bookmark for the show/hide button could be problematic). Thinking about it, in your case it probably isn't required for this.
Andrew