Commit 6217f49be8f9ffab5246733d23071f547d1691e9
1 parent
45e390a0
(#2828) made word wrap configurable
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2532 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
12 additions
and
4 deletions
lib/visualpatterns/PatternTableSqlQuery.inc
| @@ -54,8 +54,8 @@ class PatternTableSqlQuery { | @@ -54,8 +54,8 @@ class PatternTableSqlQuery { | ||
| 54 | /** Picture paths */ | 54 | /** Picture paths */ |
| 55 | var $sChkPicPath = "widgets/checked.gif"; | 55 | var $sChkPicPath = "widgets/checked.gif"; |
| 56 | var $sUnChkPicPath = "widgets/unchecked.gif"; | 56 | var $sUnChkPicPath = "widgets/unchecked.gif"; |
| 57 | - | ||
| 58 | - var $bIncludeBorder = false; | 57 | + /** whether to force entries to wrap */ |
| 58 | + var $bWordWrap = false; | ||
| 59 | 59 | ||
| 60 | function PatternTableSqlQuery($sTmpQuery, $aTmpColumns, $aTmpColumnTypes, $aTmpColumnHeaderNames, $sTmpWidth, $aTmpLinkURLs = null, $aTmpDBQueryStringColumns = null, $aNewQueryStringVariableNames = null) { | 60 | function PatternTableSqlQuery($sTmpQuery, $aTmpColumns, $aTmpColumnTypes, $aTmpColumnHeaderNames, $sTmpWidth, $aTmpLinkURLs = null, $aTmpDBQueryStringColumns = null, $aNewQueryStringVariableNames = null) { |
| 61 | $this->sQuery = $sTmpQuery; | 61 | $this->sQuery = $sTmpQuery; |
| @@ -101,6 +101,10 @@ class PatternTableSqlQuery { | @@ -101,6 +101,10 @@ class PatternTableSqlQuery { | ||
| 101 | return $this->sChkPicPath ; | 101 | return $this->sChkPicPath ; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | + function setWordWrap($bNewValue) { | ||
| 105 | + $this->bWordWrap = $bNewValue; | ||
| 106 | + } | ||
| 107 | + | ||
| 104 | /** | 108 | /** |
| 105 | * Build the HTML string used to render the object | 109 | * Build the HTML string used to render the object |
| 106 | * | 110 | * |
| @@ -145,8 +149,12 @@ class PatternTableSqlQuery { | @@ -145,8 +149,12 @@ class PatternTableSqlQuery { | ||
| 145 | } else if ($this->bUseImageURLFromQuery) { | 149 | } else if ($this->bUseImageURLFromQuery) { |
| 146 | $sToRender .= $this->generateImageURL($sql->f("image_url")); | 150 | $sToRender .= $this->generateImageURL($sql->f("image_url")); |
| 147 | } | 151 | } |
| 148 | - if ($sql->f($this->aColumns[$i]) != null) { | ||
| 149 | - $sToRender .= wordwrap(stripslashes($sql->f($this->aColumns[$i])), 25, " ", 1) . "</td>"; | 152 | + if ($sql->f($this->aColumns[$i]) != null) { |
| 153 | + if ($this->bWordWrap) { | ||
| 154 | + $sToRender .= wordwrap(stripslashes($sql->f($this->aColumns[$i])), 25, " ", 1) . "</td>"; | ||
| 155 | + } else { | ||
| 156 | + $sToRender .= stripslashes($sql->f($this->aColumns[$i])) . "</td>"; | ||
| 157 | + } | ||
| 150 | } else { | 158 | } else { |
| 151 | $sToRender .= " </td>"; | 159 | $sToRender .= " </td>"; |
| 152 | } | 160 | } |