MDL-55797 output: Support form method in chooser
Part of MDL-55071
This commit is contained in:
committed by
Dan Poltawski
parent
6f0993ccbc
commit
7f8b7b2bb3
@@ -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}}">
|
||||
|
||||
Reference in New Issue
Block a user