如何显示Drupal的默认表单之一

时间:2011-06-06 02:41:45

标签: drupal drupal-modules drupal-7 drupal-theming

我有一个模块,我想用它来显示Drupal 7的默认表单之一的修改版本。我认为表单ID是user_profile_form,它是用于编辑用户帐户信息的表单。

所以这是我模块的结构:

  1. hook_menu,页面回调函数 - > user_exe_edit() - >
  2. 功能user_exe_edit()来电drupal_get_form(input_simple_form) - >
  3. function input_simple_form($form, &$form_submit)
  4. 现在我需要函数input_simple_form来返回ID为user_profile_form的Drupal表单。

    我该怎么做?

1 个答案:

答案 0 :(得分:0)

您不需要input_simple_form(),但是您需要包含用户模块的页面:

global $user;
// if the user is logged in, otherwise anonymous users will see it
if ($user->uid > 0) {
   module_load_include('inc', 'user', 'user.pages');
   return user_edit($user);
}