You are here

function flag_user::options_form in Flag 6.2

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

File

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

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'),
    '#default_value' => $this->show_on_profile,
    '#access' => empty($this->locked['show_on_profile']),
  );
}