@@ -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]; |
@@ -99,6 +102,11 @@ discard block |
||
99 | 102 | return $url . "?v=" . VERSION; |
100 | 103 | } |
101 | 104 | |
105 | +/** |
|
106 | + * @param string $xml |
|
107 | + * |
|
108 | + * @return string |
|
109 | + */ |
|
102 | 110 | function xml2xhtml($xml) { |
103 | 111 | return preg_replace_callback('#<(\w+)([^>]*)\s*/>#s', create_function('$m', ' |
104 | 112 | $xhtml_tags = array("br", "hr", "input", "frame", "img", "area", "link", "col", "base", "basefont", "param"); |
@@ -312,6 +320,9 @@ discard block |
||
312 | 320 | return $phrase; |
313 | 321 | } |
314 | 322 | |
323 | +/** |
|
324 | + * @param string $paramName |
|
325 | + */ |
|
315 | 326 | function addURLParameter($urlParams, $paramName, $paramValue) { |
316 | 327 | if (empty ($urlParams)) { |
317 | 328 | $urlParams = ""; |
@@ -376,6 +387,9 @@ discard block |
||
376 | 387 | |
377 | 388 | class LinkNavigation extends Link |
378 | 389 | { |
390 | + /** |
|
391 | + * @param string $prel |
|
392 | + */ |
|
379 | 393 | public function __construct($phref, $prel = NULL, $ptitle = NULL) { |
380 | 394 | parent::__construct ($phref, Link::OPDS_NAVIGATION_TYPE, $prel, $ptitle); |
381 | 395 | if (!is_null (GetUrlParam (DB))) $this->href = addURLParameter ($this->href, DB, GetUrlParam (DB)); |
@@ -390,6 +404,9 @@ discard block |
||
390 | 404 | |
391 | 405 | class LinkFacet extends Link |
392 | 406 | { |
407 | + /** |
|
408 | + * @param string $phref |
|
409 | + */ |
|
393 | 410 | public function __construct($phref, $ptitle = NULL, $pfacetGroup = NULL, $pactiveFacet = FALSE) { |
394 | 411 | parent::__construct ($phref, Link::OPDS_PAGING_TYPE, "http://opds-spec.org/facet", $ptitle, $pfacetGroup, $pactiveFacet); |
395 | 412 | if (!is_null (GetUrlParam (DB))) $this->href = addURLParameter ($this->href, DB, GetUrlParam (DB)); |
@@ -469,6 +486,12 @@ discard block |
||
469 | 486 | { |
470 | 487 | public $book; |
471 | 488 | |
489 | + /** |
|
490 | + * @param string $pid |
|
491 | + * @param string $pcontent |
|
492 | + * @param string $pcontentType |
|
493 | + * @param Book $pbook |
|
494 | + */ |
|
472 | 495 | public function __construct($ptitle, $pid, $pcontent, $pcontentType, $plinkArray, $pbook) { |
473 | 496 | parent::__construct ($ptitle, $pid, $pcontent, $pcontentType, $plinkArray); |
474 | 497 | $this->book = $pbook; |
@@ -1053,6 +1076,9 @@ discard block |
||
1053 | 1076 | |
1054 | 1077 | class PageCustomize extends Page |
1055 | 1078 | { |
1079 | + /** |
|
1080 | + * @param string $key |
|
1081 | + */ |
|
1056 | 1082 | private function isChecked ($key, $testedValue = 1) { |
1057 | 1083 | $value = getCurrentOption ($key); |
1058 | 1084 | if (is_array ($value)) { |
@@ -1067,6 +1093,9 @@ discard block |
||
1067 | 1093 | return ""; |
1068 | 1094 | } |
1069 | 1095 | |
1096 | + /** |
|
1097 | + * @param string $key |
|
1098 | + */ |
|
1070 | 1099 | private function isSelected ($key, $value) { |
1071 | 1100 | if (getCurrentOption ($key) == $value) { |
1072 | 1101 | return "selected='selected'"; |
@@ -1213,6 +1242,9 @@ discard block |
||
1213 | 1242 | } |
1214 | 1243 | } |
1215 | 1244 | |
1245 | + /** |
|
1246 | + * @param integer $database |
|
1247 | + */ |
|
1216 | 1248 | public static function getDbName ($database = NULL) { |
1217 | 1249 | global $config; |
1218 | 1250 | if (self::isMultipleDatabaseEnabled ()) { |
@@ -1226,6 +1258,9 @@ discard block |
||
1226 | 1258 | return ""; |
1227 | 1259 | } |
1228 | 1260 | |
1261 | + /** |
|
1262 | + * @return string |
|
1263 | + */ |
|
1229 | 1264 | public static function getDbDirectory ($database = NULL) { |
1230 | 1265 | global $config; |
1231 | 1266 | if (self::isMultipleDatabaseEnabled ()) { |
@@ -1289,6 +1324,11 @@ discard block |
||
1289 | 1324 | return self::getDb ($database)->query($query)->fetchColumn(); |
1290 | 1325 | } |
1291 | 1326 | |
1327 | + /** |
|
1328 | + * @param string $table |
|
1329 | + * @param string $id |
|
1330 | + * @param string $numberOfString |
|
1331 | + */ |
|
1292 | 1332 | public static function getCountGeneric($table, $id, $pageId, $numberOfString = NULL) { |
1293 | 1333 | if (!$numberOfString) { |
1294 | 1334 | $numberOfString = $table . ".alphabetical"; |
@@ -1301,6 +1341,10 @@ discard block |
||
1301 | 1341 | return $entry; |
1302 | 1342 | } |
1303 | 1343 | |
1344 | + /** |
|
1345 | + * @param string $columns |
|
1346 | + * @param string $category |
|
1347 | + */ |
|
1304 | 1348 | public static function getEntryArrayWithBookNumber ($query, $columns, $params, $category) { |
1305 | 1349 | list (, $result) = self::executeQuery ($query, $columns, "", $params, -1); |
1306 | 1350 | $entryArray = array(); |
@@ -1319,6 +1363,9 @@ discard block |
||
1319 | 1363 | return $entryArray; |
1320 | 1364 | } |
1321 | 1365 | |
1366 | + /** |
|
1367 | + * @param string $filter |
|
1368 | + */ |
|
1322 | 1369 | public static function executeQuery($query, $columns, $filter, $params, $n, $database = NULL, $numberPerPage = NULL) { |
1323 | 1370 | $totalResult = -1; |
1324 | 1371 |