【发布时间】:2021-10-19 12:28:50
【问题描述】:
我会在左侧导航菜单中添加我的本地插件。但是,我在 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;
}
这是我的版本.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);
【问题讨论】:
标签: moodle