@@ -130,21 +130,24 @@ private function getHtmlForOneKey(
130130 /**
131131 * Function to get html for relational field selection
132132 *
133- * @param string $db current database
134- * @param string $table current table
135- * @param string $field field
136- * @param string|null $fieldKey field key
137- * @param string $currentValue current columns's value
133+ * @param string $db current database
134+ * @param string $table current table
135+ * @param string $field field
136+ * @param string $fieldKey field key
137+ * @param string $currentValue current columns's value
138138 */
139139 public function getHtmlForRelationalFieldSelection (
140140 string $ db ,
141141 string $ table ,
142142 string $ field ,
143143 ForeignData $ foreignData ,
144- string | null $ fieldKey ,
144+ string $ fieldKey ,
145145 string $ currentValue ,
146+ int $ pos ,
147+ string $ foreignFilter ,
148+ string |null $ rownumber ,
146149 ): string {
147- $ gotoPage = $ this ->getHtmlForGotoPage ($ foreignData );
150+ $ gotoPage = $ this ->getHtmlForGotoPage ($ foreignData, $ pos );
148151 $ foreignShowAll = '' ;
149152 if (
150153 $ foreignData ->dispRow !== null &&
@@ -160,16 +163,13 @@ public function getHtmlForRelationalFieldSelection(
160163 . Url::getHiddenInputs ($ db , $ table ) . "\n"
161164 . '<input type="hidden" name="field" value=" ' . htmlspecialchars ($ field ) . '"> ' . "\n"
162165 . '<input type="hidden" name="fieldkey" value=" '
163- . ( isset ( $ fieldKey ) ? htmlspecialchars ($ fieldKey) : '' ) . '"> ' . "\n" ;
166+ . htmlspecialchars ($ fieldKey ) . '"> ' . "\n" ;
164167
165- if (isset ($ _POST ['rownumber ' ])) {
166- $ output .= '<input type="hidden" name="rownumber" value=" '
167- . htmlspecialchars ((string ) $ _POST ['rownumber ' ]) . '"> ' ;
168+ if ($ rownumber !== null ) {
169+ $ output .= '<input type="hidden" name="rownumber" value=" ' . htmlspecialchars ($ rownumber ) . '"> ' ;
168170 }
169171
170- $ filterValue = isset ($ _POST ['foreign_filter ' ])
171- ? htmlspecialchars ($ _POST ['foreign_filter ' ])
172- : '' ;
172+ $ filterValue = htmlspecialchars ($ foreignFilter );
173173 $ output .= '<div class="col-auto"> '
174174 . '<label class="form-label" for="input_foreign_filter"> ' . __ ('Search: ' ) . '</label></div> ' . "\n"
175175 . '<div class="col-auto"><input class="form-control" type="text" name="foreign_filter" '
@@ -238,7 +238,7 @@ public function getHtmlForRelationalFieldSelection(
238238 *
239239 * @param string $description the key name's description
240240 *
241- * @return array<int, string> the new description and title
241+ * @return array{string, string} the new description and title
242242 */
243243 private function getDescriptionAndTitle (string $ description ): array
244244 {
@@ -255,9 +255,8 @@ private function getDescriptionAndTitle(string $description): array
255255 /**
256256 * Function to get html for the goto page option
257257 */
258- private function getHtmlForGotoPage (ForeignData $ foreignData ): string
258+ private function getHtmlForGotoPage (ForeignData $ foreignData, int $ pos ): string
259259 {
260- isset ($ _POST ['pos ' ]) ? $ pos = $ _POST ['pos ' ] : $ pos = 0 ;
261260 if ($ foreignData ->dispRow === null ) {
262261 return '' ;
263262 }
@@ -283,19 +282,12 @@ private function getHtmlForGotoPage(ForeignData $foreignData): string
283282 return '' ;
284283 }
285284
286- /**
287- * Function to get foreign limit
288- *
289- * @param string|null $foreignShowAll foreign navigation
290- */
291- public function getForeignLimit (string |null $ foreignShowAll ): string |null
285+ public function getForeignLimit (string |null $ foreignShowAll , int $ pos ): string
292286 {
293287 if ($ foreignShowAll === __ ('Show all ' )) {
294- return null ;
288+ return '' ;
295289 }
296290
297- isset ($ _POST ['pos ' ]) ? $ pos = $ _POST ['pos ' ] : $ pos = 0 ;
298-
299291 return 'LIMIT ' . $ pos . ', ' . $ this ->settings ->maxRows . ' ' ;
300292 }
301293}
0 commit comments