';
$head_tags[] = ' ';
}
$st_count++;
$table_html = preg_replace('/
EOD;
} else {
$js = <<
EOD;
}
return $table_html . $js;
}
function plugin_sortabletable_convert()
{
static $number = array();
$page = isset($vars['page']) ? $vars['page'] : '';
if (! isset($number[$page])) $number[$page] = 1;
$count = $number[$page]++;
$args = func_get_args();
$t_source = array_pop($args);
$t_source = str_replace("\r", "\n", str_replace("\r\n", "\n", $t_source));
if (isset($args[0]) && $args[0] != ""){
$st_so = explode("|", $args[0]);
$sortabletableso = "'" . array_shift($st_so) . "'";
foreach ($st_so as $st_so_c) {
$sortabletableso .= ",'" . $st_so_c . "'";
}
} else {
$t_l_source = explode("\n", $t_source);
foreach ($t_l_source as $ts_line) {
if ( preg_match('/^\|(.+)\|([hHfFcC]?)$/', $ts_line, $match) ){
$table_cells = explode("|", $match[1]);
$cols = count($table_cells);
break;
}
}
$sortabletableso = join(',', array_fill(0, $cols, "'String'"));
}
if (isset($args[1]) && $args[1] == 1) {
$filter = 1;
} else {
$filter = 0;
}
if (isset($args[2]) && $args[2] != ""){
$table_id = $args[2] . $count;
} else {
$table_id = 'sortabletable' . $count;
}
$h_t_source = convert_html($t_source);
$body = sortabletable_main( $table_id, $h_t_source, $sortabletableso, $filter);
return $body;
}
?>