Hi,

I'd like to thank litwol|mac and jredding for guiding me along on building this mini module.
But right now I'm kinda jammed up with overriding the "function user_login()"
Is there anyone who can give me some pointers on overriding the "function user_login()"s #value in this code below?

$form['submit'] = array('#type' => 'submit', '#value' => t('Log in'), '#weight' => 2, '#attributes' => array('tabindex' => '3'));

A summary on my mini-module journey:
Aim : Create a module which allows the admins (end users) to freely edit the "Log in" and "Register" button's text.

Accomplished:

  • I have created the module and drupal found it
  • Module settings form in the admin menu (the text field for replacing login button's text)
  • Problem: Now that I have a variable to call on to the override function of the "Log in" button, I'm stucked with how to come up with the override function.
    I have read and studied the API http://api.drupal.org/api/function/t and support forum http://drupal.org/node/143822 , but just can't get a clear understanding on;

  1. function override
  2. how I can implement it into the module to get the aim above
  3. ps: i'm still new to drupal, so the terms that is used in this post might be kinda strange to some drupal veterens out there. i consider myself a student of drupal, feel free to correct me. thanks =D

    Cheers
    Logi

Comments

yuriy.babenko’s picture

You could implement hook_form_alter() to modify the form :).

Be warned though: modifying the #value of a submit button usually leads to form validation/submit problems. Make sure to thoroughly test this out.

---
Yuriy Babenko
www.yubastudios.com
My Drupal tutorials: http://yubastudios.com/blog/tag/tutorials

---
Yuriy Babenko | Technical Consultant & Senior Developer
http://yuriybabenko.com