function spaces_types in Spaces 6.2
Same name and namespace in other branches
- 5.2 spaces.module \spaces_types()
- 6.3 spaces.module \spaces_types()
- 6 spaces.module \spaces_types()
- 7.3 spaces.module \spaces_types()
- 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, 'file' => $direct_path_to_file ), );
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. $direct_path_to_file: the relative path from the Drupal root to the file that defines the PHP class. (Optional)
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.
11 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.
- spaces_basic_form in ./
spaces_admin.inc - BASIC FORM =========================================================
- spaces_context_conditions in ./
spaces.module - Implementation of hook_context_conditions().
- spaces_features_form in ./
spaces_admin.inc - FEATURE SETTINGS ===================================================
- spaces_load in ./
spaces.module - Load a space.
File
- ./
spaces.module, line 802
Code
function spaces_types($reset = false) {
static $spaces_types;
if (!isset($spaces_types) || $reset) {
$spaces_types = module_invoke_all('spaces_types');
}
return $spaces_types;
}