You are here

function panelizer_workbench_moderation_node_history_view_alter in Panelizer 7.3

Implements hook_workbench_moderation_node_history_view_alter().

This is a little kludgy as the data in the row is stored as final HTML for display.

File

./panelizer.module, line 2056
The Panelizer module attaches panels to entities, providing default panels and allowing each panel to be configured independently by privileged users.

Code

function panelizer_workbench_moderation_node_history_view_alter(&$rows) {

  // Load the node.
  $node = node_load(arg(1));

  // Verify the user has access to the Panelizer configuration.
  if (panelizer_is_panelized('node', $node->type)) {

    // Loop over each table row.
    foreach ($rows as $key => &$row) {

      // Published.
      $path = 'node/' . $node->nid . '/panelizer';

      // Not published.
      if (!in_array('published-revision', $row['class'])) {
        $path = 'node/' . $node->nid . '/revisions/' . $row['data']['vid'] . '/panelizer';
      }

      // Add a link to the Panelizer page.
      $row['data']['revision'] .= ' | ' . l('Customize display', $path);
    }
  }
}