Contributions API

i18nprofile_menu_alter

Definition

i18nprofile_menu_alter(&$items)
contributions/i18n/i18nprofile/i18nprofile.module, line 58

Description

Implementation of hook_menu_alter().

Replace title callbacks for profile categories

Code

<?php
function i18nprofile_menu_alter(&$items) {
  $empty_account = new stdClass();
  if (($categories = _user_categories($empty_account)) && (count($categories) > 1)) {
    foreach ($categories as $key => $category) {
      // 'account' is already handled by the MENU_DEFAULT_LOCAL_TASK.
      $path = 'user/%user_category/edit/'. $category['name'];
      if ($category['name'] != 'account' && !empty($items[$path])) {
        $items[$path]['title callback'] =  'i18nprofile_translate_category'; // Was 'check_plain',
        $items[$path]['title arguments'] = array($category['title']); // Was array($category['title'])
      }
    }
  }
}
?>