primo commit

This commit is contained in:
2024-12-17 17:34:10 +01:00
commit e650f8df99
16435 changed files with 2451012 additions and 0 deletions

View File

@ -0,0 +1,4 @@
satisfy any
order deny,allow
deny from all

View File

@ -0,0 +1,27 @@
<?php
class TabulizerModifyAddemptyrow {
function modify(&$rows, $args = null) {
$num_of_rows = count($rows);
$num_of_columns = count($rows[1]);
if (empty($args)) return;
else $empty_row_id = intval($args);
// sanity check
if (($empty_row_id <1)||($empty_row_id>$num_of_rows)) return;
// construct empty row
$empty_row = array();
for ($k=1;$k<=$num_of_columns;$k++) $empty_row[$k] = '';
$k = 1;
$modified_rows = array();
for ($i=1;$i<=$num_of_rows;$i++) {
if ($i == $empty_row_id) {
$modified_rows[$k++] = $empty_row;
}
$modified_rows[$k++] = $rows[$i];
}
$rows = $modified_rows;
}
}
?>

View File

@ -0,0 +1,33 @@
<?php
class TabulizerModifyAddrow {
function modify(&$rows, $args = null) {
$num_of_rows = count($rows);
$num_of_columns = count($rows[1]);
if (empty($args)) return;
list($row_id, $delimiter, $columns_str) = explode(':',$args,3);
// sanity check
if (($row_id <1)||($row_id>$num_of_rows)) return;
if (empty($delimiter)) return;
if (empty($columns_str)) return;
$columns = explode($delimiter,$columns_str,$num_of_columns);
if (count($columns)!=$num_of_columns) return;
// construct empty row
$empty_row = array();
for ($k=1;$k<=$num_of_columns;$k++) $empty_row[$k] = '';
$k = 1;
$modified_rows = array();
for ($i=1;$i<=$num_of_rows;$i++) {
if ($i == $row_id) {
$modified_rows[$k++] = $columns;
}
$modified_rows[$k++] = $rows[$i];
}
$rows = $modified_rows;
}
}
?>

View File

@ -0,0 +1,42 @@
<?php
class TabulizerModifyConvertcharset {
function modify(&$rows, $args = null) {
if (empty($rows)) {
return;
}
if (isset($args)) {
$encoding = trim(strtoupper($args));
} else {
if (function_exists(mb_detect_encoding)) {
$num_of_rows = count($rows);
$num_of_columns = count($rows[1]);
$sample_text = '';
$ic = ($num_of_rows < 10)?$num_of_rows:10;
for ($i = 1; $i<$ic;$i++) {
for ($j=1;$j<=$num_of_columns;$j++) {
if (isset($rows[$i][$j])) $sample_text .= $rows[$i][$j];
}
}
$encoding = mb_detect_encoding($sample_text, mb_detect_order(), true);
} else {
$encoding = 'ISO-8859-1//TRANSLIT';
}
}
if (function_exists('iconv')) {
foreach ($rows as &$row) {
foreach ($row as &$cell) {
if ($cell != '') $cell = iconv($encoding, "UTF-8", $cell);
}
}
} else if (function_exists('mb_convert_encoding')) {
foreach ($rows as &$row) {
foreach ($row as &$cell) {
if ($cell != '') $cell = mb_convert_encoding($cell, "UTF-8", $encoding);
}
}
} else {
echo "No PHP character conversion library was found. Please try to install either iconv or MBString.";
}
}
}
?>

View File

@ -0,0 +1,4 @@
<html>
<body bgcolor="#FFFFFF">
</body>
</html>

View File

@ -0,0 +1,15 @@
<?php
class TabulizerModifyReplaceemptycell {
function modify(&$rows, $args = null) {
if (empty($rows)) {
return;
}
$replace_str = (isset($args))?$args:'&nbsp;';
foreach ($rows as &$row) {
foreach ($row as &$cell) {
if ($cell == '') $cell = $replace_str;
}
}
}
}
?>