You are here

function publishcontent_menu in Publish Content 6

Same name and namespace in other branches
  1. 5.2 publishcontent.module \publishcontent_menu()
  2. 5 publishcontent.module \publishcontent_menu()
  3. 7 publishcontent.module \publishcontent_menu()

Implements of hook_menu().

File

./publishcontent.module, line 12
Add button to publish or unpublish a node, with access control based on the node type

Code

function publishcontent_menu() {
  $items = array();
  $items['admin/settings/publishcontent'] = array(
    'title' => 'Publish content settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'publishcontent_config_form',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer site configuration',
    ),
    'description' => 'Show/hide the publish/unpublish tabs on nodes.',
    'file' => 'publishcontent.admin.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  $items['node/%publishcontent_tab/publish/%publishcontent_security_token'] = array(
    'title' => 'Publish',
    'page callback' => 'publishcontent_toggle_status',
    'page arguments' => array(
      1,
    ),
    'access callback' => '_publishcontent_publish_access',
    'access arguments' => array(
      1,
      3,
    ),
    'weight' => 5,
    'type' => MENU_LOCAL_TASK,
  );
  $items['node/%publishcontent_tab/unpublish/%publishcontent_security_token'] = array(
    'title' => 'Unpublish',
    'page callback' => 'publishcontent_toggle_status',
    'page arguments' => array(
      1,
    ),
    'access callback' => '_publishcontent_unpublish_access',
    'access arguments' => array(
      1,
      3,
    ),
    'weight' => 5,
    'type' => MENU_LOCAL_TASK,
  );
  return $items;
}