From 7342ce7c65c62527d9136bd1310cf17832578e37 Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 16 Jan 2003 14:59:58 +0000 Subject: [PATCH] added image handling functionality --- lib/visualpatterns/PatternTableLinks.inc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/visualpatterns/PatternTableLinks.inc b/lib/visualpatterns/PatternTableLinks.inc index 30c2fdd..b86f248 100644 --- a/lib/visualpatterns/PatternTableLinks.inc +++ b/lib/visualpatterns/PatternTableLinks.inc @@ -8,6 +8,9 @@ HTML table with with specified number of rows and columns @date 7 January 2003 */ +define("TEXT", 1); +define("IMAGE", 2); + class PatternTableLinks { /** Array of link URLS to display in tables */ @@ -33,7 +36,7 @@ class PatternTableLinks { * @param $iLinkType Link type (1 = Text or 2 = Button). Default is 1 * @param $aLinkImages Array of images URL placed over links */ - function PatternTableLinks($aNewLinks, $aNewLinksText, $iNewRows, $iNewColumns, $iNewLinkType = 1, $aNewLinkImages = null) { + function PatternTableLinks($aNewLinks, $aNewLinksText, $iNewRows, $iNewColumns, $iNewLinkType = TEXT, $aNewLinkImages = null) { $this->aLinks = $aNewLinks; $this->aLinksText = $aNewLinksText; $this->aLinkImages = $aNewLinkImages; @@ -58,7 +61,14 @@ class PatternTableLinks { for ($j = 0; $j < $this->iColumns; $j++) { $sToRender = $sToRender . ""; if ($iArrayCount < $iArraySize) { - $sToRender = $sToRender . "aLinks[$iArrayCount] . "\" />" . $this->aLinksText[$iArrayCount]; + $sToRender = $sToRender . "aLinks[$iArrayCount] . "\" />"; + if ($this->iLinkType == TEXT) { + $sToRender = $sToRender . $this->aLinksText[$iArrayCount]; + } else if ($this->iLinkType == IMAGE) { + $oImage = new PatternImage($this->aLinkImages[$iArrayCount]); + $sToRender = $sToRender . $oImage->render(); + } + $sToRender = $sToRender . ""; $iArrayCount++; } $sToRender = $sToRender . "\n"; -- libgit2 0.21.4