Skip to content

Commit

Permalink
MDL-27675 mod_feedback: Tidy up of phpdocs and scope within feedback mod
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed May 28, 2012
1 parent a09a9be commit 064cac7
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 16 deletions.
7 changes: 6 additions & 1 deletion mod/feedback/item/captcha/lib.php
Expand Up @@ -327,7 +327,12 @@ public function can_switch_require() {
return false;
}

function clean_input_value($value) {
/**
* 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);
}
}
6 changes: 3 additions & 3 deletions mod/feedback/item/feedback_item_class.php
Expand Up @@ -128,13 +128,13 @@ 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 function clean_input_value($value);
abstract public function clean_input_value($value);

}

Expand Down Expand Up @@ -186,4 +186,4 @@ public function can_switch_require() {
public function clean_input_value($value) {
}

}
}
7 changes: 6 additions & 1 deletion mod/feedback/item/info/lib.php
Expand Up @@ -389,7 +389,12 @@ public function can_switch_require() {
return false;
}

function clean_input_value($value) {
/**
* 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);
}
}
5 changes: 5 additions & 0 deletions mod/feedback/item/label/lib.php
Expand Up @@ -270,6 +270,11 @@ 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 '';
}
Expand Down
11 changes: 6 additions & 5 deletions mod/feedback/item/multichoice/lib.php
Expand Up @@ -827,11 +827,12 @@ public function value_is_array() {
return true;
}

function can_switch_require() {
return true;
}

function clean_input_value($value) {
/**
* 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);
}
}
7 changes: 6 additions & 1 deletion mod/feedback/item/multichoicerated/lib.php
Expand Up @@ -678,7 +678,12 @@ public function can_switch_require() {
return true;
}

function clean_input_value($value) {
/**
* 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: 7 additions & 2 deletions mod/feedback/item/numeric/lib.php
Expand Up @@ -534,8 +534,13 @@ public function get_hasvalue() {
public function can_switch_require() {
return true;
}

function clean_input_value($value) {

/**
* 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);
}
}
7 changes: 6 additions & 1 deletion mod/feedback/item/textarea/lib.php
Expand Up @@ -334,7 +334,12 @@ public function can_switch_require() {
return true;
}

function clean_input_value($value) {
/**
* 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);
}
}
7 changes: 6 additions & 1 deletion mod/feedback/item/textfield/lib.php
Expand Up @@ -321,7 +321,12 @@ public function can_switch_require() {
return true;
}

function clean_input_value($value) {
/**
* 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);
}
}
3 changes: 2 additions & 1 deletion mod/feedback/lib.php
Expand Up @@ -2058,9 +2058,10 @@ 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
*/
Expand Down

0 comments on commit 064cac7

Please sign in to comment.