little refactoring
This commit is contained in:
parent
e67e620ba3
commit
8a8b98620d
28
data.php
28
data.php
|
@ -144,18 +144,9 @@ class Data extends Base {
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getLink ($book, $type, $mime, $rel, $filename, $idData, $title = NULL, $height = NULL)
|
public static function handleThumbnailLink ($urlParam, $height) {
|
||||||
{
|
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$urlParam = addURLParameter("", "data", $idData);
|
|
||||||
|
|
||||||
if (Base::useAbsolutePath () ||
|
|
||||||
$rel == Link::OPDS_THUMBNAIL_TYPE ||
|
|
||||||
($type == "epub" && $config['cops_update_epub-metadata']))
|
|
||||||
{
|
|
||||||
if ($type != "jpg") $urlParam = addURLParameter($urlParam, "type", $type);
|
|
||||||
if ($rel == Link::OPDS_THUMBNAIL_TYPE) {
|
|
||||||
if (is_null ($height)) {
|
if (is_null ($height)) {
|
||||||
if (preg_match ('/feed.php/', $_SERVER["SCRIPT_NAME"])) {
|
if (preg_match ('/feed.php/', $_SERVER["SCRIPT_NAME"])) {
|
||||||
$height = $config['cops_opds_thumbnail_height'];
|
$height = $config['cops_opds_thumbnail_height'];
|
||||||
|
@ -168,6 +159,23 @@ class Data extends Base {
|
||||||
if ($config['cops_thumbnail_handling'] != "1") {
|
if ($config['cops_thumbnail_handling'] != "1") {
|
||||||
$urlParam = addURLParameter($urlParam, "height", $height);
|
$urlParam = addURLParameter($urlParam, "height", $height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $urlParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getLink ($book, $type, $mime, $rel, $filename, $idData, $title = NULL, $height = NULL)
|
||||||
|
{
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
$urlParam = addURLParameter("", "data", $idData);
|
||||||
|
|
||||||
|
if (Base::useAbsolutePath () ||
|
||||||
|
$rel == Link::OPDS_THUMBNAIL_TYPE ||
|
||||||
|
($type == "epub" && $config['cops_update_epub-metadata']))
|
||||||
|
{
|
||||||
|
if ($type != "jpg") $urlParam = addURLParameter($urlParam, "type", $type);
|
||||||
|
if ($rel == Link::OPDS_THUMBNAIL_TYPE) {
|
||||||
|
$urlParam = self::handleThumbnailLink($urlParam, $height);
|
||||||
}
|
}
|
||||||
$urlParam = addURLParameter($urlParam, "id", $book->id);
|
$urlParam = addURLParameter($urlParam, "id", $book->id);
|
||||||
if (!is_null (GetUrlParam (DB))) $urlParam = addURLParameter ($urlParam, DB, GetUrlParam (DB));
|
if (!is_null (GetUrlParam (DB))) $urlParam = addURLParameter ($urlParam, DB, GetUrlParam (DB));
|
||||||
|
|
Loading…
Reference in a new issue