Commit 4ae480c5 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1744351: Hide the xmlrpc specific fields when not using them



In the add/edit webservice users/tokens screens

behatnotneeded

Change-Id: I9921dd5408c39cbd2f449a89ddc7f177e2551aab
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent bddbc2b1
......@@ -176,8 +176,28 @@ $form = array(
$pieform = pieform_instance($form);
$form = $pieform->build(false);
$inlinejs = <<<EOF
function toggle_xmlrpc_part() {
if ($('#allocate_webservice_tokens_wssigenc').is(':checked')) {
$('#allocate_webservice_tokens_publickey_container').show();
$('#allocate_webservice_tokens_publickeyexpires_container').show();
}
else {
$('#allocate_webservice_tokens_publickey_container').hide();
$('#allocate_webservice_tokens_publickeyexpires_container').hide();
}
}
jQuery(function($) {
$('#allocate_webservice_tokens_wssigenc_container').on('click', function() {
toggle_xmlrpc_part();
});
toggle_xmlrpc_part();
});
EOF;
$smarty = smarty(array(), array('<link rel="stylesheet" type="text/css" href="' . $THEME->get_url('style/webservice.css', false, 'auth/webservice') . '">',));
safe_require('auth', 'webservice');
$smarty->assign('INLINEJAVASCRIPT', $inlinejs);
$smarty->assign('token', $dbtoken->token);
$smarty->assign('form', $form);
$heading = get_string('tokens', 'auth.webservice');
......
......@@ -187,8 +187,28 @@ $form = array(
$pieform = pieform_instance($form);
$form = $pieform->build(false);
$inlinejs = <<<EOF
function toggle_xmlrpc_part() {
if ($('#allocate_webservice_users_wssigenc').is(':checked')) {
$('#allocate_webservice_users_publickey_container').show();
$('#allocate_webservice_users_publickeyexpires_container').show();
}
else {
$('#allocate_webservice_users_publickey_container').hide();
$('#allocate_webservice_users_publickeyexpires_container').hide();
}
}
jQuery(function($) {
$('#allocate_webservice_users_wssigenc_container').on('click', function() {
toggle_xmlrpc_part();
});
toggle_xmlrpc_part();
});
EOF;
$smarty = smarty(array(), array('<link rel="stylesheet" type="text/css" href="' . $THEME->get_url('style/webservice.css', false, 'auth/webservice') . '">',));
safe_require('auth', 'webservice');
$smarty->assign('INLINEJAVASCRIPT', $inlinejs);
$smarty->assign('suid', $dbserviceuser->id);
$smarty->assign('form', $form);
$heading = get_string('users', 'auth.webservice');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment