+ /** nom du formulaire d'édition */
+ public function editor()
+ {
+ return null;
+ }
+
+ // }}}
+ // {{{ function answers()
+
+ /** automatic answers table for this type of validation */
+ public function answers()
+ {
+ static $answers_table;
+ if (!isset($answers_table[$this->type])) {
+ $r = XDB::query("SELECT id, title, answer FROM requests_answers WHERE category = {?}", $this->type);
+ $answers_table[$this->type] = $r->fetchAllAssoc($r);
+ }
+ return $answers_table[$this->type];
+ }
+
+ // }}}
+ // {{{ function id()
+
+ public function id()
+ {
+ return $this->user->id() . '_' . $this->type . '_' . $this->stamp;
+ }
+
+ // }}}
+ // {{{ function ruleText()
+
+ public function ruleText()
+ {
+ return str_replace('\'', '\\\'', $this->rules);
+ }
+
+ // }}}
+ // {{{ function unserialize()
+ public static function unserialize($data)
+ {
+ $obj = unserialize($data);
+ /* XXX: Temporary for hruid migration */
+ if (!isset($obj->user) || !is_object($obj)) {
+ $obj->user =& User::get($obj->forlife);
+ }
+ /* XXX: End temporary block */
+ return $obj;
+ }
+}