Commit 4eedae775e384ce5218fd8640dfc67bdcd86f27b

Authored by rob
1 parent 05a741e7

Added functionality to allow for multiple urls for columns of type 3 (href)


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@833 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/visualpatterns/PatternTableSqlQuery.inc
... ... @@ -36,7 +36,7 @@ class PatternTableSqlQuery {
36 36 /** table width, either in pixels or as a percentage e.g. 600 or 100%*/
37 37 var $sWidth;
38 38 /** link url used if a column type of 3 is specified */
39   - var $sLinkURL;
  39 + var $aLinkURLs;
40 40 /** database column values to append to link url if a column type of 3 is specified */
41 41 var $aDBQueryStringColumns;
42 42 /** variables names to give $aDBQueryStringColumns on the query string */
... ... @@ -52,14 +52,14 @@ class PatternTableSqlQuery {
52 52 /** message that will be displayed if the table is empty*/
53 53 var $sEmptyTableMessage;
54 54  
55   - function PatternTableSqlQuery($sTmpQuery, $aTmpColumns, $aTmpColumnTypes, $aTmpColumnHeaderNames, $sTmpWidth, $sTmpLinkURL = null, $sTmpDBQueryStringColumns = null, $aNewQueryStringVariableNames = null) {
  55 + function PatternTableSqlQuery($sTmpQuery, $aTmpColumns, $aTmpColumnTypes, $aTmpColumnHeaderNames, $sTmpWidth, $aTmpLinkURLs = null, $sTmpDBQueryStringColumns = null, $aNewQueryStringVariableNames = null) {
56 56 $this->sQuery = $sTmpQuery;
57 57 $this->aColumns = & $aTmpColumns;
58 58 $this->aColumnTypes = $aTmpColumnTypes;
59 59 $this->aColumnHeaderNames = $aTmpColumnHeaderNames;
60 60 $this->sWidth = $sTmpWidth;
61 61 $this->bDisplayColumnHeadings = $bTmpDisplayColumnHeadings;
62   - $this->sLinkURL = $sTmpLinkURL;
  62 + $this->aLinkURLs = $aTmpLinkURLs;
63 63 $this->aDBQueryStringColumns = $sTmpDBQueryStringColumns;
64 64 $this->aQueryStringVariableNames = $aNewQueryStringVariableNames;
65 65 }
... ... @@ -133,8 +133,8 @@ class PatternTableSqlQuery {
133 133 }
134 134 break;
135 135 case 3:
136   - //hyperlink
137   - $sToRender .= "<td><a href=\"" . $this->sLinkURL;
  136 + //hyperlink
  137 + $sToRender .= "<td><a href=\"" . $this->aLinkURLs[$i];
138 138 for ($j = 0; $j < count($this->aDBQueryStringColumns); $j++) {
139 139 if (strpos($sToRender, "?") === false) {
140 140 $sToRender .= "?" . $this->aQueryStringVariableNames[$j] . "=" . $sql->f($this->aDBQueryStringColumns[$j]);
... ...