You are here

function hs_content_taxonomy_widget_settings in Hierarchical Select 5.3

Same name and namespace in other branches
  1. 6.3 modules/hs_content_taxonomy.module \hs_content_taxonomy_widget_settings()

Implementation of hook_widget_settings().

File

modules/hs_content_taxonomy.module, line 215
Implementation of the Hierarchical Select API for the Content Taxonomy module.

Code

function hs_content_taxonomy_widget_settings($op, $widget) {
  switch ($op) {
    case 'form':
      drupal_add_css(drupal_get_path('module', 'hs_content_taxonomy') . '/hs_content_taxonomy.css');
      $context = _hs_content_taxonomy_parse_context_from_url();
      list($content_type_name, $field_name) = $context;
      $content_type = content_types($content_type_name);
      $url = 'admin/content/types/' . $content_type['url_str'] . '/fields/' . $field_name . '/hs_config';
      $items[] = t("Due to limitations of CCK, there is a separate form to\n        <a href=\"!url\"> configure this Hierarchical Select widget's\n        settings.</a>", array(
        '!url' => url($url),
      ));
      $items[] = t('The %multiple_values field setting is now managed by the Hierarchical
        Select module: it will be enabled when either the %enable_the_dropbox
        or %save_term_lineage settings (or both) are enabled.', array(
        '%multiple_values' => t('Multiple values'),
        '%enable_the_dropbox' => t('Enable the dropbox'),
        '%save_term_lineage' => t('Save term lineage'),
      ));
      $form['hs_config'] = array(
        '#type' => 'fieldset',
        '#title' => t('Hierarchical Select configuration'),
        '#description' => '<p class="cck-hierarchical-select-warning">' . '<span class="highlight">Important!</span>' . '</p>' . theme('item_list', $items),
        '#collapsible' => FALSE,
      );
      return $form;
    case 'callbacks':
      return array(
        'default value' => CONTENT_CALLBACK_NONE,
      );
  }
}