Commit 337c6994151e979dec6c61f3c85ca9825920558f
1 parent
a6247d3c
Changed previous and next from hyperlinks to submits
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1136 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
24 additions
and
7 deletions
lib/visualpatterns/PatternBrowsableSearchResults.inc
| @@ -68,12 +68,15 @@ class PatternBrowseableSearchResults { | @@ -68,12 +68,15 @@ class PatternBrowseableSearchResults { | ||
| 68 | for ($i = 0; $i < count($this->aColumnHeadings); $i++) { | 68 | for ($i = 0; $i < count($this->aColumnHeadings); $i++) { |
| 69 | if (! (strcmp($this->sOrderByColumn, $this->aColumns[$i]) === false) && (strcmp($this->sOrderByColumn, $this->aColumns[$i]) == 0)) { | 69 | if (! (strcmp($this->sOrderByColumn, $this->aColumns[$i]) === false) && (strcmp($this->sOrderByColumn, $this->aColumns[$i]) == 0)) { |
| 70 | if (!(strcmp($this->sOrderDirection,"ASC") === false) && (strcmp($this->sOrderDirection,"ASC") == 0)) { | 70 | if (!(strcmp($this->sOrderDirection,"ASC") === false) && (strcmp($this->sOrderDirection,"ASC") == 0)) { |
| 71 | - $sToRender .= "<th align=\"left\"><a href=\"" . $_SERVER["PHP_SELF"] . "?fOrderBy=" . $this->aColumns[$i] . "&fOrderDirection=DESC&fStartIndex=" . $this->iStartIndex . "\">" . $this->aColumnHeadings[$i]."</a></th>\n"; | 71 | + //$sToRender .= "<th align=\"left\"><a href=\"" . $_SERVER["PHP_SELF"] . "?fOrderBy=" . $this->aColumns[$i] . "&fOrderDirection=DESC&fStartIndex=" . $this->iStartIndex . "\">" . $this->aColumnHeadings[$i]."</a></th>\n"; |
| 72 | + $sToRender .= "<th align=\"left\">" . $this->aColumnHeadings[$i]. "</th>\n"; | ||
| 72 | } else { | 73 | } else { |
| 73 | - $sToRender .= "<th align=\"left\"><a href=\"" . $_SERVER["PHP_SELF"] . "?fOrderBy=" . $this->aColumns[$i] . "&fOrderDirection=ASC&fStartIndex=" . $this->iStartIndex . "\">" . $this->aColumnHeadings[$i]."</a></th>\n"; | 74 | + //$sToRender .= "<th align=\"left\"><a href=\"" . $_SERVER["PHP_SELF"] . "?fOrderBy=" . $this->aColumns[$i] . "&fOrderDirection=ASC&fStartIndex=" . $this->iStartIndex . "\">" . $this->aColumnHeadings[$i]."</a></th>\n"; |
| 75 | + $sToRender .= "<th align=\"left\">" . $this->aColumnHeadings[$i]. "</th>\n"; | ||
| 74 | } | 76 | } |
| 75 | } else { | 77 | } else { |
| 76 | - $sToRender .= "<th align=\"left\"><a href=\"" . $_SERVER["PHP_SELF"] . "?fOrderBy=" . $this->aColumns[$i] . "&fOrderDirection=ASC&fStartIndex=" . $this->iStartIndex . "\">" . $this->aColumnHeadings[$i]."</a></th>\n"; | 78 | + //$sToRender .= "<th align=\"left\"><a href=\"" . $_SERVER["PHP_SELF"] . "?fOrderBy=" . $this->aColumns[$i] . "&fOrderDirection=ASC&fStartIndex=" . $this->iStartIndex . "\">" . $this->aColumnHeadings[$i]."</a></th>\n"; |
| 79 | + $sToRender .= "<th align=\"left\">" . $this->aColumnHeadings[$i]. "</th>\n"; | ||
| 77 | } | 80 | } |
| 78 | } | 81 | } |
| 79 | $sToRender .= "</tr>\n"; | 82 | $sToRender .= "</tr>\n"; |
| @@ -105,6 +108,18 @@ class PatternBrowseableSearchResults { | @@ -105,6 +108,18 @@ class PatternBrowseableSearchResults { | ||
| 105 | } | 108 | } |
| 106 | $sToRender .= "\">" . $sql->f($this->aColumns[$i]) . "</a></td>\n"; | 109 | $sToRender .= "\">" . $sql->f($this->aColumns[$i]) . "</a></td>\n"; |
| 107 | break; | 110 | break; |
| 111 | + case 4: | ||
| 112 | + //diplay an image URL | ||
| 113 | + $sToRender .= "<td><a href=\"" . $this->aLinkURLs[$i]; | ||
| 114 | + for ($j = 0; $j < count($this->aDBQueryStringColumns); $j++) { | ||
| 115 | + if (strpos($sToRender, "?") === false) { | ||
| 116 | + $sToRender .= "?" . $this->aQueryStringVariableNames[$j] . "=" . $sql->f($this->aDBQueryStringColumns[$j]); | ||
| 117 | + } else { | ||
| 118 | + $sToRender .= "&" . $this->aQueryStringVariableNames[$j] . "=" . $sql->f($this->aDBQueryStringColumns[$j]); | ||
| 119 | + } | ||
| 120 | + } | ||
| 121 | + $sToRender .= "\"><img src=\"" . $sql->f($this->aColumns[$i]) . "\" border=\"0\" /></a></td>\n"; | ||
| 122 | + break; | ||
| 108 | default: | 123 | default: |
| 109 | break; | 124 | break; |
| 110 | } | 125 | } |
| @@ -122,19 +137,21 @@ class PatternBrowseableSearchResults { | @@ -122,19 +137,21 @@ class PatternBrowseableSearchResults { | ||
| 122 | 137 | ||
| 123 | $sToRender .= "<tr>\n"; | 138 | $sToRender .= "<tr>\n"; |
| 124 | 139 | ||
| 140 | + $sToRender .= "<input type=\"hidden\" name=\"fStartIndex\" value=\"" . ($this->iStartIndex + $this->iResultsToDisplay) . "\" />\n"; | ||
| 125 | /* Display only the next button */ | 141 | /* Display only the next button */ |
| 126 | if (($this->iStartIndex + $this->iResultsToDisplay) < $this->getResultCount($sql) && $this->iStartIndex == 0) { | 142 | if (($this->iStartIndex + $this->iResultsToDisplay) < $this->getResultCount($sql) && $this->iStartIndex == 0) { |
| 127 | $sToRender .= "<td>"; | 143 | $sToRender .= "<td>"; |
| 128 | - $sToRender .= ("<a href=\"" . $_SERVER["PHP_SELF"] . "?fStartIndex=" . ($this->iStartIndex + $this->iResultsToDisplay) . "\">Next</a>"); | 144 | + //$sToRender .= ("<a href=\"" . $_SERVER["PHP_SELF"] . "?fStartIndex=" . ($this->iStartIndex + $this->iResultsToDisplay) . "\">Next</a>"); |
| 145 | + $sToRender .= ("<input type=\"image\" src=\"$default->graphicsUrl/widgets/next.gif\" onClick=\"setActionAndSubmit('" . $_SERVER["PHP_SELF"] . "?fStartIndex=" . ($this->iStartIndex + $this->iResultsToDisplay) . "')\" />"); | ||
| 129 | $sToRender .= "</td>\n"; | 146 | $sToRender .= "</td>\n"; |
| 130 | } | 147 | } |
| 131 | /* Display both the next and the previous buttons */ | 148 | /* Display both the next and the previous buttons */ |
| 132 | else if (($this->iStartIndex + $this->iResultsToDisplay) < $this->getResultCount($sql) && $this->iStartIndex > 0) { | 149 | else if (($this->iStartIndex + $this->iResultsToDisplay) < $this->getResultCount($sql) && $this->iStartIndex > 0) { |
| 133 | $sToRender .= "<td>"; | 150 | $sToRender .= "<td>"; |
| 134 | - $sToRender .= ("<a href=\"" . $_SERVER["PHP_SELF"] . "?fStartIndex=" . ($this->iStartIndex + $this->iResultsToDisplay) . "\">Next</a>"); | 151 | + $sToRender .= ("<input type=\"image\" src=\"$default->graphicsUrl/widgets/next.gif\" onClick=\"setActionAndSubmit('" . $_SERVER["PHP_SELF"] . "?fStartIndex=" . ($this->iStartIndex + $this->iResultsToDisplay) . "')\" />"); |
| 135 | $sToRender .= "</td>"; | 152 | $sToRender .= "</td>"; |
| 136 | $sToRender .= "<td>"; | 153 | $sToRender .= "<td>"; |
| 137 | - $sToRender .= ("<a href=\"" . $_SERVER["PHP_SELF"] . "?fStartIndex=" . ($this->iStartIndex - $this->iResultsToDisplay) . "\">Previous</a>"); | 154 | + $sToRender .= ("<input type=\"image\" src=\"$default->graphicsUrl/widgets/previous.gif\" onClick=\"setActionAndSubmit('" . $_SERVER["PHP_SELF"] . "?fStartIndex=" . ($this->iStartIndex - $this->iResultsToDisplay) . "')\" />"); |
| 138 | $sToRender .= "</td>\n"; | 155 | $sToRender .= "</td>\n"; |
| 139 | 156 | ||
| 140 | } | 157 | } |
| @@ -144,7 +161,7 @@ class PatternBrowseableSearchResults { | @@ -144,7 +161,7 @@ class PatternBrowseableSearchResults { | ||
| 144 | $sToRender .= (" "); | 161 | $sToRender .= (" "); |
| 145 | $sToRender .= "</td>"; | 162 | $sToRender .= "</td>"; |
| 146 | $sToRender .= "<td>\n"; | 163 | $sToRender .= "<td>\n"; |
| 147 | - $sToRender .= ("<a href=\"" . $_SERVER["PHP_SELF"] . "?fStartIndex=" . ($this->iStartIndex - $this->iResultsToDisplay) . "\">Previous</a>"); | 164 | + $sToRender .= ("<input type=\"image\" src=\"$default->graphicsUrl/widgets/previous.gif\" onClick=\"setActionAndSubmit('" . $_SERVER["PHP_SELF"] . "?fStartIndex=" . ($this->iStartIndex - $this->iResultsToDisplay) . "')\" />"); |
| 148 | $sToRender .= "</td>"; | 165 | $sToRender .= "</td>"; |
| 149 | } | 166 | } |
| 150 | 167 |