Cleanly handle suggestion title. re #34
This commit is contained in:
parent
23129b9c9e
commit
3e98615ea9
11
base.php
11
base.php
|
@ -287,14 +287,17 @@ class Entry
|
||||||
return date (DATE_ATOM, self::$updated);
|
return date (DATE_ATOM, self::$updated);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getContentArray () {
|
public function getNavLink () {
|
||||||
$navlink = "#";
|
|
||||||
foreach ($this->linkArray as $link) {
|
foreach ($this->linkArray as $link) {
|
||||||
if ($link->type != Link::OPDS_NAVIGATION_TYPE) { continue; }
|
if ($link->type != Link::OPDS_NAVIGATION_TYPE) { continue; }
|
||||||
|
|
||||||
$navlink = $link->hrefXhtml ();
|
return $link->hrefXhtml ();
|
||||||
}
|
}
|
||||||
return array ( "title" => $this->title, "content" => $this->content, "navlink" => $navlink );
|
return "#";
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getContentArray () {
|
||||||
|
return array ( "title" => $this->title, "content" => $this->content, "navlink" => $this->getNavLink () );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct($ptitle, $pid, $pcontent, $pcontentType, $plinkArray) {
|
public function __construct($ptitle, $pid, $pcontent, $pcontentType, $plinkArray) {
|
||||||
|
|
9
book.php
9
book.php
|
@ -599,13 +599,14 @@ function getJson ($complete = false) {
|
||||||
// str_format (localize("authorword", count($array)
|
// str_format (localize("authorword", count($array)
|
||||||
// str_format (localize("seriesword", count($array)
|
// str_format (localize("seriesword", count($array)
|
||||||
// str_format (localize("tagword", count($array)
|
// str_format (localize("tagword", count($array)
|
||||||
array_push ($out, array ("title" => "<strong>" . str_format (localize("{$key}word", count($array)), count($array)) . "</strong>",
|
array_push ($out, array ("title" => str_format (localize("{$key}word", count($array)), count($array)),
|
||||||
"navlink" => "index.php?page={$pagequery}&query={$query}&db={$database}&scope={$key}"));
|
"class" => "tt-header",
|
||||||
|
"navlink" => "index.php?page={$pagequery}&query={$query}&db={$database}&scope={$key}"));
|
||||||
}
|
}
|
||||||
if ($entry instanceof EntryBook) {
|
if ($entry instanceof EntryBook) {
|
||||||
array_push ($out, array ("title" => $entry->title, "navlink" => $entry->book->getDetailUrl ()));
|
array_push ($out, array ("class" => "", "title" => $entry->title, "navlink" => $entry->book->getDetailUrl ()));
|
||||||
} else {
|
} else {
|
||||||
array_push ($out, $entry->getContentArray ());
|
array_push ($out, array ("class" => "", "title" => $entry->title, "navlink" => $entry->getNavLink ()));
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
if ($i > 4) { break; };
|
if ($i > 4) { break; };
|
||||||
|
|
Loading…
Reference in a new issue