You are here

function spaces_types in Spaces 6

Same name and namespace in other branches
  1. 5.2 spaces.module \spaces_types()
  2. 6.3 spaces.module \spaces_types()
  3. 6.2 spaces.module \spaces_types()
  4. 7.3 spaces.module \spaces_types()
  5. 7 spaces.module \spaces_types()

Invokes hook_spaces_types() to gather an array of space types and associated classes.

Implementing modules should provide an associate array in hook_spaces_types() of the following format:

return array( $id => array( 'class' => $space_class, 'title' => $space_type_name, 'purl modifier' => $bool, ), );

Where:

$id: A unique string identifier for this space type. e.g. "og" $space_class: The PHP class to construct for this space. e.g. "spaces_og" $space_type_name: The human-readable name of your space type. e.g. "Group space" $bool: TRUE or FALSE for whether spaces should provide a UI for users to provide a custom URL modifier for each space. If FALSE, the implementing module should implement hook_purl_modifiers() in order to provide PURL modifiers programatically.

Parameters

$reset: Optional reset flag for clearing the static cache.

Return value

An array of space types where $key => $value corresponds to the space type => space class.

12 calls to spaces_types()
spaces_active_space_menu in ./spaces.module
A mild abstraction of hook_menu() items that can be used by implementing modules to embed/graft relevant spaces items into the menu tree. Should only be used when the $may_cache argument of hook_menu() is false.
spaces_basic_form in ./spaces_admin.inc
spaces_context_conditions in ./spaces.module
Implementation of hook_context_conditions().
spaces_context_reactions in ./spaces.module
Implementation of hook_context_reactions().
spaces_features_form in ./spaces_admin.inc

... See full list

File

./spaces.module, line 1132

Code

function spaces_types($reset = false) {
  static $spaces_types;
  if (!isset($spaces_types) || $reset) {
    $spaces_types = module_invoke_all('spaces_types');
  }
  return $spaces_types;
}