remove comment code which is not needed

This commit is contained in:
Miles Lott 2004-02-20 15:04:26 +00:00
parent 57c55f4899
commit 2f32ca43b2

View File

@ -16,13 +16,13 @@
{ {
function hash_table($rows,$head='',$obj, $frtn) function hash_table($rows,$head='',$obj, $frtn)
{ {
$start = $GLOBALS['HTTP_POST_VARS']['start'] ? $GLOBALS['HTTP_POST_VARS']['start'] : $GLOBALS['HTTP_GET_VARS']['start']; $start = $_POST['start'] ? $_POST['start'] : $_GET['start'];
$html = ''; $html = '';
$edittable =$head['_edittable']; $edittable = $head['_edittable'];
if (isset($edittable)) if(isset($edittable))
{ {
if ($edittable) if($edittable)
{ {
// Generate the customization table... // Generate the customization table...
return $this->edit_table($rows,$head,$obj,$frtn); return $this->edit_table($rows,$head,$obj,$frtn);
@ -33,13 +33,13 @@
# . $GLOBALS['phpgw']->link('/index.php') # . $GLOBALS['phpgw']->link('/index.php')
# . '">' . "\n"; # . '">' . "\n";
$bo = CreateObject('admin.bolog',True); $bo = CreateObject('admin.bolog',True);
if (!isset($start)) if(!isset($start))
{ {
$start = 0; $start = 0;
} }
$num_rows = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']; $num_rows = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
$stop = $start + $num_rows; $stop = $start + $num_rows;
if ($stop > count($rows)) if($stop > count($rows))
{ {
$stop = count($rows); $stop = count($rows);
} }
@ -58,7 +58,7 @@
} }
} }
if ($head == '') if($head == '')
{ {
$frow = $rows[0]; $frow = $rows[0];
$cnam = $this->arr_keys($frow); $cnam = $this->arr_keys($frow);
@ -68,7 +68,6 @@
} }
} }
// if(gettype($head['_cols'])=="NULL")
if(@is_null($head['_cols'])) if(@is_null($head['_cols']))
{ {
$cols = $this->arr_keys($rows[0]); $cols = $this->arr_keys($rows[0]);
@ -82,7 +81,7 @@
// First Get the layout arrays... // First Get the layout arrays...
$layout = $head['#layout']; $layout = $head['#layout'];
if (!is_array($layout)) if(!is_array($layout))
{ {
$layout = $this->arr_keys($cols); $layout = $this->arr_keys($cols);
} }
@ -103,14 +102,14 @@
// build actual Rows... // build actual Rows...
$rparms = array(); $rparms = array();
$mrow = $stop; $mrow = $stop;
for ($rno=0;$rno<$mrow;$rno++) for($rno=0;$rno<$mrow;$rno++)
{ {
// Build GroupKey // Build GroupKey
if (isset($groupby)) if(isset($groupby))
{ {
$gkey = ''; $gkey = '';
reset($groupby); reset($groupby);
while (list($gname,)=each($groupby)) while(list($gname,)=each($groupby))
{ {
$gkey .= $rows[$rno][$gname]['value']; $gkey .= $rows[$rno][$gname]['value'];
} }
@ -128,28 +127,28 @@
// Grouping Suppression // Grouping Suppression
if (isset($groupby)) if(isset($groupby))
{ {
$grno = $start; $grno = $start;
$gkey = $rows[$start]['#gkey']; $gkey = $rows[$start]['#gkey'];
for ($rno=$start+1;$rno<$stop;$rno++) for($rno=$start+1;$rno<$stop;$rno++)
{ {
$rowspan = 1; $rowspan = 1;
$rkey = $rows[$rno]['#gkey']; $rkey = $rows[$rno]['#gkey'];
while ( $gkey == $rkey) while( $gkey == $rkey)
{ {
//echo "<p>grno:$grno ($gkey) rno:$rno ($rkey) are equal</p>"; //echo "<p>grno:$grno ($gkey) rno:$rno ($rkey) are equal</p>";
$rowspan = $rowspan + 1; $rowspan = $rowspan + 1;
$row = $rows[$rno]; $row = $rows[$rno];
for ($pc=0;$pc<count($row);$pc++) for($pc=0;$pc<count($row);$pc++)
{ {
$c = $row[$cols[$pc]]; $c = $row[$cols[$pc]];
$cno = $c['#colno']; $cno = $c['#colno'];
$cname = $c['#name']; $cname = $c['#name'];
if ($supres[$cname]) if($supres[$cname])
{ {
$rows[$rno][$cname]['#supres']='yes'; $rows[$rno][$cname]['#supres']='yes';
$rows[$rno][$cname]['value']='&nbsp '; $rows[$rno][$cname]['value']='&nbsp ';
@ -171,10 +170,10 @@
$html .= $this->html_head($head,$table,$printlist); $html .= $this->html_head($head,$table,$printlist);
/* /*
** Now (finaly) Generate the Html For the Table ** Now (finally) Generate the Html For the Table
*/ */
//print_r($rows); //print_r($rows);
for ($rno=$start;$rno<$stop;$rno++) for($rno=$start;$rno<$stop;$rno++)
{ {
// let user have a hack at the row... // let user have a hack at the row...
$row = $obj->$frtn($rno,$rows[$rno]); $row = $obj->$frtn($rno,$rows[$rno]);
@ -210,7 +209,7 @@
{ {
$html = ''; $html = '';
$comma = ' '; $comma = ' ';
if (!is_array($parmlist)) if(!is_array($parmlist))
{ {
return ''; return '';
} }
@ -223,7 +222,7 @@
break; break;
case 'colspan': case 'colspan':
case 'rowspan': case 'rowspan':
if ($pvalue != 1) if($pvalue != 1)
{ {
$html .= $comma . $pname . '="' . $pvalue . '"'; $html .= $comma . $pname . '="' . $pvalue . '"';
#$comma = ', '; #$comma = ', ';
@ -231,7 +230,7 @@
}; };
break; break;
default: default:
if (substr($pname,0,1) != '#') if(substr($pname,0,1) != '#')
{ {
$html .= $comma . $pname . '="' . $pvalue . '"'; $html .= $comma . $pname . '="' . $pvalue . '"';
#$comma = ', '; #$comma = ', ';
@ -244,11 +243,11 @@
function edit_table($rows,$head='',$obj, $frtn) function edit_table($rows,$head='',$obj, $frtn)
{ {
$nocols = $GLOBALS['HTTP_POST_VARS']['nocols']; $nocols = $_POST['nocols'];
$noflds = $GLOBALS['HTTP_POST_VARS']['noflds']; $noflds = $_POST['noflds'];
$norows = $GLOBALS['HTTP_POST_VARS']['norows']; $norows = $_POST['norows'];
$layout = $GLOBALS['HTTP_POST_VARS']['layout']; $layout = $_POST['layout'];
$_cols = $GLOBALS['HTTP_POST_VARS']['_cols']; $_cols = $_POST['_cols'];
$html = ''; $html = '';
$html .= '<form method="post" action="' $html .= '<form method="post" action="'
@ -258,7 +257,7 @@
$params = $head['_table_parms']; $params = $head['_table_parms'];
$frow = $rows[0]; $frow = $rows[0];
$cnam = $this->arr_keys($frow); $cnam = $this->arr_keys($frow);
if ($head == '') if($head == '')
{ {
while(list(,$fn)=each($cnam)) while(list(,$fn)=each($cnam))
{ {
@ -266,13 +265,12 @@
} }
} }
if (isset($_cols)) if(isset($_cols))
{ {
$cols = $_cols; $cols = $_cols;
} }
else else
{ {
// if(gettype($head['_cols'])=="NULL")
if(@is_null($head['_cols'])) if(@is_null($head['_cols']))
{ {
$cols = $this->arr_keys($rows[0]); $cols = $this->arr_keys($rows[0]);
@ -283,19 +281,19 @@
} }
} }
if (!isset($noflds)) if(!isset($noflds))
{ {
$noflds = count($cols); $noflds = count($cols);
} }
if (!isset($layout)) if(!isset($layout))
{ {
$layout = $head['#layout']; $layout = $head['#layout'];
} }
if (!isset($norows)) if(!isset($norows))
{ {
$norows = count($layout); $norows = count($layout);
} }
if (!isset($nocols)) if(!isset($nocols))
{ {
$nocols = count($layout[0]); $nocols = count($layout[0]);
} }
@ -316,21 +314,21 @@
$html .= "<h2>Column Definition</h2>"; $html .= "<h2>Column Definition</h2>";
$html .= "<table width=\"98%\" bgcolor=\"#000000\">\n"; $html .= "<table width=\"98%\" bgcolor=\"#000000\">\n";
$f = array(); $f = array();
for ($fno=0;$fno<$noflds;$fno++) for($fno=0;$fno<$noflds;$fno++)
{ {
$f[]=$fno; $f[]=$fno;
} }
// Column Headings // Column Headings
$html .= "\t<tr bgcolor=\"#D3DCFF\">\n"; $html .= "\t<tr bgcolor=\"#D3DCFF\">\n";
for ($cno=0;$cno<$nocols;$cno++) for($cno=0;$cno<$nocols;$cno++)
{ {
$html .= "\t\t<td align=\"center\">$cno</td>\n"; $html .= "\t\t<td align=\"center\">$cno</td>\n";
} }
$html .= "\t</tr >\n"; $html .= "\t</tr >\n";
for ($rno=0;$rno<$norows;$rno++) for($rno=0;$rno<$norows;$rno++)
{ {
$html .= "\t<tr bgcolor=\"#D3DCFF\">\n"; $html .= "\t<tr bgcolor=\"#D3DCFF\">\n";
for ($cno=0;$cno<$nocols;$cno++) for($cno=0;$cno<$nocols;$cno++)
{ {
$c = $layout[$rno][$cno]; $c = $layout[$rno][$cno];
$tname = "layout[$rno][]"; $tname = "layout[$rno][]";
@ -360,13 +358,13 @@
// Add Table Rows... // Add Table Rows...
reset($cols); reset($cols);
// while (list($cno,$name) = each($cols)) // while(list($cno,$name) = each($cols))
for ($fno=0;$fno<$noflds;$fno++) for($fno=0;$fno<$noflds;$fno++)
{ {
$name = $cols[$fno]; $name = $cols[$fno];
$values = $head[$name]; $values = $head[$name];
$title = $values['title']; $title = $values['title'];
if ($title == '') if($title == '')
{ {
$title = $name; $title = $name;
} }
@ -388,16 +386,16 @@
{ {
$items = $opts; $items = $opts;
$html = '<select '; $html = '<select ';
if ($name != '') if($name != '')
{ {
$html .= 'name="'.$name.'"'; $html .= 'name="'.$name.'"';
} }
$html .= ">\n"; $html .= ">\n";
while (list(,$itm)=each($opts)) while(list(,$itm)=each($opts))
{ {
$html .= '<option value="'.$itm.'" '; $html .= '<option value="'.$itm.'" ';
if ($itm == $sel) if($itm == $sel)
{ {
$html .= 'selected '; $html .= 'selected ';
} }
@ -418,7 +416,7 @@
{ {
for($pc=0;$pc<$mcols;$pc++) for($pc=0;$pc<$mcols;$pc++)
{ {
if (isset($tlayout[$pr][$pc])) if(isset($tlayout[$pr][$pc]))
{ {
$cno = $tlayout[$pr][$pc]; $cno = $tlayout[$pr][$pc];
$cname = $cols[$cno]; $cname = $cols[$cno];
@ -434,7 +432,7 @@
unset($tlayout[$pr][$pc+$colspan]); unset($tlayout[$pr][$pc+$colspan]);
$colspan++; $colspan++;
} }
if ($colspan > 1 && $rowspan > 1) if($colspan > 1 && $rowspan > 1)
{ {
for($r=$pr+1;$r<$pr+$rowspan;$r++) for($r=$pr+1;$r<$pr+$rowspan;$r++)
{ {
@ -469,7 +467,7 @@
$cname = $pcol['#name']; $cname = $pcol['#name'];
$values = $head[$cname]; $values = $head[$cname];
$title = $values['#title']; $title = $values['#title'];
if ($title == '') if($title == '')
{ {
$title = $cname; $title = $cname;
} }
@ -494,7 +492,7 @@
$intr = true; $intr = true;
while(list(,$col)=each($row)) while(list(,$col)=each($row))
{ {
if (!$intr) if(!$intr)
{ {
$html .= "\t<tr $rp>\n"; $html .= "\t<tr $rp>\n";
$intr = true; $intr = true;