Commit 4df1eb31 authored by Penny Leach's avatar Penny Leach
Browse files

add watchlist to menu and now completely untested helper function to

get artefact instance by id
parent d439e22b
......@@ -959,6 +959,11 @@ function main_nav() {
'link' => $wwwroot . 'account/activity/preferences/',
'section' => 'mahara',
),
array(
'name' => 'watchlist',
'link' => $wwwroot . 'account/watchlist/',
'section' => 'mahara',
),
),
);
......@@ -1257,6 +1262,20 @@ function rebuild_artefact_parent_cache_complete() {
db_commit();
}
function artefact_instance_from_id($id) {
$prefix = get_config('dbprefix');
$sql = 'SELECT a.*, i.plugin
FROM ' . $prefix . 'artefact a
JOIN ' . $prefix . 'artefact_installed_type i ON a.artefacttype = i.name
WHERE a.id = ?';
if (!$data = get_record_sql($sql, array($id))) {
throw new ArtefactNotFoundException(get_string('artefactnotfound'));
}
$classname = generate_artefact_class_name($data->artefacttype);
safe_require('artefact', $data->plugin);
return new $classname($id, $data);
}
/**
* Configures a default form
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment