Skip to content

Commit

Permalink
Revert "Merge branch 'MDL-27675_master_wip' of git://github.com/grabs…
Browse files Browse the repository at this point in the history
…/moodle"

This reverts commit a09a9be, reversing
changes made to 08e0aaa.
  • Loading branch information
Sam Hemelryk committed May 30, 2012
1 parent d88f1a5 commit 378eb6f
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 101 deletions.
8 changes: 5 additions & 3 deletions mod/feedback/complete.php
Original file line number Diff line number Diff line change
Expand Up @@ -507,8 +507,11 @@
//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);
if (isset($formdata->{$frmvaluename})) {
$value = $formdata->{$frmvaluename};
} else {
$value = null;
}
} else {
if (isset($feedbackcompletedtmp->id)) {
$value = feedback_get_item_value($feedbackcompletedtmp->id,
Expand All @@ -527,7 +530,6 @@
feedback_print_item_complete($feedbackitem, $value, $highlightrequired);
echo $OUTPUT->box_end();
}

echo $OUTPUT->box_end();

$lastbreakposition = $feedbackitem->position; //last item-pos (item or pagebreak)
Expand Down
12 changes: 7 additions & 5 deletions mod/feedback/complete_guest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
!isset($formdata->gonextpage) AND
!isset($formdata->gopreviouspage)) {

$gopage = (int) $formdata->lastpage;
$gopage = $formdata->lastpage;
}
if (isset($formdata->savevalues)) {
$savevalues = true;
Expand Down Expand Up @@ -441,10 +441,13 @@
echo $OUTPUT->box_start('feedback_item_box_'.$align.$dependstyle);
$value = '';
//get the value
$frmvaluename = $feedbackitem->typ . '_'. $feedbackitem->id;
$frmvaluename = $feedbackitem->typ.'_'.$feedbackitem->id;
if (isset($savereturn)) {
$value = isset($formdata->{$frmvaluename}) ? $formdata->{$frmvaluename} : null;
$value = feedback_clean_input_value($feedbackitem, $value);
if (isset($formdata->{$frmvaluename})) {
$value = $formdata->{$frmvaluename};
} else {
$value = null;
}
} else {
if (isset($feedbackcompletedtmp->id)) {
$value = feedback_get_item_value($feedbackcompletedtmp->id,
Expand All @@ -463,7 +466,6 @@
feedback_print_item_complete($feedbackitem, $value, $highlightrequired);
echo $OUTPUT->box_end();
}

echo $OUTPUT->box_end();

$lastbreakposition = $feedbackitem->position; //last item-pos (item or pagebreak)
Expand Down
9 changes: 0 additions & 9 deletions mod/feedback/item/captcha/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,4 @@ public function get_hasvalue() {
public 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);
}
}
14 changes: 3 additions & 11 deletions mod/feedback/item/feedback_item_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,6 @@ abstract public function print_item_complete($item, $value = '', $highlightrequi
*/
abstract public 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
Expand Down Expand Up @@ -183,7 +175,7 @@ public function print_item_show_value($item, $value = '') {
}
public function can_switch_require() {
}
public function clean_input_value($value) {
}

}
}


9 changes: 0 additions & 9 deletions mod/feedback/item/info/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +388,4 @@ public function get_hasvalue() {
public 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);
}
}
8 changes: 0 additions & 8 deletions mod/feedback/item/label/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,4 @@ public function get_printval($item, $value) {
}
public 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 '';
}
}
9 changes: 0 additions & 9 deletions mod/feedback/item/multichoice/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -826,13 +826,4 @@ public function value_type() {
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);
}
}
8 changes: 0 additions & 8 deletions mod/feedback/item/multichoicerated/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,4 @@ public 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_INT);
}
}
9 changes: 0 additions & 9 deletions mod/feedback/item/numeric/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -534,13 +534,4 @@ public function get_hasvalue() {
public 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);
}
}
9 changes: 0 additions & 9 deletions mod/feedback/item/textarea/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,4 @@ public function get_hasvalue() {
public 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);
}
}
9 changes: 0 additions & 9 deletions mod/feedback/item/textfield/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,4 @@ public function get_hasvalue() {
public 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);
}
}
12 changes: 0 additions & 12 deletions mod/feedback/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2058,18 +2058,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.
Expand Down

0 comments on commit 378eb6f

Please sign in to comment.