You are here

function insert_widgets in Insert 7

Same name and namespace in other branches
  1. 6 insert.module \insert_widgets()

Get a list of all supported field widgets.

3 calls to insert_widgets()
insert_element_info in ./insert.module
Implements hook_element_info().
insert_form_field_ui_field_edit_form_alter in ./insert.module
Implements hook_form_alter().
insert_widget_load in ./insert.module
Load a single insert field widget info.

File

./insert.module, line 212
Allows insertion of files, images, and other media directly into the body field by using an "Insert" button next to the uploaded file.

Code

function insert_widgets($reset = FALSE) {
  static $widgets;
  if (!isset($widgets) || $reset) {
    $widgets = array();
    foreach (module_implements('insert_widgets') as $module) {
      $module_widgets = module_invoke($module, 'insert_widgets');
      foreach ($module_widgets as $type => $widget) {
        $module_widgets[$type]['type'] = $type;
        $module_widgets[$type]['module'] = $module;
      }
      $widgets = array_merge($widgets, $module_widgets);
    }
    drupal_alter('insert_widgets', $widgets);
  }
  return $widgets;
}