You are here

function accountmenu_form_alter in Account menu 7

Same name and namespace in other branches
  1. 6 accountmenu.module \accountmenu_form_alter()

Implementation of hook_form_alter.

File

./accountmenu.module, line 294
accountmenu.module Provide a dynamic Log in/My account/Log out account menu

Code

function accountmenu_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'menu_edit_item') {
    if (!empty($form['options']['#value']['accountmenu_link_title'])) {
      $form['link_title']['#default_value'] = $form['options']['#value']['accountmenu_link_title'];
    }
    if ($form['link_path']['#value'] == 'user/self') {
      $form['link_title']['#description'] .= '  The tokens <i>@name</i> (login) and <i>@realname</i> (realname, requires Realname module) are available for this menu item.';
    }
  }
}