Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Onload function
At the signin page it says
<body onload="Focus('txtUsername');">
how can i remove that function?
0
This discussion has been closed.
Comments
using the 'PreNoPostBackRender' delagation of the SignInForm Control:
<?php /* Extension Name: MyExtension Extension Url: n/a Description: Remove Sign-in body attributes. Version: 0.1.0 Author: Me Author Url: n/a */ function MyExtension_RemoveOnloadFnc(&$SignInForm){ $SignInForm->Context->BodyAttributes = ''; /** * or * $SignInForm->Context->BodyAttributes = str_replace( * " onload=\"Focus('txtUsername');\"", * '', * $SignInForm->Context->BodyAttributes); */ } $Context->AddToDelegate('SignInForm', 'PreNoPostBackRender', 'MyExtension_RemoveOnloadFnc');
Put that in /extensions/MyExtension/default.php and enable the extension on the extension setting page.
function MyExtension_RemoveOnloadFnc(&$SignInForm){ if ($SignInForm->IsPostBack) { $SignInForm->Context->BodyAttributes = ''; /** * or * $SignInForm->Context->BodyAttributes = str_replace( * " onload=\"Focus('txtUsername');\"", * '', * $SignInForm->Context->BodyAttributes); */ } } $Context->AddToDelegate('SignInForm', 'Constructor', 'MyExtension_RemoveOnloadFnc');
But you will have to had $this->CallDelegate('Constructor'); line 85 of /library/People/People.Control.SignInForm.php so that it look like :
function SignInForm(&$Context, $FormName) { ... } $this->Context->BodyAttributes = " onload=\"Focus('txtUsername');\""; } $this->CallDelegate('Constructor'); }
The delegation will be added to the core. You have to to change /library/People/People.Control.SignInForm.php after the next release.