简体   繁体   English

如何覆盖用户在Drupal中登录的功能?

[英]How do I override function for users login in Drupal?

I'm trying to change the user login form in drupal, I have created a variation of a theme in its own folder, now I try to change the functions associated to the login like the following: 我正在尝试在drupal中更改用户登录表单,我已经在其自己的文件夹中创建了主题的变体,现在我尝试更改与登录相关的功能,如下所示:

function bartik_modificado_theme() {
return array(
'user_login' => array(
'arguments' => array('form' => NULL),
),
);
}
function bartik_modificado_form_id($form) {
$output.= drupal_render($form);
return $output; 
}

function bartik_modificado_user_login($form) {
$form['links']=t('');
$output.=drupal_render($form);
return $output; 
}

However I don't really know if the correct function to override is user_login (¿Where can I find that function in Drupal 7?) Currently the code doesn't work, please help. 但是我真的不知道是否要覆盖的正确函数是user_login(在Drupal 7中可以在哪里找到该函数?)目前该代码无法正常工作,请提供帮助。

Take a look at hook_form_alter at: https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_form_alter/7 在以下位置查看hook_form_alter: https ://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_form_alter/7

There is also an example for customizing user login forms by overriding the template and specific elements at: 还有一个通过覆盖以下模板和特定元素来自定义用户登录表单的示例:
http://www.wdtutorials.com/2012/05/16/drupal-7-how-customize-user-login-form#.UnNlepTXQ08 http://www.wdtutorials.com/2012/05/16/drupal-7-how-customize-user-login-form#.UnNlepTXQ08

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM