You are here

function flag_node::options_form in Flag 6.2

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

File

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

Class

flag_node
Implements a node flag.

Code

function options_form(&$form) {
  parent::options_form($form);

  // Support for i18n flagging requires Translation helpers module.
  $form['i18n'] = array(
    '#type' => 'radios',
    '#title' => t('Internationalization'),
    '#options' => array(
      '1' => t('Flag translations of content as a group'),
      '0' => t('Flag each translation of content separately'),
    ),
    '#default_value' => $this->i18n,
    '#description' => t('Flagging translations as a group effectively allows users to flag the original piece of content regardless of the translation they are viewing. Changing this setting will <strong>not</strong> update content that has been flagged already.'),
    '#access' => module_exists('translation_helpers'),
    '#weight' => 5,
  );
  $form['access']['access_author'] = array(
    '#type' => 'radios',
    '#title' => t('Flag access by content authorship'),
    '#options' => array(
      '' => t('No additional restrictions'),
      'own' => t('Users may only flag content they own'),
      'others' => t('Users may only flag content of others'),
    ),
    '#default_value' => $this->access_author,
    '#description' => t("Restrict access to this flag based on the user's ownership of the content. Users must also have access to the flag through the role settings."),
  );
  $form['display']['show_on_teaser'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display link on node teaser'),
    '#default_value' => $this->show_on_teaser,
    '#access' => empty($this->locked['show_on_teaser']),
  );
  $form['display']['show_on_page'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display link on node page'),
    '#default_value' => $this->show_on_page,
    '#access' => empty($this->locked['show_on_page']),
  );
  $form['display']['show_on_form'] = array(
    '#type' => 'checkbox',
    '#title' => t('Display checkbox on node edit form'),
    '#default_value' => $this->show_on_form,
    '#description' => t('If you elect to have a checkbox on the node edit form, you may specify its initial state in the settings form <a href="@content-types-url">for each content type</a>.', array(
      '@content-types-url' => url('admin/content/types'),
    )),
    '#access' => empty($this->locked['show_on_form']),
  );
}