You are here

function sheetnode_phpexcel_menu in Sheetnode 7

Same name and namespace in other branches
  1. 5 modules/sheetnode_phpexcel/sheetnode_phpexcel.module \sheetnode_phpexcel_menu()
  2. 6 modules/sheetnode_phpexcel/sheetnode_phpexcel.module \sheetnode_phpexcel_menu()
  3. 7.2 modules/sheetnode_phpexcel/sheetnode_phpexcel.module \sheetnode_phpexcel_menu()

Implements hook_menu().

File

modules/sheetnode_phpexcel/sheetnode_phpexcel.module, line 191
Module file for the sheetnode_phpexcel module. This manages handling of files for sheetnode.

Code

function sheetnode_phpexcel_menu() {
  $items = array();
  foreach (sheetnode_phpexcel_get_plugins('output') as $format => $plugin) {
    $items["sheetnode/{$format}/%node"] = array(
      'title' => 'Save as !format',
      'title arguments' => array(
        '!format' => $plugin['short-name'],
      ),
      'access arguments' => array(
        'access content',
      ),
      'page callback' => '_sheetnode_phpexcel_export',
      'page arguments' => array(
        $format,
        2,
      ),
      'type' => MENU_CALLBACK,
      'file' => 'sheetnode_phpexcel.export.inc',
    );
  }
  $items['sheetnode/export/ready'] = array(
    'title' => 'Spreadsheet exported',
    'access callback' => '_sheetnode_phpexcel_export_access',
    'page callback' => 'theme',
    'page arguments' => array(
      'sheetnode_phpexcel_export_ready',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'sheetnode_phpexcel.export.inc',
  );
  $items['sheetnode/export/download'] = array(
    'title' => 'Download spreadsheet file',
    'access callback' => '_sheetnode_phpexcel_export_access',
    'page callback' => '_sheetnode_phpexcel_export_download',
    'type' => MENU_CALLBACK,
    'file' => 'sheetnode_phpexcel.export.inc',
  );
  foreach (sheetnode_phpexcel_get_plugins('input') as $format => $plugin) {
    $items["node/add/{$format}"] = array(
      'title' => 'Sheetnode import from !format',
      'title arguments' => array(
        '!format' => $plugin['short-name'],
      ),
      'access arguments' => array(
        'create sheetnode',
      ),
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        '_sheetnode_phpexcel_import_form',
        $format,
      ),
      'description' => 'Create a new sheetnode with content from an existing spreadsheet.',
      'file' => 'sheetnode_phpexcel.import.inc',
    );
  }
  $items['admin/config/content/sheetnode/phpexcel'] = array(
    'title' => 'PHPExcel',
    'access arguments' => array(
      'administer site configuration',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      '_sheetnode_phpexcel_settings',
    ),
    'description' => 'Administer settings for Sheetnode PHPExcel.',
    'type' => MENU_LOCAL_TASK,
  );
  return $items;
}