You are here

function insert_widget_settings_alter in Insert 6

Implementation of hook_widget_settings_alter().

File

./insert.module, line 256
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_widget_settings_alter(&$settings, $op, $widget) {

  // Only support modules that implement hook_insert_widgets().
  $widget_type = isset($widget['widget_type']) ? $widget['widget_type'] : $widget['type'];
  if (!in_array($widget_type, array_keys(insert_widgets()))) {
    return;
  }

  // Add our new options to the list of settings to be saved.
  if ($op == 'save') {
    $settings = array_merge($settings, insert_widget_settings());
  }

  // Add the additional settings to the form.
  if ($op == 'form') {
    $settings = array_merge($settings, insert_widget_form($widget));
  }
}