You are here

function spaces_types in Spaces 5.2

Same name and namespace in other branches
  1. 6.3 spaces.module \spaces_types()
  2. 6 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, 'custom prefixes' => $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 prefix path for each space. If FALSE, the implementing module should implement hook_context_prefix_prefixes() in order to provide prefixes programmatically.

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_prefix_provider in ./spaces.module
Implementation of hook_context_prefix_provider().
spaces_handler_filter_type in ./spaces_views.inc
Spaces view filter handler.
spaces_load in ./spaces.module
Load a space.

... See full list

File

./spaces.module, line 775

Code

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