You are here

function flag_get_link_types in Flag 6.2

Same name and namespace in other branches
  1. 5 flag.module \flag_get_link_types()
  2. 6 flag.module \flag_get_link_types()
  3. 7.3 flag.module \flag_get_link_types()
  4. 7.2 flag.module \flag_get_link_types()

Return an array of link types provided by modules.

Parameters

$reset: (Optional) Whether to reset the static cache.

Return value

An array of link types as defined by hook_flag_link_types(). These are keyed by the type name, and each value is an array of properties. In addition to those defined in hook_flag_link_types(), the following properties are set:

  • 'module': The providing module.
  • 'name': The machine name of the type.

See also

hook_flag_link_types()

hook_flag_link_types_alter()

4 calls to flag_get_link_types()
flag_check_link_types in includes/flag.admin.inc
FormAPI after_build function to check that the link type exists.
flag_flag::get_link_type in ./flag.inc
Get the link type for this flag.
_flag_link_type_descriptions in ./flag.module
Return an array of flag link type descriptions.
_flag_link_type_options in ./flag.module
Return an array of flag link types suitable for a select list or radios.

File

./flag.module, line 1623
The Flag module.

Code

function flag_get_link_types($reset = FALSE) {
  static $link_types;
  if (!isset($link_types) || $reset) {
    $link_types = array();
    foreach (module_implements('flag_link_types') as $module) {
      $module_types = module_invoke($module, 'flag_link_types');
      foreach ($module_types as $type_name => $info) {
        $link_types[$type_name] = $info + array(
          'module' => $module,
          'name' => $type_name,
          'title' => '',
          'description' => '',
          'options' => array(),
          'uses standard js' => TRUE,
          'uses standard css' => TRUE,
        );
      }
    }
    drupal_alter('flag_link_types', $link_types);
  }
  return $link_types;
}