]> git.mjollnir.org Git - moodle.git/commitdiff
web service MDL-12886 documentation: complete description of the return type
authorjerome <jerome>
Fri, 27 Feb 2009 00:48:26 +0000 (00:48 +0000)
committerjerome <jerome>
Fri, 27 Feb 2009 00:48:26 +0000 (00:48 +0000)
webservice/documentation.php

index 4e9a809662f0b93badb6ac43bbb1defc461e063e..9152f0f242f6ec222f5303602682caf930a4da15 100644 (file)
@@ -62,7 +62,7 @@ function check_webservices($protocol){
         }
     }
 
-    
+
 }
 
 /**
@@ -123,18 +123,25 @@ EOF;
                 $documentation .= <<<EOF
                 {$comma} {$type} {$param}
 EOF;
-                 if (empty($comma)) {
+                if (empty($comma)) {
                     $comma = ',';
                 }
             }
             $documentation .= <<<EOF
         <b>)</b> :
 EOF;
-          foreach($functiondescription['return'] as $return => $type) {
-            $documentation .= <<<EOF
-            {$type} <br/>
+            foreach($functiondescription['return'] as $return => $type) {
+                $documentation .= <<<EOF
+                <i>
+                {$type}</i>
+EOF;
+                if (is_array($type)) {
+                    $arraytype = "<pre>".print_r($type, true)."</pre>";
+                    $documentation .= <<<EOF
+                <i> {$return}  {$arraytype} <br><br></i>
 EOF;
-          }
+                }
+            }
             foreach($functiondescription['params'] as $param => $type) {
 
                 if (is_array($type)) {
@@ -150,7 +157,7 @@ EOF;
         $documentation .= <<<EOF
         </ul>
 EOF;
-  
+
     }
 
     echo $documentation;