diff --git a/src/admin/charts.php b/src/admin/charts.php index 818274a..9a7e72c 100644 --- a/src/admin/charts.php +++ b/src/admin/charts.php @@ -517,7 +517,7 @@ if ( !isset($_POST['op']) && !isset($_GET['op']) ) // --- Check if Enable/Disable Button was clicked and add Autofocus code! if ( isset($content['CHARTID']) && $content['CHARTID'] == $myChart['ID'] ) - $content['EXTRA_JAVASCRIPT'] .= ""; + AddWindowLoadFocus("chartenablebutton" . $myChart['ID']); // --- } // --- diff --git a/src/admin/index.php b/src/admin/index.php index a7451a7..e75903c 100644 --- a/src/admin/index.php +++ b/src/admin/index.php @@ -98,16 +98,16 @@ if ( isset($_GET['op']) && isset($_GET['value']) ) // Set UserOption $USERCFG['UserOverwriteOptions'] = 1; - // Add some javascript to FOcus the enable/disable user button - $content['EXTRA_JAVASCRIPT'] .= ""; + // Focus the enable user button + AddWindowLoadFocus("buttonenableuseropt"); } else { // Set UserOption $USERCFG['UserOverwriteOptions'] = 0; - // Add some javascript to FOcus the enable/disable user button - $content['EXTRA_JAVASCRIPT'] .= ""; + // Focus the disable user button + AddWindowLoadFocus("buttondisableuseropt"); } diff --git a/src/admin/users.php b/src/admin/users.php index 8acd5d2..2dcf619 100644 --- a/src/admin/users.php +++ b/src/admin/users.php @@ -456,9 +456,9 @@ if ( !isset($_POST['op']) && !isset($_GET['op']) ) $content['USERID'] == $content['USERS'][$i]['ID'] ) { if ( $_GET['miniop'] == "setisadmin" ) - $content['EXTRA_JAVASCRIPT'] .= ""; + AddWindowLoadFocus("userisadminbutton" . $content['USERS'][$i]['ID']); else if ( $_GET['miniop'] == "setisreadonly" ) - $content['EXTRA_JAVASCRIPT'] .= ""; + AddWindowLoadFocus("userisreadonlybutton" . $content['USERS'][$i]['ID']); } // --- diff --git a/src/include/functions_common.php b/src/include/functions_common.php index cbc9a56..5d9f9db 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -1529,6 +1529,18 @@ function AddContextLinks(&$sourceTxt) $sourceTxt = preg_replace_callback( '/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/i', "InsertLookupLinkIP", $sourceTxt ); } +/* +* AddContextLinks +*/ +function AddWindowLoadFocus($szFieldID) +{ + global $content; + + // Add Javascript to Focus a specific element + $content['EXTRA_JAVASCRIPT'] .= ""; +} + + /* * Helper to create a Lookup Link! */