mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
fixed a couple of bugs in custom elements
This commit is contained in:
parent
6e372b2591
commit
0e6303103b
2 changed files with 26 additions and 18 deletions
|
@ -154,11 +154,15 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group{
|
|||
function exportValue(&$submitValues, $assoc = false)
|
||||
{
|
||||
$value = null;
|
||||
$valuearray = $this->_elements[0]->exportValue($submitValues[$this->getName()], true);
|
||||
$valuearray +=$this->_elements[1]->exportValue($submitValues[$this->getName()], true);
|
||||
$valuearray +=$this->_elements[2]->exportValue($submitValues[$this->getName()], true);
|
||||
$valuearray +=$this->_elements[3]->exportValue($submitValues[$this->getName()], true);
|
||||
$valuearray +=$this->_elements[4]->exportValue($submitValues[$this->getName()], true);
|
||||
print_object($submitValues);
|
||||
$valuearray = array();
|
||||
foreach ($this->_elements as $element){
|
||||
$thisexport = $element->exportValue($submitValues[$this->getName()], true);
|
||||
if ($thisexport!=null){
|
||||
$valuearray += $thisexport;
|
||||
}
|
||||
}
|
||||
if (count($valuearray)){
|
||||
$value[$this->getName()]=make_timestamp($valuearray['year'],
|
||||
$valuearray['month'],
|
||||
$valuearray['day'],
|
||||
|
@ -167,7 +171,11 @@ class MoodleQuickForm_date_time_selector extends MoodleQuickForm_group{
|
|||
0,
|
||||
$this->_options['timezone'],
|
||||
$this->_options['applydst']);
|
||||
|
||||
return $value;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
|
|
|
@ -25,7 +25,7 @@ class MoodleQuickForm_submit extends HTML_QuickForm_submit
|
|||
function MoodleQuickForm_submit($elementName=null, $value=null, $attributes=null)
|
||||
{
|
||||
HTML_QuickForm_submit::HTML_QuickForm_submit($elementName, $value, $attributes);
|
||||
if ($elementName='cancel'){
|
||||
if ('cancel'==$elementName){
|
||||
//bypass form validation js :
|
||||
$this->updateAttributes(array('onclick'=>'this.form.submit();'));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue