Revert "Merge branch 'MDL-27675_21_wip' of git://github.com/grabs/moodle into MOODLE_21_STABLE"
This reverts commit9c96488ed9, reversing changes made tob22884274f.
This commit is contained in:
@@ -434,8 +434,7 @@
|
||||
//get the value
|
||||
$frmvaluename = $feedbackitem->typ . '_'. $feedbackitem->id;
|
||||
if(isset($savereturn)) {
|
||||
$value = isset($formdata->{$frmvaluename})?$formdata->{$frmvaluename}:NULL;
|
||||
$value = feedback_clean_input_value($feedbackitem, $value);
|
||||
$value = isset($formdata->{$frmvaluename})?$formdata->{$frmvaluename}:NULL;
|
||||
}else {
|
||||
if(isset($feedbackcompletedtmp->id)) {
|
||||
$value = feedback_get_item_value($feedbackcompletedtmp->id, $feedbackitem->id, true);
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
//if the use hit enter into a textfield so the form should not submit
|
||||
if(isset($formdata->sesskey) AND !isset($formdata->savevalues) AND !isset($formdata->gonextpage) AND !isset($formdata->gopreviouspage)) {
|
||||
$gopage = (int)$formdata->lastpage;
|
||||
$gopage = $formdata->lastpage;
|
||||
}
|
||||
if(isset($formdata->savevalues)) {
|
||||
$savevalues = true;
|
||||
@@ -383,8 +383,7 @@
|
||||
//get the value
|
||||
$frmvaluename = $feedbackitem->typ . '_'. $feedbackitem->id;
|
||||
if(isset($savereturn)) {
|
||||
$value = isset($formdata->{$frmvaluename})?$formdata->{$frmvaluename}:NULL;
|
||||
$value = feedback_clean_input_value($feedbackitem, $value);
|
||||
$value = isset($formdata->{$frmvaluename})?$formdata->{$frmvaluename}:NULL;
|
||||
}else {
|
||||
if(isset($feedbackcompletedtmp->id)) {
|
||||
$value = feedback_get_item_value($feedbackcompletedtmp->id, $feedbackitem->id, sesskey());
|
||||
|
||||
@@ -280,13 +280,4 @@ class feedback_item_captcha extends feedback_item_base {
|
||||
function can_switch_require() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans the value coming from the user for a field of this type.
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
public function clean_input_value($value) {
|
||||
return clean_param($value, PARAM_RAW);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,14 +104,6 @@ abstract class feedback_item_base {
|
||||
*/
|
||||
abstract function print_item_show_value($item, $value = '');
|
||||
|
||||
/**
|
||||
* cleans the userinput while submitting the form
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function clean_input_value($value);
|
||||
|
||||
}
|
||||
|
||||
//a dummy class to realize pagebreaks
|
||||
@@ -137,7 +129,6 @@ class feedback_item_pagebreak extends feedback_item_base {
|
||||
function print_item_complete($item, $value = '', $highlightrequire = false) {}
|
||||
function print_item_show_value($item, $value = '') {}
|
||||
function can_switch_require(){}
|
||||
function clean_input_value($value){}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -323,13 +323,4 @@ class feedback_item_info extends feedback_item_base {
|
||||
function can_switch_require() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans the value coming from the user for a field of this type.
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
public function clean_input_value($value) {
|
||||
return clean_param($value, PARAM_INT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,13 +233,4 @@ class feedback_item_label extends feedback_item_base {
|
||||
function print_analysed($item, $itemnr = '', $groupid = false, $courseid = false) {}
|
||||
function get_printval($item, $value) {}
|
||||
function get_analysed($item, $groupid = false, $courseid = false) {}
|
||||
|
||||
/**
|
||||
* Cleans the value coming from the user for a field of this type.
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
public function clean_input_value($value) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -710,24 +710,8 @@ class feedback_item_multichoice extends feedback_item_base {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function can_switch_require() {
|
||||
|
||||
function can_switch_require() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function value_type() {
|
||||
return PARAM_INT;
|
||||
}
|
||||
|
||||
public function value_is_array() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans the value coming from the user for a field of this type.
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
public function clean_input_value($value) {
|
||||
return clean_param_array($value, PARAM_INT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -589,12 +589,4 @@ class feedback_item_multichoicerated extends feedback_item_base {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans the value coming from the user for a field of this type.
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
public function clean_input_value($value) {
|
||||
return clean_param($value, PARAM_INT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,13 +420,4 @@ class feedback_item_numeric extends feedback_item_base {
|
||||
function can_switch_require() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans the value coming from the user for a field of this type.
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
public function clean_input_value($value) {
|
||||
return clean_param($value, PARAM_FLOAT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,13 +280,4 @@ class feedback_item_textarea extends feedback_item_base {
|
||||
function can_switch_require() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans the value coming from the user for a field of this type.
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
public function clean_input_value($value) {
|
||||
return clean_param($value, PARAM_CLEANHTML);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,13 +274,4 @@ class feedback_item_textfield extends feedback_item_base {
|
||||
function can_switch_require() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans the value coming from the user for a field of this type.
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
public function clean_input_value($value) {
|
||||
return clean_param($value, PARAM_CLEANHTML);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1927,18 +1927,6 @@ function feedback_get_page_to_continue($feedbackid, $courseid = false, $guestid
|
||||
//functions to handle the values
|
||||
////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* cleans the userinput while submitting the form.
|
||||
*
|
||||
* @param stdClass $item The feedback item record from the database that the value needs to be cleaned against.
|
||||
* @param mixed $value
|
||||
* @return mixed
|
||||
*/
|
||||
function feedback_clean_input_value($item, $value) {
|
||||
$itemobj = feedback_get_item_class($item->typ);
|
||||
return $itemobj->clean_input_value($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* this saves the values of an completed.
|
||||
* if the param $tmp is set true so the values are saved temporary in table feedback_valuetmp.
|
||||
|
||||
Reference in New Issue
Block a user