From 390cc887da7302b4a993bd7a61aee9aa64423ecf Mon Sep 17 00:00:00 2001 From: jerome mouneyrac Date: Tue, 20 Jul 2010 03:22:55 +0000 Subject: [PATCH] webservice MDL-23345 fix moodledocs link in the ws doc --- lang/en/webservice.php | 3 ++- webservice/renderer.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lang/en/webservice.php b/lang/en/webservice.php index b80ef2e12b0..77b3877a81f 100644 --- a/lang/en/webservice.php +++ b/lang/en/webservice.php @@ -174,9 +174,10 @@ $string['webservicetokens'] = 'Web service tokens'; $string['wrongusernamepassword'] = 'Wrong username or password'; $string['wsauthmissing'] = 'The web service authentication plugin is missing.'; $string['wsauthnotenabled'] = 'The web service authentication plugin is disabled.'; +$string['wsclientdoc'] = 'Moodle web service client documentation'; $string['wsdocumentation'] = 'Web service documentation'; $string['wsdocumentationdisable'] = 'Web service documentation is disabled.'; -$string['wsdocumentationintro'] = 'Following is a listing of web service functions available for the username {$a}.
To create a client we advise you to read the Moodle documentation'; +$string['wsdocumentationintro'] = 'Following is a listing of web service functions available for the username {$a->username}.
To create a client we advise you to read the {$a->doclink}'; $string['wsdocumentationlogin'] = 'or enter your web service username and password:'; $string['wspassword'] = 'Web service password'; $string['wsusername'] = 'Web service username'; diff --git a/webservice/renderer.php b/webservice/renderer.php index bdf80afc6dc..1bfb2800b3b 100644 --- a/webservice/renderer.php +++ b/webservice/renderer.php @@ -446,10 +446,16 @@ EOF; EOF; /// Some general information - $documentationhtml = html_writer::start_tag('table', array('style' => "margin-left:auto; margin-right:auto;")); + $docinfo = new stdClass(); + $docinfo->username = $authparams['wsusername']; + $docurl = new moodle_url('http://docs.moodle.org/en/Development:Creating_a_web_service_client'); + $docinfo->doclink = html_writer::tag('a', + get_string('wsclientdoc', 'webservice'), array('href' => $docurl)); + $documentationhtml = html_writer::start_tag('table', + array('style' => "margin-left:auto; margin-right:auto;")); $documentationhtml .= html_writer::start_tag('tr', array()); $documentationhtml .= html_writer::start_tag('td', array()); - $documentationhtml .= get_string('wsdocumentationintro', 'webservice', $authparams['wsusername']); + $documentationhtml .= get_string('wsdocumentationintro', 'webservice', $docinfo); $documentationhtml .= $br . $br;