如何将非节点模块作为一项功能集成到 Open Atrium 中

发布于 2024-10-07 12:46:38 字数 841 浏览 0 评论 0原文

我已经构建了一个非节点模块,我希望将其与 Open Atrium 集成作为一项功能。

我尝试了一个测试功能来尝试“破解功能”、空间和开放中庭的代码,因为文档没有涵盖这个主题,而且我对功能、空间和开放中庭很陌生。

我使用 features 创建了一个功能,然后自定义了信息和模块文件。

信息文件:

core = "6.x"
description = "A test feature"
name = "Test Feature"
package = "Features"
spaces[types][] = "og"
features[][] = ""code here

模块文件:

function test_feature_menu()
  {
    $items['ftest'] = array(
      'title' => 'Test Feature',
      'page callback' => 'test_feature_page',
      'access callback' => 'spaces_menu_access',
      'type' => MENU_NORMAL_ITEM,
      'menu_name' => 'features'
    );
  }

function test_feature_page()
{
  $output = 'test';
  return $output;
}

该功能显示在功能部分中,启用后,无论我在哪个组中,都会显示在功能菜单中。此外,组将功能设置为禁用,但该项目仍然显示在菜单中。

有人能解释一下吗?

谢谢, 格雷格.

I have built a non-node module and I wish to integrate it with Open Atrium as a feature.

I've experimented with a test feature to try "crack the code" of features, spaces, and open atrium, as the documentation does not cover this topic and I'm new to features, spaces, and open atrium.

I created a feature using features and then customised the info and module files.

Info file:

core = "6.x"
description = "A test feature"
name = "Test Feature"
package = "Features"
spaces[types][] = "og"
features[][] = ""code here

Module file:

function test_feature_menu()
  {
    $items['ftest'] = array(
      'title' => 'Test Feature',
      'page callback' => 'test_feature_page',
      'access callback' => 'spaces_menu_access',
      'type' => MENU_NORMAL_ITEM,
      'menu_name' => 'features'
    );
  }

function test_feature_page()
{
  $output = 'test';
  return $output;
}

The feature appears in the features section, and when enabled, appears in the features menu regardless of what group I am in. Further, the groups have the feature set as disabled, but the item still appears in the menu.

Can anyone shed some light on this?

Thanks,
Greg.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷夜 2024-10-14 12:46:38

好吧,我想通了:

访问回调应该是 'spaces_access_feature',访问参数应该是 array('view', 'test_feature');

Ok, I figured it out:

The access callback should be 'spaces_access_feature', and the access arguments should be array('view', 'test_feature');

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文