You are here

function sheetnode_content_generate in Sheetnode 6

Implementation of hook_content_generate().

1 call to sheetnode_content_generate()
sheetnode_nodeapi in ./sheetnode.module
Implementation of hook_nodeapi().

File

./sheetnode.module, line 688

Code

function sheetnode_content_generate($node, $field) {
  require_once drupal_get_path('module', 'sheetnode') . '/socialcalc.inc';
  $sc = array(
    'edit' => array(),
    'audit' => array(),
    'sheet' => array(),
  );
  for ($row = 1; $row < mt_rand(10, 50); $row++) {
    $sc['sheet']['cells'][] = array(
      'pos' => array(
        1,
        $row,
      ),
      'datavalue' => devel_generate_word(mt_rand(6, 12)),
      'datatype' => 't',
      'valuetype' => 't',
    );
    $sc['sheet']['cells'][] = array(
      'pos' => array(
        2,
        $row,
      ),
      'datavalue' => _sheetnode_lcg_randf(-100, 100),
      'datatype' => 'v',
      'valuetype' => 'n',
    );
  }
  $sc['edit']['ecell']['coord'] = 'A1';
  return array(
    'value' => socialcalc_save($sc),
  );
}