Commit 8d3d754f authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Adding title to serviceconfig page (Bug #1396431)



As well as making the helpo information popup in a dialogue rather
than navigate to new page.

Change-Id: I5683632d4efbca8aa622efe29e7b77699a695c32
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 831642ca
......@@ -65,7 +65,7 @@ $string['manage_certificates'] = 'These are the Certificates generated as part o
$string['certificates'] = 'Networking Certificates';
$string['servicefunctiongroups'] = 'Manage Service Groups';
$string['servicegroups'] = 'Service Groups';
$string['servicegroup'] = 'Service Group: %s';
$string['sfgdescription'] = 'Build lists of functions into service groups, that can be allocated to users authorised for execution';
$string['name'] = 'Name';
$string['component'] = 'Component';
......
{if !$dialog}
{include file='header.tpl'}
{/if}
<h2>{str tag="function" section="auth.webservice"}: {$function->name} </h2>
<table>
......@@ -106,5 +108,6 @@
<br/>
{$form|safe}
{include file='footer.tpl'}
\ No newline at end of file
{if !$dialog}
{include file='footer.tpl'}
{/if}
\ No newline at end of file
......@@ -73,7 +73,7 @@ foreach ($dbfunctions as $function) {
);
$functions['elements']['id' . $function->id . '_method'] = array(
'value' => '<a href="' . get_config('wwwroot') . 'webservice/wsdoc.php?id=' . $function->id . '">' . $function->methodname . '</a>',
'value' => '<a class="dialogue" href="' . get_config('wwwroot') . 'webservice/wsdoc.php?id=' . $function->id . '">' . $function->methodname . '</a>',
'type' => 'html',
'title' => $function->name,
);
......@@ -190,11 +190,50 @@ $form = array(
'elements' => $elements,
);
$heading = get_string('servicegroups', 'auth.webservice');
$heading = get_string('servicegroup', 'auth.webservice', $dbservice->name);
$form['name'] = 'serviceconfig';
$form['successcallback'] = 'serviceconfig_submit';
$form = pieform($form);
$smarty = smarty(array(), array('<link rel="stylesheet" type="text/css" href="' . $THEME->get_url('style/webservice.css', false, 'auth/webservice') . '">',));
$headers[] = '<link rel="stylesheet" type="text/css" href="' . $THEME->get_url('style/webservice.css', false, 'auth/webservice') . '">';
$headers[] = '<link rel="stylesheet" type="text/css" href="' . append_version_number(get_config('wwwroot') . 'js/jquery/jquery-ui/css/ui-lightness/jquery-ui-1.10.2.min.css') .'">';
$inlinejs = <<<EOF
<script type="text/javascript">
jQuery(function() {
jQuery(".dialogue").click(function(e) {
e.preventDefault();
// fetch the info for the method
jQuery.ajax({
url: e.currentTarget.href + '&dialog=1',
}).done(function(data) {
// make sure we have a #dialog div
if (jQuery("#dialog").length == 0) {
jQuery("body").append("<div id='dialog' style='display:none'></div>");
}
// close any open dialogs
jQuery(".ui-dialog-content").dialog("close");
jQuery("#dialog").html(data).dialog({
title: get_string('wsdoc', 'auth.webservice'),
open: function(event, ui) {
// move the focus to the top of the dialog box
jQuery("html, body").animate({
scrollTop: jQuery(".ui-dialog-titlebar").offset().top
}, 500)
},
width: '90%',
buttons: [{
text: get_string('Close', 'mahara'),
click: function() {
jQuery(this).dialog("close");
}
}]
});
});
});
});
</script>
EOF;
$headers[] = $inlinejs;
$smarty = smarty(array(), $headers, array('Close' => 'mahara', 'wsdoc' => 'auth.webservice'));
safe_require('auth', 'webservice');
$webservice_menu = PluginAuthWebservice::menu_items(MENUITEM);
$smarty->assign('TERTIARYMENU', $webservice_menu);
......
......@@ -21,6 +21,7 @@ require_once('pieforms/pieform.php');
require_once(get_config('docroot') . 'webservice/lib.php');
$function = param_integer('id', 0);
$dialog = param_integer('dialog', 0);
$dbfunction = get_record('external_functions', 'id', $function);
if (empty($dbfunction)) {
$SESSION->add_error_msg(get_string('invalidfunction', 'auth.webservice'));
......@@ -39,6 +40,7 @@ $smarty->assign('restactive', webservice_protocol_is_enabled('rest'));
$smarty->assign('soapactive', webservice_protocol_is_enabled('soap'));
$heading = get_string('wsdoc', 'auth.webservice');
$smarty->assign('PAGEHEADING', $heading);
$smarty->assign('dialog', $dialog);
$smarty->display('auth:webservice:wsdoc.tpl');
die;
......
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