@@ -60,6 +60,9 @@ discard block |
||
60 | 60 | $_SERVER['REDIRECT_STATUS'] = 404; |
61 | 61 | } |
62 | 62 | |
63 | +/** |
|
64 | + * @param string $name |
|
65 | + */ |
|
63 | 66 | function getURLParam ($name, $default = NULL) { |
64 | 67 | if (!empty ($_GET) && isset($_GET[$name]) && $_GET[$name] != "") { |
65 | 68 | return $_GET[$name]; |
@@ -95,6 +98,11 @@ discard block |
||
95 | 98 | return $url . "?v=" . VERSION; |
96 | 99 | } |
97 | 100 | |
101 | +/** |
|
102 | + * @param string $xml |
|
103 | + * |
|
104 | + * @return string |
|
105 | + */ |
|
98 | 106 | function xml2xhtml($xml) { |
99 | 107 | return preg_replace_callback('#<(\w+)([^>]*)\s*/>#s', create_function('$m', ' |
100 | 108 | $xhtml_tags = array("br", "hr", "input", "frame", "img", "area", "link", "col", "base", "basefont", "param"); |
@@ -308,6 +316,9 @@ discard block |
||
308 | 316 | return $phrase; |
309 | 317 | } |
310 | 318 | |
319 | +/** |
|
320 | + * @param string $paramName |
|
321 | + */ |
|
311 | 322 | function addURLParameter($urlParams, $paramName, $paramValue) { |
312 | 323 | if (empty ($urlParams)) { |
313 | 324 | $urlParams = ""; |
@@ -369,6 +380,9 @@ discard block |
||
369 | 380 | return $this->href; |
370 | 381 | } |
371 | 382 | |
383 | + /** |
|
384 | + * @return string |
|
385 | + */ |
|
372 | 386 | public function getScriptName() { |
373 | 387 | $parts = explode('/', $_SERVER["SCRIPT_NAME"]); |
374 | 388 | return $parts[count($parts) - 1]; |
@@ -377,6 +391,9 @@ discard block |
||
377 | 391 | |
378 | 392 | class LinkNavigation extends Link |
379 | 393 | { |
394 | + /** |
|
395 | + * @param string $prel |
|
396 | + */ |
|
380 | 397 | public function __construct($phref, $prel = NULL, $ptitle = NULL) { |
381 | 398 | parent::__construct ($phref, Link::OPDS_NAVIGATION_TYPE, $prel, $ptitle); |
382 | 399 | if (!is_null (GetUrlParam (DB))) $this->href = addURLParameter ($this->href, DB, GetUrlParam (DB)); |
@@ -391,6 +408,9 @@ discard block |
||
391 | 408 | |
392 | 409 | class LinkFacet extends Link |
393 | 410 | { |
411 | + /** |
|
412 | + * @param string $phref |
|
413 | + */ |
|
394 | 414 | public function __construct($phref, $ptitle = NULL, $pfacetGroup = NULL, $pactiveFacet = FALSE) { |
395 | 415 | parent::__construct ($phref, Link::OPDS_PAGING_TYPE, "http://opds-spec.org/facet", $ptitle, $pfacetGroup, $pactiveFacet); |
396 | 416 | if (!is_null (GetUrlParam (DB))) $this->href = addURLParameter ($this->href, DB, GetUrlParam (DB)); |
@@ -445,6 +465,9 @@ discard block |
||
445 | 465 | return "#"; |
446 | 466 | } |
447 | 467 | |
468 | + /** |
|
469 | + * @param string $pcontentType |
|
470 | + */ |
|
448 | 471 | public function __construct($ptitle, $pid, $pcontent, $pcontentType, $plinkArray, $pclass = "", $pcount = 0) { |
449 | 472 | global $config; |
450 | 473 | $this->title = $ptitle; |
@@ -1111,6 +1134,9 @@ discard block |
||
1111 | 1134 | |
1112 | 1135 | class PageCustomize extends Page |
1113 | 1136 | { |
1137 | + /** |
|
1138 | + * @param string $key |
|
1139 | + */ |
|
1114 | 1140 | private function isChecked ($key, $testedValue = 1) { |
1115 | 1141 | $value = getCurrentOption ($key); |
1116 | 1142 | if (is_array ($value)) { |
@@ -1125,6 +1151,9 @@ discard block |
||
1125 | 1151 | return ""; |
1126 | 1152 | } |
1127 | 1153 | |
1154 | + /** |
|
1155 | + * @param string $key |
|
1156 | + */ |
|
1128 | 1157 | private function isSelected ($key, $value) { |
1129 | 1158 | if (getCurrentOption ($key) == $value) { |
1130 | 1159 | return "selected='selected'"; |
@@ -1271,6 +1300,9 @@ discard block |
||
1271 | 1300 | } |
1272 | 1301 | } |
1273 | 1302 | |
1303 | + /** |
|
1304 | + * @param integer $database |
|
1305 | + */ |
|
1274 | 1306 | public static function getDbName ($database = NULL) { |
1275 | 1307 | global $config; |
1276 | 1308 | if (self::isMultipleDatabaseEnabled ()) { |
@@ -1284,6 +1316,9 @@ discard block |
||
1284 | 1316 | return ""; |
1285 | 1317 | } |
1286 | 1318 | |
1319 | + /** |
|
1320 | + * @return string |
|
1321 | + */ |
|
1287 | 1322 | public static function getDbDirectory ($database = NULL) { |
1288 | 1323 | global $config; |
1289 | 1324 | if (self::isMultipleDatabaseEnabled ()) { |
@@ -1347,6 +1382,12 @@ discard block |
||
1347 | 1382 | return self::getDb ($database)->query($query)->fetchColumn(); |
1348 | 1383 | } |
1349 | 1384 | |
1385 | + /** |
|
1386 | + * @param string $table |
|
1387 | + * @param string $id |
|
1388 | + * @param string $numberOfString |
|
1389 | + * @param string $sql |
|
1390 | + */ |
|
1350 | 1391 | public static function getCountGeneric($table, $id, $pageId, $numberOfString = NULL, $sql = NULL) { |
1351 | 1392 | if (!$numberOfString) { |
1352 | 1393 | $numberOfString = $table . ".alphabetical"; |
@@ -1363,6 +1404,10 @@ discard block |
||
1363 | 1404 | return $entry; |
1364 | 1405 | } |
1365 | 1406 | |
1407 | + /** |
|
1408 | + * @param string $columns |
|
1409 | + * @param string $category |
|
1410 | + */ |
|
1366 | 1411 | public static function getEntryArrayWithBookNumber ($query, $columns, $params, $category) { |
1367 | 1412 | /* @var $result PDOStatement */ |
1368 | 1413 | |
@@ -1385,6 +1430,9 @@ discard block |
||
1385 | 1430 | return $entryArray; |
1386 | 1431 | } |
1387 | 1432 | |
1433 | + /** |
|
1434 | + * @param string $filter |
|
1435 | + */ |
|
1388 | 1436 | public static function executeQuery($query, $columns, $filter, $params, $n, $database = NULL, $numberPerPage = NULL, $max = NULL) { |
1389 | 1437 | $totalResult = -1; |
1390 | 1438 |