Autofocus "Enable/disable personal Options" button in admin panel

Added javscript code to automatically set focus on the button after
page load.
This commit is contained in:
Andre Lorbach 2015-03-26 10:49:10 +01:00
parent b91d3256b5
commit 1b2bf32dde
2 changed files with 14 additions and 1 deletions

View File

@ -94,10 +94,23 @@ if ( isset($_GET['op']) && isset($_GET['value']) )
{
$iNewVal = intval($_GET['value']);
if ( $iNewVal == 1 )
{
// Set UserOption
$USERCFG['UserOverwriteOptions'] = 1;
// Add some javascript to FOcus the enable/disable user button
$content['EXTRA_JAVASCRIPT'] .= "<script>window.onload = function(){ document.getElementById('buttonenableuseropt').focus(); };</script>";
}
else
{
// Set UserOption
$USERCFG['UserOverwriteOptions'] = 0;
// Add some javascript to FOcus the enable/disable user button
$content['EXTRA_JAVASCRIPT'] .= "<script>window.onload = function(){ document.getElementById('buttondisableuseropt').focus(); };</script>";
}
// Enable User Options!
WriteConfigValue( "UserOverwriteOptions", false, $content['SESSION_USERID'] );
}

View File

@ -23,7 +23,7 @@
</br>
<!-- ENDIF isupdateavailable="true" -->
<form action="" method="post">
<form action="" method="post" name="mainform">
<table border="0" cellpadding="1" cellspacing="1" width="80%" align="center" class="table_with_border">
<tr>
<td colspan="2">&nbsp;</td>