【问题标题】:Adding local plugin in the left navigation menu in Moodle在 Moodle 的左侧导航菜单中添加本地插件
【发布时间】: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


    【解决方案1】:

    “站点管理员”菜单?

    如果是这样,您应该通过/local/glossary/settings.php 文件添加菜单

    这里有答案-Moodle - how to add navigation menu in left side menu bar

    更多详情请看-https://docs.moodle.org/dev/Navigation_API#Settings_navigation

    【讨论】:

      猜你喜欢
      • 2014-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-28
      • 2017-08-05
      • 2015-12-24
      • 1970-01-01
      相关资源
      最近更新 更多