/** * Magic function __get returns properties for this object, or passes it on to the parent class * Potential valid properties: * value: The value of the control, whether the default or submitted in the form * * @param string $name The paramter to retrieve * @return mixed The value of the parameter */ public function __get( $name ) { $default = $this->get_default(); switch ( $name ) { case 'value': if ( isset( $_POST[$this->field] ) ) { if ( $_POST[$this->field] == substr( md5( $default ), 0, 8 ) ) { return $default; } else { return $_POST[$this->field]; } } else { return $default; } default: return parent::__get( $name ); } }