简体   繁体   English

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

[英]How to integrate a non-node module into Open Atrium as a feature

I have built a non-node module and I wish to integrate it with Open Atrium as a feature. 我已经构建了一个非节点模块,并且希望将其与Open Atrium集成为一个功能。

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. 谢谢,格雷格。

Ok, I figured it out: 好的,我知道了:

The access callback should be 'spaces_access_feature', and the access arguments should be array('view', 'test_feature'); 访问回调应为'spaces_access_feature',访问参数应为array('view','test_feature');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM