Commit 7f8b7b2b authored by Frederic Massart's avatar Frederic Massart Committed by Dan Poltawski
Browse files

MDL-55797 output: Support form method in chooser

Part of MDL-55071
parent 6f0993cc
......@@ -45,6 +45,8 @@ class chooser implements renderable, templatable {
public $actionurl;
/** @var lang_string The instructions to display. */
public $instructions;
/** @var string The form method. */
public $method = 'post';
/** @var string The name of the parameter for the items value. */
public $paramname;
/** @var array The list of hidden parameters. See {@link self::add_param}. */
......@@ -96,6 +98,15 @@ class chooser implements renderable, templatable {
$this->instructions = $value;
}
/**
* Set the form method.
*
* @param string $value The method.
*/
public function set_method($value) {
$this->method = $value;
}
/**
* Export for template.
*
......@@ -107,6 +118,7 @@ class chooser implements renderable, templatable {
$data->actionurl = $this->actionurl->out(false);
$data->instructions = (string) $this->instructions;
$data->method = $this->method;
$data->paramname = $this->paramname;
$data->params = $this->params;
$data->sesskey = sesskey();
......
......@@ -24,7 +24,7 @@
<div class="chooserdialoguebody">
<div class="choosercontainer">
<div id="chooseform">
<form action="{{actionurl}}" id="chooserform" method="post">
<form action="{{actionurl}}" id="chooserform" method="{{method}}">
<div id="typeformdiv">
{{#params}}
<input type="hidden" id="{{id}}" name="{{name}}" value="{{value}}">
......
......@@ -24,7 +24,7 @@
<div class="chooserdialoguebody">
<div class="choosercontainer">
<div id="chooseform">
<form action="{{actionurl}}" id="chooserform" method="post">
<form action="{{actionurl}}" id="chooserform" method="{{method}}">
<div id="typeformdiv">
{{#params}}
<input type="hidden" id="{{id}}" name="{{name}}" value="{{value}}">
......
Supports Markdown
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