Index: lib/moodlelib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/moodlelib.php,v retrieving revision 1.960.2.24 diff -u -r1.960.2.24 moodlelib.php --- lib/moodlelib.php 1 Jan 2008 17:21:54 -0000 1.960.2.24 +++ lib/moodlelib.php 15 Jan 2008 00:33:31 -0000 @@ -4889,6 +4889,7 @@ 'enrol_' => array('enrol'), 'filter_' => array('filter'), 'format_' => array('course/format'), + 'local' => array('local'), 'qtype_' => array('question/type'), 'report_' => array($CFG->admin.'/report', 'course/report', 'mod/quiz/report'), 'resource_' => array('mod/resource/type'), @@ -5018,7 +5019,7 @@ $type = ''; $plugin = $module; } else { - $type = substr($module, 0, $dividerpos + 1); + $type = substr($module, 0, $dividerpos); $plugin = substr($module, $dividerpos + 1); } if (!empty($rules[$type])) { Index: lib/locallib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/locallib.php,v retrieving revision 1.10 diff -u -r1.10 locallib.php --- lib/locallib.php 17 Aug 2007 19:09:19 -0000 1.10 +++ lib/locallib.php 15 Jan 2008 00:33:31 -0000 @@ -48,6 +48,45 @@ * with $oldversion set to 0, so that all the updates run. * * + * Local capabilities + * ------------------ + * + * If your local customisations require their own capabilities, use + * + * local/db/access.php + * + * You should create an array called $local_capabilities, which looks like: + * + * $local_capabilities = array( + * 'local/component:capability' => array( + * 'captype' => 'read', + * 'contextlevel' => CONTEXT_SYSTEM, + * ), + * ); + * + * + * Local language support + * ---------------------- + * + * Moodle supports looking in the local/ directory for language files. + * Say your local language file related to a new feature called foo, + * You would create: + * local/foo/lang/en_utf8/local_foo.php + * and then call strings like get_string('key', 'local_foo'); + * + * + * Local admin menu items + * ---------------------- + * + * It is possible to add new items to the admin_tree block. + * To do this, create a file, local/localsettings.php + * which can access the $ADMIN variable directly and add things to id. + * You might do something like: + * $ADMIN->add('root', new admin_category('foo', get_string('key','local_foo'))); + * $ADMIN->add('foo', new admin_externalpage($name, $title, $url, $cap); + * + * + * * Course deletion * --------------- * @@ -99,6 +138,9 @@ $db->debug=true; if (xmldb_local_upgrade($CFG->local_version)) { $db->debug=false; + if (!update_capabilities('local')) { + error('Could not set up the local capabilities'); + } if (set_config('local_version', $local_version)) { notify(get_string('databasesuccess'), 'notifysuccess'); notify(get_string('databaseupgradelocal', '', $local_version), 'notifysuccess');