Commit 337c6994151e979dec6c61f3c85ca9825920558f

Authored by rob
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
lib/visualpatterns/PatternBrowsableSearchResults.inc
... ... @@ -68,12 +68,15 @@ class PatternBrowseableSearchResults {
68 68 for ($i = 0; $i < count($this->aColumnHeadings); $i++) {
69 69 if (! (strcmp($this->sOrderByColumn, $this->aColumns[$i]) === false) && (strcmp($this->sOrderByColumn, $this->aColumns[$i]) == 0)) {
70 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 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 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 82 $sToRender .= "</tr>\n";
... ... @@ -105,6 +108,18 @@ class PatternBrowseableSearchResults {
105 108 }
106 109 $sToRender .= "\">" . $sql->f($this->aColumns[$i]) . "</a></td>\n";
107 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 123 default:
109 124 break;
110 125 }
... ... @@ -122,19 +137,21 @@ class PatternBrowseableSearchResults {
122 137  
123 138 $sToRender .= "<tr>\n";
124 139  
  140 + $sToRender .= "<input type=\"hidden\" name=\"fStartIndex\" value=\"" . ($this->iStartIndex + $this->iResultsToDisplay) . "\" />\n";
125 141 /* Display only the next button */
126 142 if (($this->iStartIndex + $this->iResultsToDisplay) < $this->getResultCount($sql) && $this->iStartIndex == 0) {
127 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 146 $sToRender .= "</td>\n";
130 147 }
131 148 /* Display both the next and the previous buttons */
132 149 else if (($this->iStartIndex + $this->iResultsToDisplay) < $this->getResultCount($sql) && $this->iStartIndex > 0) {
133 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 152 $sToRender .= "</td>";
136 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 155 $sToRender .= "</td>\n";
139 156  
140 157 }
... ... @@ -144,7 +161,7 @@ class PatternBrowseableSearchResults {
144 161 $sToRender .= ("&nbsp");
145 162 $sToRender .= "</td>";
146 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 165 $sToRender .= "</td>";
149 166 }
150 167  
... ...