You are here

function _sheetnode_ajax_load in Sheetnode 6

Same name and namespace in other branches
  1. 5 sheetnode.module \_sheetnode_ajax_load()
  2. 7.2 sheetnode.module \_sheetnode_ajax_load()
  3. 7 sheetnode.module \_sheetnode_ajax_load()

AJAX function to return a sheet value.

1 string reference to '_sheetnode_ajax_load'
sheetnode_menu in ./sheetnode.module
Implementation of hook_menu().

File

./sheetnode.module, line 969

Code

function _sheetnode_ajax_load($sheetname = NULL) {

  // Parse the sheetname which might contain extra args separated by forward-slash.
  if (empty($sheetname)) {
    $sheetname = $_REQUEST['sheetname'];
  }

  // Look for the sheet.
  list($value, $title) = sheetnode_find_sheet($sheetname);

  // Found a spreadsheet: return it.
  drupal_set_header('Content-type: text/plain; charset=utf-8');
  if ($value) {
    $parts = socialcalc_parse_parts($value);
    if (isset($parts['sheet'])) {
      echo $parts['sheet'];
    }
  }
  exit;
}