You are here

function access_unpublished_url_param_form in Access unpublished 7

Form constructor for system setting.

1 string reference to 'access_unpublished_url_param_form'
access_unpublished_menu in ./access_unpublished.module
Implements hook_menu().

File

./access_unpublished.admin.inc, line 10
Admin page callbacks for Access unpublished.

Code

function access_unpublished_url_param_form($form) {
  $form['access_unpublished_url_key'] = array(
    '#type' => 'textfield',
    '#title' => t('URL hash parameter'),
    '#default_value' => variable_get('access_unpublished_url_key', 'hash'),
    '#description' => t('Set the URL parameter for hashed key,
      for example: http://example.com/node/1?<strong>hash</strong>=abc...,
      example.com/node/1?<strong>key</strong>=abc...'),
    '#maxlength' => 20,
    '#size' => 10,
  );
  $form['access_unpublished_display_link'] = array(
    '#type' => 'fieldset',
    '#title' => t('Display hashed link to unpublished node in:'),
  );
  $form['access_unpublished_display_link']['access_unpublished_display_link_in_drupal_message'] = array(
    '#type' => 'checkbox',
    '#title' => t('Drupal message'),
    '#default_value' => variable_get('access_unpublished_display_link_in_drupal_message', 1),
  );
  $form['access_unpublished_display_link']['access_unpublished_display_link_in_node_content'] = array(
    '#type' => 'checkbox',
    '#title' => t('Node content'),
    '#description' => t('Use template access-unpublished-link.tpl.php
      and access_unpublished.css for custom design.'),
    '#default_value' => variable_get('access_unpublished_display_link_in_node_content', 1),
  );
  $form['access_unpublished_display_link']['access_unpublished_display_link_on_node_form'] = array(
    '#type' => 'checkbox',
    '#title' => t('Node form'),
    '#description' => t('Show hashed link on the node edit form. Has no effect unless "Drupal message" setting above is also checked.'),
    '#default_value' => variable_get('access_unpublished_display_link_on_node_form', 1),
  );
  return system_settings_form($form);
}