You are here

function flag_user::options_form in Flag 7.3

Same name and namespace in other branches
  1. 5 flag.inc \flag_user::options_form()
  2. 6.2 flag.inc \flag_user::options_form()
  3. 6 flag.inc \flag_user::options_form()
  4. 7.2 flag.inc \flag_user::options_form()

Options form extras for user flags.

Overrides flag_entity::options_form

File

includes/flag/flag_user.inc, line 24
Contains the flag_user class.

Class

flag_user
Implements a user flag.

Code

function options_form(&$form) {
  parent::options_form($form);
  $form['access']['types'] = array(
    // A user flag doesn't support node types.
    // TODO: Maybe support roles instead of node types.
    '#type' => 'value',
    '#value' => array(
      0 => 0,
    ),
  );
  $form['access']['access_uid'] = array(
    '#type' => 'checkbox',
    '#title' => t('Users may flag themselves'),
    '#description' => t('Disabling this option may be useful when setting up a "friend" flag, when a user flagging themself does not make sense.'),
    '#default_value' => $this->access_uid ? 0 : 1,
  );
  $form['display']['show_on_profile'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display link on user profile page'),
    '#description' => t('Show the link formatted as a user profile element.'),
    '#default_value' => $this->show_on_profile,
    // Put this above 'show on entity'.
    '#weight' => -1,
  );
}