Commit da2b9fb3 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Adjusting the webservice protocols to use the switchbox (Bug #1396430)

Change-Id: Ief2496eefd3f827a84c49e39580aad630ead5ecc
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 901df0a5
......@@ -93,13 +93,8 @@ span.response {
margin-right: 3px;
}
.header {
border-bottom: 1px solid #ccc;
.heading {
font-size: 1.167em;
color: #42637b;
line-height: 1.25em;
padding: 3px 5px;
text-align: left;
vertical-align: bottom;
font-weight: bold;
}
\ No newline at end of file
}
......@@ -229,22 +229,21 @@ function webservices_master_switch_form() {
'name' => 'activate_webservices',
'elementclasses' => false,
'successcallback' => 'activate_webservices_submit',
'class' => 'oneline inline',
'renderer' => 'div',
'jsform' => false,
'elements' => array(
'label' => array('type' => 'html', 'value' => get_string('control_webservices', 'auth.webservice'),),
'plugintype' => array('type' => 'hidden', 'value' => 'auth'),
'type' => array('type' => 'hidden', 'value' => 'webservice'),
'pluginname' => array('type' => 'hidden', 'value' => 'webservice'),
'enabled' => array('type' => 'hidden', 'value' => $enabled),
'enable' => array('type' => 'hidden', 'value' => $enabled-1),
'submit' => array(
'type' => 'submit',
'class' => 'linkbtn',
'value' => $enabled ? get_string('disable') : get_string('enable')
),
'state' => array('type' => 'html', 'value' => '[' . ($enabled ? get_string('enabled') : get_string('disabled')) . ']',),
'enabled' => array('type' => 'switchbox',
'value' => $enabled,
'on_callback' => 'switchbox_submit',
'off_callback' => 'switchbox_submit',
'on_label' => get_string('enabled'),
'off_label' => get_string('disabled'),
'wrapperclass' => 'switch-wrapper-inline',
'labelhtml' => get_string('control_webservices', 'auth.webservice'),
),
),
)
),
......@@ -262,35 +261,35 @@ function webservices_master_switch_form() {
function webservices_protocol_switch_form() {
// enable/disable separate protocols of SOAP/XML-RPC/REST
$elements = array();
$elements['label'] = array('title' => ' ', 'class' => 'header', 'type' => 'html', 'value' => get_string('protocol', 'auth.webservice'),);
$elements['label'] = array('title' => ' ', 'type' => 'html', 'value' => '<span class="heading">' . get_string('protocol', 'auth.webservice') . '</span>');
foreach (array('soap', 'xmlrpc', 'rest', 'oauth') as $proto) {
$enabled = (get_config('webservice_' . $proto . '_enabled') || 0);
$elements[$proto] = array(
'class' => 'header',
'title' => ' ',
'type' => 'html',
'value' =>
pieform(array(
'name' => 'activate_webservice_protos_' . $proto,
'renderer' => 'oneline',
'elementclasses' => false,
'renderer' => 'div',
'successcallback' => 'activate_webservice_proto_submit',
'class' => 'oneline inline',
'jsform' => false,
'elements' => array(
'label' => array('type' => 'html', 'value' => get_string($proto, 'auth.webservice'),),
'plugintype' => array('type' => 'hidden', 'value' => 'auth'),
'type' => array('type' => 'hidden', 'value' => 'webservice'),
'pluginname' => array('type' => 'hidden', 'value' => 'webservice'),
'protocol' => array('type' => 'hidden', 'value' => $proto),
'enabled' => array('type' => 'hidden', 'value' => $enabled),
'submit' => array(
'type' => 'submit',
'class' => 'linkbtn',
'value' => $enabled ? get_string('disable') : get_string('enable')
),
'state' => array('type' => 'html', 'value' => '[' . ($enabled ? get_string('enabled') : get_string('disabled')) . ']',),
'enabled' => array('type' => 'switchbox',
'value' => $enabled,
'on_callback' => 'switchbox_submit',
'off_callback' => 'switchbox_submit',
'on_label' => get_string('enabled'),
'off_label' => get_string('disabled'),
'wrapperclass' => 'switch-wrapper-inline',
'labelhtml' => get_string($proto, 'auth.webservice') . ': ',
),
),
)));
}
......
Markdown is supported
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