@@ -18,6 +18,9 @@ discard block |
||
18 | 18 | // Use {page} in link_url als placeholder for the selected page number |
19 | 19 | // and/or {offset} for the 0-based data offset of the selected page. |
20 | 20 | |
21 | + /** |
|
22 | + * @param string $link_url |
|
23 | + */ |
|
21 | 24 | public function __construct($link_url, $min_pages_shown = 2, $max_pages_shown = 15) |
22 | 25 | { |
23 | 26 | global $tpl; |
@@ -31,6 +34,10 @@ discard block |
||
31 | 34 | } |
32 | 35 | |
33 | 36 | |
37 | + /** |
|
38 | + * @param double $current_page |
|
39 | + * @param double $total_pages |
|
40 | + */ |
|
34 | 41 | public function make_from_pagenr($current_page, $total_pages, $page_size = false) |
35 | 42 | { |
36 | 43 | global $tpl; |
@@ -94,6 +101,9 @@ discard block |
||
94 | 101 | } |
95 | 102 | |
96 | 103 | |
104 | + /** |
|
105 | + * @param boolean $page_size |
|
106 | + */ |
|
97 | 107 | private function pagelink($page, $page_size) |
98 | 108 | { |
99 | 109 | return mb_ereg_replace( |
@@ -59,7 +59,7 @@ |
||
59 | 59 | $to_page = min($last_page, max($first_page, $current_page - $lrspan) + $this->max_pages_shown - 1); |
60 | 60 | $from_page = max($first_page, $to_page - $this->max_pages_shown + 1); |
61 | 61 | |
62 | - for ($page = $from_page; $page <= $to_page; $page ++) { |
|
62 | + for ($page = $from_page; $page <= $to_page; $page++) { |
|
63 | 63 | if ($page == $current_page) { |
64 | 64 | $pages[$page] = false; |
65 | 65 | } else { |
@@ -19,6 +19,10 @@ discard block |
||
19 | 19 | |
20 | 20 | /* primaryKey may be an array |
21 | 21 | */ |
22 | + |
|
23 | + /** |
|
24 | + * @param string $sTable |
|
25 | + */ |
|
22 | 26 | public function __construct($sTable) |
23 | 27 | { |
24 | 28 | $this->pk = array(); |
@@ -26,6 +30,11 @@ discard block |
||
26 | 30 | $this->sTable = $sTable; |
27 | 31 | } |
28 | 32 | |
33 | + /** |
|
34 | + * @param string $sField |
|
35 | + * @param boolean $bNullable |
|
36 | + * @param integer $nInsertFunction |
|
37 | + */ |
|
29 | 38 | public function addPKInt($sField, $nDefault, $bNullable, $nInsertFunction = RE_INSERT_NOTHING) |
30 | 39 | { |
31 | 40 | $this->pk[$sField] = array( |
@@ -100,6 +109,11 @@ discard block |
||
100 | 109 | ); |
101 | 110 | } |
102 | 111 | |
112 | + /** |
|
113 | + * @param string $sField |
|
114 | + * @param boolean $bNullable |
|
115 | + * @param integer $nInsertFunction |
|
116 | + */ |
|
103 | 117 | public function addInt($sField, $nDefault, $bNullable, $nInsertFunction = RE_INSERT_NOTHING) |
104 | 118 | { |
105 | 119 | $this->fields[$sField] = array( |
@@ -112,6 +126,11 @@ discard block |
||
112 | 126 | ); |
113 | 127 | } |
114 | 128 | |
129 | + /** |
|
130 | + * @param string $sField |
|
131 | + * @param integer $nDefault |
|
132 | + * @param boolean $bNullable |
|
133 | + */ |
|
115 | 134 | public function addFloat($sField, $nDefault, $bNullable, $nInsertFunction = RE_INSERT_NOTHING) |
116 | 135 | { |
117 | 136 | $this->fields[$sField] = array( |
@@ -124,6 +143,11 @@ discard block |
||
124 | 143 | ); |
125 | 144 | } |
126 | 145 | |
146 | + /** |
|
147 | + * @param string $sField |
|
148 | + * @param integer $nDefault |
|
149 | + * @param boolean $bNullable |
|
150 | + */ |
|
127 | 151 | public function addDouble($sField, $nDefault, $bNullable, $nInsertFunction = RE_INSERT_NOTHING) |
128 | 152 | { |
129 | 153 | $this->fields[$sField] = array( |
@@ -136,6 +160,11 @@ discard block |
||
136 | 160 | ); |
137 | 161 | } |
138 | 162 | |
163 | + /** |
|
164 | + * @param string $sField |
|
165 | + * @param boolean $bNullable |
|
166 | + * @param integer $nInsertFunction |
|
167 | + */ |
|
139 | 168 | public function addString($sField, $sDefault, $bNullable, $nInsertFunction = RE_INSERT_NOTHING) |
140 | 169 | { |
141 | 170 | $this->fields[$sField] = array( |
@@ -148,6 +177,10 @@ discard block |
||
148 | 177 | ); |
149 | 178 | } |
150 | 179 | |
180 | + /** |
|
181 | + * @param string $sField |
|
182 | + * @param boolean $bNullable |
|
183 | + */ |
|
151 | 184 | public function addBoolean($sField, $bDefault, $bNullable, $nInsertFunction = RE_INSERT_NOTHING) |
152 | 185 | { |
153 | 186 | $this->fields[$sField] = array( |
@@ -160,6 +193,11 @@ discard block |
||
160 | 193 | ); |
161 | 194 | } |
162 | 195 | |
196 | + /** |
|
197 | + * @param string $sField |
|
198 | + * @param boolean $bNullable |
|
199 | + * @param integer $nInsertFunction |
|
200 | + */ |
|
163 | 201 | public function addDate($sField, $dDefault, $bNullable, $nInsertFunction = RE_INSERT_NOTHING) |
164 | 202 | { |
165 | 203 | $this->fields[$sField] = array( |
@@ -339,6 +377,9 @@ discard block |
||
339 | 377 | return join(' AND ', $fwhere); |
340 | 378 | } |
341 | 379 | |
380 | + /** |
|
381 | + * @param string $sField |
|
382 | + */ |
|
342 | 383 | public function getValue($sField) |
343 | 384 | { |
344 | 385 | if (isset($this->pk[$sField])) { |
@@ -353,6 +394,9 @@ discard block |
||
353 | 394 | return $this->fields[$sField]['default']; |
354 | 395 | } |
355 | 396 | |
397 | + /** |
|
398 | + * @param string $sField |
|
399 | + */ |
|
356 | 400 | public function getChanged($sField) |
357 | 401 | { |
358 | 402 | return $this->fields[$sField]['changed']; |
@@ -367,6 +411,9 @@ discard block |
||
367 | 411 | } |
368 | 412 | } |
369 | 413 | |
414 | + /** |
|
415 | + * @param string $sField |
|
416 | + */ |
|
370 | 417 | public function setValue($sField, $sValue) |
371 | 418 | { |
372 | 419 | if ($this->bLoaded == false || ($this->bAddNew == false && $this->bExist == false)) { |
@@ -556,6 +603,9 @@ discard block |
||
556 | 603 | return $sql; |
557 | 604 | } |
558 | 605 | |
606 | + /** |
|
607 | + * @param string $field |
|
608 | + */ |
|
559 | 609 | public function saveField($field) |
560 | 610 | { |
561 | 611 | if ($this->bLoaded == false || $this->bExist == false || $this->bAddNew == true) { |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | { |
10 | 10 | public $sTable; |
11 | 11 | public $sAutoIncrementField = null; |
12 | - public $pk; // (idx:name; type, default, nullable, value, insertfunction) |
|
12 | + public $pk; // (idx:name; type, default, nullable, value, insertfunction) |
|
13 | 13 | public $fields; // (idx:name; type, default, nullable, value, changed, insertfunction) |
14 | 14 | |
15 | 15 | // status var |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | if ($i == $index) { |
255 | 255 | return $k; |
256 | 256 | } |
257 | - $i ++; |
|
257 | + $i++; |
|
258 | 258 | } |
259 | 259 | } |
260 | 260 |
@@ -13,6 +13,7 @@ |
||
13 | 13 | * |
14 | 14 | * @param int $items number of feeditems to parse from feed |
15 | 15 | * @param string $url url of the feed to parse |
16 | + * @param boolean $includetext |
|
16 | 17 | * |
17 | 18 | * @return string $item feeditems as HTML-string |
18 | 19 | */ |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | 'description' => $item->description |
67 | 67 | ); |
68 | 68 | // increment counter |
69 | - $i ++; |
|
69 | + $i++; |
|
70 | 70 | // htmlspecialchars_decode() works around inconsistent HTML encoding |
71 | 71 | // e.g. in SMF Forum Threads |
72 | 72 | } elseif (!in_array(htmlspecialchars_decode($item->title), $headlines) && |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | ); |
81 | 81 | $headlines[] = "" . htmlspecialchars_decode($item->title); |
82 | 82 | // increment counter |
83 | - $i ++; |
|
83 | + $i++; |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | } |
@@ -159,6 +159,9 @@ discard block |
||
159 | 159 | } |
160 | 160 | |
161 | 161 | // str = long text |
162 | +/** |
|
163 | + * @param boolean $simple |
|
164 | + */ |
|
162 | 165 | function ftsearch_split(&$str, $simple) |
163 | 166 | { |
164 | 167 | global $ftsearch_ignores; |
@@ -488,6 +491,9 @@ discard block |
||
488 | 491 | sql("DELETE FROM `search_index_times` WHERE `object_type`='&1' AND `object_id`='&2'", $object_type, $object_id); |
489 | 492 | } |
490 | 493 | |
494 | +/** |
|
495 | + * @param integer $object_type |
|
496 | + */ |
|
491 | 497 | function ftsearch_set_entries($object_type, $object_id, $cache_id, &$text, $last_modified) |
492 | 498 | { |
493 | 499 | ftsearch_delete_entries($object_type, $object_id, $cache_id); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $str = ''; |
189 | 189 | |
190 | 190 | ftsearch_load_ignores(); |
191 | - for ($i = count($astr) - 1; $i >= 0; $i --) { |
|
191 | + for ($i = count($astr) - 1; $i >= 0; $i--) { |
|
192 | 192 | // ignore? |
193 | 193 | if (array_search(mb_strtolower($astr[$i]), $ftsearch_ignores) !== false) { |
194 | 194 | unset($astr[$i]); |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } |
238 | 238 | |
239 | 239 | // doppelte chars ersetzen |
240 | - for ($c = ord('a'); $c <= ord('z'); $c ++) { |
|
240 | + for ($c = ord('a'); $c <= ord('z'); $c++) { |
|
241 | 241 | $old_str = ''; |
242 | 242 | while ($old_str != $str) { |
243 | 243 | $old_str = $str; |
@@ -569,6 +569,9 @@ |
||
569 | 569 | return $str; |
570 | 570 | } |
571 | 571 | |
572 | +/** |
|
573 | + * @return string |
|
574 | + */ |
|
572 | 575 | function changePlaceholder($str, $inverse = false) |
573 | 576 | { |
574 | 577 | static $translate = array( |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | $thislog = mb_ereg_replace('{username}', text_xmlentities($rLog['username']), $thislog); |
391 | 391 | |
392 | 392 | if ($rLog['type'] == 3 && $rLog['needs_maintenance'] == 2) { |
393 | - $logtype = 'Needs Maintenance'; // with capital M, other than cache attribute |
|
393 | + $logtype = 'Needs Maintenance'; // with capital M, other than cache attribute |
|
394 | 394 | } elseif (isset($gpxLogType[$rLog['type']])) { |
395 | 395 | $logtype = $gpxLogType[$rLog['type']]; |
396 | 396 | } else { |
@@ -511,28 +511,28 @@ discard block |
||
511 | 511 | switch ($childWaypoint['type']) { |
512 | 512 | case 1: |
513 | 513 | $wp_typename = "Parking Area"; |
514 | - break; // well-known garmin symbols |
|
514 | + break; // well-known garmin symbols |
|
515 | 515 | case 2: |
516 | 516 | $wp_typename = "Flag, Green"; |
517 | - break; // stage / ref point |
|
517 | + break; // stage / ref point |
|
518 | 518 | case 3: |
519 | 519 | $wp_typename = "Flag, Blue"; |
520 | - break; // path |
|
520 | + break; // path |
|
521 | 521 | case 4: |
522 | 522 | $wp_typename = "Circle with X"; |
523 | 523 | break; // final |
524 | 524 | case 5: |
525 | 525 | $wp_typename = "Diamond, Green"; |
526 | - break; // point of interest |
|
526 | + break; // point of interest |
|
527 | 527 | default: |
528 | 528 | $wp_typename = "Flag, Blue"; |
529 | - break; // for the case new types are forgotten here .. |
|
529 | + break; // for the case new types are forgotten here .. |
|
530 | 530 | } |
531 | 531 | $thiswp = mb_ereg_replace('{type}', text_xmlentities($wp_typename), $thiswp); |
532 | 532 | $thiswp = mb_ereg_replace('{parent}', $r['waypoint'], $thiswp); |
533 | 533 | $thiswp = mb_ereg_replace('{cacheid}', $r['cacheid'], $thiswp); |
534 | 534 | $waypoints .= $thiswp; |
535 | - ++ $n; |
|
535 | + ++$n; |
|
536 | 536 | } |
537 | 537 | |
538 | 538 | if ($cacheNote && !empty($cacheNote['latitude']) && !empty($cacheNote['longitude'])) { |
@@ -202,6 +202,10 @@ |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | |
205 | +/** |
|
206 | + * @param string $interval |
|
207 | + * @param string $dateTimeEnd |
|
208 | + */ |
|
205 | 209 | function dateDiff($interval, $dateTimeBegin, $dateTimeEnd) |
206 | 210 | { |
207 | 211 | //Parse about any English textual datetime |
@@ -203,6 +203,9 @@ |
||
203 | 203 | return $str; |
204 | 204 | } |
205 | 205 | |
206 | +/** |
|
207 | + * @param string $str |
|
208 | + */ |
|
206 | 209 | function lf2crlf($str) |
207 | 210 | { |
208 | 211 | return str_replace("\r\r\n", "\r\n", str_replace("\n", "\r\n", $str)); |
@@ -107,6 +107,9 @@ discard block |
||
107 | 107 | return $rsResult; |
108 | 108 | } |
109 | 109 | |
110 | + /** |
|
111 | + * @param string $sql |
|
112 | + */ |
|
110 | 113 | public function strip_temptable($sql) |
111 | 114 | { |
112 | 115 | $start = stripos($sql, 'SELECT '); |
@@ -118,6 +121,9 @@ discard block |
||
118 | 121 | return substr($sql, $start); |
119 | 122 | } |
120 | 123 | |
124 | + /** |
|
125 | + * @param string $sql |
|
126 | + */ |
|
121 | 127 | public function strip_from($sql) |
122 | 128 | { |
123 | 129 | $start = stripos($sql, 'FROM '); |
@@ -129,6 +135,9 @@ discard block |
||
129 | 135 | return 'SELECT * ' . substr($sql, $start); |
130 | 136 | } |
131 | 137 | |
138 | + /** |
|
139 | + * @param string $sql |
|
140 | + */ |
|
132 | 141 | public function insert_nocache($sql) |
133 | 142 | { |
134 | 143 | if (strtoupper(substr($sql, 0, 7)) == 'SELECT ') { |
@@ -74,7 +74,7 @@ |
||
74 | 74 | break; |
75 | 75 | } |
76 | 76 | $command['result'][] = $r; |
77 | - $c ++; |
|
77 | + $c++; |
|
78 | 78 | } |
79 | 79 | sql_free_result($rs); |
80 | 80 |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | /** Removes entry from the archive. |
284 | 284 | * please be very carefull with this function, there is no undo after you save the archive |
285 | 285 | * |
286 | - * @return bool true on success or false on failure |
|
286 | + * @return boolean|null true on success or false on failure |
|
287 | 287 | * |
288 | 288 | * @param int $idx |
289 | 289 | */ |
@@ -334,6 +334,10 @@ discard block |
||
334 | 334 | return $idx >= 0 and $idx < $this->cnt; |
335 | 335 | } |
336 | 336 | |
337 | + /** |
|
338 | + * @param string $name |
|
339 | + * @param string $data |
|
340 | + */ |
|
337 | 341 | public function _write($name, $data) |
338 | 342 | { |
339 | 343 | $fp = fopen($name, "w"); |
@@ -143,9 +143,9 @@ discard block |
||
143 | 143 | |
144 | 144 | } |
145 | 145 | $fnl = strlen($filename); |
146 | - $fh = "\x14\x00"; // ver needed to extract |
|
147 | - $fh .= "\x00\x00"; // gen purpose bit flag |
|
148 | - $fh .= "\x08\x00"; // compression method |
|
146 | + $fh = "\x14\x00"; // ver needed to extract |
|
147 | + $fh .= "\x00\x00"; // gen purpose bit flag |
|
148 | + $fh .= "\x08\x00"; // compression method |
|
149 | 149 | $fh .= "\x00\x00\x00\x00"; // last mod time and date |
150 | 150 | $fh .= pack( |
151 | 151 | "V3v2", |
@@ -170,16 +170,16 @@ discard block |
||
170 | 170 | "va*v3V2", |
171 | 171 | 0, |
172 | 172 | $fh, |
173 | - 0, // file comment length |
|
174 | - 0, // disk number start |
|
175 | - 0, // internal file attributes |
|
176 | - $attr, // external file attributes - 'archive/directory' bit set |
|
173 | + 0, // file comment length |
|
174 | + 0, // disk number start |
|
175 | + 0, // internal file attributes |
|
176 | + $attr, // external file attributes - 'archive/directory' bit set |
|
177 | 177 | $this->offset |
178 | 178 | ) . $filename; |
179 | 179 | |
180 | 180 | $this->offset += 42 + $fnl + $gzsize; |
181 | 181 | $this->cdir[] = $cdir; |
182 | - $this->cnt ++; |
|
182 | + $this->cnt++; |
|
183 | 183 | $this->idx = $this->cnt - 1; |
184 | 184 | } |
185 | 185 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $cdsl, // size of central dir |
229 | 229 | $zdsl, // offset to start of central dir |
230 | 230 | 0 |
231 | - ); // .zip file comment length |
|
231 | + ); // .zip file comment length |
|
232 | 232 | return $this->zipfile; |
233 | 233 | } |
234 | 234 |