2009-12-13 10:48:22 +00:00
|
|
|
<?php
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
// //
|
|
|
|
// This file is part of Moodle - http://moodle.org/ //
|
|
|
|
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
|
|
|
|
// //
|
|
|
|
// Moodle is free software: you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// Moodle is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
// //
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Web service documentation renderer.
|
|
|
|
* @package webservice
|
|
|
|
* @copyright 2009 Moodle Pty Ltd (http://moodle.com)
|
|
|
|
* @author Jerome Mouneyrac
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
|
*/
|
|
|
|
|
2009-12-17 22:43:27 +00:00
|
|
|
class core_webservice_renderer extends plugin_renderer_base {
|
2009-12-18 03:19:22 +00:00
|
|
|
/**
|
2009-12-13 10:48:22 +00:00
|
|
|
* Create documentation for a description object
|
|
|
|
* @param object $params a part of parameter/return description
|
|
|
|
* @return string the html to display
|
|
|
|
*/
|
2009-12-14 05:30:12 +00:00
|
|
|
public function detailed_description_html($params) {
|
2009-12-13 10:48:22 +00:00
|
|
|
$paramdesc = "";
|
|
|
|
if (!empty($params->desc)) {
|
|
|
|
$paramdesc = "<span style=\"color:#2A33A6\"><i>//".$params->desc."</i></span><br/>";
|
|
|
|
}
|
|
|
|
if ($params instanceof external_multiple_structure) {
|
|
|
|
|
2009-12-14 05:30:12 +00:00
|
|
|
return $paramdesc."list of ( <br/>". $this->detailed_description_html($params->content).")";
|
2009-12-13 10:48:22 +00:00
|
|
|
} else if ($params instanceof external_single_structure) {
|
|
|
|
//var_dump($params->keys);
|
|
|
|
$singlestructuredesc = $paramdesc."object {<br/>";
|
|
|
|
foreach ($params->keys as $attributname => $attribut) {
|
2009-12-14 05:30:12 +00:00
|
|
|
$singlestructuredesc .= "<b>".$attributname."</b> ".$this->detailed_description_html($params->keys[$attributname]);
|
2009-12-13 10:48:22 +00:00
|
|
|
}
|
|
|
|
$singlestructuredesc .= "} <br/>";
|
|
|
|
return $singlestructuredesc;
|
|
|
|
} else {
|
|
|
|
switch($params->type) {
|
|
|
|
case PARAM_BOOL: // 0 or 1 only for now
|
|
|
|
case PARAM_INT:
|
|
|
|
$type = 'int';
|
|
|
|
break;
|
|
|
|
case PARAM_FLOAT;
|
|
|
|
$type = 'double';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$type = 'string';
|
|
|
|
}
|
|
|
|
return $type." ".$paramdesc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create description in indented xml format
|
|
|
|
* It is indented in order to be displayed into <pre> tag
|
|
|
|
* @param object $returndescription
|
|
|
|
* @param string $indentation composed by space only
|
|
|
|
* @return string the html to diplay
|
|
|
|
*/
|
|
|
|
public function description_in_indented_xml_format($returndescription, $indentation = "") {
|
|
|
|
$indentation = $indentation . " ";
|
|
|
|
$brakeline = <<<EOF
|
|
|
|
|
|
|
|
|
|
|
|
EOF;
|
|
|
|
if ($returndescription instanceof external_multiple_structure) {
|
|
|
|
$return = $indentation."<MULTIPLE>".$brakeline;
|
|
|
|
$return .= $this->description_in_indented_xml_format($returndescription->content, $indentation);
|
|
|
|
$return .= $indentation."</MULTIPLE>".$brakeline;
|
|
|
|
return $return;
|
|
|
|
} else if ($returndescription instanceof external_single_structure) {
|
|
|
|
$singlestructuredesc = $indentation."<SINGLE>".$brakeline;
|
|
|
|
$keyindentation = $indentation." ";
|
|
|
|
foreach ($returndescription->keys as $attributname => $attribut) {
|
|
|
|
$singlestructuredesc .= $keyindentation."<KEY name=\"".$attributname."\">".$brakeline.
|
|
|
|
$this->description_in_indented_xml_format($returndescription->keys[$attributname], $keyindentation).
|
|
|
|
$keyindentation."</KEY>".$brakeline;
|
|
|
|
}
|
|
|
|
$singlestructuredesc .= $indentation."</SINGLE>".$brakeline;
|
|
|
|
return $singlestructuredesc;
|
|
|
|
} else {
|
|
|
|
switch($returndescription->type) {
|
|
|
|
case PARAM_BOOL: // 0 or 1 only for now
|
|
|
|
case PARAM_INT:
|
|
|
|
$type = 'int';
|
|
|
|
break;
|
|
|
|
case PARAM_FLOAT;
|
|
|
|
$type = 'double';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$type = 'string';
|
|
|
|
}
|
|
|
|
return $indentation."<VALUE>".$type."</VALUE>".$brakeline;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-14 05:30:12 +00:00
|
|
|
/**
|
|
|
|
* Create indented XML-RPC param description
|
|
|
|
* @param object $paramdescription
|
|
|
|
* @param string $indentation composed by space only
|
|
|
|
* @return string the html to diplay
|
|
|
|
*/
|
|
|
|
public function xmlrpc_param_description_html($paramdescription, $indentation = "") {
|
|
|
|
$indentation = $indentation . " ";
|
|
|
|
$brakeline = <<<EOF
|
|
|
|
|
|
|
|
|
|
|
|
EOF;
|
|
|
|
if ($paramdescription instanceof external_multiple_structure) {
|
|
|
|
$return = $brakeline.$indentation."Array ";
|
|
|
|
$indentation = $indentation . " ";
|
|
|
|
$return .= $brakeline.$indentation."(";
|
|
|
|
$return .= $brakeline.$indentation."[0] =>";
|
|
|
|
$return .= $this->xmlrpc_param_description_html($paramdescription->content, $indentation);
|
|
|
|
$return .= $brakeline.$indentation.")";
|
|
|
|
return $return;
|
|
|
|
} else if ($paramdescription instanceof external_single_structure) {
|
|
|
|
$singlestructuredesc = $brakeline.$indentation."Array ";
|
|
|
|
$keyindentation = $indentation." ";
|
|
|
|
$singlestructuredesc .= $brakeline.$keyindentation."(";
|
|
|
|
foreach ($paramdescription->keys as $attributname => $attribut) {
|
|
|
|
$singlestructuredesc .= $brakeline.$keyindentation."[".$attributname."] =>".
|
|
|
|
$this->xmlrpc_param_description_html($paramdescription->keys[$attributname], $keyindentation).
|
|
|
|
$keyindentation;
|
|
|
|
}
|
|
|
|
$singlestructuredesc .= $brakeline.$keyindentation.")";
|
|
|
|
return $singlestructuredesc;
|
|
|
|
} else {
|
|
|
|
switch($paramdescription->type) {
|
|
|
|
case PARAM_BOOL: // 0 or 1 only for now
|
|
|
|
case PARAM_INT:
|
|
|
|
$type = 'int';
|
|
|
|
break;
|
|
|
|
case PARAM_FLOAT;
|
|
|
|
$type = 'double';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$type = 'string';
|
|
|
|
}
|
|
|
|
return " ".$type;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-13 10:48:22 +00:00
|
|
|
/**
|
|
|
|
* Return the REST response (xml code display in <pre> tag)
|
|
|
|
* @param string $functionname
|
|
|
|
* @param object $returndescription
|
|
|
|
* @return string the html to diplay
|
|
|
|
*/
|
|
|
|
public function rest_response_html($functionname, $returndescription) {
|
2009-12-14 05:30:12 +00:00
|
|
|
$brakeline = <<<EOF
|
|
|
|
|
|
|
|
|
|
|
|
EOF;
|
2009-12-13 10:48:22 +00:00
|
|
|
|
|
|
|
$restresponsehtml = "";
|
|
|
|
|
2009-12-21 04:01:02 +00:00
|
|
|
$restresponsehtml .= "<ins><div style=\"border:solid 1px #DEDEDE;background:#FEEBE5;color:#222222;padding:4px;\">";
|
2009-12-13 10:48:22 +00:00
|
|
|
$restresponsehtml .= "<pre>";
|
2009-12-14 05:30:12 +00:00
|
|
|
$restresponsehtml .= '<b>'.get_string('restcode', 'webservice').'</b><br/>';
|
2009-12-13 10:48:22 +00:00
|
|
|
$brakeline = <<<EOF
|
|
|
|
|
|
|
|
|
|
|
|
EOF;
|
|
|
|
$content = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>".$brakeline."<RESPONSE>".$brakeline;
|
|
|
|
$content .= $this->description_in_indented_xml_format($returndescription);
|
|
|
|
$content .="</RESPONSE>".$brakeline;
|
2009-12-14 05:30:12 +00:00
|
|
|
$restresponsehtml .= $brakeline.htmlentities($content).$brakeline;
|
2009-12-21 04:01:02 +00:00
|
|
|
$restresponsehtml .= "</pre></div></ins>";
|
2009-12-13 10:48:22 +00:00
|
|
|
return $restresponsehtml;
|
|
|
|
}
|
|
|
|
|
2009-12-14 06:01:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create indented REST param description
|
|
|
|
* @param object $paramdescription
|
|
|
|
* @param string $indentation composed by space only
|
|
|
|
* @return string the html to diplay
|
|
|
|
*/
|
|
|
|
public function rest_param_description_html($paramdescription, $paramstring) {
|
|
|
|
$brakeline = <<<EOF
|
|
|
|
|
|
|
|
|
|
|
|
EOF;
|
|
|
|
if ($paramdescription instanceof external_multiple_structure) {
|
|
|
|
$paramstring = $paramstring.'[0]';
|
|
|
|
$return = $this->rest_param_description_html($paramdescription->content, $paramstring);
|
|
|
|
return $return;
|
|
|
|
} else if ($paramdescription instanceof external_single_structure) {
|
|
|
|
$singlestructuredesc = "";
|
2009-12-14 07:12:47 +00:00
|
|
|
$initialparamstring = $paramstring;
|
2009-12-14 06:01:13 +00:00
|
|
|
foreach ($paramdescription->keys as $attributname => $attribut) {
|
2009-12-14 07:12:47 +00:00
|
|
|
$paramstring = $initialparamstring.'['.$attributname.']';
|
2009-12-14 06:01:13 +00:00
|
|
|
$singlestructuredesc .= $this->rest_param_description_html($paramdescription->keys[$attributname], $paramstring);
|
|
|
|
}
|
|
|
|
return $singlestructuredesc;
|
|
|
|
} else {
|
|
|
|
$paramstring = $paramstring.'=';
|
|
|
|
switch($paramdescription->type) {
|
|
|
|
case PARAM_BOOL: // 0 or 1 only for now
|
|
|
|
case PARAM_INT:
|
|
|
|
$type = 'int';
|
|
|
|
break;
|
|
|
|
case PARAM_FLOAT;
|
|
|
|
$type = 'double';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$type = 'string';
|
|
|
|
}
|
|
|
|
return $paramstring." ".$type.$brakeline;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-12-13 10:48:22 +00:00
|
|
|
/**
|
|
|
|
* This display all the documentation
|
|
|
|
* @param array $functions contains all decription objects
|
|
|
|
* @param string $username
|
|
|
|
* @return string the html to diplay
|
|
|
|
*/
|
2009-12-18 03:19:22 +00:00
|
|
|
public function documentation_html($functions, $username, $activatedprotocol) {
|
2009-12-13 10:48:22 +00:00
|
|
|
|
2009-12-14 05:30:12 +00:00
|
|
|
$brakeline = <<<EOF
|
|
|
|
|
|
|
|
|
|
|
|
EOF;
|
|
|
|
|
2009-12-13 10:48:22 +00:00
|
|
|
$documentationhtml = "";
|
|
|
|
|
2009-12-18 03:19:22 +00:00
|
|
|
$documentationhtml .= "<table style=\"margin-left:auto; margin-right:auto;\"><tr><td style=\"text-align=left\">";
|
2009-12-13 10:48:22 +00:00
|
|
|
$documentationhtml .= get_string('wsdocumentationintro', 'webservice', $username);
|
|
|
|
$documentationhtml .= "<br/><br/><br/>";
|
|
|
|
|
|
|
|
foreach ($functions as $functionname => $description) {
|
|
|
|
$documentationhtml .= print_collapsible_region_start('', 'aera_'.$functionname,"<strong>".$functionname."</strong>",false,true,true);
|
|
|
|
|
|
|
|
$documentationhtml .= "<br/>";
|
|
|
|
$documentationhtml .= "<div style=\"border:solid 1px #DEDEDE;background:#E2E0E0;color:#222222;padding:4px;\">";
|
|
|
|
$documentationhtml .= $description->description;
|
|
|
|
$documentationhtml .= "</div>";
|
|
|
|
$documentationhtml .= "<br/><br/>";
|
|
|
|
|
|
|
|
$documentationhtml .= "<span style=\"color:#EA33A6\">".get_string('arguments', 'webservice')."</span><br/>";
|
|
|
|
foreach ($description->parameters_desc->keys as $paramname => $paramdesc) {
|
|
|
|
$documentationhtml .= "<span style=\"font-size:80%\">";
|
|
|
|
$required = $paramdesc->required?get_string('required', 'webservice'):get_string('optional', 'webservice');
|
|
|
|
$documentationhtml .= "<b>".$paramname . "</b> (" .$required. ")<br/>";
|
|
|
|
$documentationhtml .= " ".$paramdesc->desc." <br/><br/>";
|
2009-12-21 04:01:02 +00:00
|
|
|
$documentationhtml .= "<ins><div style=\"border:solid 1px #DEDEDE;background:#FFF1BC;color:#222222;padding:4px;\">";
|
2009-12-13 10:48:22 +00:00
|
|
|
$documentationhtml .= "<pre>";
|
2009-12-18 03:19:22 +00:00
|
|
|
$documentationhtml .= '<b>'.get_string('generalstructure', 'webservice').'</b><br/>';
|
2009-12-14 05:30:12 +00:00
|
|
|
$documentationhtml .= $brakeline.$this->detailed_description_html($paramdesc);
|
2009-12-21 04:01:02 +00:00
|
|
|
$documentationhtml .= "</pre></div></ins><br/>";
|
2009-12-18 03:19:22 +00:00
|
|
|
if (!empty($activatedprotocol['xmlrpc'])) {
|
2009-12-21 04:01:02 +00:00
|
|
|
$documentationhtml .= "<ins><div style=\"border:solid 1px #DEDEDE;background:#DFEEE7;color:#222222;padding:4px;\">";
|
2009-12-18 03:19:22 +00:00
|
|
|
$documentationhtml .= "<pre>";
|
|
|
|
$documentationhtml .= '<b>'.get_string('phpparam', 'webservice').'</b><br/>';
|
|
|
|
$documentationhtml .= $brakeline.'['.$paramname.'] =>'.htmlentities($this->xmlrpc_param_description_html($paramdesc)). $brakeline. $brakeline;
|
2009-12-21 04:01:02 +00:00
|
|
|
$documentationhtml .= "</pre></div></ins><br/>";
|
2009-12-18 03:19:22 +00:00
|
|
|
}
|
|
|
|
if (!empty($activatedprotocol['rest'])) {
|
2009-12-21 04:01:02 +00:00
|
|
|
$documentationhtml .= "<ins><div style=\"border:solid 1px #DEDEDE;background:#FEEBE5;color:#222222;padding:4px;\">";
|
2009-12-18 03:19:22 +00:00
|
|
|
$documentationhtml .= "<pre>";
|
|
|
|
$documentationhtml .= '<b>'.get_string('restparam', 'webservice').'</b><br/>';
|
|
|
|
$documentationhtml .= $brakeline.htmlentities($this->rest_param_description_html($paramdesc,$paramname)). $brakeline. $brakeline;
|
2009-12-21 04:01:02 +00:00
|
|
|
$documentationhtml .= "</pre></div></ins>";
|
2009-12-18 03:19:22 +00:00
|
|
|
}
|
2009-12-13 10:48:22 +00:00
|
|
|
$documentationhtml .= "</span>";
|
|
|
|
}
|
|
|
|
$documentationhtml .= "<br/><br/>";
|
|
|
|
|
|
|
|
$documentationhtml .= "<span style=\"color:#EA33A6\">".get_string('response', 'webservice')."</span><br/>";
|
|
|
|
$documentationhtml .= "<span style=\"font-size:80%\">";
|
|
|
|
if (!empty($description->returns_desc->desc)) {
|
|
|
|
$documentationhtml .= $description->returns_desc->desc."<br/><br/>";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!empty($description->returns_desc)) {
|
2009-12-21 04:01:02 +00:00
|
|
|
$documentationhtml .= "<ins><div style=\"border:solid 1px #DEDEDE;background:#FFF1BC;color:#222222;padding:4px;\">";
|
2009-12-13 10:48:22 +00:00
|
|
|
$documentationhtml .= "<pre>";
|
2009-12-18 03:19:22 +00:00
|
|
|
$documentationhtml .= '<b>'.get_string('generalstructure', 'webservice').'</b><br/>';
|
2009-12-14 05:30:12 +00:00
|
|
|
$documentationhtml .= $brakeline.$this->detailed_description_html($description->returns_desc);
|
2009-12-21 04:01:02 +00:00
|
|
|
$documentationhtml .= "</pre></div></ins><br/>";
|
2009-12-18 03:19:22 +00:00
|
|
|
if (!empty($activatedprotocol['xmlrpc'])) {
|
2009-12-21 04:01:02 +00:00
|
|
|
$documentationhtml .= "<ins><div style=\"border:solid 1px #DEDEDE;background:#DFEEE7;color:#222222;padding:4px;\">";
|
2009-12-18 03:19:22 +00:00
|
|
|
$documentationhtml .= "<pre>";
|
|
|
|
$documentationhtml .= '<b>'.get_string('phpresponse', 'webservice').'</b><br/>';
|
|
|
|
$documentationhtml .= htmlentities($this->xmlrpc_param_description_html($description->returns_desc)).$brakeline.$brakeline;
|
2009-12-21 04:01:02 +00:00
|
|
|
$documentationhtml .= "</pre></div></ins><br/>";
|
2009-12-18 03:19:22 +00:00
|
|
|
}
|
|
|
|
if (!empty($activatedprotocol['rest'])) {
|
|
|
|
$documentationhtml .= $this->rest_response_html($functionname, $description->returns_desc);
|
|
|
|
}
|
2009-12-13 10:48:22 +00:00
|
|
|
}
|
|
|
|
$documentationhtml .= "</span>";
|
|
|
|
$documentationhtml .= "<br/><br/>";
|
|
|
|
|
|
|
|
|
2009-12-18 03:19:22 +00:00
|
|
|
if (!empty($activatedprotocol['rest'])) {
|
|
|
|
$documentationhtml .= "<span style=\"color:#EA33A6\">".get_string('errorcodes', 'webservice')."</span><br/>";
|
2009-12-21 04:01:02 +00:00
|
|
|
$documentationhtml .= "<br/><span style=\"font-size:80%\">";
|
|
|
|
$documentationhtml .= "<ins><div style=\"border:solid 1px #DEDEDE;background:#FEEBE5;color:#222222;padding:4px;\">";
|
2009-12-18 03:19:22 +00:00
|
|
|
$documentationhtml .= "<pre>";
|
|
|
|
$documentationhtml .= '<b>'.get_string('restexception', 'webservice').'</b><br/>';
|
|
|
|
$errormessage = get_string('invalidparameter', 'debug');
|
|
|
|
$restexceptiontext =<<<EOF
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<EXCEPTION class="invalid_parameter_exception">
|
|
|
|
<MESSAGE>{$errormessage}</MESSAGE>
|
|
|
|
<DEBUGINFO></DEBUGINFO>
|
|
|
|
</EXCEPTION>
|
|
|
|
EOF;
|
|
|
|
$documentationhtml .= $brakeline.htmlentities($restexceptiontext);
|
2009-12-21 04:01:02 +00:00
|
|
|
$documentationhtml .= "</pre></div></ins><br/>";
|
2009-12-13 10:48:22 +00:00
|
|
|
$documentationhtml .= "</span>";
|
2009-12-18 03:19:22 +00:00
|
|
|
}
|
2009-12-13 10:48:22 +00:00
|
|
|
$documentationhtml .= "<br/><br/>";
|
|
|
|
|
|
|
|
$documentationhtml .= print_collapsible_region_end(true);
|
|
|
|
}
|
|
|
|
|
2009-12-18 03:19:22 +00:00
|
|
|
$documentationhtml .= "</td>";
|
|
|
|
|
|
|
|
$documentationhtml .= "</tr></table>";
|
2009-12-13 10:48:22 +00:00
|
|
|
return $documentationhtml;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the login page html
|
|
|
|
* @param string $errormessage - the error message to display
|
|
|
|
* @return string the html to diplay
|
|
|
|
*/
|
|
|
|
public function login_page_html($errormessage) {
|
|
|
|
global $CFG, $OUTPUT;
|
|
|
|
|
|
|
|
$htmlloginpage = "";
|
|
|
|
$htmlloginpage .= "<table style=\"margin-left:auto; margin-right:auto;\"><tr><td>";
|
|
|
|
$htmlloginpage .= get_string('wsdocumentationlogin', 'webservice');
|
|
|
|
$htmlloginpage .= "<br/><br/><br/>";
|
|
|
|
|
|
|
|
// echo get_string('error','webservice',$errormessage);
|
|
|
|
// echo "<br/><br/>";
|
|
|
|
|
2009-12-14 05:30:12 +00:00
|
|
|
//login form - we cannot use moodle form as we don't have sessionkey
|
2009-12-13 10:48:22 +00:00
|
|
|
$form = new html_form();
|
|
|
|
$form->url = new moodle_url($CFG->wwwroot.'/webservice/wsdoc.php', array()); // Required
|
|
|
|
$form->button = new html_button();
|
|
|
|
$form->button->text = get_string('wsdocumentation','webservice'); // Required
|
|
|
|
$form->button->disabled = false;
|
|
|
|
$form->button->title = get_string('wsdocumentation','webservice');
|
|
|
|
$form->method = 'post';
|
|
|
|
|
|
|
|
$field = new html_field();
|
|
|
|
$field->name = 'wsusername';
|
|
|
|
$field->value = get_string('wsusername', 'webservice');
|
|
|
|
$field->style = 'width: 30em;';
|
|
|
|
$contents = $OUTPUT->textfield($field);
|
|
|
|
$contents .= "<br/><br/>";
|
|
|
|
$field = new html_field();
|
|
|
|
$field->name = 'wspassword';
|
|
|
|
$field->value = get_string('wspassword', 'webservice');
|
|
|
|
$field->style = 'width: 30em;';
|
|
|
|
$contents .= $OUTPUT->textfield($field);
|
|
|
|
$contents .= "<br/><br/>";
|
|
|
|
|
|
|
|
$htmlloginpage .= $OUTPUT->form($form, $contents);
|
|
|
|
|
|
|
|
$htmlloginpage .= "</td></tr></table>";
|
|
|
|
return $htmlloginpage;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|