* $form['date'] = array( * '#type' => 'textfield', * '#extendeddescription' => t('This is additional information about the field.') * ); * */ /** * Implementation of hook_help(). */ function extendeddescription_help($section) { switch ($section) { case 'admin/modules#description': return t('Provide an extended description of a form element that is displayed when a user clicks a link.'); } } /** * Implementation of hook_form_alter(). */ function extendeddescription_form_alter($form_id, &$form) { if (_extendeddescription_has_description($form_id, $form)) { extendeddescription_load(); } } /** * Parse extended description data and add to form as needed. */ function _extendeddescription_has_description($form_id, &$form, $keys = array()) { static $has_description = array(); if (!isset($has_description[$form_id])) { $has_description[$form_id] = FALSE; } // Test if child elements have the 'extendeddescription' class set. foreach (element_children($form) as $key) { if (isset($form[$key]) && isset($form[$key]['#extendeddescription'])) { $form[$key]['#suffix'] = '