You are here

function spaces_customtext_form_spaces_features_form_alter in Spaces 7.3

Same name and namespace in other branches
  1. 6.3 spaces_customtext/spaces_customtext.module \spaces_customtext_form_spaces_features_form_alter()
  2. 7 spaces_customtext/spaces_customtext.module \spaces_customtext_form_spaces_features_form_alter()

Implements hook_form_alter() for spaces_features_form().

File

spaces_customtext/spaces_customtext.module, line 136
Spaces Custom Text.

Code

function spaces_customtext_form_spaces_features_form_alter(&$form, &$form_state) {
  $parent = menu_get_item();
  if (isset($form['settings'])) {
    foreach (element_children($form['settings']) as $feature) {
      $link = l(t('Customize text'), "{$parent['href']}/customtext/{$feature}");
      $link = !empty($form['settings'][$feature]['#value']) ? " | {$link}" : $link;
      if (isset($form['settings'][$feature]['#value'])) {
        $form['settings'][$feature]['#value'] .= $link;
      }
      else {
        $form['settings'][$feature]['#value'] = $link;
      }
    }
  }
}