You are here

function menu_workbench_access_configuration in Workbench Access 7

Defines configuration options for the default access scheme.

See also

workbench_access_workbench_access_info()

2 string references to 'menu_workbench_access_configuration'
hook_workbench_access_info in ./workbench_access.api.php
Defines your implementation for Workbench Access.
menu_workbench_access_info in modules/menu.workbench_access.inc
Implements hook_workbench_access_info().

File

modules/menu.workbench_access.inc, line 56
Menu integration for Workbench Access.

Code

function menu_workbench_access_configuration(&$form, &$form_state) {
  $options = array();
  $menus = menu_get_menus();
  foreach ($menus as $name => $menu) {
    $options[$name] = $menu;
  }
  $form['menu_workbench_access_info'] = array(
    '#type' => 'fieldset',
    '#title' => t('Menu scheme settings'),
    '#states' => array(
      'visible' => array(
        ':input[name=workbench_access]' => array(
          'value' => 'menu',
        ),
      ),
    ),
  );
  $form['menu_workbench_access_info']['workbench_access_menu'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Editorial menus'),
    '#description' => t('Select the menus to be used for access control.'),
    '#options' => $options,
    '#default_value' => variable_get('workbench_access_menu', array(
      'main_menu',
    )),
    '#states' => array(
      'visible' => array(
        ':input[name=workbench_access]' => array(
          'value' => 'menu',
        ),
      ),
    ),
  );
  $form['menu_workbench_access_info']['workbench_access_menu_limit'] = array(
    '#type' => 'checkbox',
    '#title' => t('Limit available menu items based on Workbench Access.'),
    '#description' => t('If checked, when creating nodes users will not be able to choose a parent menu item to which they do not have editorial access.'),
    '#default_value' => variable_get('workbench_access_menu_limit', 1),
  );
}