You are here

function flag_flag::form_input in Flag 5

Same name and namespace in other branches
  1. 6.2 flag.inc \flag_flag::form_input()
  2. 6 flag.inc \flag_flag::form_input()
  3. 7.3 includes/flag/flag_flag.inc \flag_flag::form_input()
  4. 7.2 flag.inc \flag_flag::form_input()

Update the flag with settings entered in a form.

File

./flag.inc, line 221
Implements various flags. Uses object oriented style inspired by that of Views 2.

Class

flag_flag
This abstract class represents a flag, or, in Views 2 terminology, "a handler".

Code

function form_input($form_values) {

  // Load the form fields indiscriminately unto the flag (we don't care about
  // stray FormAPI fields because we aren't touching unknown properties anyway.
  foreach ($form_values as $field => $value) {
    $this->{$field} = $value;
  }

  // But checkboxes need some massaging:
  $this->roles = array_values(array_filter($this->roles));
  $this->types = array_values(array_filter($this->types));

  // Clear internal titles cache:
  $this
    ->get_title(NULL, TRUE);
}