"; $block_content .= "
  • \n"; $block_content .= "
  • \n"; $block_content .= "
  • \n"; $block_content .= "
  • \n"; $block_content .= "

  • \n"; $block_content .= "\n"; $block_content .= "
  • \n"; $block_content .= "\n"; return $block_content; } /****************************** * CREATEJS * * Create JavaScript to auto update select lists and 'Find Documents' button URL */ function createJS() { global $base_url; global $vid; global $taxTree; global $termNames; $jsTermNames .= "var termNames = new Array();\n"; foreach ($termNames as $id => $name) { $jsTermNames .= "termNames[$id] = '$name'\n"; } $jsTaxTree .= "var taxTree = new Array();\n"; foreach ($taxTree as $pidx => $pid) { $jsTaxTree .= "taxTree[$pidx] = new Array();\n"; foreach ($taxTree[$pidx] as $cidx => $cid) { $jsTaxTree .= "taxTree[$pidx][$cidx] = $cid;\n"; } } $js = <<< EOT EOT; return $js; } /****************************** * CREATETAXTREE * * Create an flattened array-based of the term_hierarchy table */ function createTaxTree($termId) { global $taxTree; $query = "SELECT th.tid FROM term_hierarchy th WHERE th.parent=%d"; $queryResult = db_query($query, $termId); while ($row = db_fetch_object($queryResult)) { $taxTree[$termId][] = $row->tid; if ($taxTree[$row->tid] == null) { createTaxTree($row->tid); } } } /****************************** * CREATETERMNAMES * * Create an array-based version of the term_hierarchy table */ function createTermNames() { global $termNames; $query = "SELECT td.tid,td.name FROM term_data td WHERE td.vid=%d"; $queryResult = db_query($query, 1); while ($row = db_fetch_object($queryResult)) { $termNames[$row->tid] = $row->name; } }