Commit 7342ce7c65c62527d9136bd1310cf17832578e37
1 parent
27748a00
added image handling functionality
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@271 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
12 additions
and
2 deletions
lib/visualpatterns/PatternTableLinks.inc
| ... | ... | @@ -8,6 +8,9 @@ HTML table with with specified number of rows and columns |
| 8 | 8 | @date 7 January 2003 |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | +define("TEXT", 1); | |
| 12 | +define("IMAGE", 2); | |
| 13 | + | |
| 11 | 14 | class PatternTableLinks { |
| 12 | 15 | |
| 13 | 16 | /** Array of link URLS to display in tables */ |
| ... | ... | @@ -33,7 +36,7 @@ class PatternTableLinks { |
| 33 | 36 | * @param $iLinkType Link type (1 = Text or 2 = Button). Default is 1 |
| 34 | 37 | * @param $aLinkImages Array of images URL placed over links |
| 35 | 38 | */ |
| 36 | - function PatternTableLinks($aNewLinks, $aNewLinksText, $iNewRows, $iNewColumns, $iNewLinkType = 1, $aNewLinkImages = null) { | |
| 39 | + function PatternTableLinks($aNewLinks, $aNewLinksText, $iNewRows, $iNewColumns, $iNewLinkType = TEXT, $aNewLinkImages = null) { | |
| 37 | 40 | $this->aLinks = $aNewLinks; |
| 38 | 41 | $this->aLinksText = $aNewLinksText; |
| 39 | 42 | $this->aLinkImages = $aNewLinkImages; |
| ... | ... | @@ -58,7 +61,14 @@ class PatternTableLinks { |
| 58 | 61 | for ($j = 0; $j < $this->iColumns; $j++) { |
| 59 | 62 | $sToRender = $sToRender . "<td>"; |
| 60 | 63 | if ($iArrayCount < $iArraySize) { |
| 61 | - $sToRender = $sToRender . "<a href=\"" . $this->aLinks[$iArrayCount] . "\" />" . $this->aLinksText[$iArrayCount]; | |
| 64 | + $sToRender = $sToRender . "<a href=\"" . $this->aLinks[$iArrayCount] . "\" />"; | |
| 65 | + if ($this->iLinkType == TEXT) { | |
| 66 | + $sToRender = $sToRender . $this->aLinksText[$iArrayCount]; | |
| 67 | + } else if ($this->iLinkType == IMAGE) { | |
| 68 | + $oImage = new PatternImage($this->aLinkImages[$iArrayCount]); | |
| 69 | + $sToRender = $sToRender . $oImage->render(); | |
| 70 | + } | |
| 71 | + $sToRender = $sToRender . "</a>"; | |
| 62 | 72 | $iArrayCount++; |
| 63 | 73 | } |
| 64 | 74 | $sToRender = $sToRender . "</td>\n"; | ... | ... |