diff --git a/lang/en_utf8/webservice.php b/lang/en_utf8/webservice.php
new file mode 100644
index 00000000000..37a2f46080e
--- /dev/null
+++ b/lang/en_utf8/webservice.php
@@ -0,0 +1,33 @@
+SOAP Manual
+ 1. Call the method tmp_get_token on \"http://remotemoodle/webservice/soap/zend_soap_server.php?wsdl\"
+ Function parameter is an array: in PHP it would be array(\"username\" => \"wsuser\", \"password\" => \"wspassword\")
+ Return value is a token (integer)
+
+ 2. Then call a moodle web service method on \"http://remotemoodle/webservice/soap/zend_soap_server.php?token=the_received_token&classpath=the_moodle_path&wsdl\"
+ Every method has only one parameter which is an array.
+
+ For example in PHP for this specific function:
+ Moodle path: user
+ tmp_delete_user( string username, integer mnethostid, )
+ You will call something like:
+ your_client->tmp_delete_user(array(\"username\" => \"username_to_delete\",\"mnethostid\" => 1))
+';
+$string['xmlrpcdocumentation'] = '
XMLRPC Manual
+ 1. Call the method authentication.tmp_get_token on \"http://remotemoodle/webservice/xmlrpc/zend_xmlrpc_server.php\"
+ Function parameter is an array: in PHP it would be array(\"username\" => \"wsuser\", \"password\" => \"wspassword\")
+ Return value is a token (integer)
+
+ 2. Then call a moodle web service method on \"http://remotemoodle/webservice/xmlrpc/zend_xmlrpc_server.php?classpath=the_moodle_path&token=the_received_token\"
+ Every method has only one parameter which is an array.
+
+ For example in PHP for this specific function:
+ Moodle path: user
+ tmp_delete_user( string username, integer mnethostid, )
+ You will call something like:
+ your_client->call(\"user.tmp_delete_user\", array(array(\"username\" => \"username_to_delete\",\"mnethostid\" => 1)))
+
+';
+$string['functionlist'] = 'list of web service functions';
+$string['moodlepath'] = 'Moodle path';
+?>
diff --git a/webservice/documentation.php b/webservice/documentation.php
index 10186568c2e..29f3e072133 100644
--- a/webservice/documentation.php
+++ b/webservice/documentation.php
@@ -40,41 +40,12 @@ generate_functionlist();
*/
function generate_documentation($protocol) {
switch ($protocol) {
- case "soap":
- $documentation = <<SOAP Manual
- 1. Call the method tmp_get_token on "http://remotemoodle/webservice/soap/zend_soap_server.php?wsdl"
- Function parameter is an array: in PHP it would be array('username' => "wsuser", 'password' => "wspassword")
- Return value is a token (integer)
-
- 2. Then call a moodle web service method on "http://remotemoodle/webservice/soap/zend_soap_server.php?token=the_received_token&classpath=the_moodle_path&wsdl"
- Every method has only one parameter which is an array.
-
- For example in PHP for this specific function:
- Moodle path: user
- tmp_delete_user( string username, integer mnethostid, )
- You will call something like:
- your_client->tmp_delete_user(array('username' => "username_to_delete",'mnethostid' => 1))
-EOF;
+ case "soap":
+ $documentation = get_string('soapdocumentation','webservice');
break;
case "xmlrpc":
- $documentation = <<XMLRPC Manual
- 1. Call the method authentication.tmp_get_token on "http://remotemoodle/webservice/xmlrpc/zend_xmlrpc_server.php"
- Function parameter is an array: in PHP it would be array('username' => "wsuser", 'password' => "wspassword")
- Return value is a token (integer)
-
- 2. Then call a moodle web service method on "http://remotemoodle/webservice/xmlrpc/zend_xmlrpc_server.php?classpath=the_moodle_path&token=the_received_token"
- Every method has only one parameter which is an array.
-
- For example in PHP for this specific function:
- Moodle path: user
- tmp_delete_user( string username, integer mnethostid, )
- You will call something like:
- your_client->call('user.tmp_delete_user', array(array('username' => "username_to_delete",'mnethostid' => 1)))
-
-EOF;
+ $documentation = get_string('xmlrpcdocumentation','webservice');
break;
default:
break;
@@ -89,9 +60,7 @@ EOF;
*/
function generate_functionlist () {
global $CFG;
- $documentation = <<list of web service functions
-EOF;
+ $documentation = "".get_string('functionlist','webservice')."
";
//retrieve all external file
$externalfiles = array();
@@ -106,9 +75,7 @@ EOF;
$classpath = str_replace('/','_',$classpath); //convert all / into _
$classname = $classpath."_external";
$api = new $classname();
- $documentation .= <<Moodle path: {$classpath}
-EOF;
+ $documentation .= "".get_string('moodlepath','webservice').": ".$classpath."
";
$description = webservice_lib::generate_webservice_description($file, $classname);