You are here

function publishcontent_views_tables_alter in Publish Content 5.2

Same name and namespace in other branches
  1. 5 publishcontent.module \publishcontent_views_tables_alter()

Implementation of hook_views_tables_alter(). implements a a link to un/publish for views

File

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

Code

function publishcontent_views_tables_alter(&$tables) {
  $tables['node']['fields']['publish'] = array(
    'name' => t('Node: Publish link'),
    'handler' => array(
      'publishcontent_views_handler_node_publish_destination' => t('Return To View'),
      'publishcontent_views_handler_node_publish' => t('Return to Node'),
    ),
    'notafield' => TRUE,
    'addlfields' => array(
      'type',
      'uid',
      'status',
    ),
    'help' => t('Display a link to publish the node.'),
  );
}