You are here

function flag_node::options_form in Flag 6

Same name and namespace in other branches
  1. 5 flag.inc \flag_node::options_form()
  2. 6.2 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 817
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);

  // Note there isn't a translation helpers module in Drupal 5,
  // this feature is essentially Drupal 6 only.
  $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['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']),
  );
}