You are here

function optionwidgets_help in Content Construction Kit (CCK) 5

Implementation of hook_help().

File

./optionwidgets.module, line 11
Defines selection, check box and radio button widgets for text and numeric fields.

Code

function optionwidgets_help($section) {
  if (preg_match('|^admin/content/types/([^/]*)/fields/([^/]*)$|', $section, $matches)) {
    if (($field = content_fields($matches[2], $matches[1])) && in_array($field['widget']['type'], array_keys(optionwidgets_widget_info()))) {
      $output = t('Create a list of options as a list in <strong>Allowed values</strong> or as an array in PHP code at the bottom of this page. These values will be the same for the %field in all content types. ', array(
        '%field' => $field['widget']['label'],
      ));
      if ($field['widget']['type'] == 'options_onoff') {
        $output .= '<br/>' . t('For a \'Single on/off checkbox\' widget, define the \'off\' value first, then the \'on\' value in the <strong>Allowed values</strong> section. Note that the checkbox will be labeled with the label of the \'on\' value.');
      }
      else {
        $output .= '<br/>' . t('The \'Checkboxes / radio buttons\' widget will display checkboxes if the multiple values option is selected for this field, otherwise radios will be displayed.');
      }
      return $output;
    }
  }
}