. */ class CandLanguages extends Cand { /* Constructor * Make sure you set the name, and, when needed, if the field is * compulsory */ public function __construct($candidate_id) { $this->candidate_id = $candidate_id; $this->name = "Languages"; $this->compulsory = true; } /* get_print_name() * Return the name of the field (caption) to be shown in the application * form */ public function get_print_name() { return "Spoken languages"; } /* get_print_name_short() * Return the name of the field (caption) to be shown in a table */ public function get_print_name_short() { return "Languages"; } /* get_print_value($readonly) * Return the value to be printed in the form (with text boxes etc) * @param: readonly: if the field can be changed (false) or not (true) */ public function get_print_value($readonly=false) { $r = "name."\" value=\"".$this->value."\" size=\"40\" maxlength=\"50\""; if( $readonly ) $r .= " readonly=\"readonly\""; $r .= ">"; return $r; } /* set($value) * Check the supplied value and assign it if ok (return true), otherwise * set an error and return false * @param: value: the value to be assigned and checked * @return: true on ok, false on error */ public function set($value) { if( strlen($value)<3 OR strlen($value)>50 ) { // Error $this->error = true; $this->error_txt = "The spoken languages is missing or too long (maximum 50 characters)"; return false; }else { $this->value = $value; return true; } } } ?>