简体   繁体   中英

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.

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');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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