【发布时间】:2015-05-22 11:08:42
【问题描述】:
我是 moodle 的新手。我已经创建了一个本地插件 setmotd。
新菜单项未添加到站点管理中。
使用moodle 2.8.5
在 lib.php 中我放置了函数:
function local_setmotd_extends_settings_navigation($settingsnav, $context)
{
global $CFG, $PAGE;
/*
// Only let users with the appropriate capability see this settings item.
if( ! has_capability('local_plugin/setmotd:view', $context) )
{
return;
}
*/
if($settingnode = $settingsnav->find('root', navigation_node::TYPE_SETTING))
{
$setMotdMenuLbl = get_string('menutitle', 'local_setmotd');
$setMotdUrl = new moodle_url('/local/setmotd/set_motd.php');
$setMotdnode = navigation_node::create(
$setMotdMenuLbl,
$setMotdUrl,
navigation_node::NODETYPE_LEAF);
if ($PAGE->setMotdUrl->compare($setMotdUrl, URL_MATCH_BASE)) {
$setMotdnode->make_active();
}
$settingnode->add_node($setMotdnode);
}
}
请帮忙。
【问题讨论】:
标签: moodle