我会在左侧导航菜单中添加我的本地插件。但是,我在lib.php中编写的代码块没有运行,也没有在导航菜单中显示我的插件。
你能帮帮我吗?这是我的lib.php
<?php
function local_glossary_extend_navigation(global_navigation $navigation){
$main_node = $navigation->add(get_string('glossary','local_glossary'), '/local/glossary/');
$main_node->nodetype=1;
$main_node->collapse = false;
$main_node->forceopen = true;
$main_node->isexpendable = false;
$main_node->showinflatnavigation = true;}
这是我的version.php
<?php
$plugin->version = 2020061510.00;
$plugin->requires = 2020060900;
$plugin->component = 'local_glossary';
$plugin->cron = 0;
$plugin->release = '1.0';
$plugin->maturity = MATURITY_STABLE;这是我的index.php
$PAGE->set_url('/local/glossary/index.php');
$PAGE->set_context(context_system::instance());
$PAGE->requires->jquery();
require_login();
$strpagetitle=get_string('glossary','local_glossary');
$strpageheading=get_string('glossary','local_glossary');
$PAGE->set_title($strpagetitle);
$PAGE->set_heading($strpageheading);发布于 2021-10-20 09:19:34
“站点管理”菜单?
如果是,则应通过/local/glossary/settings.php文件添加菜单
这里有一个答案-- Moodle - how to add navigation menu in left side menu bar
有关更多详细信息,请参阅- https://docs.moodle.org/dev/Navigation_API#Settings_navigation
https://stackoverflow.com/questions/69630834
复制相似问题