Simplify form_alter logic by using hook_form_FORM_ID_alter
robertDouglass - February 8, 2009 - 22:22
| Project: | Webmail Plus |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | ApacheSolr |
Jump to:
Description
<?php
function webmail_plus_solr_form_alter(&$form, $form_state, $form_id) {
if($form_id=='apachesolr_settings') {
$form['webmail_plus_solr_notice'] = array (
'#type' => 'item',
'#value' => t('You have Webmail Plus Solr installed. To configure Solr for Webmail Plus please follow !thislink and then click on the Solr Search section.', array('!thislink' => l(t('this link'), 'admin/settings/webmail_plus'))),
'#weight' => -1
);
}
if($form_id!='webmail_plus_admin_settings') return;
?>http://api.drupal.org/api/function/hook_form_FORM_ID_alter/6

#1