// перекрываем callback функцию function mymodule_menu_alter(&$items){ $items['user/%user_uid_optional']['page callback'] = 'mymodule_user_view'; } // в отличии от стандартной, здесь нет загрузки стандартного профиля function mymodule_user_view($account){ drupal_set_title(check_plain($account->name)); returntheme('user_profile', $account); } // убераем стандартные preprocess функции профиля function mymodule_theme_registry_alter(&$theme_registry){ $theme_registry['user_profile']['preprocess functions'] = array('mymodule_preprocess_user_profile'); }
Комментарии
function mymodule_menu_alter(&$items) {
$items['user/%user_uid_optional']['page callback'] = 'mymodule_user_view';
}
// в отличии от стандартной, здесь нет загрузки стандартного профиля
function mymodule_user_view($account) {
drupal_set_title(check_plain($account->name));
return theme('user_profile', $account);
}
// убераем стандартные preprocess функции профиля
function mymodule_theme_registry_alter(&$theme_registry) {
$theme_registry['user_profile']['preprocess functions'] = array('mymodule_preprocess_user_profile');
}