$value) { if ($value != $item->$key) $changes[$key] = $value; } } return $field_errors; } /* * Parser/formatter values helpers */ function can_modify($item) { return can_do( $item, array('pending') ); } function can_archive($item) { return can_do( $item, array('refused', 'validated') ); } function can_delete($item) { return can_do( $item, array('archived') ); } function can_do($item, $status=array()) { return in_array($item->status, $status); } # vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab