From: Aryeh Gregor Date: Fri, 21 Aug 2009 21:35:52 +0000 (+0000) Subject: Autofocus password, not name, if name is prefilled X-Git-Tag: 1.31.0-rc.0~40148 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=b8755f1127a6ba890c24a888f0f59560b22e341c;p=lhc%2Fweb%2Fwiklou.git Autofocus password, not name, if name is prefilled --- diff --git a/includes/templates/Userlogin.php b/includes/templates/Userlogin.php index 7a173002f9..5a4d3f9c8b 100644 --- a/includes/templates/Userlogin.php +++ b/includes/templates/Userlogin.php @@ -41,9 +41,10 @@ class UserloginTemplate extends QuickTemplate { 'id' => 'wpName1', 'tabindex' => '1', 'size' => '20', - 'required', - 'autofocus' - ) ); ?> + 'required' + # Can't do + array( 'autofocus' ) because + for arrays in PHP + # only works right for associative arrays! Thanks, PHP. + ) + ( $this->data['name'] ? array() : array( 'autofocus' => '' ) ) ); ?> @@ -56,7 +57,7 @@ class UserloginTemplate extends QuickTemplate { 'id' => 'wpPassword1', 'tabindex' => '2', 'size' => '20' - ) ); ?> + ) + ( $this->data['name'] ? array( 'autofocus' ) : array() ) ); ?>