From eb2cf5f2a6b2ae24374adbb499f7c22134801bdb Mon Sep 17 00:00:00 2001
From: Ralf Becker
Date: Tue, 24 Aug 2004 19:52:10 +0000
Subject: [PATCH] renamed html class in admin to html_tables, as the name
clashes with the class html in the api
---
admin/inc/class.html_tables.inc.php | 544 ++++++++++++++++++++++++++++
admin/inc/class.uilog.inc.php | 14 +-
2 files changed, 551 insertions(+), 7 deletions(-)
create mode 100644 admin/inc/class.html_tables.inc.php
diff --git a/admin/inc/class.html_tables.inc.php b/admin/inc/class.html_tables.inc.php
new file mode 100644
index 0000000000..771aeb34fd
--- /dev/null
+++ b/admin/inc/class.html_tables.inc.php
@@ -0,0 +1,544 @@
+ *
+ * -------------------------------------------- *
+ * This program is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU General Public License as published by the *
+ * Free Software Foundation; either version 2 of the License, or (at your *
+ * option) any later version. *
+ \**************************************************************************/
+
+ /* $Id$ */
+
+ class html_tables
+ {
+ function hash_table($rows,$head='',$obj, $frtn)
+ {
+ $start = $_POST['start'] ? $_POST['start'] : $_GET['start'];
+
+ $html = '';
+ $edittable = $head['_edittable'];
+ if(isset($edittable))
+ {
+ if($edittable)
+ {
+ // Generate the customization table...
+ return $this->edit_table($rows,$head,$obj,$frtn);
+ }
+ else
+ {
+ #$html .= '
";
+ $grno=$rno;
+ $gkey=$rkey;
+ }
+ }
+ /*
+ ** Now Generate the Html For the Table Header
+ */
+ //print_r($table);
+
+ $html .= $this->html_head($head,$table,$printlist);
+ /*
+ ** Now (finally) Generate the Html For the Table
+ */
+ //print_r($rows);
+ for($rno=$start;$rno<$stop;$rno++)
+ {
+ // let user have a hack at the row...
+ $row = $obj->$frtn($rno,$rows[$rno]);
+ // $row = $rows[$rno];
+
+ // $rp = $this->makeparms($row[$rno]['#row_parms']);
+ $rp = '';
+ $gkey = $row['#gkey'];
+ // $html .= "\t \n";
+ $html .= "\t \n";
+ reset($printlist);
+ while(list($pc,$pcol)=each($printlist))
+ {
+ $cname = $pcol['#name'];
+
+ $cp = $this->makeparms($row[$cname]);
+ if($row[$cname]['#supres'] != 'yes')
+ {
+ $html .= "\t\t".$row[$cname]['value']." | \n";
+ }
+ if($pcol['#eor']=='1')
+ {
+ $html .= "\t
\n"; // \t\n
+ }
+ }
+ }
+ $html .= "\n";
+ #$html .= "";
+ return $html;
+ }
+
+ function makeparms($parmlist)
+ {
+ $html = '';
+ $comma = ' ';
+ if(!is_array($parmlist))
+ {
+ return '';
+ }
+ reset($parmlist);
+ while(list($pname,$pvalue)=each($parmlist))
+ {
+ switch($pname)
+ {
+ case 'value':
+ break;
+ case 'colspan':
+ case 'rowspan':
+ if($pvalue != 1)
+ {
+ $html .= $comma . $pname . '="' . $pvalue . '"';
+ #$comma = ', ';
+ $comma = ' ';
+ };
+ break;
+ default:
+ if(substr($pname,0,1) != '#')
+ {
+ $html .= $comma . $pname . '="' . $pvalue . '"';
+ #$comma = ', ';
+ $comma = ' ';
+ }
+ }
+ }
+ return $html;
+ }
+
+ function edit_table($rows,$head='',$obj, $frtn)
+ {
+ $nocols = $_POST['nocols'];
+ $noflds = $_POST['noflds'];
+ $norows = $_POST['norows'];
+ $layout = $_POST['layout'];
+ $_cols = $_POST['_cols'];
+
+ $html = '';
+ $html .= '