You are here

function sheetnode_phpexcel_link in Sheetnode 6

Same name and namespace in other branches
  1. 5 modules/sheetnode_phpexcel/sheetnode_phpexcel.module \sheetnode_phpexcel_link()

Implementation of hook_link().

File

modules/sheetnode_phpexcel/sheetnode_phpexcel.module, line 139

Code

function sheetnode_phpexcel_link($type, $node = NULL, $teaser = FALSE) {
  if ($type != 'node' || $node->type != 'sheetnode' && !sheetnode_get_sheetfields($node->type) || !variable_get('sheetnode_phpexcel_export_links', TRUE)) {
    return array();
  }
  foreach (sheetnode_phpexcel_get_plugins('output') as $format => $plugin) {
    $links[$format] = array(
      'title' => t('Save as !format', array(
        '!format' => $plugin['short-name'],
      )),
      'href' => "sheetnode/{$format}/{$node->nid}",
    );
  }
  return $links;
}