Project

General

Profile

« Previous | Next » 

Revision 26d785bb

Added by Phil Davis about 10 years ago

More combinedfields and usecolspan2 fixes

Actually the "tr" tag needs to be a single tag-pair that encloses all of the set of fields with combinedfields specified - combinedfields=begin is where the "tr" tag starts and combinedfields=end is where the "tr" tag ends, enclosing a whole set of combined fields.
That allows usecolspan2 to work.
In the previous change I had made it enclose every field in its own "tr" tag-pair That caused usecolspan2 to be ineffective at spreading the combined fields across the display.
Also colspan needs to be initialised each time around the loop - it was getting applied to all fields further down the page after the first one it was used in.
This is the version for master.

View differences:

usr/local/www/pkg_edit.php
507 507
		}
508 508

  
509 509
		$size = "";
510
		$colspan="";
510 511
		if (isset($pkga['dontdisplayname'])) {
511 512
			$input="";
512
			if ($pkga['combinefields'] != "begin") {
513
			// We do not want a separate tr tag pair for each field in a set of combined fields.
514
			// The case of putting the first tr tag at the beginning of a combine-fields set is already handled above.
515
			if (!isset($pkga['combinefields'])) {
513 516
				$input .= "<tr valign='top' id='tr_{$pkga['fieldname']}'>";
514 517
			}
515 518
			if (isset($pkga['usecolspan2'])) {
......
529 532
				$req = 'req';
530 533
			}
531 534
			$input="";
532
			if ($pkga['combinefields'] != "begin") {
535
			// We do not want a separate tr tag pair for each field in a set of combined fields.
536
			// The case of putting the first tr tag at the beginning of a combine-fields set is already handled above.
537
			if (!isset($pkga['combinefields'])) {
533 538
				$input .= "<tr>";
534 539
			}
535 540
			$input .= "<td valign='top' width=\"22%\" class=\"vncell{$req}\">";
......
1001 1006
		if ($pkga['typehint']) {
1002 1007
			echo " " . $pkga['typehint'];
1003 1008
		}
1004
		$input = "</td></tr>";
1005 1009
		#check combinefields options
1006 1010
		if (isset($pkga['combinefields'])) {
1011
			// At the end of each combined-fields field we just want to end a td tag.
1012
			$input = "</td>";
1013
			// The tr tag and... ends are only used to end the whole set of combined fields.
1007 1014
			if ($pkga['combinefields']=="end") {
1008
				$input.="</table></td></tr>";
1015
				$input.="</tr></table></td></tr>";
1009 1016
			}
1010 1017
		} else {
1018
			$input = "</td></tr>";
1011 1019
			if ($pkga['usecolspan2']) {
1012 1020
				$input.= "</tr><br />";
1013 1021
			}

Also available in: Unified diff